π₯ π₯ π₯ A Free & Self-hostable Airtable Alternative
TypeScript airtableairtable-alternativeautomatic-apihacktoberfestlow-codeno-codeno-code-databaseno-code-platformpostgresqlrest-apirestful-apispreadsheetsqliteswagger
feat(nc-gui): add copy user id in memebers tab
Ramesh Manefea685cb3e9f
diff --git a/packages/nc-gui/components/account/Profile.vue b/packages/nc-gui/components/account/Profile.vueindex e6c3d7fe9c..5fc1eb4107 100644--- a/packages/nc-gui/components/account/Profile.vue+++ b/packages/nc-gui/components/account/Profile.vue@@ -8,6 +8,8 @@ const { t } = useI18n()const isErrored = ref(false)const isProfileUpdating = ref(false)+const copyBtnRef = ref()+const form = ref<{title: stringemail: string@@ -184,7 +186,26 @@ const onCancel = () => {<div class="flex-1 flex flex-col gap-4"><div>- <div class="text-gray-800 mb-2" data-rec="true">{{ $t('general.name') }}</div>+ <div class="flex items-center gap-1.5 justify-between mb-2">+ <div class="text-nc-content-gray" data-rec="true">{{ $t('general.name') }}</div>+ <NcTooltip v-if="user" :title="$t('labels.clickToCopyUserID')" placement="top" hide-on-click class="flex">+ <div+ data-rec="true"+ class="flex items-center gap-1.5 text-bodyDefaultSm text-nc-content-gray-subtle2 cursor-pointer"+ @click="copyBtnRef?.copyContent()"+ >+ {{ $t('labels.userIdColon', { userId: user?.id }) }}++ <GeneralCopyButton+ ref="copyBtnRef"+ type="text"+ size="xxsmall"+ :content="user?.id"+ :show-toast="false"+ />+ </div>+ </NcTooltip>+ </div><a-form-item name="title" :rules="formRules.title" class="!my-0"><a-inputv-model:value="form.title"diff --git a/packages/nc-gui/components/project/AccessSettings.vue b/packages/nc-gui/components/project/AccessSettings.vueindex 59261b5bc5..652dbb6534 100644--- a/packages/nc-gui/components/project/AccessSettings.vue+++ b/packages/nc-gui/components/project/AccessSettings.vue@@ -273,9 +273,16 @@ const columns = [{key: 'created_at',title: t('title.dateJoined'),- basis: '25%',+ basis: '20%',minWidth: 200,},+ {+ key: 'action',+ title: t('labels.actions'),+ width: 110,+ minWidth: 110,+ justify: 'justify-end',+ },] as NcTableColumnProps[]const customRow = (record: Record<string, any>) => ({@@ -490,6 +497,26 @@ onBeforeUnmount(() => {</span></NcTooltip></div>+ <div v-if="column.key === 'action'">+ <NcDropdown placement="bottomRight">+ <NcButton size="small" type="secondary">+ <component :is="iconMap.ncMoreVertical" />+ </NcButton>+ <template #overlay>+ <NcMenu variant="small">+ <NcMenuItemCopyId+ :id="record.id"+ :tooltip="$t('labels.clickToCopyUserID')"+ :label="+ $t('labels.userIdColon', {+ userId: record.id,+ })+ "+ />+ </NcMenu>+ </template>+ </NcDropdown>+ </div></template></NcTable></div>diff --git a/packages/nc-gui/components/workspace/CollaboratorsList.vue b/packages/nc-gui/components/workspace/CollaboratorsList.vueindex 91bcadf607..78ef32f373 100644--- a/packages/nc-gui/components/workspace/CollaboratorsList.vue+++ b/packages/nc-gui/components/workspace/CollaboratorsList.vue@@ -500,36 +500,50 @@ const removeCollaborator = (userId: string, workspaceId: string) => {</div><div v-if="column.key === 'action'">- <NcDropdown v-if="isOwnerOrCreator || record.id === user.id">+ <NcDropdown placement="bottomRight"><NcButton size="small" type="secondary"><component :is="iconMap.ncMoreVertical" /></NcButton><template #overlay><NcMenu variant="small">- <template v-if="isAdminPanel">- <NcMenuItem data-testid="nc-admin-org-user-delete">- <GeneralIcon icon="signout" />- <span>{{ $t('labels.signOutUser') }}</span>- </NcMenuItem>-+ <NcMenuItemCopyId+ :id="record.id"+ :tooltip="$t('labels.clickToCopyUserID')"+ :label="+ $t('labels.userIdColon', {+ userId: record.id,+ })+ "+ />++ <template v-if="isOwnerOrCreator || record.id === user.id"><NcDivider />- </template>- <NcTooltip :disabled="!isOnlyOneOwner || record.roles !== WorkspaceUserRoles.OWNER">- <template #title>- {{ $t('tooltip.leaveWorkspace') }}++ <template v-if="isAdminPanel">+ <NcMenuItem data-testid="nc-admin-org-user-delete">+ <GeneralIcon icon="signout" />+ <span>{{ $t('labels.signOutUser') }}</span>+ </NcMenuItem>++ <NcDivider /></template>- <NcMenuItem- :disabled="!isDeleteOrUpdateAllowed(record)"- danger- @click="removeCollaborator(record.id, currentWorkspace?.id)"- >- <div v-if="removingCollaboratorMap[record.id]" class="h-4 w-4 flex items-center justify-center">- <GeneralLoader class="!flex-none !text-current" />- </div>- <GeneralIcon v-else icon="delete" />- {{ record.id === user.id ? t('activity.leaveWorkspace') : t('activity.removeMember') }}- </NcMenuItem>- </NcTooltip>+ <NcTooltip :disabled="!isOnlyOneOwner || record.roles !== WorkspaceUserRoles.OWNER">+ <template #title>+ {{ $t('tooltip.leaveWorkspace') }}+ </template>+ <NcMenuItem+ :disabled="!isDeleteOrUpdateAllowed(record)"+ danger+ @click="removeCollaborator(record.id, currentWorkspace?.id)"+ >+ <div v-if="removingCollaboratorMap[record.id]" class="h-4 w-4 flex items-center justify-center">+ <GeneralLoader class="!flex-none !text-current" />+ </div>+ <GeneralIcon v-else icon="delete" />+ {{ record.id === user.id ? t('activity.leaveWorkspace') : t('activity.removeMember') }}+ </NcMenuItem>+ </NcTooltip>+ </template></NcMenu></template></NcDropdown>diff --git a/packages/nc-gui/lang/en.json b/packages/nc-gui/lang/en.jsonindex a61d03f610..09d2caeaef 100644--- a/packages/nc-gui/lang/en.json+++ b/packages/nc-gui/lang/en.json@@ -1188,6 +1188,7 @@"tokenLimit": "Only one token per user is allowed","duplicateAttachment": "File with name {filename} already attached","workspaceId": "WORKSPACE ID: {workspaceId}",+ "userIdColon": "USER ID: {userId}","tableIdColon": "TABLE ID: {tableId}","baseIdColon": "BASE ID: {baseId}","scriptIdColon": "SCRIPT ID: {scriptId}",@@ -1233,6 +1234,7 @@"forRole": "for role","clickToCopy": "Click to copy","clickToCopyWorkspaceID": "Click to copy Workspace ID",+ "clickToCopyUserID": "Click to copy User ID","clickToCopyTableID": "Click to copy Table ID","clickToCopyBaseID": "Click to copy Base ID","clickToCopyScriptID": "Click to copy Script ID",