mirror of
https://github.com/nocodb/nocodb.git
synced 2026-05-02 04:06:47 +00:00
Nc feat/user management (#8369)
* fix: source filter Signed-off-by: mertmit <mertmit99@gmail.com> * feat: sso cloud apis - WIP * feat: admin panel menu option * feat: UI integration - WIP * feat: UI integration - SSO * feat: domain verification * feat: workspace upgrade and sso page - WIP * feat: domain adding and verification - WIP * feat: domain adding and verification * fix: domain validation corrections * chore: lint * feat(nc-gui): organization settings page * feat(nc-gui): organization members page * fix(nc-gui): some more changes * fix(nc-gui): refactor collaborators ui * feat(nc-gui): dashboard ui * feat(nc-gui): bases page * feat(nocodb): wired up ui and apis. wip * fix(nc-gui): some more fixes * fix(nc-gui): move ws to org immediately after creation * fix(nc-gui): some more bug fixes * feat(nocodb): transfer workspace ownership * fix(nc-gui): load roles if baseId is provided in prop * fix(nc-gui): show only org workspaces * fix(nc-gui): some more fixes * fix(nc-gui): rename base * fix(nc-gui): invite fixes * feat: restrict access to org level user(SSO login) * fix: include org and client info in token * fix: include org and client info in refresh token * refactor: minor ui corrections * refactor: add a generic component for copying * refactor: ui correction and cleanup * fix: refresh token update * fix: ui corrections * fix: if user signin using unverified domain show error in sso page rather than showing the json with error * fix: for all sso related exceptions redirect to sso ui page with error * chore: lint * fix: show admin panel option only for user who have permission * fix: redirect to sso login page on logout based on current user info * test: sso - playwright test * fix: duplicate attribute * test: playwright * fix: missing import * test: playwright - WIP * test: playwright - Cloud sso login flow * fix: error handling * test: playwright - sso auth flow tests * fix: show upgrade option only for workspace owner * test: user invite tests corrections * test: user invite tests corrections * test: user management correction * test: playwright - use regex for path match * fix: delete existing provider if any * test: combine sso tests to run serially * test: playwright - title name correction * test: playwright - reset sso client from sso tests only * test: playwright - page navigation correction * refactor: by default navigate to org settings page on org creation and disable org image upload * refactor: reverify domain after 7 days and update role names to avoid confusion between org and cloud org roles * fix: corrections * fix: show org level roles in members section * refactor: disable org update by default * test: unit tests for org admin apis * chore: lint * fix: review comments * chore: lint and cleanup --------- Signed-off-by: mertmit <mertmit99@gmail.com> Co-authored-by: mertmit <mertmit99@gmail.com> Co-authored-by: DarkPhoenix2704 <anbarasun123@gmail.com>
This commit is contained in:
@@ -1,13 +1,17 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref, storeToRefs, useGlobal, useI18n, useWorkspace, watch } from '#imports'
|
||||
|
||||
const props = defineProps<{
|
||||
workspaceId?: string
|
||||
}>()
|
||||
|
||||
const { signOut } = useGlobal()
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const { deleteWorkspace, navigateToWorkspace, updateWorkspace } = useWorkspace()
|
||||
|
||||
const { workspacesList, activeWorkspaceId, activeWorkspace, workspaces } = storeToRefs(useWorkspace())
|
||||
const { workspacesList, activeWorkspace, workspaces } = storeToRefs(useWorkspace())
|
||||
|
||||
const formValidator = ref()
|
||||
|
||||
@@ -33,19 +37,29 @@ const formRules = {
|
||||
],
|
||||
}
|
||||
|
||||
const currentWorkspace = computed(() => {
|
||||
return props.workspaceId ? workspaces.value.get(props.workspaceId) : activeWorkspace.value
|
||||
})
|
||||
|
||||
const onDelete = async () => {
|
||||
isDeleting.value = true
|
||||
try {
|
||||
await deleteWorkspace(activeWorkspaceId.value, { skipStateUpdate: true })
|
||||
await deleteWorkspace(currentWorkspace.value.id, { skipStateUpdate: true })
|
||||
|
||||
isConfirmed.value = false
|
||||
isDeleting.value = false
|
||||
|
||||
// We only remove the delete workspace from the list after the api call is successful
|
||||
workspaces.value.delete(activeWorkspaceId.value)
|
||||
workspaces.value.delete(currentWorkspace.value.id)
|
||||
|
||||
if (workspacesList.value.length > 1) {
|
||||
await navigateToWorkspace(workspacesList.value[0].id)
|
||||
// WorkspaceId is provided from the admin Panel. If deleted navigate to the workspace list page
|
||||
if (!props.workspaceId) {
|
||||
await navigateToWorkspace(workspacesList.value[0].id)
|
||||
} else {
|
||||
// #TODO: @DarkPhoenix2704
|
||||
// Navigate BackPage
|
||||
}
|
||||
} else {
|
||||
// As signin page will clear the workspaces, we need to check if there are more than one workspace
|
||||
await signOut(false)
|
||||
@@ -69,7 +83,7 @@ const titleChange = async () => {
|
||||
isErrored.value = false
|
||||
|
||||
try {
|
||||
await updateWorkspace(activeWorkspaceId.value, {
|
||||
await updateWorkspace(currentWorkspace.value.id, {
|
||||
title: form.value.title,
|
||||
})
|
||||
} catch (e: any) {
|
||||
@@ -81,9 +95,9 @@ const titleChange = async () => {
|
||||
}
|
||||
|
||||
watch(
|
||||
() => activeWorkspace.value.title,
|
||||
() => currentWorkspace.value.id,
|
||||
() => {
|
||||
form.value.title = activeWorkspace.value.title
|
||||
form.value.title = currentWorkspace.value.title
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
@@ -94,11 +108,7 @@ watch(
|
||||
() => form.value.title,
|
||||
async () => {
|
||||
try {
|
||||
if (form.value.title !== activeWorkspace.value?.title) {
|
||||
isCancelButtonVisible.value = true
|
||||
} else {
|
||||
isCancelButtonVisible.value = false
|
||||
}
|
||||
isCancelButtonVisible.value = form.value.title !== currentWorkspace.value?.title
|
||||
isErrored.value = !(await formValidator.value.validate())
|
||||
} catch (e: any) {
|
||||
isErrored.value = true
|
||||
@@ -107,7 +117,7 @@ watch(
|
||||
)
|
||||
|
||||
const onCancel = () => {
|
||||
form.value.title = activeWorkspace.value?.title
|
||||
form.value.title = currentWorkspace.value?.title
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -140,7 +150,7 @@ const onCancel = () => {
|
||||
v-e="['c:workspace:settings:rename']"
|
||||
type="primary"
|
||||
html-type="submit"
|
||||
:disabled="isErrored || (form.title && form.title === activeWorkspace.title)"
|
||||
:disabled="isErrored || (form.title && form.title === currentWorkspace.title)"
|
||||
:loading="isDeleting"
|
||||
data-testid="nc-workspace-settings-settings-rename-submit"
|
||||
>
|
||||
@@ -175,7 +185,7 @@ const onCancel = () => {
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.item {
|
||||
.item-card {
|
||||
@apply p-6 rounded-2xl border-1 max-w-180 mt-10 min-w-100 w-full;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user