-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
994 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"model": { | ||
"id": "ID", | ||
"name": "Meno", | ||
"extSystem": "Externý systém", | ||
"licences": "Licencie" | ||
}, | ||
"filter": { | ||
"id": "ID" | ||
}, | ||
"meta": { | ||
"create": "Vytvoriť skupinu licencií" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { SYSTEM_CORE_DAM } from '@/model/systems' | ||
import { dateTimeNow } from '@anzusystems/common-admin' | ||
import { ENTITY } from '@/services/api/coreDam/assetLicenceGroupApi' | ||
import type { AssetLicenceGroup } from '@/types/coreDam/AssetLicenceGroup' | ||
|
||
export function useAssetLicenceGroupFactory() { | ||
const createDefault = (): AssetLicenceGroup => { | ||
return { | ||
id: 0, | ||
name: '', | ||
extSystem: null, | ||
licences: [], | ||
createdAt: dateTimeNow(), | ||
modifiedAt: dateTimeNow(), | ||
createdBy: 0, | ||
modifiedBy: 0, | ||
_resourceName: ENTITY, | ||
_system: SYSTEM_CORE_DAM, | ||
} | ||
} | ||
|
||
return { | ||
createDefault, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { makeFilterHelper } from '@anzusystems/common-admin' | ||
import { reactive } from 'vue' | ||
import { SYSTEM_CORE_DAM } from '@/model/systems' | ||
import { ENTITY } from '@/services/api/coreDam/assetLicenceGroupApi' | ||
|
||
const makeFilter = makeFilterHelper(SYSTEM_CORE_DAM, ENTITY) | ||
|
||
const filter = reactive({ | ||
id: { | ||
...makeFilter({ name: 'id' }), | ||
}, | ||
}) | ||
|
||
export function useAssetLicenceGroupListFilter() { | ||
return filter | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { ROUTE } from '@/router/routes' | ||
import { ACL } from '@/types/Permission' | ||
import type { RouteRecordRaw } from 'vue-router' | ||
import { AEmptyRouterView } from '@anzusystems/common-admin' | ||
|
||
export const assetLicenceGroupRoutes: RouteRecordRaw[] = [ | ||
{ | ||
path: '/asset-licence-group', | ||
component: AEmptyRouterView, | ||
meta: { | ||
requiresAuth: true, | ||
requiredPermissions: [], | ||
layout: 'AppLayoutDrawer', | ||
breadcrumbT: 'breadcrumb.coreDam.assetLicenceGroup.list', | ||
}, | ||
children: [ | ||
{ | ||
path: '', | ||
name: ROUTE.DAM.ASSET_LICENCE_GROUP.LIST, | ||
component: () => import('@/views/coreDam/assetLicenceGroup/AssetLicenceGroupListView.vue'), | ||
meta: { | ||
requiresAuth: true, | ||
requiredPermissions: [ACL.DAM_ASSET_LICENCE_GROUP_VIEW], | ||
layout: 'AppLayoutDrawer', | ||
}, | ||
}, | ||
{ | ||
path: ':id(\\d+)/edit', | ||
name: ROUTE.DAM.ASSET_LICENCE_GROUP.EDIT, | ||
component: () => import('@/views/coreDam/assetLicenceGroup/AssetLicenceGroupEditView.vue'), | ||
meta: { | ||
requiresAuth: true, | ||
requiredPermissions: [ACL.DAM_ASSET_LICENCE_GROUP_VIEW, ACL.DAM_ASSET_LICENCE_GROUP_UPDATE], | ||
layout: 'AppLayoutDrawer', | ||
breadcrumbT: 'breadcrumb.coreDam.assetLicenceGroup.edit', | ||
}, | ||
}, | ||
{ | ||
path: ':id(\\d+)', | ||
name: ROUTE.DAM.ASSET_LICENCE_GROUP.DETAIL, | ||
component: () => import('@/views/coreDam/assetLicenceGroup/AssetLicenceGroupDetailView.vue'), | ||
meta: { | ||
requiresAuth: true, | ||
requiredPermissions: [ACL.DAM_ASSET_LICENCE_GROUP_VIEW], | ||
layout: 'AppLayoutDrawer', | ||
breadcrumbT: 'breadcrumb.coreDam.assetLicenceGroup.detail', | ||
}, | ||
}, | ||
], | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { damClient } from '@/services/api/clients/damClient' | ||
import { SYSTEM_CORE_DAM } from '@/model/systems' | ||
import { | ||
apiCreateOne, | ||
apiFetchByIds, apiFetchList, | ||
apiFetchOne, | ||
apiUpdateOne, | ||
type FilterBag, | ||
type IntegerId, type Pagination | ||
} from '@anzusystems/common-admin' | ||
import type { AssetLicenceGroup } from '@/types/coreDam/AssetLicenceGroup' | ||
|
||
const END_POINT = '/adm/v1/asset-licence-group' | ||
export const ENTITY = 'assetLicenceGroup' | ||
|
||
export const fetchAssetLicenceGroupListByIds = (ids: IntegerId[]) => | ||
apiFetchByIds<AssetLicenceGroup[]>( | ||
damClient, | ||
ids, | ||
END_POINT, | ||
{}, | ||
SYSTEM_CORE_DAM, | ||
ENTITY, | ||
{}, | ||
true | ||
) | ||
|
||
export const fetchAssetLicenceGroupList = (pagination: Pagination, filterBag: FilterBag) => | ||
apiFetchList<AssetLicenceGroup[]>( | ||
damClient, | ||
END_POINT, | ||
{}, | ||
pagination, | ||
filterBag, | ||
SYSTEM_CORE_DAM, | ||
ENTITY | ||
) | ||
|
||
export const createAssetLicenceGroup = (data: AssetLicenceGroup) => | ||
apiCreateOne<AssetLicenceGroup>(damClient, data, END_POINT, {}, SYSTEM_CORE_DAM, ENTITY) | ||
|
||
export const updateAssetLicenceGroup = (id: IntegerId, data: AssetLicenceGroup) => | ||
apiUpdateOne<AssetLicenceGroup>(damClient, data, END_POINT + '/:id', { id }, SYSTEM_CORE_DAM, ENTITY) | ||
|
||
export const fetchAssetLicenceGroup = (id: IntegerId) => | ||
apiFetchOne<AssetLicenceGroup>(damClient, END_POINT + '/:id', { id }, SYSTEM_CORE_DAM, ENTITY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { acceptHMRUpdate, defineStore } from 'pinia' | ||
import { useAssetLicenceGroupFactory } from '@/model/coreDam/factory/AssetLicenceGroupFactory' | ||
import type { AssetLicenceGroup } from '@/types/coreDam/AssetLicenceGroup' | ||
import { ref } from 'vue' | ||
|
||
export const useAssetLicenceGroupOneStore = defineStore('assetLicenceGroupOneStore', () => { | ||
const { createDefault } = useAssetLicenceGroupFactory() | ||
|
||
const assetLicenceGroup = ref<AssetLicenceGroup>(createDefault()) | ||
|
||
function reset() { | ||
assetLicenceGroup.value = createDefault() | ||
} | ||
|
||
return { | ||
assetLicenceGroup, | ||
reset | ||
} | ||
}) | ||
|
||
if (import.meta.hot) { | ||
import.meta.hot.accept(acceptHMRUpdate(useAssetLicenceGroupOneStore, import.meta.hot)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import type { | ||
AnzuUserAndTimeTrackingAware, | ||
IntegerId, | ||
IntegerIdNullable, | ||
ResourceNameSystemAware | ||
} from '@anzusystems/common-admin' | ||
|
||
export interface AssetLicenceGroup extends AnzuUserAndTimeTrackingAware, ResourceNameSystemAware { | ||
id: IntegerId | ||
name: string | ||
extSystem: IntegerIdNullable | ||
licences: IntegerId[] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src/views/coreDam/assetLicenceGroup/AssetLicenceGroupCreateView.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<script lang="ts" setup> | ||
import { AActionCloseButton, AActionSaveButton, ACard, stringToInt } from '@anzusystems/common-admin' | ||
import { onBeforeUnmount, onMounted } from 'vue' | ||
import { useRoute } from 'vue-router' | ||
import { ROUTE } from '@/router/routes' | ||
import { useAssetLicenceGroupEditActions } from '@/views/coreDam/assetLicenceGroup/composables/assetLicenceGroupActions' | ||
import AssetLicenceGroupEditForm from '@/views/coreDam/assetLicenceGroup/components/AssetLicenceGroupEditForm.vue' | ||
import ActionbarWrapper from '@/components/wrappers/ActionbarWrapper.vue' | ||
const route = useRoute() | ||
const id = stringToInt(route.params.id) | ||
const { | ||
detailLoading, | ||
saveButtonLoading, | ||
saveAndCloseButtonLoading, | ||
fetchData, | ||
resetStore, | ||
onUpdate, | ||
assetLicenceGroup | ||
} = | ||
useAssetLicenceGroupEditActions() | ||
const getData = () => { | ||
fetchData(id) | ||
} | ||
onMounted(() => { | ||
getData() | ||
}) | ||
onBeforeUnmount(() => { | ||
resetStore() | ||
}) | ||
</script> | ||
|
||
<template> | ||
<ActionbarWrapper :last-breadcrumb-title="assetLicenceGroup.name"> | ||
<template #buttons> | ||
<AActionSaveButton | ||
v-if="!detailLoading" | ||
:loading="saveButtonLoading" | ||
:disabled="saveAndCloseButtonLoading" | ||
@save-record="onUpdate" | ||
/> | ||
<AActionCloseButton :route-name="ROUTE.DAM.ASSET_LICENCE_GROUP.LIST" /> | ||
</template> | ||
</ActionbarWrapper> | ||
|
||
<ACard :loading="detailLoading"> | ||
<VCardText> | ||
<AssetLicenceGroupEditForm /> | ||
</VCardText> | ||
</ACard> | ||
</template> |
Oops, something went wrong.