Browse Source

chore(nc-gui): lint

pull/8836/head
Ramesh Mane 2 weeks ago
parent
commit
a2650724c6
  1. 10
      packages/nc-gui/components/workspace/AuditLogs.vue
  2. 11
      packages/nc-gui/store/workspace.ts

10
packages/nc-gui/components/workspace/AuditLogs.vue

@ -23,7 +23,6 @@ const workspaceStore = useWorkspace()
const { loadAudits: _loadAudits } = workspaceStore const { loadAudits: _loadAudits } = workspaceStore
const { const {
collaborators,
audits, audits,
auditLogsQuery, auditLogsQuery,
auditCurrentLimit: currentLimit, auditCurrentLimit: currentLimit,
@ -35,12 +34,12 @@ const basesStore = useBases()
const { getBaseUsers, loadProjects } = basesStore const { getBaseUsers, loadProjects } = basesStore
const { bases, basesList } = storeToRefs(basesStore) const { bases } = storeToRefs(basesStore)
const localCollaborators = ref<User[] | UserType[]>([]) const localCollaborators = ref<User[] | UserType[]>([])
const collaboratorsMap = computed<Map<string, (WorkspaceUserType & { id: string }) | User | UserType>>(() => { const collaboratorsMap = computed<Map<string, (WorkspaceUserType & { id: string }) | User | UserType>>(() => {
const map = new Map<string, WorkspaceUserType & { id: string }>() const map = new Map()
localCollaborators.value?.forEach((coll) => { localCollaborators.value?.forEach((coll) => {
if (coll?.email) { if (coll?.email) {
@ -62,10 +61,7 @@ const tableWrapper = ref<HTMLDivElement>()
async function loadAudits(page = currentPage.value, limit = currentLimit.value, updateCurrentPage = true) { async function loadAudits(page = currentPage.value, limit = currentLimit.value, updateCurrentPage = true) {
try { try {
if ( if ((!isUIAllowed('workspaceAuditList') && !props.baseId) || (!isUIAllowed('baseAuditList') && props.baseId)) {
(isEeUI && isUIAllowed('workspaceAuditList') && !props.workspaceId) ||
(!isUIAllowed('workspaceAuditList') && !props.baseId)
) {
return return
} }

11
packages/nc-gui/store/workspace.ts

@ -5,18 +5,13 @@ import { isString } from '@vue/shared'
import type { AuditLogsQuery } from '~/lib/types' import type { AuditLogsQuery } from '~/lib/types'
const defaultAuditLogsQuery = { const defaultAuditLogsQuery = {
type: undefined,
baseId: undefined, baseId: undefined,
sourceId: undefined, sourceId: undefined,
user: undefined,
startDate: undefined,
endData: undefined,
dateRangeLabel: undefined,
orderBy: { orderBy: {
created_at: 'desc', created_at: 'desc',
user: undefined, user: undefined,
}, },
} as AuditLogsQuery } as Partial<AuditLogsQuery>
export const useWorkspace = defineStore('workspaceStore', () => { export const useWorkspace = defineStore('workspaceStore', () => {
const basesStore = useBases() const basesStore = useBases()
@ -228,7 +223,7 @@ export const useWorkspace = defineStore('workspaceStore', () => {
} }
} }
const auditLogsQuery = ref<AuditLogsQuery>(defaultAuditLogsQuery) const auditLogsQuery = ref<Partial<AuditLogsQuery>>(defaultAuditLogsQuery)
const audits = ref<null | Array<AuditType>>(null) const audits = ref<null | Array<AuditType>>(null)
@ -239,7 +234,7 @@ export const useWorkspace = defineStore('workspaceStore', () => {
const auditCurrentLimit = ref(25) const auditCurrentLimit = ref(25)
const loadAudits = async ( const loadAudits = async (
workspaceId?: string, _workspaceId?: string,
page: number = auditCurrentPage.value, page: number = auditCurrentPage.value,
limit: number = auditCurrentLimit.value, limit: number = auditCurrentLimit.value,
) => { ) => {

Loading…
Cancel
Save