-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1647 create a svelte component where taginfos are shown to a version…
…, update on pubslih, show, release note, tag nr
- Loading branch information
Showing
209 changed files
with
422 additions
and
2,216 deletions.
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
4 changes: 2 additions & 2 deletions
4
Console/BExIS.Web.Shell/Areas/DDM/BExIS.Modules.Ddm.UI.Svelte/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
172 changes: 165 additions & 7 deletions
172
...ole/BExIS.Web.Shell/Areas/DDM/BExIS.Modules.Ddm.UI.Svelte/src/routes/taginfo/+page.svelte
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 |
---|---|---|
@@ -1,19 +1,177 @@ | ||
<script> | ||
import { Page, pageContentLayoutType } from "@bexis2/bexis2-core-ui"; | ||
import { getTagInfos } from '$services' | ||
import { onMount } from 'svelte' | ||
<script lang="ts"> | ||
onMount(()=>{ | ||
import { Page, pageContentLayoutType, TablePlaceholder, Table, notificationStore, notificationType, ErrorMessage} from "@bexis2/bexis2-core-ui"; | ||
import { get, save } from './services' | ||
import { tagInfoModelStore } from './stores.js' | ||
import TablePublish from "./table/tablePublish.svelte"; | ||
import TableShow from "./table/tableShow.svelte"; | ||
import TableNr from "./table/tableNr.svelte"; | ||
import TableText from "./table/tableText.svelte"; | ||
import TableOptions from "./table/tableOptions.svelte"; | ||
import TableDate from "./table/tableDate.svelte"; | ||
import type { TagInfoModel } from "./types"; | ||
import TableReleaseNote from "./table/tableReleaseNote.svelte"; | ||
}) | ||
let container; | ||
let id: number = 0; | ||
async function reload(){ | ||
container = document.getElementById('taginfo'); | ||
id = Number(container?.getAttribute('dataset')); | ||
var taginfos = await get(id); | ||
console.log("🚀 ~ onMount ~ taginfos:", taginfos) | ||
tagInfoModelStore.set(taginfos) | ||
} | ||
const tableActions = (action: CustomEvent<{ row: TagInfoModel; type: string }>) => { | ||
// See tableCRUDActions tab for more details | ||
const { type, row } = action.detail; | ||
console.log("🚀 ~ tableActions ~ action.detail:", action.detail) | ||
switch (type) { | ||
case 'SAVE': | ||
saveFn(row); | ||
break; | ||
case 'UPDATE': | ||
// updateFn(row); | ||
break; | ||
default: | ||
break; | ||
} | ||
}; | ||
async function saveFn(tagInfo: TagInfoModel) { | ||
const responce = await save(tagInfo); | ||
if(responce.status === 200){ | ||
notificationStore.showNotification({ | ||
notificationType: notificationType.success, | ||
message: 'Tag is saved.' | ||
}) | ||
console.log('ok'); | ||
}else{ | ||
notificationStore.showNotification({ | ||
notificationType: notificationType.error, | ||
message: 'Tag is not saved.' | ||
}) | ||
} | ||
} | ||
</script> | ||
<Page | ||
title="Tag Overview" | ||
note="Tag Infomations about a version" | ||
contentLayoutType={pageContentLayoutType.full} | ||
contentLayoutType={pageContentLayoutType.center} | ||
> | ||
|
||
{#await reload()} | ||
<div class="table-container w-full"> | ||
<TablePlaceholder cols={7} /> | ||
</div> | ||
{:then model} | ||
<div class="table table-compact w-full"> | ||
|
||
<Table | ||
on:action={tableActions} | ||
config={{ | ||
id:"taginfos", | ||
search:false, | ||
data: tagInfoModelStore, | ||
optionsComponent: TableOptions, | ||
columns:{ | ||
versionId: { | ||
disableFiltering: true, | ||
exclude: true | ||
}, | ||
tagId: { | ||
disableFiltering: true, | ||
exclude: true | ||
}, | ||
versionNr: { | ||
fixedWidth:10, | ||
header:"Internal version", | ||
disableFiltering:true, | ||
disableSorting:true | ||
}, | ||
tagNr: { | ||
fixedWidth:80, | ||
header:"Tag", | ||
disableFiltering:true, | ||
disableSorting:true, | ||
instructions:{ | ||
renderComponent:TableNr | ||
} | ||
}, | ||
releaseNote: { | ||
header:"Release Note", | ||
fixedWidth:400, | ||
disableFiltering:true, | ||
disableSorting:true, | ||
instructions:{ | ||
renderComponent:TableReleaseNote | ||
} | ||
}, | ||
releaseDate: { | ||
header:"Release Date", | ||
instructions:{ | ||
renderComponent:TableDate | ||
}, | ||
disableFiltering:true, | ||
disableSorting:true | ||
}, | ||
systemDescription: { | ||
header:"System Description", | ||
disableFiltering:true, | ||
disableSorting:true | ||
}, | ||
systemAuthor: { | ||
header:"System Author", | ||
disableFiltering:true, | ||
disableSorting:true | ||
}, | ||
systemDate: { | ||
header:"System Date", | ||
instructions:{ | ||
renderComponent:TableDate | ||
}, | ||
disableFiltering:true, | ||
disableSorting:true | ||
}, | ||
show:{ | ||
header:"Show history", | ||
fixedWidth:10, | ||
instructions:{ | ||
renderComponent:TableShow | ||
}, | ||
disableFiltering:true, | ||
disableSorting:true | ||
}, | ||
publish:{ | ||
header:"Publish dataset", | ||
fixedWidth:10, | ||
instructions:{ | ||
renderComponent:TablePublish | ||
}, | ||
disableFiltering:true, | ||
disableSorting:true | ||
} | ||
} | ||
}}> | ||
</Table> | ||
|
||
</div> | ||
{:catch error} | ||
<ErrorMessage {error} /> | ||
{/await} | ||
|
||
</Page> |
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
5 changes: 5 additions & 0 deletions
5
Console/BExIS.Web.Shell/Areas/DDM/BExIS.Modules.Ddm.UI.Svelte/src/routes/taginfo/stores.ts
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,5 @@ | ||
import type { TagInfoModel } from './types'; | ||
import { writable } from 'svelte/store'; | ||
|
||
export const tagInfoModelStore = writable<TagInfoModel[]>([]); | ||
|
23 changes: 23 additions & 0 deletions
23
...Web.Shell/Areas/DDM/BExIS.Modules.Ddm.UI.Svelte/src/routes/taginfo/table/tableDate.svelte
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 @@ | ||
<script lang="ts"> | ||
import type { TagInfoModel } from '../types'; | ||
export let value: string; | ||
export let row: TagInfoModel; | ||
let emtpy:boolean = true; | ||
emtpy = isEmpty(value) | ||
function isEmpty(value: string): boolean { | ||
if(value === null || value === undefined || value === '' || value === '0001-01-01T00:00:00') { | ||
return true; | ||
} | ||
return false; | ||
} | ||
</script> | ||
{#if !emtpy} | ||
{new Date(value).toLocaleString("de-DE")} | ||
{/if} | ||
|
Oops, something went wrong.