Compare commits
16 Commits
release/20
...
fix/user-h
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46ac7e3a16 | ||
|
|
d6c8400116 | ||
|
|
4a0205e622 | ||
|
|
c2520006ac | ||
|
|
99817fd8bd | ||
|
|
3f35fedd9d | ||
|
|
b7c2d13992 | ||
|
|
a6426587fb | ||
|
|
5f68356278 | ||
|
|
08f61e7408 | ||
|
|
9beda15f00 | ||
|
|
09d1663f81 | ||
|
|
f43b6e7cff | ||
|
|
6581eb4fd1 | ||
|
|
caedfe5c1e | ||
|
|
f6a234aaf9 |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hoppscotch-backend",
|
"name": "hoppscotch-backend",
|
||||||
"version": "2023.4.2",
|
"version": "2023.4.3",
|
||||||
"description": "",
|
"description": "",
|
||||||
"author": "",
|
"author": "",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
|||||||
@@ -360,13 +360,15 @@ describe('UserHistoryService', () => {
|
|||||||
});
|
});
|
||||||
describe('removeRequestFromHistory', () => {
|
describe('removeRequestFromHistory', () => {
|
||||||
test('Should resolve right and delete request from users history', async () => {
|
test('Should resolve right and delete request from users history', async () => {
|
||||||
|
const executedOn = new Date();
|
||||||
|
|
||||||
mockPrisma.userHistory.delete.mockResolvedValueOnce({
|
mockPrisma.userHistory.delete.mockResolvedValueOnce({
|
||||||
userUid: 'abc',
|
userUid: 'abc',
|
||||||
id: '1',
|
id: '1',
|
||||||
request: [{}],
|
request: [{}],
|
||||||
responseMetadata: [{}],
|
responseMetadata: [{}],
|
||||||
reqType: ReqType.REST,
|
reqType: ReqType.REST,
|
||||||
executedOn: new Date(),
|
executedOn: executedOn,
|
||||||
isStarred: false,
|
isStarred: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -376,7 +378,7 @@ describe('UserHistoryService', () => {
|
|||||||
request: JSON.stringify([{}]),
|
request: JSON.stringify([{}]),
|
||||||
responseMetadata: JSON.stringify([{}]),
|
responseMetadata: JSON.stringify([{}]),
|
||||||
reqType: ReqType.REST,
|
reqType: ReqType.REST,
|
||||||
executedOn: new Date(),
|
executedOn: executedOn,
|
||||||
isStarred: false,
|
isStarred: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -384,7 +386,7 @@ describe('UserHistoryService', () => {
|
|||||||
await userHistoryService.removeRequestFromHistory('abc', '1'),
|
await userHistoryService.removeRequestFromHistory('abc', '1'),
|
||||||
).toEqualRight(userHistory);
|
).toEqualRight(userHistory);
|
||||||
});
|
});
|
||||||
test('Should resolve left and error out when req id is invalid ', async () => {
|
test('Should resolve left and error out when req id is invalid', async () => {
|
||||||
mockPrisma.userHistory.delete.mockResolvedValueOnce(null);
|
mockPrisma.userHistory.delete.mockResolvedValueOnce(null);
|
||||||
|
|
||||||
return expect(
|
return expect(
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@hoppscotch/common",
|
"name": "@hoppscotch/common",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "2023.4.2",
|
"version": "2023.4.3",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "pnpm exec npm-run-all -p -l dev:*",
|
"dev": "pnpm exec npm-run-all -p -l dev:*",
|
||||||
"dev:vite": "vite",
|
"dev:vite": "vite",
|
||||||
|
|||||||
@@ -131,7 +131,6 @@ declare module '@vue/runtime-core' {
|
|||||||
IconLucideListEnd: typeof import('~icons/lucide/list-end')['default']
|
IconLucideListEnd: typeof import('~icons/lucide/list-end')['default']
|
||||||
IconLucideMinus: typeof import('~icons/lucide/minus')['default']
|
IconLucideMinus: typeof import('~icons/lucide/minus')['default']
|
||||||
IconLucideSearch: typeof import('~icons/lucide/search')['default']
|
IconLucideSearch: typeof import('~icons/lucide/search')['default']
|
||||||
IconLucideUser: typeof import('~icons/lucide/user')['default']
|
|
||||||
IconLucideUsers: typeof import('~icons/lucide/users')['default']
|
IconLucideUsers: typeof import('~icons/lucide/users')['default']
|
||||||
LensesHeadersRenderer: typeof import('./components/lenses/HeadersRenderer.vue')['default']
|
LensesHeadersRenderer: typeof import('./components/lenses/HeadersRenderer.vue')['default']
|
||||||
LensesHeadersRendererEntry: typeof import('./components/lenses/HeadersRendererEntry.vue')['default']
|
LensesHeadersRendererEntry: typeof import('./components/lenses/HeadersRendererEntry.vue')['default']
|
||||||
@@ -142,7 +141,6 @@ declare module '@vue/runtime-core' {
|
|||||||
LensesRenderersRawLensRenderer: typeof import('./components/lenses/renderers/RawLensRenderer.vue')['default']
|
LensesRenderersRawLensRenderer: typeof import('./components/lenses/renderers/RawLensRenderer.vue')['default']
|
||||||
LensesRenderersXMLLensRenderer: typeof import('./components/lenses/renderers/XMLLensRenderer.vue')['default']
|
LensesRenderersXMLLensRenderer: typeof import('./components/lenses/renderers/XMLLensRenderer.vue')['default']
|
||||||
LensesResponseBodyRenderer: typeof import('./components/lenses/ResponseBodyRenderer.vue')['default']
|
LensesResponseBodyRenderer: typeof import('./components/lenses/ResponseBodyRenderer.vue')['default']
|
||||||
ProfilePicture: typeof import('./components/profile/Picture.vue')['default']
|
|
||||||
ProfileShortcode: typeof import('./components/profile/Shortcode.vue')['default']
|
ProfileShortcode: typeof import('./components/profile/Shortcode.vue')['default']
|
||||||
ProfileShortcodes: typeof import('./components/profile/Shortcodes.vue')['default']
|
ProfileShortcodes: typeof import('./components/profile/Shortcodes.vue')['default']
|
||||||
ProfileUserDelete: typeof import('./components/profile/UserDelete.vue')['default']
|
ProfileUserDelete: typeof import('./components/profile/UserDelete.vue')['default']
|
||||||
|
|||||||
@@ -36,13 +36,12 @@
|
|||||||
? IconCheck
|
? IconCheck
|
||||||
: undefined
|
: undefined
|
||||||
"
|
"
|
||||||
class="my-2"
|
|
||||||
:active-info-icon="
|
:active-info-icon="
|
||||||
selectedEnvironmentIndex.type === 'NO_ENV_SELECTED'
|
selectedEnvironmentIndex.type === 'NO_ENV_SELECTED'
|
||||||
"
|
"
|
||||||
@click="
|
@click="
|
||||||
() => {
|
() => {
|
||||||
setSelectedEnvironmentIndex({ type: 'NO_ENV_SELECTED' })
|
selectedEnvironmentIndex = { type: 'NO_ENV_SELECTED' }
|
||||||
hide()
|
hide()
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ const switchToMyEnvironments = () => {
|
|||||||
adapter.changeTeamID(undefined)
|
adapter.changeTeamID(undefined)
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateSelectedTeam = (newSelectedTeam: SelectedTeam) => {
|
const updateSelectedTeam = (newSelectedTeam: SelectedTeam | undefined) => {
|
||||||
if (newSelectedTeam) {
|
if (newSelectedTeam) {
|
||||||
environmentType.value.selectedTeam = newSelectedTeam
|
environmentType.value.selectedTeam = newSelectedTeam
|
||||||
REMEMBERED_TEAM_ID.value = newSelectedTeam.id
|
REMEMBERED_TEAM_ID.value = newSelectedTeam.id
|
||||||
@@ -150,25 +150,23 @@ const workspace = useReadonlyStream(workspaceStatus$, { type: "personal" })
|
|||||||
// Used to switch environment type and team when user switch workspace in the global workspace switcher
|
// Used to switch environment type and team when user switch workspace in the global workspace switcher
|
||||||
// Check if there is a teamID in the workspace, if yes, switch to team environment and select the team
|
// Check if there is a teamID in the workspace, if yes, switch to team environment and select the team
|
||||||
// If there is no teamID, switch to my environment
|
// If there is no teamID, switch to my environment
|
||||||
watch(
|
watch(workspace, (newWorkspace) => {
|
||||||
() => workspace.value.type === "team" && workspace.value.teamID,
|
if (newWorkspace.type === "personal") {
|
||||||
(teamID) => {
|
|
||||||
if (!teamID) {
|
|
||||||
switchToMyEnvironments()
|
switchToMyEnvironments()
|
||||||
setSelectedEnvironmentIndex({
|
setSelectedEnvironmentIndex({
|
||||||
type: "NO_ENV_SELECTED",
|
type: "NO_ENV_SELECTED",
|
||||||
})
|
})
|
||||||
} else {
|
} else if (newWorkspace.type === "team") {
|
||||||
const team = myTeams.value?.find((t) => t.id === teamID)
|
const team = myTeams.value?.find((t) => t.id === newWorkspace.teamID)
|
||||||
if (team) {
|
|
||||||
updateSelectedTeam(team)
|
updateSelectedTeam(team)
|
||||||
|
|
||||||
|
if (selectedEnvironmentIndex.value.type !== "MY_ENV") {
|
||||||
setSelectedEnvironmentIndex({
|
setSelectedEnvironmentIndex({
|
||||||
type: "NO_ENV_SELECTED",
|
type: "NO_ENV_SELECTED",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
)
|
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => currentUser.value,
|
() => currentUser.value,
|
||||||
|
|||||||
@@ -42,16 +42,21 @@ const dispatchers = defineDispatchers({
|
|||||||
selectedEnvironmentIndex,
|
selectedEnvironmentIndex,
|
||||||
}: { selectedEnvironmentIndex: SelectedEnvironmentIndex }
|
}: { selectedEnvironmentIndex: SelectedEnvironmentIndex }
|
||||||
) {
|
) {
|
||||||
if (
|
if (selectedEnvironmentIndex.type === "MY_ENV") {
|
||||||
selectedEnvironmentIndex.type === "MY_ENV" &&
|
if (store.environments[selectedEnvironmentIndex.index]) {
|
||||||
!!store.environments[selectedEnvironmentIndex.index]
|
|
||||||
) {
|
|
||||||
return {
|
return {
|
||||||
selectedEnvironmentIndex,
|
selectedEnvironmentIndex,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
|
selectedEnvironmentIndex: {
|
||||||
type: "NO_ENV_SELECTED",
|
type: "NO_ENV_SELECTED",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
selectedEnvironmentIndex,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@hoppscotch/selfhost-web",
|
"name": "@hoppscotch/selfhost-web",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "2023.4.2",
|
"version": "2023.4.3",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev:vite": "vite",
|
"dev:vite": "vite",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "hoppscotch-sh-admin",
|
"name": "hoppscotch-sh-admin",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "2023.4.2",
|
"version": "2023.4.3",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "pnpm exec npm-run-all -p -l dev:*",
|
"dev": "pnpm exec npm-run-all -p -l dev:*",
|
||||||
|
|||||||
Reference in New Issue
Block a user