Browse Source

fix: css refactor

pull/6601/head
sreehari jayaraj 1 year ago
parent
commit
180add5e3b
  1. 14
      packages/nc-gui/components/account/Token.vue
  2. 212
      packages/nc-gui/components/account/UserList.vue

14
packages/nc-gui/components/account/Token.vue

@ -161,7 +161,7 @@ const handleCancel = () => {
<template> <template>
<div class="h-full overflow-y-scroll scrollbar-thin-dull pt-2"> <div class="h-full overflow-y-scroll scrollbar-thin-dull pt-2">
<div class="max-w-[810px] mx-auto p-4" data-testid="nc-token-list"> <div class="max-w-202 mx-auto px-4" data-testid="nc-token-list">
<div class="py-2 flex gap-4 items-center justify-between"> <div class="py-2 flex gap-4 items-center justify-between">
<h6 class="text-2xl my-4 text-left font-bold">{{ $t('title.apiTokens') }}</h6> <h6 class="text-2xl my-4 text-left font-bold">{{ $t('title.apiTokens') }}</h6>
<NcTooltip :disabled="!(isEeUI && tokens.length)"> <NcTooltip :disabled="!(isEeUI && tokens.length)">
@ -195,7 +195,12 @@ const handleCancel = () => {
</div> </div>
<main> <main>
<div v-if="showNewTokenModal"> <div v-if="showNewTokenModal">
<div class="flex gap-5 px-3 py-3.5 text-gray-500 font-medium text-3.5 w-full nc-token-generate"> <div
class="flex gap-5 px-3 py-3.5 text-gray-500 font-medium text-3.5 w-full nc-token-generate border-x-1"
:class="{
'border-b-1': !tokens.length,
}"
>
<div class="flex flex-col w-full"> <div class="flex flex-col w-full">
<a-input <a-input
:ref="selectInputOnMount" :ref="selectInputOnMount"
@ -224,9 +229,8 @@ const handleCancel = () => {
</NcButton> </NcButton>
</div> </div>
</div> </div>
<NcDivider />
</div> </div>
<div v-if="!tokens.length" class="h-118 justify-center flex items-center"> <div v-if="showNewTokenModal && !tokens.length" class="h-118 justify-center flex items-center">
<a-empty :image="Empty.PRESENTED_IMAGE_SIMPLE" :description="$t('title.noLabels')" /> <a-empty :image="Empty.PRESENTED_IMAGE_SIMPLE" :description="$t('title.noLabels')" />
</div> </div>
@ -282,7 +286,7 @@ const handleCancel = () => {
</main> </main>
</div> </div>
</div> </div>
<div v-if="pagination.total > 10" class="flex items-center justify-center mt-15"> <div v-if="pagination.total > 10" class="flex items-center justify-center mt-5">
<a-pagination <a-pagination
v-model:current="currentPage" v-model:current="currentPage"
:total="pagination.total" :total="pagination.total"

212
packages/nc-gui/components/account/UserList.vue

@ -154,8 +154,8 @@ const openDeleteModal = (user: UserType) => {
<template> <template>
<div data-testid="nc-super-user-list"> <div data-testid="nc-super-user-list">
<div class="max-w-195 mx-auto"> <div class="max-w-195 mx-auto h-full">
<div class="text-2xl my-4 text-left font-weight-bold">{{ $t('title.userManagement') }}</div> <div class="text-2xl text-left font-weight-bold">{{ $t('title.userManagement') }}</div>
<div class="py-2 flex gap-4 items-center justify-between"> <div class="py-2 flex gap-4 items-center justify-between">
<a-input v-model:value="searchText" class="!max-w-90 !rounded-md" placeholder="Search members" @change="loadUsers()"> <a-input v-model:value="searchText" class="!max-w-90 !rounded-md" placeholder="Search members" @change="loadUsers()">
<template #prefix> <template #prefix>
@ -172,112 +172,114 @@ const openDeleteModal = (user: UserType) => {
</NcButton> </NcButton>
</div> </div>
</div> </div>
<div class="w-full mt-5 border-1 rounded-md h-[613px] max-w-250"> <div class="mt-3 flex flex-col justify-between">
<div class="flex w-full bg-gray-50 border-b-1"> <div class="w-full border-1 rounded-md max-w-250 h-160">
<span class="py-3.5 text-gray-500 font-medium text-3.5 w-1/3 text-start pl-10">{{ $t('labels.email') }}</span> <div class="flex w-full bg-gray-50 border-b-1">
<span class="py-3.5 text-gray-500 font-medium text-3.5 w-1/3 text-start pl-20">{{ $t('objects.role') }}</span> <span class="py-3.5 text-gray-500 font-medium text-3.5 w-1/3 text-start pl-10">{{ $t('labels.email') }}</span>
<span class="py-3.5 text-gray-500 font-medium text-3.5 w-1/3 text-end pl-42">{{ $t('labels.action') }}</span> <span class="py-3.5 text-gray-500 font-medium text-3.5 w-1/3 text-start pl-20">{{ $t('objects.role') }}</span>
</div> <span class="py-3.5 text-gray-500 font-medium text-3.5 w-1/3 text-end pl-42">{{ $t('labels.action') }}</span>
<div v-if="isLoading" class="flex items-center justify-center text-center h-[513px]"> </div>
<GeneralLoader size="xlarge" /> <div v-if="isLoading" class="flex items-center justify-center text-center h-[513px]">
</div> <GeneralLoader size="xlarge" />
<!-- if users are empty --> </div>
<div v-else-if="!users.length" class="flex items-center justify-center text-center h-128.25"> <!-- if users are empty -->
<a-empty :image="Empty.PRESENTED_IMAGE_SIMPLE" :description="$t('labels.noData')" /> <div v-else-if="!users.length" class="flex items-center justify-center text-center h-128.25">
</div> <a-empty :image="Empty.PRESENTED_IMAGE_SIMPLE" :description="$t('labels.noData')" />
<section v-else class="tbody"> </div>
<div <section v-else class="tbody">
v-for="el of users" <div
:key="el.id" v-for="el of users"
data-testid="nc-token-list" :key="el.id"
class="flex py-3 justify-around px-5 border-b-1" data-testid="nc-token-list"
:class="{ class="flex py-3 justify-around px-5 border-b-1"
'py-4': el.roles?.includes('super'), :class="{
}" 'py-4': el.roles?.includes('super'),
> }"
<span class="text-3.5 text-start w-1/3 pl-5"> >
{{ el.email }} <span class="text-3.5 text-start w-1/3 pl-5">
</span> {{ el.email }}
<span class="text-3.5 text-start w-1/3 pl-18"> </span>
<div v-if="el?.roles?.includes('super')" class="font-weight-bold">{{ $t('labels.superAdmin') }}</div> <span class="text-3.5 text-start w-1/3 pl-18">
<a-select <div v-if="el?.roles?.includes('super')" class="font-weight-bold">{{ $t('labels.superAdmin') }}</div>
v-else <a-select
v-model:value="el.roles" v-else
class="w-55 nc-user-roles" v-model:value="el.roles"
:dropdown-match-select-width="false" class="w-55 nc-user-roles"
@change="updateRole(el.id, el.roles as string)" :dropdown-match-select-width="false"
> @change="updateRole(el.id, el.roles as string)"
<a-select-option
class="nc-users-list-role-option"
:value="OrgUserRoles.CREATOR"
:label="$t(`objects.roleType.orgLevelCreator`)"
> >
<div>{{ $t(`objects.roleType.orgLevelCreator`) }}</div> <a-select-option
<span class="text-gray-500 text-xs whitespace-normal"> class="nc-users-list-role-option"
{{ $t('msg.info.roles.orgCreator') }} :value="OrgUserRoles.CREATOR"
</span> :label="$t(`objects.roleType.orgLevelCreator`)"
</a-select-option> >
<div>{{ $t(`objects.roleType.orgLevelCreator`) }}</div>
<a-select-option <span class="text-gray-500 text-xs whitespace-normal">
class="nc-users-list-role-option" {{ $t('msg.info.roles.orgCreator') }}
:value="OrgUserRoles.VIEWER" </span>
:label="$t(`objects.roleType.orgLevelViewer`)" </a-select-option>
<a-select-option
class="nc-users-list-role-option"
:value="OrgUserRoles.VIEWER"
:label="$t(`objects.roleType.orgLevelViewer`)"
>
<div>{{ $t(`objects.roleType.orgLevelViewer`) }}</div>
<span class="text-gray-500 text-xs whitespace-normal">
{{ $t('msg.info.roles.orgViewer') }}
</span>
</a-select-option>
</a-select>
</span>
<span class="w-1/3 pl-43">
<div
class="flex items-center gap-2"
:class="{
'opacity-0': el.roles?.includes('super'),
}"
> >
<div>{{ $t(`objects.roleType.orgLevelViewer`) }}</div> <NcDropdown :trigger="['click']">
<span class="text-gray-500 text-xs whitespace-normal"> <MdiDotsVertical
{{ $t('msg.info.roles.orgViewer') }} class="border-1 !text-gray-600 h-5.5 w-5.5 rounded outline-0 p-0.5 nc-workspace-menu transform transition-transform !text-gray-400 cursor-pointer hover:(!text-gray-500 bg-gray-100)"
</span> />
</a-select-option> <template #overlay>
</a-select> <NcMenu>
</span> <template v-if="!el.roles?.includes('super')">
<span class="w-1/3 pl-43"> <!-- Resend invite Email -->
<div <NcMenuItem @click="resendInvite(el)">
class="flex items-center gap-2" <component :is="iconMap.email" class="flex text-gray-500" />
:class="{ <div>{{ $t('activity.resendInvite') }}</div>
'opacity-0': el.roles?.includes('super'), </NcMenuItem>
}" <NcMenuItem @click="copyInviteUrl(el)">
> <component :is="iconMap.copy" class="flex text-gray-500" />
<NcDropdown :trigger="['click']"> <div>{{ $t('activity.copyInviteURL') }}</div>
<MdiDotsVertical </NcMenuItem>
class="border-1 !text-gray-600 h-5.5 w-5.5 rounded outline-0 p-0.5 nc-workspace-menu transform transition-transform !text-gray-400 cursor-pointer hover:(!text-gray-500 bg-gray-100)" <NcMenuItem @click="copyPasswordResetUrl(el)">
/> <component :is="iconMap.copy" class="flex text-gray-500" />
<template #overlay> <div>{{ $t('activity.copyPasswordResetURL') }}</div>
<NcMenu> </NcMenuItem>
<template v-if="!el.roles?.includes('super')"> </template>
<!-- Resend invite Email --> <NcDivider v-if="!el.roles?.includes('super')" />
<NcMenuItem @click="resendInvite(el)"> <NcMenuItem class="!text-red-500 !hover:bg-red-50" @click="openDeleteModal(el)">
<component :is="iconMap.email" class="flex text-gray-500" /> <MaterialSymbolsDeleteOutlineRounded />
<div>{{ $t('activity.resendInvite') }}</div> {{ $t('general.remove') }} {{ $t('objects.user') }}
</NcMenuItem> </NcMenuItem>
<NcMenuItem @click="copyInviteUrl(el)"> </NcMenu>
<component :is="iconMap.copy" class="flex text-gray-500" /> </template>
<div>{{ $t('activity.copyInviteURL') }}</div> </NcDropdown>
</NcMenuItem> </div>
<NcMenuItem @click="copyPasswordResetUrl(el)"> </span>
<component :is="iconMap.copy" class="flex text-gray-500" /> </div>
<div>{{ $t('activity.copyPasswordResetURL') }}</div> </section>
</NcMenuItem> </div>
</template> <div v-if="pagination.total > 10" class="flex items-center justify-center mt-4">
<NcDivider v-if="!el.roles?.includes('super')" /> <a-pagination
<NcMenuItem class="!text-red-500 !hover:bg-red-50" @click="openDeleteModal(el)"> v-model:current="currentPage"
<MaterialSymbolsDeleteOutlineRounded /> :total="pagination.total"
{{ $t('general.remove') }} {{ $t('objects.user') }} show-less-items
</NcMenuItem> @change="loadUsers(currentPage, currentLimit)"
</NcMenu> />
</template> </div>
</NcDropdown>
</div>
</span>
</div>
</section>
</div>
<div v-if="pagination.total > 10" class="flex items-center justify-center mt-7">
<a-pagination
v-model:current="currentPage"
:total="pagination.total"
show-less-items
@change="loadUsers(currentPage, currentLimit)"
/>
</div> </div>
<GeneralDeleteModal v-model:visible="isOpen" entity-name="User" :on-delete="() => deleteUser()"> <GeneralDeleteModal v-model:visible="isOpen" entity-name="User" :on-delete="() => deleteUser()">
<template #entity-preview> <template #entity-preview>

Loading…
Cancel
Save