Skip to content

Commit

Permalink
datatable fixed to new version
Browse files Browse the repository at this point in the history
  • Loading branch information
volar committed Oct 31, 2023
1 parent 77a87c8 commit f839791
Show file tree
Hide file tree
Showing 18 changed files with 1,488 additions and 1,195 deletions.
76 changes: 38 additions & 38 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "adam-admin",
"packageManager": "yarn@3.5.0",
"packageManager": "yarn@3.6.4",
"license": "Apache-2.0",
"version": "0.0.1",
"scripts": {
Expand All @@ -21,55 +21,55 @@
"cy:open": "CYPRESS_CACHE_FOLDER='node_modules/.cache/Cypress' yarn cypress open -C cypress/config/cypress.config.ts"
},
"dependencies": {
"@anzusystems/common-admin": "^1.5.0",
"@mdi/font": "7.2.96",
"@anzusystems/common-admin": "^1.33.0",
"@mdi/font": "7.3.67",
"@vuelidate/core": "^2.0.3",
"@vuelidate/validators": "^2.0.3",
"@vueuse/core": "10.2.1",
"@vueuse/integrations": "10.2.1",
"axios": "^1.4.0",
"core-js": "^3.31.0",
"@vuelidate/validators": "^2.0.4",
"@vueuse/core": "10.5.0",
"@vueuse/integrations": "10.5.0",
"axios": "^1.6.0",
"core-js": "^3.33.1",
"js-sha1": "^0.6.0",
"jwt-decode": "^3.1.2",
"pinia": "^2.1.4",
"jwt-decode": "^4.0.0",
"pinia": "^2.1.7",
"sortablejs": "^1.15.0",
"universal-cookie": "^4.0.4",
"uuid": "^9.0.0",
"vue": "^3.3.4",
"universal-cookie": "^6.1.1",
"uuid": "^9.0.1",
"vue": "^3.3.7",
"vue-cropperjs": "^5.0.0",
"vue-i18n": "^9.2.2",
"vue-router": "^4.2.2",
"vuetify": "^3.3.6"
"vue-i18n": "^9.6.2",
"vue-router": "^4.2.5",
"vuetify": "^3.3.23"
},
"devDependencies": {
"@cypress/grep": "^3.1.5",
"@intlify/unplugin-vue-i18n": "^0.11.0",
"@rushstack/eslint-patch": "^1.3.2",
"@types/node": "^18.16.18",
"@types/sortablejs": "^1.15.1",
"@types/uuid": "^9.0.2",
"@typescript-eslint/parser": "^5.60.1",
"@vitejs/plugin-vue": "^4.2.3",
"@vue/eslint-config-prettier": "^7.1.0",
"@vue/eslint-config-typescript": "^11.0.3",
"@cypress/grep": "^4.0.1",
"@intlify/unplugin-vue-i18n": "^1.4.0",
"@rushstack/eslint-patch": "^1.5.1",
"@types/node": "^18.18.7",
"@types/sortablejs": "^1.15.4",
"@types/uuid": "^9.0.6",
"@typescript-eslint/parser": "^6.9.0",
"@vitejs/plugin-vue": "^4.4.0",
"@vue/eslint-config-prettier": "^8.0.0",
"@vue/eslint-config-typescript": "^12.0.0",
"@vue/tsconfig": "^0.1.3",
"cypress": "^12.16.0",
"cypress": "^13.3.3",
"cypress-downloadfile": "1.2.3",
"cypress-mochawesome-reporter": "^3.5.1",
"eslint": "8.43.0",
"eslint-plugin-cypress": "^2.13.3",
"eslint-plugin-vue": "^9.15.1",
"cypress-mochawesome-reporter": "^3.6.1",
"eslint": "8.52.0",
"eslint-plugin-cypress": "^2.15.1",
"eslint-plugin-vue": "^9.18.1",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.31",
"postcss-html": "^1.5.0",
"prettier": "^2.8.8",
"sass": "^1.63.6",
"stylelint": "^15.9.0",
"stylelint-config-recommended-vue": "^1.4.0",
"stylelint-config-standard-scss": "^10.0.0",
"prettier": "^3.0.3",
"sass": "^1.69.5",
"stylelint": "^15.11.0",
"stylelint-config-recommended-vue": "^1.5.0",
"stylelint-config-standard-scss": "^11.0.0",
"typescript": "^4.9.5",
"vite": "^4.3.9",
"vite": "^4.5.0",
"vite-plugin-vuetify": "^1.0.2",
"vue-tsc": "1.8.3"
"vue-tsc": "1.8.22"
}
}
6 changes: 2 additions & 4 deletions src/styles/components/dam-upload-queue.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ $duplicate-bg-color-dark: rgb(0 0 0 / 70%);
}

.#{$class-name-root} {
overflow-x: auto;
overflow-y: hidden;
overflow: auto hidden;
margin-top: 1px;

&--simple {
Expand All @@ -69,8 +68,7 @@ $duplicate-bg-color-dark: rgb(0 0 0 / 70%);
}

&--list {
overflow-x: hidden;
overflow-y: auto;
overflow: hidden auto;

.#{$class-name-root}__item {
min-width: auto;
Expand Down
28 changes: 14 additions & 14 deletions src/views/common/anzuUser/components/AnzuUserDatatable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { usePermissionConfigActions } from '@/views/common/permission/composable
import CachedPermissionGroupChip from '@/views/common/permissionGroup/components/CachedPermissionGroupChip.vue'
import { damClient } from '@/services/api/clients/damClient'
type DatatableItem = { raw: AnzuUser }
type DatatableItem = AnzuUser
const router = useRouter()
Expand All @@ -37,8 +37,8 @@ const { fetchAnzuUserList, anzuUserList, datatableHiddenColumns } = useAnzuUserA
const { can } = useAcl<AclValue>()
const onRowClick = (event: unknown, { item }: { item: DatatableItem }) => {
if (item.raw.id && can(ACL.DAM_USER_VIEW)) {
router.push({ name: ROUTE.COMMON.ANZU_USER.DETAIL, params: { id: item.raw.id } })
if (item.id && can(ACL.DAM_USER_VIEW)) {
router.push({ name: ROUTE.COMMON.ANZU_USER.DETAIL, params: { id: item.id } })
}
}
Expand Down Expand Up @@ -104,49 +104,49 @@ defineExpose({
<template #item.enabled="{ item }: { item: DatatableItem }">
<ABooleanValue
chip
:value="item.raw.enabled"
:value="item.enabled"
/>
</template>
<template #item.roles="{ item }: { item: DatatableItem }">
<AChipNoLink
v-for="role in item.raw.roles"
v-for="role in item.roles"
:key="role"
class="mr-1 mb-1"
>
{{ translatePermission('roles', role) }}
</AChipNoLink>
<span v-if="item.raw.roles.length === 0">-</span>
<span v-if="item.roles.length === 0">-</span>
</template>
<template #item.permissionGroups="{ item }: { item: DatatableItem }">
<CachedPermissionGroupChip
v-for="permissionGroupId in item.raw.permissionGroups"
v-for="permissionGroupId in item.permissionGroups"
:id="permissionGroupId"
:key="permissionGroupId"
class="mr-1 mb-1"
/>
<span v-if="item.raw.permissionGroups.length === 0">-</span>
<span v-if="item.permissionGroups.length === 0">-</span>
</template>
<template #item.permissions="{ item }: { item: DatatableItem }">
{{ Object.keys(item.raw.permissions).length }}
{{ Object.keys(item.permissions).length }}
</template>
<template #item.createdAt="{ item }: { item: DatatableItem }">
<ADatetime :date-time="item.raw.createdAt" />
<ADatetime :date-time="item.createdAt" />
</template>
<template #item.modifiedAt="{ item }: { item: DatatableItem }">
<ADatetime :date-time="item.raw.modifiedAt" />
<ADatetime :date-time="item.modifiedAt" />
</template>
<template #item.actions="{ item }: { item: DatatableItem }">
<div class="d-flex justify-end">
<ATableCopyIdButton :id="item.raw.id" />
<ATableCopyIdButton :id="item.id" />
<Acl :permission="ACL.DAM_USER_VIEW">
<ATableDetailButton
:record-id="item.raw.id"
:record-id="item.id"
:route-name="ROUTE.COMMON.ANZU_USER.DETAIL"
/>
</Acl>
<Acl :permission="ACL.DAM_USER_UPDATE">
<ATableEditButton
:record-id="item.raw.id"
:record-id="item.id"
:route-name="ROUTE.COMMON.ANZU_USER.EDIT"
/>
</Acl>
Expand Down
22 changes: 11 additions & 11 deletions src/views/common/log/components/LogDatatable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { onMounted } from 'vue'
import { useRouter } from 'vue-router'
import type { LogSystem } from '@/model/common/valueObject/LogSystem'
type DatatableItem = { raw: Log }
type DatatableItem = Log
const props = withDefaults(
defineProps<{
Expand All @@ -35,10 +35,10 @@ const { resetFilter: resetFilterHelper, submitFilter: submitFilterHelper } = use
const { fetchList, listItems, datatableHiddenColumns } = useLogListActions()
const onRowClick = (event: unknown, { item }: { item: DatatableItem }) => {
if (item.raw.id) {
if (item.id) {
router.push({
name: ROUTE.COMMON.LOG.DETAIL,
params: { id: item.raw.id, system: item.raw.context.appSystem, type: filter.type.model },
params: { id: item.id, system: item.context.appSystem, type: filter.type.model },
})
}
}
Expand Down Expand Up @@ -113,32 +113,32 @@ defineExpose({
@click:row="onRowClick"
>
<template #item.datetime="{ item }: { item: DatatableItem }">
<ADatetime :date-time="item.raw.datetime" />
<ADatetime :date-time="item.datetime" />
</template>
<template #item.levelName="{ item }: { item: DatatableItem }">
{{ item.raw.levelName }}
<!-- <LogLevelChip :level="item.raw.levelName" />-->
{{ item.levelName }}
<!-- <LogLevelChip :level="item.levelName" />-->
</template>
<template #item.message="{ item }: { item: DatatableItem }">
<div class="line-clamp-2">
{{ item.raw.message }}
{{ item.message }}
</div>
</template>
<template #item.context.contextId="{ item }: { item: DatatableItem }">
<ACopyText :value="item.raw.context.contextId" />
<ACopyText :value="item.context.contextId" />
</template>
<template #item.context.userId="{ item }: { item: DatatableItem }">
<ACopyText
v-if="!isNull(item.raw.context.userId)"
:value="item.raw.context.userId"
v-if="!isNull(item.context.userId)"
:value="item.context.userId"
/>
</template>
<template #item.actions="{ item }: { item: DatatableItem }">
<div class="d-flex justify-end">
<VBtn
:to="{
name: ROUTE.COMMON.LOG.DETAIL,
params: { id: item.raw.id, system: system, type: filter.type.model },
params: { id: item.id, system: system, type: filter.type.model },
}"
class="ml-1"
icon="mdi-information-outline"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { usePermissionGroupActions } from '@/views/common/permissionGroup/compos
import PermissionGroupFilter from '@/views/common/permissionGroup/components/PermissionGroupFilter.vue'
import { damClient } from '@/services/api/clients/damClient'
type DatatableItem = { raw: PermissionGroup }
type DatatableItem = PermissionGroup
const router = useRouter()
Expand All @@ -33,8 +33,8 @@ const { fetchPermissionGroupList, permissionGroupList, datatableHiddenColumns }
const { can } = useAcl<AclValue>()
const onRowClick = (event: unknown, { item }: { item: DatatableItem }) => {
if (item.raw.id && can(ACL.DAM_PERMISSION_GROUP_VIEW)) {
router.push({ name: ROUTE.COMMON.PERMISSION_GROUP.DETAIL, params: { id: item.raw.id } })
if (item.id && can(ACL.DAM_PERMISSION_GROUP_VIEW)) {
router.push({ name: ROUTE.COMMON.PERMISSION_GROUP.DETAIL, params: { id: item.id } })
}
}
Expand Down Expand Up @@ -94,26 +94,26 @@ defineExpose({
@click:row="onRowClick"
>
<template #item.permissions="{ item }: { item: DatatableItem }">
{{ Object.keys(item.raw.permissions).length }}
{{ Object.keys(item.permissions).length }}
</template>
<template #item.createdAt="{ item }: { item: DatatableItem }">
<ADatetime :date-time="item.raw.createdAt" />
<ADatetime :date-time="item.createdAt" />
</template>
<template #item.modifiedAt="{ item }: { item: DatatableItem }">
<ADatetime :date-time="item.raw.modifiedAt" />
<ADatetime :date-time="item.modifiedAt" />
</template>
<template #item.actions="{ item }: { item: DatatableItem }">
<div class="d-flex justify-end">
<ATableCopyIdButton :id="item.raw.id" />
<ATableCopyIdButton :id="item.id" />
<Acl :permission="ACL.DAM_PERMISSION_GROUP_VIEW">
<ATableDetailButton
:record-id="item.raw.id"
:record-id="item.id"
:route-name="ROUTE.COMMON.PERMISSION_GROUP.DETAIL"
/>
</Acl>
<Acl :permission="ACL.DAM_PERMISSION_GROUP_UPDATE">
<ATableEditButton
:record-id="item.raw.id"
:record-id="item.id"
:route-name="ROUTE.COMMON.PERMISSION_GROUP.EDIT"
/>
</Acl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import CachedExtSystemChip from '@/views/coreDam/extSystem/components/CachedExtS
import { ACL, type AclValue } from '@/types/Permission'
import type { AssetLicence } from '@/types/coreDam/AssetLicence'
type DatatableItem = { raw: AssetLicence }
type DatatableItem = AssetLicence
const router = useRouter()
const filter = useAssetLicenceListFilter()
Expand All @@ -38,8 +38,8 @@ const getList = () => {
const { can } = useAcl<AclValue>()
const onRowClick = (event: unknown, { item }: { item: DatatableItem }) => {
if (item.raw.id && can(ACL.DAM_ASSET_LICENCE_VIEW))
router.push({ name: ROUTE.DAM.ASSET_LICENCE.DETAIL, params: { id: item.raw.id } })
if (item.id && can(ACL.DAM_ASSET_LICENCE_VIEW))
router.push({ name: ROUTE.DAM.ASSET_LICENCE.DETAIL, params: { id: item.id } })
}
const { columnsVisible, columnsAll, columnsHidden, updateSortBy, pagination } = createDatatableColumnsConfig(
Expand Down Expand Up @@ -88,28 +88,28 @@ defineExpose({
>
<template #item.extSystem="{ item }: { item: DatatableItem }">
<CachedExtSystemChip
:id="item.raw.extSystem"
:id="item.extSystem"
variant="text"
/>
</template>
<template #item.createdAt="{ item }: { item: DatatableItem }">
<ADatetime :date-time="item.raw.createdAt" />
<ADatetime :date-time="item.createdAt" />
</template>
<template #item.modifiedAt="{ item }: { item: DatatableItem }">
<ADatetime :date-time="item.raw.modifiedAt" />
<ADatetime :date-time="item.modifiedAt" />
</template>
<template #item.actions="{ item }: { item: DatatableItem }">
<div class="d-flex justify-end">
<ATableCopyIdButton :id="item.raw.id" />
<ATableCopyIdButton :id="item.id" />
<Acl :permission="ACL.DAM_ASSET_LICENCE_VIEW">
<ATableDetailButton
:record-id="item.raw.id"
:record-id="item.id"
:route-name="ROUTE.DAM.ASSET_LICENCE.DETAIL"
/>
</Acl>
<Acl :permission="ACL.DAM_ASSET_LICENCE_UPDATE">
<ATableEditButton
:record-id="item.raw.id"
:record-id="item.id"
:route-name="ROUTE.DAM.ASSET_LICENCE.EDIT"
/>
</Acl>
Expand Down
Loading

0 comments on commit f839791

Please sign in to comment.