@yuuvis/app-templates 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/extensions/lib/actions/apply.component.d.ts +1 -1
- package/extensions/lib/extensions.service.d.ts +1 -1
- package/fesm2022/yuuvis-app-templates-extensions.mjs +1 -1
- package/fesm2022/yuuvis-app-templates-extensions.mjs.map +1 -1
- package/fesm2022/yuuvis-app-templates-shared.mjs +48 -0
- package/fesm2022/yuuvis-app-templates-shared.mjs.map +1 -0
- package/fesm2022/yuuvis-app-templates.mjs +25 -54
- package/fesm2022/yuuvis-app-templates.mjs.map +1 -1
- package/index.d.ts +0 -1
- package/lib/app-templates.service.d.ts +2 -2
- package/lib/assets/i18n/de.json +1 -1
- package/lib/assets/i18n/en.json +1 -1
- package/lib/components/template-details/template-details.component.d.ts +1 -1
- package/lib/pages/management/template-management.component.d.ts +1 -1
- package/package.json +9 -2
- package/shared/README.md +3 -0
- package/{lib → shared}/app-templates.schema.d.ts +1 -1
- package/shared/index.d.ts +1 -0
package/README.md
CHANGED
|
@@ -19,7 +19,9 @@ import { YuvTemplatesExtension } from '@yuuvis/app-templates/extensions';
|
|
|
19
19
|
|
|
20
20
|
export const appConfig: ApplicationConfig = {
|
|
21
21
|
providers: [
|
|
22
|
-
importShellExtensions([
|
|
22
|
+
importShellExtensions([
|
|
23
|
+
{ id: 'io.yuuvis.app.templates.extension', extension: YuvTemplatesExtension }
|
|
24
|
+
])
|
|
23
25
|
]
|
|
24
26
|
}
|
|
25
27
|
```
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DmsObject } from '@yuuvis/client-core';
|
|
2
|
-
import { TemplateObject } from '@yuuvis/app-templates';
|
|
2
|
+
import { TemplateObject } from '@yuuvis/app-templates/shared';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class ApplyTemplateComponent {
|
|
5
5
|
#private;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DmsObject } from '@yuuvis/client-core';
|
|
2
2
|
import { ClientShellExtension } from '@yuuvis/client-shell-core';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
|
-
import { TemplateSearchResponse } from '@yuuvis/app-templates';
|
|
4
|
+
import { TemplateSearchResponse } from '@yuuvis/app-templates/shared';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export declare class YuvTemplatesExtension implements ClientShellExtension {
|
|
7
7
|
#private;
|
|
@@ -5,7 +5,7 @@ import * as i1 from '@yuuvis/client-core';
|
|
|
5
5
|
import { TranslateModule, NotificationService, TranslateService, SystemType, BackendService, DmsService, EventService, ApiBase, YuvEventType } from '@yuuvis/client-core';
|
|
6
6
|
import { AbstractContextAction, SelectionRange, ActionsService } from '@yuuvis/client-framework/actions';
|
|
7
7
|
import { finalize, of, map, switchMap, tap } from 'rxjs';
|
|
8
|
-
import { APP_ICONS, APP_ACTIONS, TemplateObject } from '@yuuvis/app-templates';
|
|
8
|
+
import { APP_ICONS, APP_ACTIONS, TemplateObject } from '@yuuvis/app-templates/shared';
|
|
9
9
|
import { TranslateService as TranslateService$1 } from '@ngx-translate/core';
|
|
10
10
|
import { MAT_DIALOG_DATA, MatDialogRef, MatDialog } from '@angular/material/dialog';
|
|
11
11
|
import { CommonModule } from '@angular/common';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yuuvis-app-templates-extensions.mjs","sources":["../../../../projects/yuuvis/app-templates/extensions/src/lib/actions/apply.component.ts","../../../../projects/yuuvis/app-templates/extensions/src/lib/actions/apply.component.html","../../../../projects/yuuvis/app-templates/extensions/src/lib/actions/apply.action.ts","../../../../projects/yuuvis/app-templates/extensions/src/lib/extensions.service.ts","../../../../projects/yuuvis/app-templates/extensions/src/yuuvis-app-templates-extensions.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Component, effect, inject, input, signal, untracked } from '@angular/core';\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\nimport { MatIconModule } from '@angular/material/icon';\nimport { DmsObject, NotificationService, TranslateModule, TranslateService } from '@yuuvis/client-core';\nimport { BusyOverlayDirective, DialogComponent } from '@yuuvis/client-framework/common';\nimport { ListComponent, ListItemDirective } from '@yuuvis/client-framework/list';\nimport { finalize } from 'rxjs';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { YmtButtonDirective } from '@yuuvis/material';\nimport { APP_ICONS, TemplateObject, TemplateSearchResponse } from '@yuuvis/app-templates';\nimport { YuvTemplatesExtension } from './../extensions.service';\n\nconst components = [\n BusyOverlayDirective,\n ListComponent,\n ListItemDirective,\n DialogComponent,\n YmtButtonDirective\n];\n\nconst modules = [\n CommonModule,\n TranslateModule,\n MatIconModule,\n MatProgressBarModule,\n];\n\n@Component({\n selector: 'ymtmpl-apply',\n templateUrl: './apply.component.html',\n styleUrls: ['./apply.component.scss'],\n standalone: true,\n imports: [...modules, ...components]\n})\nexport class ApplyTemplateComponent {\n\n readonly #extension = inject(YuvTemplatesExtension);\n readonly #notificationService = inject(NotificationService);\n readonly #translateService = inject(TranslateService);\n\n #dialogData = inject<DmsObject>(MAT_DIALOG_DATA);\n readonly #dialogRef = inject(MatDialogRef<ApplyTemplateComponent>);\n\n dmsObject = input<DmsObject>(this.#dialogData);\n\n #dmsObjectEffect = effect(() => {\n if (this.dmsObject())\n untracked(() => {\n this.#init()\n });\n });\n\n supportedTemplates = signal<TemplateObject[]>([]);\n\n selectedTemplate = signal<TemplateObject | undefined>(undefined);\n\n busy = signal<boolean>(false);\n\n error = signal<boolean>(false);\n\n icons = {\n ...APP_ICONS\n };\n\n #init() {\n this.busy.set(true)\n this.#extension.getTemplatesForObject(this.dmsObject())\n .pipe(finalize(() => this.busy.set(false)))\n .subscribe({\n next: (res: TemplateSearchResponse) => {\n this.error.set(false);\n this.supportedTemplates.set(res.items);\n },\n error: () => {\n this.error.set(true);\n }\n });\n }\n\n onItemSelect(idx: number[]) {\n this.selectedTemplate.set(this.supportedTemplates()[idx[0]]);\n }\n\n cancel() {\n this.#dialogRef.close();\n }\n \n apply() {\n this.busy.set(true)\n this.#extension.applyTemplateOnObject(`obj:${this.selectedTemplate()?.id}`, this.dmsObject()).subscribe({\n next: () => {\n this.#notificationService.success(this.#translateService.instant('yuv.app.templates.action.apply.success'));\n },\n error: (err: any) => {\n this.#notificationService.error(err);\n this.busy.set(false);\n },\n complete: () => {\n this.#dialogRef.close();\n }\n });\n }\n} \n","<yuv-dialog [headertitel]=\"'yuv.app.templates.action.apply.headline' | translate\">\n <main [yuvBusyOverlay]=\"busy()\">\n @let templates = supportedTemplates(); @if (templates.length) {\n <p>{{ \"yuv.app.templates.action.apply.text\" | translate }}</p>\n <yuv-list selectOnEnter=\"true\" (itemSelect)=\"onItemSelect($event)\">\n @for (t of templates; track $index) {\n <div yuvListItem>\n <mat-icon class=\"icon\">{{ icons.actionApplyTemplate }}</mat-icon>\n <div class=\"name\">{{ t.name }}</div>\n <div class=\"description\">{{ t.description }}</div>\n </div>\n }\n </yuv-list>\n } @else if (!busy()) { @if (!error()) {\n <div class=\"hint empty\">\n <p>{{ \"yuv.app.templates.action.apply.list.empty\" | translate }}</p>\n </div>\n } @else {\n <div class=\"hint error\">\n <p>{{ \"yuv.app.templates.action.apply.error\" | translate }}</p>\n </div>\n } }\n </main>\n <footer>\n <button [disabled]=\"busy()\" type=\"button\" ymtButton=\"secondary\" (click)=\"cancel()\">{{ \"yuv.app.templates.action.apply.button.cancel\" | translate }}</button>\n <button [disabled]=\"busy() || error() || !selectedTemplate()\" ymtButton=\"primary\" (click)=\"apply()\">{{ \"yuv.app.templates.action.apply.button.ok\" | translate }}</button>\n </footer>\n</yuv-dialog>\n","import { inject } from '@angular/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport { DmsObject, SystemType } from '@yuuvis/client-core';\nimport {\n AbstractContextAction,\n Action,\n ActionSupport,\n SelectionRange,\n} from '@yuuvis/client-framework/actions';\nimport { Observable, of } from 'rxjs';\nimport { MatDialog } from '@angular/material/dialog';\nimport { APP_ACTIONS, APP_ICONS } from '@yuuvis/app-templates';\nimport { ApplyTemplateComponent } from './apply.component';\n\nexport class ApplyTemplateAction\n extends AbstractContextAction\n implements Action\n{\n readonly #translateService = inject(TranslateService);\n #dialog = inject(MatDialog);\n\n id = APP_ACTIONS.apply;\n label = this.#translateService.instant(\n 'yuv.app.templates.action.apply.label'\n );\n description = this.#translateService.instant(\n 'yuv.app.templates.action.apply.description'\n );\n icon = APP_ICONS.actionApplyTemplate;\n group = 'common';\n priority = 0;\n range = SelectionRange.SINGLE_SELECT;\n supports: ActionSupport = {\n types: [SystemType.DOCUMENT],\n };\n\n isExecutable(selection: DmsObject[]) {\n const i = selection[0];\n return of(i && !i.isFolder);\n }\n\n run(selection: DmsObject[]): Observable<boolean> {\n this.#dialog.open(ApplyTemplateComponent, {\n width: '400px',\n maxWidth: '90vw',\n data: selection[0],\n });\n return of(true);\n }\n}\n","import { HttpParams } from '@angular/common/http';\nimport { inject, Injectable } from '@angular/core';\nimport { ApiBase, BackendService, CoreApiObject, CoreApiResponse, DmsObject, DmsService, EventService, SearchResponse, YuvEventType } from '@yuuvis/client-core';\nimport { ActionsService } from '@yuuvis/client-framework/actions';\nimport { ClientShellExtension } from '@yuuvis/client-shell-core';\nimport { map, Observable, of, switchMap, tap } from 'rxjs';\nimport { APP_ACTIONS, TemplateObject, TemplateSearchResponse } from '@yuuvis/app-templates';\nimport { ApplyTemplateAction } from './actions/apply.action';\n\n@Injectable()\nexport class YuvTemplatesExtension implements ClientShellExtension {\n static MAX_TEMPLATES = 20;\n\n readonly #actions = [\n { id: APP_ACTIONS.apply, action: ApplyTemplateAction }\n ];\n\n readonly #actionsService = inject(ActionsService);\n readonly #backendService = inject(BackendService);\n readonly #dmsService = inject(DmsService);\n readonly #eventService = inject(EventService);\n \n init(): Promise<any> {\n this.#actionsService.registerActions(this.#actions);\n return Promise.resolve();\n }\n\n getTemplatesForObject(object: DmsObject, pageNumber = 0): Observable<TemplateSearchResponse> {\n let searchParams = new HttpParams()\n .set('page', 0)\n .set('size', YuvTemplatesExtension.MAX_TEMPLATES)\n .set('sort', 'name%2Casc')\n .set('published', true)\n .set('type', object.objectTypeId);\n\n object.sots.forEach((sot) => { \n searchParams = searchParams.append('type', sot)\n });\n\n return this.#backendService.get(`/template-service/api/objects/?${searchParams}`, ApiBase.none).pipe(\n map((res: SearchResponse) => ({\n pageNumber: pageNumber,\n pageSize: YuvTemplatesExtension.MAX_TEMPLATES,\n totalNumItems: res.totalNumItems,\n items: res.objects.map((obj: CoreApiObject) => new TemplateObject(obj))\n }))\n );\n }\n\n applyTemplateOnObject(templateRef: String, object: DmsObject, silent = false): Observable<DmsObject> {\n return this.#backendService.post(`/template-service/api/:createAndSaveDocument?templateRef=${templateRef}&targetObjectId=${object.id}`, { objectData: object.id }, ApiBase.none).pipe(\n map((res: CoreApiResponse) => {\n return this.#dmsService.coreApiResponseToDmsObject(res)\n })\n ).pipe(\n switchMap((res) => (!object.id ? of(res) : this.#dmsService.getDmsObject(object.id))),\n tap((res: any) => !silent && this.#eventService.trigger(YuvEventType.DMS_OBJECT_UPDATED, res))\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["TranslateService"],"mappings":";;;;;;;;;;;;;;;;;;AAaA,MAAM,UAAU,GAAG;IACjB,oBAAoB;IACpB,aAAa;IACb,iBAAiB;IACjB,eAAe;IACf;CACD;AAED,MAAM,OAAO,GAAG;IACd,YAAY;IACZ,eAAe;IACf,aAAa;IACb,oBAAoB;CACrB;MASY,sBAAsB,CAAA;AAPnC,IAAA,WAAA,GAAA;AASW,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,qBAAqB,CAAC;AAC1C,QAAA,IAAA,CAAA,oBAAoB,GAAG,MAAM,CAAC,mBAAmB,CAAC;AAClD,QAAA,IAAA,CAAA,iBAAiB,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAErD,QAAA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/lib/actions/apply.component.ts","../../../../projects/yuuvis/app-templates/extensions/src/lib/actions/apply.component.html","../../../../projects/yuuvis/app-templates/extensions/src/lib/actions/apply.action.ts","../../../../projects/yuuvis/app-templates/extensions/src/lib/extensions.service.ts","../../../../projects/yuuvis/app-templates/extensions/src/yuuvis-app-templates-extensions.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Component, effect, inject, input, signal, untracked } from '@angular/core';\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\nimport { MatIconModule } from '@angular/material/icon';\nimport { DmsObject, NotificationService, TranslateModule, TranslateService } from '@yuuvis/client-core';\nimport { BusyOverlayDirective, DialogComponent } from '@yuuvis/client-framework/common';\nimport { ListComponent, ListItemDirective } from '@yuuvis/client-framework/list';\nimport { finalize } from 'rxjs';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { YmtButtonDirective } from '@yuuvis/material';\nimport { APP_ICONS, TemplateObject, TemplateSearchResponse } from '@yuuvis/app-templates/shared';\nimport { YuvTemplatesExtension } from './../extensions.service';\n\nconst components = [\n BusyOverlayDirective,\n ListComponent,\n ListItemDirective,\n DialogComponent,\n YmtButtonDirective\n];\n\nconst modules = [\n CommonModule,\n TranslateModule,\n MatIconModule,\n MatProgressBarModule,\n];\n\n@Component({\n selector: 'ymtmpl-apply',\n templateUrl: './apply.component.html',\n styleUrls: ['./apply.component.scss'],\n standalone: true,\n imports: [...modules, ...components]\n})\nexport class ApplyTemplateComponent {\n\n readonly #extension = inject(YuvTemplatesExtension);\n readonly #notificationService = inject(NotificationService);\n readonly #translateService = inject(TranslateService);\n\n #dialogData = inject<DmsObject>(MAT_DIALOG_DATA);\n readonly #dialogRef = inject(MatDialogRef<ApplyTemplateComponent>);\n\n dmsObject = input<DmsObject>(this.#dialogData);\n\n #dmsObjectEffect = effect(() => {\n if (this.dmsObject())\n untracked(() => {\n this.#init()\n });\n });\n\n supportedTemplates = signal<TemplateObject[]>([]);\n\n selectedTemplate = signal<TemplateObject | undefined>(undefined);\n\n busy = signal<boolean>(false);\n\n error = signal<boolean>(false);\n\n icons = {\n ...APP_ICONS\n };\n\n #init() {\n this.busy.set(true)\n this.#extension.getTemplatesForObject(this.dmsObject())\n .pipe(finalize(() => this.busy.set(false)))\n .subscribe({\n next: (res: TemplateSearchResponse) => {\n this.error.set(false);\n this.supportedTemplates.set(res.items);\n },\n error: () => {\n this.error.set(true);\n }\n });\n }\n\n onItemSelect(idx: number[]) {\n this.selectedTemplate.set(this.supportedTemplates()[idx[0]]);\n }\n\n cancel() {\n this.#dialogRef.close();\n }\n \n apply() {\n this.busy.set(true)\n this.#extension.applyTemplateOnObject(`obj:${this.selectedTemplate()?.id}`, this.dmsObject()).subscribe({\n next: () => {\n this.#notificationService.success(this.#translateService.instant('yuv.app.templates.action.apply.success'));\n },\n error: (err: any) => {\n this.#notificationService.error(err);\n this.busy.set(false);\n },\n complete: () => {\n this.#dialogRef.close();\n }\n });\n }\n} \n","<yuv-dialog [headertitel]=\"'yuv.app.templates.action.apply.headline' | translate\">\n <main [yuvBusyOverlay]=\"busy()\">\n @let templates = supportedTemplates(); @if (templates.length) {\n <p>{{ \"yuv.app.templates.action.apply.text\" | translate }}</p>\n <yuv-list selectOnEnter=\"true\" (itemSelect)=\"onItemSelect($event)\">\n @for (t of templates; track $index) {\n <div yuvListItem>\n <mat-icon class=\"icon\">{{ icons.actionApplyTemplate }}</mat-icon>\n <div class=\"name\">{{ t.name }}</div>\n <div class=\"description\">{{ t.description }}</div>\n </div>\n }\n </yuv-list>\n } @else if (!busy()) { @if (!error()) {\n <div class=\"hint empty\">\n <p>{{ \"yuv.app.templates.action.apply.list.empty\" | translate }}</p>\n </div>\n } @else {\n <div class=\"hint error\">\n <p>{{ \"yuv.app.templates.action.apply.error\" | translate }}</p>\n </div>\n } }\n </main>\n <footer>\n <button [disabled]=\"busy()\" type=\"button\" ymtButton=\"secondary\" (click)=\"cancel()\">{{ \"yuv.app.templates.action.apply.button.cancel\" | translate }}</button>\n <button [disabled]=\"busy() || error() || !selectedTemplate()\" ymtButton=\"primary\" (click)=\"apply()\">{{ \"yuv.app.templates.action.apply.button.ok\" | translate }}</button>\n </footer>\n</yuv-dialog>\n","import { inject } from '@angular/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport { DmsObject, SystemType } from '@yuuvis/client-core';\nimport {\n AbstractContextAction,\n Action,\n ActionSupport,\n SelectionRange,\n} from '@yuuvis/client-framework/actions';\nimport { Observable, of } from 'rxjs';\nimport { MatDialog } from '@angular/material/dialog';\nimport { APP_ACTIONS, APP_ICONS } from '@yuuvis/app-templates/shared';\nimport { ApplyTemplateComponent } from './apply.component';\n\nexport class ApplyTemplateAction\n extends AbstractContextAction\n implements Action\n{\n readonly #translateService = inject(TranslateService);\n #dialog = inject(MatDialog);\n\n id = APP_ACTIONS.apply;\n label = this.#translateService.instant(\n 'yuv.app.templates.action.apply.label'\n );\n description = this.#translateService.instant(\n 'yuv.app.templates.action.apply.description'\n );\n icon = APP_ICONS.actionApplyTemplate;\n group = 'common';\n priority = 0;\n range = SelectionRange.SINGLE_SELECT;\n supports: ActionSupport = {\n types: [SystemType.DOCUMENT],\n };\n\n isExecutable(selection: DmsObject[]) {\n const i = selection[0];\n return of(i && !i.isFolder);\n }\n\n run(selection: DmsObject[]): Observable<boolean> {\n this.#dialog.open(ApplyTemplateComponent, {\n width: '400px',\n maxWidth: '90vw',\n data: selection[0],\n });\n return of(true);\n }\n}\n","import { HttpParams } from '@angular/common/http';\nimport { inject, Injectable } from '@angular/core';\nimport { ApiBase, BackendService, CoreApiObject, CoreApiResponse, DmsObject, DmsService, EventService, SearchResponse, YuvEventType } from '@yuuvis/client-core';\nimport { ActionsService } from '@yuuvis/client-framework/actions';\nimport { ClientShellExtension } from '@yuuvis/client-shell-core';\nimport { map, Observable, of, switchMap, tap } from 'rxjs';\nimport { APP_ACTIONS, TemplateObject, TemplateSearchResponse } from '@yuuvis/app-templates/shared';\nimport { ApplyTemplateAction } from './actions/apply.action';\n\n@Injectable()\nexport class YuvTemplatesExtension implements ClientShellExtension {\n static MAX_TEMPLATES = 20;\n\n readonly #actions = [\n { id: APP_ACTIONS.apply, action: ApplyTemplateAction }\n ];\n\n readonly #actionsService = inject(ActionsService);\n readonly #backendService = inject(BackendService);\n readonly #dmsService = inject(DmsService);\n readonly #eventService = inject(EventService);\n \n init(): Promise<any> {\n this.#actionsService.registerActions(this.#actions);\n return Promise.resolve();\n }\n\n getTemplatesForObject(object: DmsObject, pageNumber = 0): Observable<TemplateSearchResponse> {\n let searchParams = new HttpParams()\n .set('page', 0)\n .set('size', YuvTemplatesExtension.MAX_TEMPLATES)\n .set('sort', 'name%2Casc')\n .set('published', true)\n .set('type', object.objectTypeId);\n\n object.sots.forEach((sot) => { \n searchParams = searchParams.append('type', sot)\n });\n\n return this.#backendService.get(`/template-service/api/objects/?${searchParams}`, ApiBase.none).pipe(\n map((res: SearchResponse) => ({\n pageNumber: pageNumber,\n pageSize: YuvTemplatesExtension.MAX_TEMPLATES,\n totalNumItems: res.totalNumItems,\n items: res.objects.map((obj: CoreApiObject) => new TemplateObject(obj))\n }))\n );\n }\n\n applyTemplateOnObject(templateRef: String, object: DmsObject, silent = false): Observable<DmsObject> {\n return this.#backendService.post(`/template-service/api/:createAndSaveDocument?templateRef=${templateRef}&targetObjectId=${object.id}`, { objectData: object.id }, ApiBase.none).pipe(\n map((res: CoreApiResponse) => {\n return this.#dmsService.coreApiResponseToDmsObject(res)\n })\n ).pipe(\n switchMap((res) => (!object.id ? of(res) : this.#dmsService.getDmsObject(object.id))),\n tap((res: any) => !silent && this.#eventService.trigger(YuvEventType.DMS_OBJECT_UPDATED, res))\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["TranslateService"],"mappings":";;;;;;;;;;;;;;;;;;AAaA,MAAM,UAAU,GAAG;IACjB,oBAAoB;IACpB,aAAa;IACb,iBAAiB;IACjB,eAAe;IACf;CACD;AAED,MAAM,OAA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C,CAAC,CAC/F;;+GA/CQ,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;mHAArB,qBAAqB,EAAA,CAAA,CAAA;;4FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBADjC;;;ACTD;;AAEG;;;;"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { BaseObjectTypeField } from '@yuuvis/client-core';
|
|
2
|
+
|
|
3
|
+
const APP_ID = 'io.yuuvis.app.templates';
|
|
4
|
+
const APP_ICONS = {
|
|
5
|
+
close: 'close',
|
|
6
|
+
refresh: 'refresh',
|
|
7
|
+
actionApplyTemplate: 'article_shortcut',
|
|
8
|
+
actionCreateNewTemplate: 'add_notes',
|
|
9
|
+
actionToggleStateToPublished: 'input_circle',
|
|
10
|
+
actionToggleStateToUnpublished: 'unpublished',
|
|
11
|
+
actionDeleteTemplate: 'delete',
|
|
12
|
+
actionDownloadTemplateContent: 'download',
|
|
13
|
+
actionReplaceTemplateContent: 'upload_file',
|
|
14
|
+
toggleRight: 'dock_to_left',
|
|
15
|
+
};
|
|
16
|
+
const APP_ACTIONS = {
|
|
17
|
+
apply: APP_ID + 'action.apply',
|
|
18
|
+
};
|
|
19
|
+
const APP_SCHEMA = {
|
|
20
|
+
id: APP_ID,
|
|
21
|
+
name: 'yuuvis Templates',
|
|
22
|
+
icon: 'library_books',
|
|
23
|
+
types: {},
|
|
24
|
+
flavors: []
|
|
25
|
+
};
|
|
26
|
+
const TEMPLATE_FILE_MIME_TYPE = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
|
|
27
|
+
class TemplateObject {
|
|
28
|
+
constructor(obj) {
|
|
29
|
+
this.id = obj.properties[BaseObjectTypeField.OBJECT_ID].value;
|
|
30
|
+
this.name = obj.properties["appTemplates:name"].value;
|
|
31
|
+
this.description = obj.properties["appTemplates:description"]?.value;
|
|
32
|
+
this.published = obj.properties["appTemplates:published"].value;
|
|
33
|
+
this.dataObjectType = obj.properties["appTemplates:dataObjects"].value[0][1];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
var TemplateManagementEventType;
|
|
37
|
+
(function (TemplateManagementEventType) {
|
|
38
|
+
TemplateManagementEventType["TEMPLATE_OBJECT_CREATED"] = "io.yuuvis.app.templates.object.created";
|
|
39
|
+
TemplateManagementEventType["TEMPLATE_OBJECT_UPDATED"] = "io.yuuvis.app.templates.object.updated";
|
|
40
|
+
TemplateManagementEventType["TEMPLATE_OBJECT_DELETED"] = "io.yuuvis.app.templates.object.deleted";
|
|
41
|
+
})(TemplateManagementEventType || (TemplateManagementEventType = {}));
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Generated bundle index. Do not edit.
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
export { APP_ACTIONS, APP_ICONS, APP_ID, APP_SCHEMA, TEMPLATE_FILE_MIME_TYPE, TemplateManagementEventType, TemplateObject };
|
|
48
|
+
//# sourceMappingURL=yuuvis-app-templates-shared.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yuuvis-app-templates-shared.mjs","sources":["../../../../projects/yuuvis/app-templates/shared/src/app-templates.schema.ts","../../../../projects/yuuvis/app-templates/shared/src/yuuvis-app-templates-shared.ts"],"sourcesContent":["import { BaseObjectTypeField, CoreApiObject } from '@yuuvis/client-core';\nimport { AppSchema } from '@yuuvis/client-shell-core';\n\nexport const APP_ID = 'io.yuuvis.app.templates';\n\nexport const APP_ICONS = {\n close: 'close',\n refresh: 'refresh',\n actionApplyTemplate: 'article_shortcut',\n actionCreateNewTemplate: 'add_notes',\n actionToggleStateToPublished: 'input_circle',\n actionToggleStateToUnpublished: 'unpublished',\n actionDeleteTemplate: 'delete',\n actionDownloadTemplateContent: 'download',\n actionReplaceTemplateContent: 'upload_file',\n toggleRight: 'dock_to_left',\n};\n\nexport const APP_ACTIONS = {\n apply: APP_ID + 'action.apply',\n};\n\nexport const APP_SCHEMA: AppSchema = {\n id: APP_ID,\n name: 'yuuvis Templates',\n icon: 'library_books',\n types: {},\n flavors: []\n};\n\nexport const TEMPLATE_FILE_MIME_TYPE = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';\n\nexport class TemplateObject {\n readonly id: string;\n\n name: string;\n description: string;\n published: boolean;\n dataObjectType: string\n\n constructor(obj: CoreApiObject) {\n this.id = obj.properties[BaseObjectTypeField.OBJECT_ID].value as string;\n this.name = obj.properties[\"appTemplates:name\"].value as string;\n this.description = obj.properties[\"appTemplates:description\"]?.value as string;\n this.published = obj.properties[\"appTemplates:published\"].value as boolean;\n this.dataObjectType = (obj.properties[\"appTemplates:dataObjects\"].value as Array<string[]>)[0][1];\n }\n}\n\nexport enum TemplateManagementEventType {\n TEMPLATE_OBJECT_CREATED = APP_ID + '.object.created',\n TEMPLATE_OBJECT_UPDATED = APP_ID + '.object.updated',\n TEMPLATE_OBJECT_DELETED = APP_ID + '.object.deleted'\n}\n\nexport interface CreateTemplateResult {\n item: TemplateObject;\n}\n\nexport interface TemplateSearchResponse {\n pageNumber: number;\n pageSize: number;\n totalNumItems: number;\n items: TemplateObject[];\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAGO,MAAM,MAAM,GAAG;AAET,MAAA,SAAS,GAAG;AACvB,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,OAAO,EAAE,SAAS;AAClB,IAAA,mBAAmB,EAAE,kBAAkB;AACvC,IAAA,uBAAuB,EAAE,WAAW;AACpC,IAAA,4BAA4B,EAAE,cAAc;AAC5C,IAAA,8BAA8B,EAAE,aAAa;AAC7C,IAAA,oBAAoB,EAAE,QAAQ;AAC9B,IAAA,6BAA6B,EAAE,UAAU;AACzC,IAAA,4BAA4B,EAAE,aAAa;AAC3C,IAAA,WAAW,EAAE,cAAc;;AAGhB,MAAA,WAAW,GAAG;IACzB,KAAK,EAAE,MAAM,GAAG,cAAc;;AAGnB,MAAA,UAAU,GAAc;AACnC,IAAA,EAAE,EAAE,MAAM;AACV,IAAA,IAAI,EAAE,kBAAkB;AACxB,IAAA,IAAI,EAAE,eAAe;AACrB,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,OAAO,EAAE;;AAGJ,MAAM,uBAAuB,GAAG;MAE1B,cAAc,CAAA;AAQzB,IAAA,WAAA,CAAY,GAAkB,EAAA;AAC5B,QAAA,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC,UAAU,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,KAAe;QACvE,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC,KAAe;QAC/D,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC,UAAU,CAAC,0BAA0B,CAAC,EAAE,KAAe;QAC9E,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,UAAU,CAAC,wBAAwB,CAAC,CAAC,KAAgB;AAC1E,QAAA,IAAI,CAAC,cAAc,GAAI,GAAG,CAAC,UAAU,CAAC,0BAA0B,CAAC,CAAC,KAAyB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;;AAEpG;IAEW;AAAZ,CAAA,UAAY,2BAA2B,EAAA;AACrC,IAAA,2BAAA,CAAA,yBAAA,CAAA,GAAA,wCAAoD;AACpD,IAAA,2BAAA,CAAA,yBAAA,CAAA,GAAA,wCAAoD;AACpD,IAAA,2BAAA,CAAA,yBAAA,CAAA,GAAA,wCAAoD;AACtD,CAAC,EAJW,2BAA2B,KAA3B,2BAA2B,GAItC,EAAA,CAAA,CAAA;;ACrDD;;AAEG;;;;"}
|
|
@@ -2,8 +2,9 @@ import { HttpParams } from '@angular/common/http';
|
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { inject, signal, Injectable, Component, Input, linkedSignal, viewChild, HostBinding } from '@angular/core';
|
|
4
4
|
import * as i2 from '@yuuvis/client-core';
|
|
5
|
-
import {
|
|
5
|
+
import { Logger, BackendService, DmsService, TranslateService, SystemService, ContentStreamAllowed, ApiBase, TranslateModule, DeviceService, NotificationService } from '@yuuvis/client-core';
|
|
6
6
|
import { ReplaySubject, catchError, throwError, map, tap, switchMap, of } from 'rxjs';
|
|
7
|
+
import { TemplateObject, TEMPLATE_FILE_MIME_TYPE, APP_SCHEMA, APP_ICONS } from '@yuuvis/app-templates/shared';
|
|
7
8
|
import { ConfirmService, BusyOverlayDirective, DialogComponent } from '@yuuvis/client-framework/common';
|
|
8
9
|
import * as i1$2 from '@angular/common';
|
|
9
10
|
import { CommonModule, DOCUMENT } from '@angular/common';
|
|
@@ -34,46 +35,6 @@ import { MatSelectModule } from '@angular/material/select';
|
|
|
34
35
|
import { StringComponent } from '@yuuvis/client-framework/forms';
|
|
35
36
|
import { YmtButtonDirective } from '@yuuvis/material';
|
|
36
37
|
|
|
37
|
-
const APP_ID = 'io.yuuvis.app.templates';
|
|
38
|
-
const APP_ICONS = {
|
|
39
|
-
close: 'close',
|
|
40
|
-
refresh: 'refresh',
|
|
41
|
-
actionApplyTemplate: 'article_shortcut',
|
|
42
|
-
actionCreateNewTemplate: 'add_notes',
|
|
43
|
-
actionToggleStateToPublished: 'input_circle',
|
|
44
|
-
actionToggleStateToUnpublished: 'unpublished',
|
|
45
|
-
actionDeleteTemplate: 'delete',
|
|
46
|
-
actionDownloadTemplateContent: 'download',
|
|
47
|
-
actionReplaceTemplateContent: 'upload_file',
|
|
48
|
-
toggleRight: 'dock_to_left',
|
|
49
|
-
};
|
|
50
|
-
const APP_ACTIONS = {
|
|
51
|
-
apply: APP_ID + 'action.apply',
|
|
52
|
-
};
|
|
53
|
-
const APP_SCHEMA = {
|
|
54
|
-
id: APP_ID,
|
|
55
|
-
name: 'yuuvis Templates',
|
|
56
|
-
icon: 'library_books',
|
|
57
|
-
types: {},
|
|
58
|
-
flavors: []
|
|
59
|
-
};
|
|
60
|
-
const TEMPLATE_FILE_MIME_TYPE = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
|
|
61
|
-
class TemplateObject {
|
|
62
|
-
constructor(obj) {
|
|
63
|
-
this.id = obj.properties[BaseObjectTypeField.OBJECT_ID].value;
|
|
64
|
-
this.name = obj.properties["appTemplates:name"].value;
|
|
65
|
-
this.description = obj.properties["appTemplates:description"]?.value;
|
|
66
|
-
this.published = obj.properties["appTemplates:published"].value;
|
|
67
|
-
this.dataObjectType = obj.properties["appTemplates:dataObjects"].value[0][1];
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
var TemplateManagementEventType;
|
|
71
|
-
(function (TemplateManagementEventType) {
|
|
72
|
-
TemplateManagementEventType["TEMPLATE_OBJECT_CREATED"] = "io.yuuvis.app.templates.object.created";
|
|
73
|
-
TemplateManagementEventType["TEMPLATE_OBJECT_UPDATED"] = "io.yuuvis.app.templates.object.updated";
|
|
74
|
-
TemplateManagementEventType["TEMPLATE_OBJECT_DELETED"] = "io.yuuvis.app.templates.object.deleted";
|
|
75
|
-
})(TemplateManagementEventType || (TemplateManagementEventType = {}));
|
|
76
|
-
|
|
77
38
|
var _a;
|
|
78
39
|
class TemplateService {
|
|
79
40
|
static { this.PAGE_SIZE = 20; }
|
|
@@ -123,9 +84,7 @@ class TemplateService {
|
|
|
123
84
|
.pipe(catchError((e) => {
|
|
124
85
|
this.#logger.error('Failed to create template', e);
|
|
125
86
|
return throwError(() => new Error(e.message));
|
|
126
|
-
}), map((res) => (
|
|
127
|
-
id: res.properties[BaseObjectTypeField.OBJECT_ID].value,
|
|
128
|
-
})), tap((res) => this.refreshTemplates()));
|
|
87
|
+
}), map((res) => new TemplateObject(res)));
|
|
129
88
|
}
|
|
130
89
|
downloadTemplateContent(template) {
|
|
131
90
|
return this.#backendService.download(this.#dmsService.getContentPath(template.id, undefined));
|
|
@@ -287,6 +246,7 @@ class CreateTemplateComponent {
|
|
|
287
246
|
this.dataObjectTypes.set(this.#templateService.getAvailableDataObjectTypes().sort((ot1, ot2) => ot1.id > ot2.id ? 1 : -1));
|
|
288
247
|
}
|
|
289
248
|
createTemplate() {
|
|
249
|
+
let createdTemplate;
|
|
290
250
|
let createParams = this.form.value;
|
|
291
251
|
this.busy.set(true);
|
|
292
252
|
this.error.set(undefined);
|
|
@@ -297,8 +257,11 @@ class CreateTemplateComponent {
|
|
|
297
257
|
this.error.set(e);
|
|
298
258
|
this.busy.set(false);
|
|
299
259
|
},
|
|
260
|
+
next: (obj) => {
|
|
261
|
+
createdTemplate = obj;
|
|
262
|
+
},
|
|
300
263
|
complete: () => {
|
|
301
|
-
this.close();
|
|
264
|
+
this.#dialogRef.close(createdTemplate);
|
|
302
265
|
},
|
|
303
266
|
});
|
|
304
267
|
}
|
|
@@ -311,13 +274,13 @@ class CreateTemplateComponent {
|
|
|
311
274
|
});
|
|
312
275
|
}
|
|
313
276
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CreateTemplateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
314
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: CreateTemplateComponent, isStandalone: true, selector: "ymtmpl-create-template", host: { properties: { "class.busy": "!busy()" } }, ngImport: i0, template: "<yuv-dialog [yuvBusyOverlay]=\"busy()\" [headertitel]=\"'yuv.app.templates.action.create.headline' | translate\">\n <main>\n <form [formGroup]=\"form\">\n <mat-form-field class=\"yuv-form-field\">\n <mat-label>{{\"yuv.app.templates.object.property.name\" | translate }}</mat-label>\n <yuv-string [required]=\"true\" formControlName=\"name\"></yuv-string>\n </mat-form-field>\n <mat-form-field class=\"yuv-form-field\">\n <mat-label>{{\"yuv.app.templates.object.property.description\" | translate}}</mat-label>\n <yuv-string formControlName=\"description\"></yuv-string>\n </mat-form-field>\n <mat-form-field class=\"yuv-form-field\">\n <mat-label>{{\"yuv.app.templates.object.property.dataObjectType\" | translate}}</mat-label>\n <mat-select formControlName=\"dataObjectType\">\n @for (dataObjectType of dataObjectTypes(); track dataObjectType) {\n <mat-option [value]=\"dataObjectType.id\">{{ dataObjectType.id }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n @if (error()) {\n <p class=\"error\">{{ error() }}</p>\n }\n </form>\n </main>\n <footer>\n <button ymtButton=\"secondary\" [disabled]=\"busy()\" (click)=\"close()\">\n {{ \"yuv.app.templates.action.create.button.cancel\" | translate }}\n </button>\n <button ymtButton=\"primary\" [disabled]=\"disabledSubmit()\" (click)=\"createTemplate()\">\n {{ 'yuv.object-flavor.apply-flavor.button.apply' | translate }}\n </button>\n </footer>\n</yuv-dialog>\n", styles: [":host{display:block;position:relative}:host
|
|
277
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: CreateTemplateComponent, isStandalone: true, selector: "ymtmpl-create-template", host: { properties: { "class.busy": "!busy()" } }, ngImport: i0, template: "<yuv-dialog [yuvBusyOverlay]=\"busy()\" [headertitel]=\"'yuv.app.templates.action.create.headline' | translate\">\n <main class=\"yuv-dialog-content\">\n <form [formGroup]=\"form\">\n <mat-form-field class=\"yuv-form-field\">\n <mat-label>{{\"yuv.app.templates.object.property.name\" | translate }}</mat-label>\n <yuv-string [required]=\"true\" formControlName=\"name\"></yuv-string>\n </mat-form-field>\n <mat-form-field class=\"yuv-form-field\">\n <mat-label>{{\"yuv.app.templates.object.property.description\" | translate}}</mat-label>\n <yuv-string formControlName=\"description\"></yuv-string>\n </mat-form-field>\n <mat-form-field class=\"yuv-form-field\">\n <mat-label>{{\"yuv.app.templates.object.property.dataObjectType\" | translate}}</mat-label>\n <mat-select formControlName=\"dataObjectType\">\n @for (dataObjectType of dataObjectTypes(); track dataObjectType) {\n <mat-option [value]=\"dataObjectType.id\">{{ dataObjectType.id }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n @if (error()) {\n <p class=\"error\">{{ error() }}</p>\n }\n </form>\n </main>\n <footer>\n <button ymtButton=\"secondary\" [disabled]=\"busy()\" (click)=\"close()\">\n {{ \"yuv.app.templates.action.create.button.cancel\" | translate }}\n </button>\n <button ymtButton=\"primary\" [disabled]=\"disabledSubmit()\" (click)=\"createTemplate()\">\n {{ 'yuv.object-flavor.apply-flavor.button.apply' | translate }}\n </button>\n </footer>\n</yuv-dialog>\n", styles: [":host{display:block;position:relative}:host main form{padding:var(--ymt-spacing-m)}:host main form .yuv-form-field{width:100%;margin:var(--ymt-spacing-xs) 0}:host main form .error{color:var(--ymt-on-danger-container);background-color:var(--ymt-danger-container);padding:var(--ymt-spacing-m);border-radius:var(--ymt-corner-xs)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i4.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i4.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: BusyOverlayDirective, selector: "[yuvBusyOverlay]", inputs: ["yuvBusyOverlay"] }, { kind: "component", type: StringComponent, selector: "yuv-string", inputs: ["multiselect", "rows", "readonly", "autofocus", "classifications", "situation", "regex", "minLength", "maxLength"] }, { kind: "directive", type: YmtButtonDirective, selector: "button[ymtButton], a[ymtButton]", inputs: ["ymtButton", "disabled", "aria-disabled", "disableRipple", "disabledInteractive", "button-size"] }, { kind: "component", type: DialogComponent, selector: "yuv-dialog", inputs: ["headertitel"] }] }); }
|
|
315
278
|
}
|
|
316
279
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CreateTemplateComponent, decorators: [{
|
|
317
280
|
type: Component,
|
|
318
281
|
args: [{ selector: 'ymtmpl-create-template', standalone: true, imports: [...modules$1, ...components$1], host: {
|
|
319
282
|
'[class.busy]': '!busy()',
|
|
320
|
-
}, template: "<yuv-dialog [yuvBusyOverlay]=\"busy()\" [headertitel]=\"'yuv.app.templates.action.create.headline' | translate\">\n <main>\n <form [formGroup]=\"form\">\n <mat-form-field class=\"yuv-form-field\">\n <mat-label>{{\"yuv.app.templates.object.property.name\" | translate }}</mat-label>\n <yuv-string [required]=\"true\" formControlName=\"name\"></yuv-string>\n </mat-form-field>\n <mat-form-field class=\"yuv-form-field\">\n <mat-label>{{\"yuv.app.templates.object.property.description\" | translate}}</mat-label>\n <yuv-string formControlName=\"description\"></yuv-string>\n </mat-form-field>\n <mat-form-field class=\"yuv-form-field\">\n <mat-label>{{\"yuv.app.templates.object.property.dataObjectType\" | translate}}</mat-label>\n <mat-select formControlName=\"dataObjectType\">\n @for (dataObjectType of dataObjectTypes(); track dataObjectType) {\n <mat-option [value]=\"dataObjectType.id\">{{ dataObjectType.id }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n @if (error()) {\n <p class=\"error\">{{ error() }}</p>\n }\n </form>\n </main>\n <footer>\n <button ymtButton=\"secondary\" [disabled]=\"busy()\" (click)=\"close()\">\n {{ \"yuv.app.templates.action.create.button.cancel\" | translate }}\n </button>\n <button ymtButton=\"primary\" [disabled]=\"disabledSubmit()\" (click)=\"createTemplate()\">\n {{ 'yuv.object-flavor.apply-flavor.button.apply' | translate }}\n </button>\n </footer>\n</yuv-dialog>\n", styles: [":host{display:block;position:relative}:host
|
|
283
|
+
}, template: "<yuv-dialog [yuvBusyOverlay]=\"busy()\" [headertitel]=\"'yuv.app.templates.action.create.headline' | translate\">\n <main class=\"yuv-dialog-content\">\n <form [formGroup]=\"form\">\n <mat-form-field class=\"yuv-form-field\">\n <mat-label>{{\"yuv.app.templates.object.property.name\" | translate }}</mat-label>\n <yuv-string [required]=\"true\" formControlName=\"name\"></yuv-string>\n </mat-form-field>\n <mat-form-field class=\"yuv-form-field\">\n <mat-label>{{\"yuv.app.templates.object.property.description\" | translate}}</mat-label>\n <yuv-string formControlName=\"description\"></yuv-string>\n </mat-form-field>\n <mat-form-field class=\"yuv-form-field\">\n <mat-label>{{\"yuv.app.templates.object.property.dataObjectType\" | translate}}</mat-label>\n <mat-select formControlName=\"dataObjectType\">\n @for (dataObjectType of dataObjectTypes(); track dataObjectType) {\n <mat-option [value]=\"dataObjectType.id\">{{ dataObjectType.id }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n @if (error()) {\n <p class=\"error\">{{ error() }}</p>\n }\n </form>\n </main>\n <footer>\n <button ymtButton=\"secondary\" [disabled]=\"busy()\" (click)=\"close()\">\n {{ \"yuv.app.templates.action.create.button.cancel\" | translate }}\n </button>\n <button ymtButton=\"primary\" [disabled]=\"disabledSubmit()\" (click)=\"createTemplate()\">\n {{ 'yuv.object-flavor.apply-flavor.button.apply' | translate }}\n </button>\n </footer>\n</yuv-dialog>\n", styles: [":host{display:block;position:relative}:host main form{padding:var(--ymt-spacing-m)}:host main form .yuv-form-field{width:100%;margin:var(--ymt-spacing-xs) 0}:host main form .error{color:var(--ymt-on-danger-container);background-color:var(--ymt-danger-container);padding:var(--ymt-spacing-m);border-radius:var(--ymt-corner-xs)}\n"] }]
|
|
321
284
|
}], ctorParameters: () => [] });
|
|
322
285
|
|
|
323
286
|
const components = [
|
|
@@ -437,6 +400,11 @@ class TemplateManagementComponent {
|
|
|
437
400
|
this.#dialog.open(CreateTemplateComponent, {
|
|
438
401
|
width: '400px',
|
|
439
402
|
maxWidth: '90vw',
|
|
403
|
+
}).afterClosed().subscribe((createdTemplate) => {
|
|
404
|
+
if (createdTemplate) {
|
|
405
|
+
this.#templates.push(createdTemplate);
|
|
406
|
+
this.#logger.debug("New template created and added to list");
|
|
407
|
+
}
|
|
440
408
|
});
|
|
441
409
|
}
|
|
442
410
|
downloadCurrentContent() {
|
|
@@ -466,7 +434,7 @@ class TemplateManagementComponent {
|
|
|
466
434
|
this.#notificationService.error(err);
|
|
467
435
|
},
|
|
468
436
|
complete: () => {
|
|
469
|
-
this.#logger.debug('Template content replaced
|
|
437
|
+
this.#logger.debug('Template content replaced');
|
|
470
438
|
},
|
|
471
439
|
});
|
|
472
440
|
}
|
|
@@ -482,8 +450,8 @@ class TemplateManagementComponent {
|
|
|
482
450
|
.toggleTemplateState(template)
|
|
483
451
|
.subscribe((res) => {
|
|
484
452
|
if (res) {
|
|
485
|
-
this.#logger.info('Template published state chenged!');
|
|
486
453
|
this.#updateActions(template);
|
|
454
|
+
this.#logger.info('Template published state chenged');
|
|
487
455
|
}
|
|
488
456
|
});
|
|
489
457
|
}
|
|
@@ -491,10 +459,13 @@ class TemplateManagementComponent {
|
|
|
491
459
|
deleteCurrent() {
|
|
492
460
|
const template = this.selectedTemplate();
|
|
493
461
|
if (template) {
|
|
462
|
+
const index = this.#templates.indexOf(template);
|
|
494
463
|
this.#logger.debug('Delete template ' + template.id + ' ...');
|
|
495
|
-
this.#templateService.deleteTemplate(template)
|
|
464
|
+
this.#templateService.deleteTemplate(template)
|
|
465
|
+
.subscribe((res) => {
|
|
496
466
|
if (res) {
|
|
497
|
-
this.#
|
|
467
|
+
this.#templates.splice(index, 1);
|
|
468
|
+
this.#logger.debug('Template deleted and removed from list');
|
|
498
469
|
}
|
|
499
470
|
});
|
|
500
471
|
}
|
|
@@ -513,13 +484,13 @@ class TemplateManagementComponent {
|
|
|
513
484
|
this.#templateService.refreshTemplates();
|
|
514
485
|
}
|
|
515
486
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TemplateManagementComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
516
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: TemplateManagementComponent, isStandalone: true, selector: "ymtmpl-templates-management", host: { attributes: { "class.smallScreen": "smallScreenLayout()" }, properties: { "class.pagination": "this.pagination" } }, viewQueries: [{ propertyName: "templateListComponent", first: true, predicate: ListComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<header>\n <nav [attr.aria-label]=\"'yuv.app.templates.naviagtion.aria.label' | translate\">\n <div class=\"primary-actions\">\n <button mat-mini-fab (click)=\"createNewTemplate()\" [matTooltip]=\"'yuv.app.templates.action.create.label' | translate\">\n <mat-icon>{{icons.actionCreateNewTemplate}}</mat-icon> \n </button>\n </div>\n <div class=\"template-actions\">\n <yuv-overflow-menu [menuItems]=\"actions\"></yuv-overflow-menu>\n </div>\n <div class=\"secondary-actions\">\n @if (!smallScreenLayout()) {\n <button mat-icon-button
|
|
487
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: TemplateManagementComponent, isStandalone: true, selector: "ymtmpl-templates-management", host: { attributes: { "class.smallScreen": "smallScreenLayout()" }, properties: { "class.pagination": "this.pagination" } }, viewQueries: [{ propertyName: "templateListComponent", first: true, predicate: ListComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<header>\n <nav [attr.aria-label]=\"'yuv.app.templates.naviagtion.aria.label' | translate\">\n <div class=\"primary-actions\">\n <button mat-mini-fab (click)=\"createNewTemplate()\" [matTooltip]=\"'yuv.app.templates.action.create.label' | translate\">\n <mat-icon>{{icons.actionCreateNewTemplate}}</mat-icon> \n </button>\n </div>\n <div class=\"template-actions\">\n <yuv-overflow-menu [menuItems]=\"actions\"></yuv-overflow-menu>\n </div>\n <div class=\"secondary-actions\">\n @if (!smallScreenLayout()) {\n <button mat-icon-button (click)=\"enableDetails.set(!enableDetails())\" [matTooltip]=\"'yuv.app.templates.toggledetails.tooltip' | translate\" [ngClass]=\"{ enabled: enableDetails() }\">\n <mat-icon>{{icons.toggleRight}}</mat-icon>\n </button>\n }\n </div>\n </nav>\n</header>\n\n<main>\n <yuv-master-details\n [gutterSize]=\"1\"\n [detailsActive]=\"!smallScreenLayout() && enableDetails()\"\n [layoutOptions]=\"layoutOptions()\"\n [layoutSettingsID]=\"layoutSettingsID\"\n [mode]=\"smallScreenLayout() ? 'ontop' : 'aside'\">\n \n <ng-template #yuvMasterPane>\n <div class=\"masterPaneContainer\">\n @let templateObjects = (templates$ | async)?.items;\n @if (templateObjects?.length) {\n <yuv-list (itemSelect)=\"onItemSelect($event)\">\n @for (t of templateObjects; track t.id) {\n <div class=\"item\" [ngClass]=\"[t.published ? 'public' : '']\" yuvListItem [style.--i]=\"$index\">\n <mat-icon class=\"icon\">{{t.published ? 'export_notes' : 'article'}}</mat-icon>\n <div class=\"name\">{{ t.name }}</div>\n <div class=\"description\">{{ t.description }}</div>\n <div class=\"id\">{{ t.id.toUpperCase( ) }}</div>\n <div class=\"dataObjectType\">{{ t.dataObjectType }}</div> \n </div>\n }\n </yuv-list>\n @if (pagination) {\n <yuv-pagination [pagination]=\"pagination\" (pageChange)=\"goToPage($event)\"></yuv-pagination>\n }\n } @else {\n <div class=\"empty\">\n <p>{{ 'yuv.app.templates.list.empty' | translate }}</p>\n </div>\n }\n </div>\n </ng-template>\n\n <ng-template #yuvDetailsPane>\n <div class=\"detailsPaneContainer\">\n @let templateObject = selectedTemplate();\n @if (templateObject) {\n @if (smallScreenLayout()) {\n <div class=\"toolbar\">\n <button (click)=\"selectedTemplate.set(undefined)\"> \n <mat-icon>{{icons.close}}</mat-icon> \n </button>\n </div>\n }\n <ymtmpl-template-details [templateObject]=\"templateObject\"></ymtmpl-template-details>\n } @else {\n <div class=\"nothing-selected\">\n <h2>{{ 'yuv.app.templates.list.selection.empty' | translate }}</h2>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M14 2H6C4.89 2 4 2.9 4 4V20C4 21.11 4.89 22 6 22H18C19.11 22 20 21.11 20 20V8L14 2M18 20H6V4H13V9H18V20M17.35 10L15.25 19H13.85L12.05 12.21L10.25 19H8.85L6.65 10H8.15L9.55 16.81L11.35 10H12.65L14.45 16.81L15.85 10H17.35Z\" /></svg>\n </div>\n }\n </div>\n </ng-template>\n\n </yuv-master-details>\n</main>\n\n<router-outlet name=\"modal\"></router-outlet>", styles: [":host{--split-gutter-background-color: var(--ymt-outline-variant);display:flex;overflow:hidden;flex-flow:column;box-sizing:border-box;height:100%}:host header>nav{flex:0 0 auto;display:grid;grid-template-columns:auto 1fr auto;grid-template-areas:\"primary actions sort secondary\";align-items:center;gap:var(--ymt-spacing-s);border-block-end:1px solid var(--ymt-outline-variant);position:relative;padding:var(--ymt-spacing-xs) var(--ymt-spacing-s)}:host header>nav .primary-actions{grid-area:primary;overflow-x:auto}:host header>nav .secondary-actions{grid-area:secondary;overflow-x:auto}:host header>nav .template-actions{grid-area:actions;align-self:stretch;overflow-x:auto;border-color:var(--ymt-outline-variant);border-width:0 1px 0 1px;border-style:solid;display:grid;grid-template-rows:1fr;grid-template-columns:1fr;align-items:center}:host main{overflow:hidden;background-color:var(--ymt-surface);height:100%}:host yuv-master-details{height:100%}:host yuv-master-details .masterPaneContainer{display:flex;flex-direction:column;height:100%;overflow:hidden}:host yuv-master-details .masterPaneContainer yuv-list{height:100%}:host yuv-master-details .masterPaneContainer yuv-list [yuvListItem]{--icon-size: 32px;--list-item-hover-background: var(--ymt-focus-background);display:grid;padding:var(--ymt-spacing-s) var(--ymt-spacing-s);border-block-end:1px solid var(--ymt-outline-variant);align-items:center;grid-template-columns:var(--icon-size) 1fr auto;grid-template-rows:repeat(2,auto);grid-template-areas:\"icon name name\" \"icon description description\" \"icon id dataObjectType\";column-gap:var(--ymt-spacing-s);row-gap:var(--ymt-spacing-s);cursor:pointer}:host yuv-master-details .masterPaneContainer yuv-list [yuvListItem] .icon{grid-area:icon;color:var(--ymt-text-color-subtle)}:host yuv-master-details .masterPaneContainer yuv-list [yuvListItem] .id{grid-area:id;color:var(--ymt-text-color-subtle);font:var(--ymt-font-body-subtle)}:host yuv-master-details .masterPaneContainer yuv-list [yuvListItem] .name{grid-area:name;color:var(--ymt-text-color-body);font:var(--ymt-font-body)}:host yuv-master-details .masterPaneContainer yuv-list [yuvListItem] .description{grid-area:description;color:var(--ymt-text-color-subtle);font:var(--ymt-font-body)}:host yuv-master-details .masterPaneContainer yuv-list [yuvListItem] .dataObjectType{grid-area:dataObjectType;color:var(--ymt-text-color-subtle);font:var(--ymt-font-body-subtle)}:host yuv-master-details .masterPaneContainer yuv-list [yuvListItem]:not(:last-child){border-block-end:1px solid var(--ymt-outline-variant)}:host yuv-master-details .masterPaneContainer yuv-pagination{border-block-start:1px solid var(--ymt-outline-variant)}:host yuv-master-details .detailsPaneContainer{display:flex;flex-direction:column;height:100%;overflow:hidden}:host yuv-master-details .detailsPaneContainer ymtmpl-template-details{height:100%}:host yuv-master-details .detailsPaneContainer .toolbar{flex:0 0 auto}:host yuv-master-details .detailsPaneContainer .nothing-selected{display:flex;flex-flow:column;justify-content:center;align-items:center;height:100%}:host yuv-master-details .detailsPaneContainer .nothing-selected svg{width:150px;height:150px;opacity:.5;fill:var(--ymt-text-color-subtle)}:host.smallScreen{--border-radius: 0}:host.smallScreen yuv-master-details{padding:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1.RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "ngmodule", type: YuvOverflowMenuModule }, { kind: "component", type: i4$1.OverflowMenuComponent, selector: "yuv-overflow-menu", inputs: ["overflowIcon", "groupLabels", "menuItems"] }, { kind: "ngmodule", type: YuvMasterDetailsModule }, { kind: "component", type: i5.YuvMasterDetailsComponent, selector: "yuv-master-details", inputs: ["detailsActive", "layoutSettingsID", "layoutOptions", "undockableDetails", "panelStyle", "gutterSize", "mode"], outputs: ["detailsActiveChange"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i7.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i7.MatMiniFabButton, selector: "button[mat-mini-fab]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i8.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: ListComponent, selector: "yuv-list", inputs: ["multiselect", "selfHandleSelection", "disableSelection"], outputs: ["itemSelect", "itemFocus"] }, { kind: "directive", type: ListItemDirective, selector: "[yuvListItem]", inputs: ["disabled", "active", "selected"] }, { kind: "component", type: PaginationComponent, selector: "yuv-pagination", inputs: ["pagination"], outputs: ["pageChange"] }, { kind: "component", type: TemplateDetailsComponent, selector: "ymtmpl-template-details", inputs: ["templateObject"] }] }); }
|
|
517
488
|
}
|
|
518
489
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TemplateManagementComponent, decorators: [{
|
|
519
490
|
type: Component,
|
|
520
491
|
args: [{ selector: 'ymtmpl-templates-management', standalone: true, imports: [...modules, ...components], host: {
|
|
521
492
|
'class.smallScreen': 'smallScreenLayout()',
|
|
522
|
-
}, template: "<header>\n <nav [attr.aria-label]=\"'yuv.app.templates.naviagtion.aria.label' | translate\">\n <div class=\"primary-actions\">\n <button mat-mini-fab (click)=\"createNewTemplate()\" [matTooltip]=\"'yuv.app.templates.action.create.label' | translate\">\n <mat-icon>{{icons.actionCreateNewTemplate}}</mat-icon> \n </button>\n </div>\n <div class=\"template-actions\">\n <yuv-overflow-menu [menuItems]=\"actions\"></yuv-overflow-menu>\n </div>\n <div class=\"secondary-actions\">\n @if (!smallScreenLayout()) {\n <button mat-icon-button
|
|
493
|
+
}, template: "<header>\n <nav [attr.aria-label]=\"'yuv.app.templates.naviagtion.aria.label' | translate\">\n <div class=\"primary-actions\">\n <button mat-mini-fab (click)=\"createNewTemplate()\" [matTooltip]=\"'yuv.app.templates.action.create.label' | translate\">\n <mat-icon>{{icons.actionCreateNewTemplate}}</mat-icon> \n </button>\n </div>\n <div class=\"template-actions\">\n <yuv-overflow-menu [menuItems]=\"actions\"></yuv-overflow-menu>\n </div>\n <div class=\"secondary-actions\">\n @if (!smallScreenLayout()) {\n <button mat-icon-button (click)=\"enableDetails.set(!enableDetails())\" [matTooltip]=\"'yuv.app.templates.toggledetails.tooltip' | translate\" [ngClass]=\"{ enabled: enableDetails() }\">\n <mat-icon>{{icons.toggleRight}}</mat-icon>\n </button>\n }\n </div>\n </nav>\n</header>\n\n<main>\n <yuv-master-details\n [gutterSize]=\"1\"\n [detailsActive]=\"!smallScreenLayout() && enableDetails()\"\n [layoutOptions]=\"layoutOptions()\"\n [layoutSettingsID]=\"layoutSettingsID\"\n [mode]=\"smallScreenLayout() ? 'ontop' : 'aside'\">\n \n <ng-template #yuvMasterPane>\n <div class=\"masterPaneContainer\">\n @let templateObjects = (templates$ | async)?.items;\n @if (templateObjects?.length) {\n <yuv-list (itemSelect)=\"onItemSelect($event)\">\n @for (t of templateObjects; track t.id) {\n <div class=\"item\" [ngClass]=\"[t.published ? 'public' : '']\" yuvListItem [style.--i]=\"$index\">\n <mat-icon class=\"icon\">{{t.published ? 'export_notes' : 'article'}}</mat-icon>\n <div class=\"name\">{{ t.name }}</div>\n <div class=\"description\">{{ t.description }}</div>\n <div class=\"id\">{{ t.id.toUpperCase( ) }}</div>\n <div class=\"dataObjectType\">{{ t.dataObjectType }}</div> \n </div>\n }\n </yuv-list>\n @if (pagination) {\n <yuv-pagination [pagination]=\"pagination\" (pageChange)=\"goToPage($event)\"></yuv-pagination>\n }\n } @else {\n <div class=\"empty\">\n <p>{{ 'yuv.app.templates.list.empty' | translate }}</p>\n </div>\n }\n </div>\n </ng-template>\n\n <ng-template #yuvDetailsPane>\n <div class=\"detailsPaneContainer\">\n @let templateObject = selectedTemplate();\n @if (templateObject) {\n @if (smallScreenLayout()) {\n <div class=\"toolbar\">\n <button (click)=\"selectedTemplate.set(undefined)\"> \n <mat-icon>{{icons.close}}</mat-icon> \n </button>\n </div>\n }\n <ymtmpl-template-details [templateObject]=\"templateObject\"></ymtmpl-template-details>\n } @else {\n <div class=\"nothing-selected\">\n <h2>{{ 'yuv.app.templates.list.selection.empty' | translate }}</h2>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M14 2H6C4.89 2 4 2.9 4 4V20C4 21.11 4.89 22 6 22H18C19.11 22 20 21.11 20 20V8L14 2M18 20H6V4H13V9H18V20M17.35 10L15.25 19H13.85L12.05 12.21L10.25 19H8.85L6.65 10H8.15L9.55 16.81L11.35 10H12.65L14.45 16.81L15.85 10H17.35Z\" /></svg>\n </div>\n }\n </div>\n </ng-template>\n\n </yuv-master-details>\n</main>\n\n<router-outlet name=\"modal\"></router-outlet>", styles: [":host{--split-gutter-background-color: var(--ymt-outline-variant);display:flex;overflow:hidden;flex-flow:column;box-sizing:border-box;height:100%}:host header>nav{flex:0 0 auto;display:grid;grid-template-columns:auto 1fr auto;grid-template-areas:\"primary actions sort secondary\";align-items:center;gap:var(--ymt-spacing-s);border-block-end:1px solid var(--ymt-outline-variant);position:relative;padding:var(--ymt-spacing-xs) var(--ymt-spacing-s)}:host header>nav .primary-actions{grid-area:primary;overflow-x:auto}:host header>nav .secondary-actions{grid-area:secondary;overflow-x:auto}:host header>nav .template-actions{grid-area:actions;align-self:stretch;overflow-x:auto;border-color:var(--ymt-outline-variant);border-width:0 1px 0 1px;border-style:solid;display:grid;grid-template-rows:1fr;grid-template-columns:1fr;align-items:center}:host main{overflow:hidden;background-color:var(--ymt-surface);height:100%}:host yuv-master-details{height:100%}:host yuv-master-details .masterPaneContainer{display:flex;flex-direction:column;height:100%;overflow:hidden}:host yuv-master-details .masterPaneContainer yuv-list{height:100%}:host yuv-master-details .masterPaneContainer yuv-list [yuvListItem]{--icon-size: 32px;--list-item-hover-background: var(--ymt-focus-background);display:grid;padding:var(--ymt-spacing-s) var(--ymt-spacing-s);border-block-end:1px solid var(--ymt-outline-variant);align-items:center;grid-template-columns:var(--icon-size) 1fr auto;grid-template-rows:repeat(2,auto);grid-template-areas:\"icon name name\" \"icon description description\" \"icon id dataObjectType\";column-gap:var(--ymt-spacing-s);row-gap:var(--ymt-spacing-s);cursor:pointer}:host yuv-master-details .masterPaneContainer yuv-list [yuvListItem] .icon{grid-area:icon;color:var(--ymt-text-color-subtle)}:host yuv-master-details .masterPaneContainer yuv-list [yuvListItem] .id{grid-area:id;color:var(--ymt-text-color-subtle);font:var(--ymt-font-body-subtle)}:host yuv-master-details .masterPaneContainer yuv-list [yuvListItem] .name{grid-area:name;color:var(--ymt-text-color-body);font:var(--ymt-font-body)}:host yuv-master-details .masterPaneContainer yuv-list [yuvListItem] .description{grid-area:description;color:var(--ymt-text-color-subtle);font:var(--ymt-font-body)}:host yuv-master-details .masterPaneContainer yuv-list [yuvListItem] .dataObjectType{grid-area:dataObjectType;color:var(--ymt-text-color-subtle);font:var(--ymt-font-body-subtle)}:host yuv-master-details .masterPaneContainer yuv-list [yuvListItem]:not(:last-child){border-block-end:1px solid var(--ymt-outline-variant)}:host yuv-master-details .masterPaneContainer yuv-pagination{border-block-start:1px solid var(--ymt-outline-variant)}:host yuv-master-details .detailsPaneContainer{display:flex;flex-direction:column;height:100%;overflow:hidden}:host yuv-master-details .detailsPaneContainer ymtmpl-template-details{height:100%}:host yuv-master-details .detailsPaneContainer .toolbar{flex:0 0 auto}:host yuv-master-details .detailsPaneContainer .nothing-selected{display:flex;flex-flow:column;justify-content:center;align-items:center;height:100%}:host yuv-master-details .detailsPaneContainer .nothing-selected svg{width:150px;height:150px;opacity:.5;fill:var(--ymt-text-color-subtle)}:host.smallScreen{--border-radius: 0}:host.smallScreen yuv-master-details{padding:0}\n"] }]
|
|
523
494
|
}], ctorParameters: () => [], propDecorators: { pagination: [{
|
|
524
495
|
type: HostBinding,
|
|
525
496
|
args: ['class.pagination']
|
|
@@ -540,5 +511,5 @@ const YuvTemplateManagerRoutes = [
|
|
|
540
511
|
* Generated bundle index. Do not edit.
|
|
541
512
|
*/
|
|
542
513
|
|
|
543
|
-
export {
|
|
514
|
+
export { TemplateService, YuvTemplateManagerRoutes, YuvTemplatesComponent };
|
|
544
515
|
//# sourceMappingURL=yuuvis-app-templates.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yuuvis-app-templates.mjs","sources":["../../../../projects/yuuvis/app-templates/src/lib/app-templates.schema.ts","../../../../projects/yuuvis/app-templates/src/lib/app-templates.service.ts","../../../../projects/yuuvis/app-templates/src/lib/app-templates.component.ts","../../../../projects/yuuvis/app-templates/src/lib/components/template-details/template-details.component.ts","../../../../projects/yuuvis/app-templates/src/lib/components/template-details/template-details.component.html","../../../../projects/yuuvis/app-templates/src/lib/overlays/create-template/create-template.component.ts","../../../../projects/yuuvis/app-templates/src/lib/overlays/create-template/create-template.component.html","../../../../projects/yuuvis/app-templates/src/lib/pages/management/template-management.component.ts","../../../../projects/yuuvis/app-templates/src/lib/pages/management/template-management.component.html","../../../../projects/yuuvis/app-templates/src/lib/lib.routes.ts","../../../../projects/yuuvis/app-templates/src/yuuvis-app-templates.ts"],"sourcesContent":["import { BaseObjectTypeField, CoreApiObject } from '@yuuvis/client-core';\nimport { AppSchema } from '@yuuvis/client-shell-core';\n\nexport const APP_ID = 'io.yuuvis.app.templates';\n\nexport const APP_ICONS = {\n close: 'close',\n refresh: 'refresh',\n actionApplyTemplate: 'article_shortcut',\n actionCreateNewTemplate: 'add_notes',\n actionToggleStateToPublished: 'input_circle',\n actionToggleStateToUnpublished: 'unpublished',\n actionDeleteTemplate: 'delete',\n actionDownloadTemplateContent: 'download',\n actionReplaceTemplateContent: 'upload_file',\n toggleRight: 'dock_to_left',\n};\n\nexport const APP_ACTIONS = {\n apply: APP_ID + 'action.apply',\n};\n\nexport const APP_SCHEMA: AppSchema = {\n id: APP_ID,\n name: 'yuuvis Templates',\n icon: 'library_books',\n types: {},\n flavors: []\n};\n\nexport const TEMPLATE_FILE_MIME_TYPE = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';\n\nexport class TemplateObject {\n readonly id: string;\n\n name: string;\n description: string;\n published: boolean;\n dataObjectType: string\n\n constructor(obj: CoreApiObject) {\n this.id = obj.properties[BaseObjectTypeField.OBJECT_ID].value as string;\n this.name = obj.properties[\"appTemplates:name\"].value as string;\n this.description = obj.properties[\"appTemplates:description\"]?.value as string;\n this.published = obj.properties[\"appTemplates:published\"].value as boolean;\n this.dataObjectType = (obj.properties[\"appTemplates:dataObjects\"].value as Array<string[]>)[0][1];\n }\n}\n\nexport enum TemplateManagementEventType {\n TEMPLATE_OBJECT_CREATED = APP_ID + '.object.created',\n TEMPLATE_OBJECT_UPDATED = APP_ID + '.object.updated',\n TEMPLATE_OBJECT_DELETED = APP_ID + '.object.deleted'\n}\n\nexport interface CreateTemplateResult {\n id: string;\n}\n\nexport interface TemplateSearchResponse {\n pageNumber: number;\n pageSize: number;\n totalNumItems: number;\n items: TemplateObject[];\n}","import { HttpErrorResponse, HttpParams } from '@angular/common/http';\nimport { inject, Injectable, signal } from '@angular/core';\nimport {\n ApiBase,\n BackendService,\n BaseObjectTypeField,\n ContentStreamAllowed,\n CoreApiObject,\n DmsService,\n GenericObjectType,\n Logger,\n SearchResponse,\n SystemService,\n TranslateService,\n} from '@yuuvis/client-core';\nimport {\n catchError,\n map,\n Observable,\n of,\n ReplaySubject,\n switchMap,\n tap,\n throwError,\n} from 'rxjs';\nimport {\n CreateTemplateResult,\n TEMPLATE_FILE_MIME_TYPE,\n TemplateObject,\n TemplateSearchResponse,\n} from './app-templates.schema';\n\nimport { ConfirmService } from '@yuuvis/client-framework/common';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class TemplateService {\n static PAGE_SIZE = 20;\n\n readonly #logger = inject(Logger);\n\n readonly #backendService = inject(BackendService);\n readonly #dmsService = inject(DmsService);\n readonly #confirmService = inject(ConfirmService);\n readonly #translateService = inject(TranslateService);\n readonly #systemService = inject(SystemService)\n\n private templates?: TemplateSearchResponse;\n\n private templatesDataSource = new ReplaySubject<TemplateSearchResponse>(1);\n public templates$: Observable<TemplateSearchResponse> =\n this.templatesDataSource.asObservable();\n\n private busyDataSource = signal<boolean>(false);\n public busy$ = this.busyDataSource.asReadonly();\n\n constructor() {}\n\n getAvailableDataObjectTypes(): GenericObjectType[] {\n return this.#systemService.getObjectTypes().filter((ot) => !ot.isFolder && ot.contentStreamAllowed !== ContentStreamAllowed.NOT_ALLOWED);\n }\n\n getPage(page?: number) {\n this.busyDataSource.set(true);\n\n this.#fetchTemplates(page)\n .subscribe({\n next: (res: TemplateSearchResponse) => {\n this.templates = res;\n this.templatesDataSource.next(this.templates);\n },\n error: (e: any) => {\n this.#logger.error('Failed to fetch templates', e);\n },\n })\n .add(() => this.busyDataSource.set(false));\n }\n\n createTemplate(\n name: string,\n description: string,\n dataObjectType: string\n ): Observable<CreateTemplateResult> {\n let requestParams = {\n name: name,\n description: description,\n dataObjects: { objectData: dataObjectType },\n };\n\n return this.#backendService\n .post(`/template-service/api/objects/`, requestParams, ApiBase.none)\n .pipe(\n catchError((e: HttpErrorResponse) => {\n this.#logger.error('Failed to create template', e);\n return throwError(() => new Error(e.message));\n }),\n map((res: CoreApiObject) => ({\n id: res.properties[BaseObjectTypeField.OBJECT_ID].value as string,\n })),\n tap((res: CreateTemplateResult) => this.refreshTemplates())\n );\n }\n\n downloadTemplateContent(template: TemplateObject): void {\n return this.#backendService.download(\n this.#dmsService.getContentPath(template.id, undefined)\n );\n }\n\n replaceTemplateContent(\n template: TemplateObject,\n file: File\n ): Observable<boolean> {\n if (file.type != TEMPLATE_FILE_MIME_TYPE) {\n return throwError(\n () =>\n new Error(\n this.#translateService.instant(\n 'yuv.app.templates.action.replaceContent.error.unsupportedFileType'\n )\n )\n );\n }\n\n return this.#dmsService\n .uploadContent(template.id, file)\n .pipe(tap(() => this.refreshTemplates()));\n }\n\n toggleTemplateState(template: TemplateObject): Observable<boolean> {\n let requestParams = {\n published: !template.published,\n };\n\n return this.#confirmService\n .confirm(\n template.published\n ? {\n title: this.#translateService.instant(\n 'yuv.app.templates.action.unpublish.label'\n ),\n message: this.#translateService.instant(\n 'yuv.app.templates.action.unpublish.confirm.message',\n { template: template.name }\n ),\n }\n : {\n title: this.#translateService.instant(\n 'yuv.app.templates.action.publish.label'\n ),\n message: this.#translateService.instant(\n 'yuv.app.templates.action.publish.confirm.message',\n { template: template.name }\n ),\n }\n )\n .pipe(\n switchMap((confirmed: boolean) => {\n if (confirmed) {\n return this.#backendService\n .patch(\n `/template-service/api/objects/${template.id}`,\n requestParams,\n ApiBase.none\n )\n .pipe(\n map(() => true),\n tap(() => this.refreshTemplates())\n );\n } else return of(false);\n })\n );\n }\n\n deleteTemplate(template: TemplateObject): Observable<boolean> {\n return this.#confirmService\n .confirm({\n title: this.#translateService.instant(\n 'yuv.app.templates.action.delete.label'\n ),\n message: template.published\n ? this.#translateService.instant(\n 'yuv.app.templates.action.delete.public.confirm.message',\n { template: template.name }\n )\n : this.#translateService.instant(\n 'yuv.app.templates.action.delete.confirm.message',\n { template: template.name }\n ),\n })\n .pipe(\n switchMap((confirmed: boolean) => {\n if (confirmed) {\n return this.#backendService\n .delete(`/dms/objects/${template.id}`, ApiBase.core)\n .pipe(\n map(() => true),\n tap(() => this.refreshTemplates())\n );\n } else return of(false);\n })\n );\n }\n\n refreshTemplates() {\n this.getPage(this.templates?.pageNumber);\n }\n\n #fetchTemplates(pageNumber = 0): Observable<TemplateSearchResponse> {\n let filterParams = new HttpParams()\n .set('page', pageNumber)\n .set('size', TemplateService.PAGE_SIZE)\n .set('sort', 'name%2Casc');\n\n return this.#backendService\n .get(`/template-service/api/objects/?${filterParams}`, ApiBase.none)\n .pipe(\n map((res: SearchResponse) => ({\n pageNumber: pageNumber,\n pageSize: TemplateService.PAGE_SIZE,\n totalNumItems: res.totalNumItems,\n items: res.objects.map(\n (obj: CoreApiObject) => new TemplateObject(obj)\n ),\n }))\n );\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { Component } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { TranslateModule } from '@yuuvis/client-core';\nimport { AppLogoComponent } from '@yuuvis/client-shell';\nimport { APP_SCHEMA } from './app-templates.schema';\n\nconst components = [AppLogoComponent];\n\nconst module = [CommonModule, TranslateModule, RouterModule];\n\n@Component({\n selector: 'ymtmpl-app-templates',\n standalone: true,\n imports: [...module, ...components],\n template: `\n <header>\n <yuv-app-logo [label]=\"appName\" routerLink=\"management\"></yuv-app-logo>\n </header>\n <main><router-outlet></router-outlet></main>\n `,\n styleUrl: './app-templates.component.scss',\n})\nexport class YuvTemplatesComponent {\n appName = APP_SCHEMA.name;\n appIcon = APP_SCHEMA.icon;\n}\n","import { CommonModule } from '@angular/common';\nimport { Component, Input } from '@angular/core';\nimport { ObjectPreviewComponent } from '@yuuvis/client-framework/object-preview';\nimport { TemplateObject } from '../../app-templates.schema';\n\nconst components = [\n ObjectPreviewComponent\n];\n\nconst modules = [\n CommonModule\n];\n\n@Component({\n selector: 'ymtmpl-template-details',\n templateUrl: './template-details.component.html',\n styleUrls: ['./template-details.component.scss'],\n standalone: true,\n imports: [...modules, ...components]\n})\nexport class TemplateDetailsComponent {\n @Input() templateObject!: TemplateObject;\n}","<yuv-object-preview [objectId]=\"templateObject.id\"></yuv-object-preview>","import { CommonModule } from '@angular/common';\nimport { Component, inject, linkedSignal, signal } from '@angular/core';\nimport {\n FormBuilder,\n FormGroup,\n ReactiveFormsModule,\n Validators,\n} from '@angular/forms';\nimport { MatDialogRef } from '@angular/material/dialog';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatSelectModule } from '@angular/material/select';\nimport { GenericObjectType, TranslateModule } from '@yuuvis/client-core';\nimport { StringComponent } from '@yuuvis/client-framework/forms';\nimport { YmtButtonDirective } from '@yuuvis/material';\nimport { TemplateService } from './../../app-templates.service';\nimport { BusyOverlayDirective, DialogComponent } from '@yuuvis/client-framework/common';\n\nconst components = [BusyOverlayDirective, StringComponent, YmtButtonDirective, DialogComponent];\n\nconst modules = [\n CommonModule,\n ReactiveFormsModule,\n TranslateModule,\n MatFormFieldModule,\n MatSelectModule\n];\n\n@Component({\n selector: 'ymtmpl-create-template',\n templateUrl: './create-template.component.html',\n styleUrl: './create-template.component.scss',\n standalone: true,\n imports: [...modules, ...components],\n host: {\n '[class.busy]': '!busy()',\n },\n})\nexport class CreateTemplateComponent {\n readonly #fb = inject(FormBuilder);\n readonly #templateService = inject(TemplateService);\n readonly #dialogRef = inject(MatDialogRef<CreateTemplateComponent>);\n\n busy = signal<boolean>(false);\n\n error = signal<string | undefined>(undefined);\n\n form: FormGroup = this.#fb.group({\n name: ['New template', Validators.required],\n description: [''],\n dataObjectType: ['system:document', Validators.required]\n });\n\n dataObjectTypes = signal<GenericObjectType[]>([]);\n\n changedInput = signal<any | undefined>(undefined);\n \n disabledSubmit = linkedSignal({\n source: this.changedInput,\n computation: () => {\n return this.busy() || this.form.invalid || !this.form.value.name;\n }\n });\n\n constructor() {\n this.#loadDataObjectTypes();\n }\n\n #loadDataObjectTypes() {\n this.dataObjectTypes.set(this.#templateService.getAvailableDataObjectTypes().sort((ot1, ot2) => ot1.id > ot2.id ? 1 : -1))\n }\n\n createTemplate() {\n let createParams = this.form.value;\n\n this.busy.set(true);\n this.error.set(undefined);\n\n this.#templateService\n .createTemplate(\n createParams.name,\n createParams.description,\n createParams.dataObjectType\n )\n .subscribe({\n error: (e: any) => {\n this.error.set(e);\n this.busy.set(false);\n },\n complete: () => {\n this.close();\n },\n });\n }\n\n close() {\n this.#dialogRef.close();\n }\n\n ngAfterViewInit() {\n this.form.valueChanges.subscribe((value) => {\n this.changedInput.set(value);\n });\n }\n}\n","<yuv-dialog [yuvBusyOverlay]=\"busy()\" [headertitel]=\"'yuv.app.templates.action.create.headline' | translate\">\n <main>\n <form [formGroup]=\"form\">\n <mat-form-field class=\"yuv-form-field\">\n <mat-label>{{\"yuv.app.templates.object.property.name\" | translate }}</mat-label>\n <yuv-string [required]=\"true\" formControlName=\"name\"></yuv-string>\n </mat-form-field>\n <mat-form-field class=\"yuv-form-field\">\n <mat-label>{{\"yuv.app.templates.object.property.description\" | translate}}</mat-label>\n <yuv-string formControlName=\"description\"></yuv-string>\n </mat-form-field>\n <mat-form-field class=\"yuv-form-field\">\n <mat-label>{{\"yuv.app.templates.object.property.dataObjectType\" | translate}}</mat-label>\n <mat-select formControlName=\"dataObjectType\">\n @for (dataObjectType of dataObjectTypes(); track dataObjectType) {\n <mat-option [value]=\"dataObjectType.id\">{{ dataObjectType.id }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n @if (error()) {\n <p class=\"error\">{{ error() }}</p>\n }\n </form>\n </main>\n <footer>\n <button ymtButton=\"secondary\" [disabled]=\"busy()\" (click)=\"close()\">\n {{ \"yuv.app.templates.action.create.button.cancel\" | translate }}\n </button>\n <button ymtButton=\"primary\" [disabled]=\"disabledSubmit()\" (click)=\"createTemplate()\">\n {{ 'yuv.object-flavor.apply-flavor.button.apply' | translate }}\n </button>\n </footer>\n</yuv-dialog>\n","import { CommonModule, DOCUMENT } from '@angular/common';\nimport {\n Component,\n HostBinding,\n inject,\n OnInit,\n signal,\n viewChild\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { RouterModule } from '@angular/router';\nimport {\n DeviceScreen,\n DeviceService,\n Logger,\n NotificationService,\n TranslateModule,\n TranslateService\n} from '@yuuvis/client-core';\nimport {\n ListComponent,\n ListItemDirective,\n} from '@yuuvis/client-framework/list';\nimport { YuvMasterDetailsModule } from '@yuuvis/client-framework/master-details';\nimport {\n OverflowMenuItem,\n YuvOverflowMenuModule,\n} from '@yuuvis/client-framework/overflow-menu';\nimport {\n Pagination,\n PaginationComponent,\n} from '@yuuvis/client-framework/pagination';\nimport { tap } from 'rxjs';\n\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatDialog } from '@angular/material/dialog';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport {\n APP_ICONS,\n TEMPLATE_FILE_MIME_TYPE,\n TemplateObject,\n TemplateSearchResponse,\n} from '../../app-templates.schema';\nimport { TemplateDetailsComponent } from '../../components/template-details/template-details.component';\nimport { CreateTemplateComponent } from '../../overlays/create-template/create-template.component';\nimport { TemplateService } from '../../app-templates.service';\n\nconst components = [\n ListComponent,\n ListItemDirective,\n PaginationComponent,\n TemplateDetailsComponent,\n];\n\nconst modules = [\n CommonModule,\n TranslateModule,\n RouterModule,\n YuvOverflowMenuModule,\n YuvMasterDetailsModule,\n MatIconModule,\n MatButtonModule,\n MatTooltipModule,\n];\n\n@Component({\n selector: 'ymtmpl-templates-management',\n templateUrl: './template-management.component.html',\n styleUrl: './template-management.component.scss',\n standalone: true,\n imports: [...modules, ...components],\n host: {\n 'class.smallScreen': 'smallScreenLayout()',\n },\n})\nexport class TemplateManagementComponent implements OnInit {\n readonly layoutSettingsID = 'template-management.layout.settings';\n\n readonly #logger = inject(Logger);\n\n readonly #document = inject(DOCUMENT);\n readonly #deviceService = inject(DeviceService);\n readonly #notificationService = inject(NotificationService);\n readonly #dialog = inject(MatDialog);\n\n readonly #templateService = inject(TemplateService);\n readonly #translateService = inject(TranslateService);\n\n @HostBinding('class.pagination') pagination?: Pagination;\n\n busy = this.#templateService.busy$;\n\n icons = {\n ...APP_ICONS,\n };\n\n selectedTemplate = signal<TemplateObject | undefined>(undefined);\n\n smallScreenLayout = signal(false);\n\n layoutOptions = signal<{ masterSize: number; detailsSize: number }>({\n masterSize: 40,\n detailsSize: 60,\n });\n\n actions: OverflowMenuItem[] = [];\n\n #templates: TemplateObject[] = [];\n\n templates$ = this.#templateService.templates$.pipe(\n tap((response: TemplateSearchResponse) => {\n this.#templates = response.items;\n const selectedTemplate = this.selectedTemplate();\n if (selectedTemplate) {\n // check if the selected template is still in the list\n const found = this.#templates.find((t) => t.id === selectedTemplate.id);\n if (found) {\n // update the selected template instance and the actions\n this.selectedTemplate.set(found);\n this.#updateActions(this.selectedTemplate());\n } \n // if not, set selected template to undefined\n else this.selectedTemplate.set(undefined);\n }\n this.pagination =\n response && response.totalNumItems > response.pageSize\n ? {\n total: response.totalNumItems,\n page: response.pageNumber + 1,\n pages: Math.ceil(response.totalNumItems / response.pageSize),\n }\n : undefined;\n })\n );\n\n templateListComponent = viewChild.required(ListComponent);\n enableDetails = signal<boolean>(true);\n\n constructor() {\n this.#deviceService.screenChange$\n .pipe(takeUntilDestroyed())\n .subscribe((s: DeviceScreen) => {\n this.smallScreenLayout.set(\n s.size === 's' && s.orientation === 'portrait'\n );\n });\n }\n\n #updateActions(obj: TemplateObject | undefined) {\n this.actions = obj\n ? [\n {\n id: 'yuv.app.templates.action.replaceContent',\n icon: APP_ICONS.actionReplaceTemplateContent,\n label: this.#translateService.instant(\n 'yuv.app.templates.action.replaceContent.label'\n ),\n callback: () => this.replaceCurrentContent(),\n },\n {\n id: 'yuv.app.templates.action.downloadContent',\n icon: APP_ICONS.actionDownloadTemplateContent,\n label: this.#translateService.instant(\n 'yuv.app.templates.action.downloadContent.label'\n ),\n callback: () => this.downloadCurrentContent(),\n },\n {\n id: 'yuv.app.templates.action.delete',\n icon: APP_ICONS.actionDeleteTemplate,\n label: this.#translateService.instant(\n 'yuv.app.templates.action.delete.label'\n ),\n callback: () => this.deleteCurrent(),\n },\n {\n id: 'yuv.app.templates.action.toggleState',\n icon: this.selectedTemplate()?.published\n ? APP_ICONS.actionToggleStateToUnpublished\n : APP_ICONS.actionToggleStateToPublished,\n label: this.#translateService.instant(\n this.selectedTemplate()?.published\n ? 'yuv.app.templates.action.unpublish.label'\n : 'yuv.app.templates.action.publish.label'\n ),\n callback: () => this.toggleCurrentState(),\n },\n ]\n : [];\n }\n\n createNewTemplate() {\n this.#logger.debug('Create new template ...');\n\n this.#dialog.open(CreateTemplateComponent, {\n width: '400px',\n maxWidth: '90vw',\n });\n }\n\n downloadCurrentContent() {\n const template = this.selectedTemplate();\n if (template) {\n this.#templateService.downloadTemplateContent(template);\n }\n }\n\n replaceCurrentContent() {\n const template = this.selectedTemplate();\n if (template) {\n this.#logger.debug('Replace content of template ' + template.id + ' ...');\n\n const fileInput = this.#document.createElement('input');\n\n fileInput.type = 'file';\n fileInput.multiple = false;\n fileInput.accept = TEMPLATE_FILE_MIME_TYPE;\n\n fileInput.onchange = (e) => {\n const file = (e.target as HTMLInputElement).files?.[0];\n if (file) {\n this.#templateService\n .replaceTemplateContent(template, file)\n .subscribe({\n next: () => {\n this.#notificationService.success(\n this.#translateService.instant(\n 'yuv.app.templates.action.replaceContent.success'\n )\n );\n },\n error: (err: any) => {\n this.#notificationService.error(err);\n },\n complete: () => {\n this.#logger.debug('Template content replaced!');\n },\n });\n }\n };\n\n fileInput.click();\n fileInput.remove();\n }\n }\n\n toggleCurrentState() {\n const template = this.selectedTemplate();\n if (template) {\n this.#templateService\n .toggleTemplateState(template)\n .subscribe((res: boolean) => {\n if (res) {\n this.#logger.info('Template published state chenged!');\n this.#updateActions(template);\n }\n });\n }\n }\n\n deleteCurrent() {\n const template = this.selectedTemplate();\n if (template) {\n this.#logger.debug('Delete template ' + template.id + ' ...');\n\n this.#templateService.deleteTemplate(template).subscribe((res) => {\n if (res) {\n this.#logger.debug('Template deleted!');\n }\n });\n }\n }\n\n goToPage(pageNumber: number) {\n this.#templateService.getPage(pageNumber - 1);\n }\n\n onItemSelect(idx: number[]) {\n const item = this.#templates[idx[0]];\n if (item.id === this.selectedTemplate()?.id) return;\n\n this.selectedTemplate.set(item);\n\n this.#updateActions(this.selectedTemplate());\n }\n\n ngOnInit() {\n this.#templateService.refreshTemplates();\n }\n}\n","<header>\n <nav [attr.aria-label]=\"'yuv.app.templates.naviagtion.aria.label' | translate\">\n <div class=\"primary-actions\">\n <button mat-mini-fab (click)=\"createNewTemplate()\" [matTooltip]=\"'yuv.app.templates.action.create.label' | translate\">\n <mat-icon>{{icons.actionCreateNewTemplate}}</mat-icon> \n </button>\n </div>\n <div class=\"template-actions\">\n <yuv-overflow-menu [menuItems]=\"actions\"></yuv-overflow-menu>\n </div>\n <div class=\"secondary-actions\">\n @if (!smallScreenLayout()) {\n <button mat-icon-button [ngClass]=\"{ enabled: enableDetails() }\" title=\"{{ 'yuv.app.templates.toggledetails.tooltip' | translate }}\" (click)=\"enableDetails.set(!enableDetails())\">\n <mat-icon>{{icons.toggleRight}}</mat-icon>\n </button>\n }\n </div>\n </nav>\n</header>\n\n<yuv-master-details\n [gutterSize]=\"1\"\n [detailsActive]=\"smallScreenLayout() ? !!selectedTemplate() : enableDetails()\"\n [layoutOptions]=\"layoutOptions()\"\n [layoutSettingsID]=\"layoutSettingsID\">\n \n <ng-template #yuvMasterPane>\n @let templateObjects = (templates$ | async)?.items;\n @if (templateObjects?.length) {\n <yuv-list (itemSelect)=\"onItemSelect($event)\">\n @for (t of templateObjects; track t.id) {\n <div class=\"item\" [ngClass]=\"[t.published ? 'public' : '']\" yuvListItem [style.--i]=\"$index\">\n <mat-icon class=\"icon\">{{t.published ? 'export_notes' : 'article'}}</mat-icon>\n <div class=\"name\">{{ t.name }}</div>\n <div class=\"description\">{{ t.description }}</div>\n <div class=\"id\">{{ t.id.toUpperCase( ) }}</div>\n <div class=\"dataObjectType\">{{ t.dataObjectType }}</div> \n </div>\n }\n </yuv-list>\n @if (pagination) { <yuv-pagination [pagination]=\"pagination\" (pageChange)=\"goToPage($event)\"></yuv-pagination> }\n } @else {\n <div class=\"empty\">\n <p>{{ 'yuv.app.templates.list.empty' | translate }}</p>\n </div>\n }\n </ng-template>\n\n <ng-template #yuvDetailsPane>\n @let templateObject = selectedTemplate();\n @if (templateObject) {\n <div class=\"details\">\n @if (smallScreenLayout()) {\n <div class=\"toolbar\">\n <button (click)=\"selectedTemplate.set(undefined)\"> \n <mat-icon>{{icons.close}}</mat-icon> \n </button>\n </div>\n }\n <ymtmpl-template-details [templateObject]=\"templateObject\"></ymtmpl-template-details>\n </div>\n } @else {\n <div class=\"empty nothing-selected\">\n <h2>{{ 'yuv.app.templates.list.selection.empty' | translate }}</h2>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M14 2H6C4.89 2 4 2.9 4 4V20C4 21.11 4.89 22 6 22H18C19.11 22 20 21.11 20 20V8L14 2M18 20H6V4H13V9H18V20M17.35 10L15.25 19H13.85L12.05 12.21L10.25 19H8.85L6.65 10H8.15L9.55 16.81L11.35 10H12.65L14.45 16.81L15.85 10H17.35Z\" /></svg>\n </div>\n }\n </ng-template>\n\n</yuv-master-details>\n\n<router-outlet name=\"modal\"></router-outlet>","import { Route } from '@angular/router';\nimport { YuvTemplatesComponent } from './app-templates.component';\nimport { TemplateManagementComponent } from './pages/management/template-management.component';\n\nexport const YuvTemplateManagerRoutes: Route[] = [\n {\n path: '',\n component: YuvTemplatesComponent,\n children: [\n { path: 'management', component: TemplateManagementComponent }, \n { path: '', redirectTo: 'management', pathMatch: 'full' },\n ]\n },\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["components","modules","i1","i3","i4"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,MAAM,MAAM,GAAG;AAET,MAAA,SAAS,GAAG;AACvB,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,OAAO,EAAE,SAAS;AAClB,IAAA,mBAAmB,EAAE,kBAAkB;AACvC,IAAA,uBAAuB,EAAE,WAAW;AACpC,IAAA,4BAA4B,EAAE,cAAc;AAC5C,IAAA,8BAA8B,EAAE,aAAa;AAC7C,IAAA,oBAAoB,EAAE,QAAQ;AAC9B,IAAA,6BAA6B,EAAE,UAAU;AACzC,IAAA,4BAA4B,EAAE,aAAa;AAC3C,IAAA,WAAW,EAAE,cAAc;;AAGhB,MAAA,WAAW,GAAG;IACzB,KAAK,EAAE,MAAM,GAAG,cAAc;;AAGnB,MAAA,UAAU,GAAc;AACnC,IAAA,EAAE,EAAE,MAAM;AACV,IAAA,IAAI,EAAE,kBAAkB;AACxB,IAAA,IAAI,EAAE,eAAe;AACrB,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,OAAO,EAAE;;AAGJ,MAAM,uBAAuB,GAAG;MAE1B,cAAc,CAAA;AAQzB,IAAA,WAAA,CAAY,GAAkB,EAAA;AAC5B,QAAA,IAAI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,YAAY,EAAE,SAAS,EAAE,2BAA2B,EAAE;YAC9D,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE;AAC1D;AACF,KAAA;;;ACZH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"yuuvis-app-templates.mjs","sources":["../../../../projects/yuuvis/app-templates/src/lib/app-templates.service.ts","../../../../projects/yuuvis/app-templates/src/lib/app-templates.component.ts","../../../../projects/yuuvis/app-templates/src/lib/components/template-details/template-details.component.ts","../../../../projects/yuuvis/app-templates/src/lib/components/template-details/template-details.component.html","../../../../projects/yuuvis/app-templates/src/lib/overlays/create-template/create-template.component.ts","../../../../projects/yuuvis/app-templates/src/lib/overlays/create-template/create-template.component.html","../../../../projects/yuuvis/app-templates/src/lib/pages/management/template-management.component.ts","../../../../projects/yuuvis/app-templates/src/lib/pages/management/template-management.component.html","../../../../projects/yuuvis/app-templates/src/lib/lib.routes.ts","../../../../projects/yuuvis/app-templates/src/yuuvis-app-templates.ts"],"sourcesContent":["import { HttpErrorResponse, HttpParams } from '@angular/common/http';\nimport { inject, Injectable, signal } from '@angular/core';\nimport {\n ApiBase,\n BackendService,\n BaseObjectTypeField,\n ContentStreamAllowed,\n CoreApiObject,\n DmsService,\n GenericObjectType,\n Logger,\n SearchResponse,\n SystemService,\n TranslateService,\n} from '@yuuvis/client-core';\nimport {\n catchError,\n map,\n Observable,\n of,\n ReplaySubject,\n switchMap,\n tap,\n throwError,\n} from 'rxjs';\nimport {\n CreateTemplateResult,\n TEMPLATE_FILE_MIME_TYPE,\n TemplateObject,\n TemplateSearchResponse,\n} from '@yuuvis/app-templates/shared';\n\nimport { ConfirmService } from '@yuuvis/client-framework/common';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class TemplateService {\n static PAGE_SIZE = 20;\n\n readonly #logger = inject(Logger);\n\n readonly #backendService = inject(BackendService);\n readonly #dmsService = inject(DmsService);\n readonly #confirmService = inject(ConfirmService);\n readonly #translateService = inject(TranslateService);\n readonly #systemService = inject(SystemService)\n\n private templates?: TemplateSearchResponse;\n\n private templatesDataSource = new ReplaySubject<TemplateSearchResponse>(1);\n public templates$: Observable<TemplateSearchResponse> =\n this.templatesDataSource.asObservable();\n\n private busyDataSource = signal<boolean>(false);\n public busy$ = this.busyDataSource.asReadonly();\n\n constructor() {}\n\n getAvailableDataObjectTypes(): GenericObjectType[] {\n return this.#systemService.getObjectTypes().filter((ot) => !ot.isFolder && ot.contentStreamAllowed !== ContentStreamAllowed.NOT_ALLOWED);\n }\n\n getPage(page?: number) {\n this.busyDataSource.set(true);\n\n this.#fetchTemplates(page)\n .subscribe({\n next: (res: TemplateSearchResponse) => {\n this.templates = res;\n this.templatesDataSource.next(this.templates);\n },\n error: (e: any) => {\n this.#logger.error('Failed to fetch templates', e);\n },\n })\n .add(() => this.busyDataSource.set(false));\n }\n\n createTemplate(\n name: string,\n description: string,\n dataObjectType: string\n ): Observable<TemplateObject> {\n let requestParams = {\n name: name,\n description: description,\n dataObjects: { objectData: dataObjectType },\n };\n\n return this.#backendService\n .post(`/template-service/api/objects/`, requestParams, ApiBase.none)\n .pipe(\n catchError((e: HttpErrorResponse) => {\n this.#logger.error('Failed to create template', e);\n return throwError(() => new Error(e.message));\n }),\n map((res: CoreApiObject) => new TemplateObject(res)\n )\n );\n }\n\n downloadTemplateContent(template: TemplateObject): void {\n return this.#backendService.download(\n this.#dmsService.getContentPath(template.id, undefined)\n );\n }\n\n replaceTemplateContent(\n template: TemplateObject,\n file: File\n ): Observable<boolean> {\n if (file.type != TEMPLATE_FILE_MIME_TYPE) {\n return throwError(\n () =>\n new Error(\n this.#translateService.instant(\n 'yuv.app.templates.action.replaceContent.error.unsupportedFileType'\n )\n )\n );\n }\n\n return this.#dmsService\n .uploadContent(template.id, file)\n .pipe(tap(() => this.refreshTemplates()));\n }\n\n toggleTemplateState(template: TemplateObject): Observable<boolean> {\n let requestParams = {\n published: !template.published,\n };\n\n return this.#confirmService\n .confirm(\n template.published\n ? {\n title: this.#translateService.instant(\n 'yuv.app.templates.action.unpublish.label'\n ),\n message: this.#translateService.instant(\n 'yuv.app.templates.action.unpublish.confirm.message',\n { template: template.name }\n ),\n }\n : {\n title: this.#translateService.instant(\n 'yuv.app.templates.action.publish.label'\n ),\n message: this.#translateService.instant(\n 'yuv.app.templates.action.publish.confirm.message',\n { template: template.name }\n ),\n }\n )\n .pipe(\n switchMap((confirmed: boolean) => {\n if (confirmed) {\n return this.#backendService\n .patch(\n `/template-service/api/objects/${template.id}`,\n requestParams,\n ApiBase.none\n )\n .pipe(\n map(() => true),\n tap(() => this.refreshTemplates())\n );\n } else return of(false);\n })\n );\n }\n\n deleteTemplate(template: TemplateObject): Observable<boolean> {\n return this.#confirmService\n .confirm({\n title: this.#translateService.instant(\n 'yuv.app.templates.action.delete.label'\n ),\n message: template.published\n ? this.#translateService.instant(\n 'yuv.app.templates.action.delete.public.confirm.message',\n { template: template.name }\n )\n : this.#translateService.instant(\n 'yuv.app.templates.action.delete.confirm.message',\n { template: template.name }\n ),\n })\n .pipe(\n switchMap((confirmed: boolean) => {\n if (confirmed) {\n return this.#backendService\n .delete(`/dms/objects/${template.id}`, ApiBase.core)\n .pipe(\n map(() => true),\n tap(() => this.refreshTemplates())\n );\n } else return of(false);\n })\n );\n }\n\n refreshTemplates() {\n this.getPage(this.templates?.pageNumber);\n }\n\n #fetchTemplates(pageNumber = 0): Observable<TemplateSearchResponse> {\n let filterParams = new HttpParams()\n .set('page', pageNumber)\n .set('size', TemplateService.PAGE_SIZE)\n .set('sort', 'name%2Casc');\n\n return this.#backendService\n .get(`/template-service/api/objects/?${filterParams}`, ApiBase.none)\n .pipe(\n map((res: SearchResponse) => ({\n pageNumber: pageNumber,\n pageSize: TemplateService.PAGE_SIZE,\n totalNumItems: res.totalNumItems,\n items: res.objects.map(\n (obj: CoreApiObject) => new TemplateObject(obj)\n ),\n }))\n );\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { Component } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { TranslateModule } from '@yuuvis/client-core';\nimport { AppLogoComponent } from '@yuuvis/client-shell';\nimport { APP_SCHEMA } from '@yuuvis/app-templates/shared';\n\nconst components = [AppLogoComponent];\n\nconst module = [CommonModule, TranslateModule, RouterModule];\n\n@Component({\n selector: 'ymtmpl-app-templates',\n standalone: true,\n imports: [...module, ...components],\n template: `\n <header>\n <yuv-app-logo [label]=\"appName\" routerLink=\"management\"></yuv-app-logo>\n </header>\n <main><router-outlet></router-outlet></main>\n `,\n styleUrl: './app-templates.component.scss',\n})\nexport class YuvTemplatesComponent {\n appName = APP_SCHEMA.name;\n appIcon = APP_SCHEMA.icon;\n}\n","import { CommonModule } from '@angular/common';\nimport { Component, Input } from '@angular/core';\nimport { ObjectPreviewComponent } from '@yuuvis/client-framework/object-preview';\nimport { TemplateObject } from '@yuuvis/app-templates/shared';\n\nconst components = [\n ObjectPreviewComponent\n];\n\nconst modules = [\n CommonModule\n];\n\n@Component({\n selector: 'ymtmpl-template-details',\n templateUrl: './template-details.component.html',\n styleUrls: ['./template-details.component.scss'],\n standalone: true,\n imports: [...modules, ...components]\n})\nexport class TemplateDetailsComponent {\n @Input() templateObject!: TemplateObject;\n}","<yuv-object-preview [objectId]=\"templateObject.id\"></yuv-object-preview>","import { CommonModule } from '@angular/common';\nimport { Component, inject, linkedSignal, signal } from '@angular/core';\nimport {\n FormBuilder,\n FormGroup,\n ReactiveFormsModule,\n Validators,\n} from '@angular/forms';\nimport { MatDialogRef } from '@angular/material/dialog';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatSelectModule } from '@angular/material/select';\nimport { GenericObjectType, TranslateModule } from '@yuuvis/client-core';\nimport { StringComponent } from '@yuuvis/client-framework/forms';\nimport { YmtButtonDirective } from '@yuuvis/material';\nimport { TemplateService } from './../../app-templates.service';\nimport { BusyOverlayDirective, DialogComponent } from '@yuuvis/client-framework/common';\nimport { TemplateObject } from '@yuuvis/app-templates/shared';\n\nconst components = [BusyOverlayDirective, StringComponent, YmtButtonDirective, DialogComponent];\n\nconst modules = [\n CommonModule,\n ReactiveFormsModule,\n TranslateModule,\n MatFormFieldModule,\n MatSelectModule\n];\n\n@Component({\n selector: 'ymtmpl-create-template',\n templateUrl: './create-template.component.html',\n styleUrl: './create-template.component.scss',\n standalone: true,\n imports: [...modules, ...components],\n host: {\n '[class.busy]': '!busy()',\n },\n})\nexport class CreateTemplateComponent {\n readonly #fb = inject(FormBuilder);\n readonly #templateService = inject(TemplateService);\n readonly #dialogRef = inject(MatDialogRef<CreateTemplateComponent, TemplateObject>);\n\n busy = signal<boolean>(false);\n\n error = signal<string | undefined>(undefined);\n\n form: FormGroup = this.#fb.group({\n name: ['New template', Validators.required],\n description: [''],\n dataObjectType: ['system:document', Validators.required]\n });\n\n dataObjectTypes = signal<GenericObjectType[]>([]);\n\n changedInput = signal<any | undefined>(undefined);\n \n disabledSubmit = linkedSignal({\n source: this.changedInput,\n computation: () => {\n return this.busy() || this.form.invalid || !this.form.value.name;\n }\n });\n\n constructor() {\n this.#loadDataObjectTypes();\n }\n\n #loadDataObjectTypes() {\n this.dataObjectTypes.set(this.#templateService.getAvailableDataObjectTypes().sort((ot1, ot2) => ot1.id > ot2.id ? 1 : -1))\n }\n\n createTemplate() {\n let createdTemplate : TemplateObject;\n let createParams = this.form.value;\n\n this.busy.set(true);\n this.error.set(undefined);\n\n this.#templateService\n .createTemplate(\n createParams.name,\n createParams.description,\n createParams.dataObjectType\n )\n .subscribe({\n error: (e: any) => {\n this.error.set(e);\n this.busy.set(false);\n },\n next: (obj : TemplateObject) => {\n createdTemplate = obj;\n },\n complete: () => {\n this.#dialogRef.close(createdTemplate);\n },\n });\n }\n\n close() {\n this.#dialogRef.close();\n }\n\n ngAfterViewInit() {\n this.form.valueChanges.subscribe((value) => {\n this.changedInput.set(value);\n });\n }\n}\n","<yuv-dialog [yuvBusyOverlay]=\"busy()\" [headertitel]=\"'yuv.app.templates.action.create.headline' | translate\">\n <main class=\"yuv-dialog-content\">\n <form [formGroup]=\"form\">\n <mat-form-field class=\"yuv-form-field\">\n <mat-label>{{\"yuv.app.templates.object.property.name\" | translate }}</mat-label>\n <yuv-string [required]=\"true\" formControlName=\"name\"></yuv-string>\n </mat-form-field>\n <mat-form-field class=\"yuv-form-field\">\n <mat-label>{{\"yuv.app.templates.object.property.description\" | translate}}</mat-label>\n <yuv-string formControlName=\"description\"></yuv-string>\n </mat-form-field>\n <mat-form-field class=\"yuv-form-field\">\n <mat-label>{{\"yuv.app.templates.object.property.dataObjectType\" | translate}}</mat-label>\n <mat-select formControlName=\"dataObjectType\">\n @for (dataObjectType of dataObjectTypes(); track dataObjectType) {\n <mat-option [value]=\"dataObjectType.id\">{{ dataObjectType.id }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n @if (error()) {\n <p class=\"error\">{{ error() }}</p>\n }\n </form>\n </main>\n <footer>\n <button ymtButton=\"secondary\" [disabled]=\"busy()\" (click)=\"close()\">\n {{ \"yuv.app.templates.action.create.button.cancel\" | translate }}\n </button>\n <button ymtButton=\"primary\" [disabled]=\"disabledSubmit()\" (click)=\"createTemplate()\">\n {{ 'yuv.object-flavor.apply-flavor.button.apply' | translate }}\n </button>\n </footer>\n</yuv-dialog>\n","import { CommonModule, DOCUMENT } from '@angular/common';\nimport {\n Component,\n HostBinding,\n inject,\n OnInit,\n signal,\n viewChild\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { RouterModule } from '@angular/router';\nimport {\n DeviceScreen,\n DeviceService,\n Logger,\n NotificationService,\n TranslateModule,\n TranslateService\n} from '@yuuvis/client-core';\nimport {\n ListComponent,\n ListItemDirective,\n} from '@yuuvis/client-framework/list';\nimport { YuvMasterDetailsModule } from '@yuuvis/client-framework/master-details';\nimport {\n OverflowMenuItem,\n YuvOverflowMenuModule,\n} from '@yuuvis/client-framework/overflow-menu';\nimport {\n Pagination,\n PaginationComponent,\n} from '@yuuvis/client-framework/pagination';\nimport { tap } from 'rxjs';\n\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatDialog } from '@angular/material/dialog';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport {\n APP_ICONS,\n TEMPLATE_FILE_MIME_TYPE,\n TemplateObject,\n TemplateSearchResponse,\n} from '@yuuvis/app-templates/shared';\nimport { TemplateDetailsComponent } from '../../components/template-details/template-details.component';\nimport { CreateTemplateComponent } from '../../overlays/create-template/create-template.component';\nimport { TemplateService } from '../../app-templates.service';\n\nconst components = [\n ListComponent,\n ListItemDirective,\n PaginationComponent,\n TemplateDetailsComponent,\n];\n\nconst modules = [\n CommonModule,\n TranslateModule,\n RouterModule,\n YuvOverflowMenuModule,\n YuvMasterDetailsModule,\n MatIconModule,\n MatButtonModule,\n MatTooltipModule,\n];\n\n@Component({\n selector: 'ymtmpl-templates-management',\n templateUrl: './template-management.component.html',\n styleUrl: './template-management.component.scss',\n standalone: true,\n imports: [...modules, ...components],\n host: {\n 'class.smallScreen': 'smallScreenLayout()',\n },\n})\nexport class TemplateManagementComponent implements OnInit {\n readonly layoutSettingsID = 'template-management.layout.settings';\n\n readonly #logger = inject(Logger);\n\n readonly #document = inject(DOCUMENT);\n readonly #deviceService = inject(DeviceService);\n readonly #notificationService = inject(NotificationService);\n readonly #dialog = inject(MatDialog);\n\n readonly #templateService = inject(TemplateService);\n readonly #translateService = inject(TranslateService);\n\n @HostBinding('class.pagination') pagination?: Pagination;\n\n busy = this.#templateService.busy$;\n\n icons = {\n ...APP_ICONS,\n };\n\n selectedTemplate = signal<TemplateObject | undefined>(undefined);\n\n smallScreenLayout = signal(false);\n\n layoutOptions = signal<{ masterSize: number; detailsSize: number }>({\n masterSize: 40,\n detailsSize: 60,\n });\n\n actions: OverflowMenuItem[] = [];\n\n #templates: TemplateObject[] = [];\n\n templates$ = this.#templateService.templates$.pipe(\n tap((response: TemplateSearchResponse) => {\n this.#templates = response.items;\n const selectedTemplate = this.selectedTemplate();\n if (selectedTemplate) {\n // check if the selected template is still in the list\n const found = this.#templates.find((t) => t.id === selectedTemplate.id);\n if (found) {\n // update the selected template instance and the actions\n this.selectedTemplate.set(found);\n this.#updateActions(this.selectedTemplate());\n } \n // if not, set selected template to undefined\n else this.selectedTemplate.set(undefined);\n }\n this.pagination =\n response && response.totalNumItems > response.pageSize\n ? {\n total: response.totalNumItems,\n page: response.pageNumber + 1,\n pages: Math.ceil(response.totalNumItems / response.pageSize),\n }\n : undefined;\n })\n );\n\n templateListComponent = viewChild.required(ListComponent);\n enableDetails = signal<boolean>(true);\n\n constructor() {\n this.#deviceService.screenChange$\n .pipe(takeUntilDestroyed())\n .subscribe((s: DeviceScreen) => {\n this.smallScreenLayout.set(\n s.size === 's' && s.orientation === 'portrait'\n );\n });\n }\n\n #updateActions(obj: TemplateObject | undefined) {\n this.actions = obj\n ? [\n {\n id: 'yuv.app.templates.action.replaceContent',\n icon: APP_ICONS.actionReplaceTemplateContent,\n label: this.#translateService.instant(\n 'yuv.app.templates.action.replaceContent.label'\n ),\n callback: () => this.replaceCurrentContent(),\n },\n {\n id: 'yuv.app.templates.action.downloadContent',\n icon: APP_ICONS.actionDownloadTemplateContent,\n label: this.#translateService.instant(\n 'yuv.app.templates.action.downloadContent.label'\n ),\n callback: () => this.downloadCurrentContent(),\n },\n {\n id: 'yuv.app.templates.action.delete',\n icon: APP_ICONS.actionDeleteTemplate,\n label: this.#translateService.instant(\n 'yuv.app.templates.action.delete.label'\n ),\n callback: () => this.deleteCurrent(),\n },\n {\n id: 'yuv.app.templates.action.toggleState',\n icon: this.selectedTemplate()?.published\n ? APP_ICONS.actionToggleStateToUnpublished\n : APP_ICONS.actionToggleStateToPublished,\n label: this.#translateService.instant(\n this.selectedTemplate()?.published\n ? 'yuv.app.templates.action.unpublish.label'\n : 'yuv.app.templates.action.publish.label'\n ),\n callback: () => this.toggleCurrentState(),\n },\n ]\n : [];\n }\n\n createNewTemplate() {\n this.#logger.debug('Create new template ...');\n\n this.#dialog.open(CreateTemplateComponent, {\n width: '400px',\n maxWidth: '90vw',\n }).afterClosed().subscribe((createdTemplate: TemplateObject | undefined)=>{\n if (createdTemplate){\n this.#templates.push(createdTemplate);\n this.#logger.debug(\"New template created and added to list\");\n }\n });\n }\n\n downloadCurrentContent() {\n const template = this.selectedTemplate();\n if (template) {\n this.#templateService.downloadTemplateContent(template);\n }\n }\n\n replaceCurrentContent() {\n const template = this.selectedTemplate();\n if (template) {\n this.#logger.debug('Replace content of template ' + template.id + ' ...');\n\n const fileInput = this.#document.createElement('input');\n\n fileInput.type = 'file';\n fileInput.multiple = false;\n fileInput.accept = TEMPLATE_FILE_MIME_TYPE;\n\n fileInput.onchange = (e) => {\n const file = (e.target as HTMLInputElement).files?.[0];\n if (file) {\n this.#templateService\n .replaceTemplateContent(template, file)\n .subscribe({\n next: () => {\n this.#notificationService.success(\n this.#translateService.instant(\n 'yuv.app.templates.action.replaceContent.success'\n )\n );\n },\n error: (err: any) => {\n this.#notificationService.error(err);\n },\n complete: () => {\n this.#logger.debug('Template content replaced');\n },\n });\n }\n };\n\n fileInput.click();\n fileInput.remove();\n }\n }\n\n toggleCurrentState() {\n const template = this.selectedTemplate();\n if (template) {\n this.#templateService\n .toggleTemplateState(template)\n .subscribe((res: boolean) => {\n if (res) {\n this.#updateActions(template);\n this.#logger.info('Template published state chenged');\n }\n });\n }\n }\n\n deleteCurrent() {\n const template = this.selectedTemplate();\n if (template) {\n const index: number = this.#templates.indexOf(template);\n this.#logger.debug('Delete template ' + template.id + ' ...');\n this.#templateService.deleteTemplate(template)\n .subscribe((res: boolean) => {\n if (res) {\n this.#templates.splice(index, 1);\n this.#logger.debug('Template deleted and removed from list');\n }\n });\n }\n }\n\n goToPage(pageNumber: number) {\n this.#templateService.getPage(pageNumber - 1);\n }\n\n onItemSelect(idx: number[]) {\n const item = this.#templates[idx[0]];\n if (item.id === this.selectedTemplate()?.id) return;\n\n this.selectedTemplate.set(item);\n\n this.#updateActions(this.selectedTemplate());\n }\n\n ngOnInit() {\n this.#templateService.refreshTemplates();\n }\n}\n","<header>\n <nav [attr.aria-label]=\"'yuv.app.templates.naviagtion.aria.label' | translate\">\n <div class=\"primary-actions\">\n <button mat-mini-fab (click)=\"createNewTemplate()\" [matTooltip]=\"'yuv.app.templates.action.create.label' | translate\">\n <mat-icon>{{icons.actionCreateNewTemplate}}</mat-icon> \n </button>\n </div>\n <div class=\"template-actions\">\n <yuv-overflow-menu [menuItems]=\"actions\"></yuv-overflow-menu>\n </div>\n <div class=\"secondary-actions\">\n @if (!smallScreenLayout()) {\n <button mat-icon-button (click)=\"enableDetails.set(!enableDetails())\" [matTooltip]=\"'yuv.app.templates.toggledetails.tooltip' | translate\" [ngClass]=\"{ enabled: enableDetails() }\">\n <mat-icon>{{icons.toggleRight}}</mat-icon>\n </button>\n }\n </div>\n </nav>\n</header>\n\n<main>\n <yuv-master-details\n [gutterSize]=\"1\"\n [detailsActive]=\"!smallScreenLayout() && enableDetails()\"\n [layoutOptions]=\"layoutOptions()\"\n [layoutSettingsID]=\"layoutSettingsID\"\n [mode]=\"smallScreenLayout() ? 'ontop' : 'aside'\">\n \n <ng-template #yuvMasterPane>\n <div class=\"masterPaneContainer\">\n @let templateObjects = (templates$ | async)?.items;\n @if (templateObjects?.length) {\n <yuv-list (itemSelect)=\"onItemSelect($event)\">\n @for (t of templateObjects; track t.id) {\n <div class=\"item\" [ngClass]=\"[t.published ? 'public' : '']\" yuvListItem [style.--i]=\"$index\">\n <mat-icon class=\"icon\">{{t.published ? 'export_notes' : 'article'}}</mat-icon>\n <div class=\"name\">{{ t.name }}</div>\n <div class=\"description\">{{ t.description }}</div>\n <div class=\"id\">{{ t.id.toUpperCase( ) }}</div>\n <div class=\"dataObjectType\">{{ t.dataObjectType }}</div> \n </div>\n }\n </yuv-list>\n @if (pagination) {\n <yuv-pagination [pagination]=\"pagination\" (pageChange)=\"goToPage($event)\"></yuv-pagination>\n }\n } @else {\n <div class=\"empty\">\n <p>{{ 'yuv.app.templates.list.empty' | translate }}</p>\n </div>\n }\n </div>\n </ng-template>\n\n <ng-template #yuvDetailsPane>\n <div class=\"detailsPaneContainer\">\n @let templateObject = selectedTemplate();\n @if (templateObject) {\n @if (smallScreenLayout()) {\n <div class=\"toolbar\">\n <button (click)=\"selectedTemplate.set(undefined)\"> \n <mat-icon>{{icons.close}}</mat-icon> \n </button>\n </div>\n }\n <ymtmpl-template-details [templateObject]=\"templateObject\"></ymtmpl-template-details>\n } @else {\n <div class=\"nothing-selected\">\n <h2>{{ 'yuv.app.templates.list.selection.empty' | translate }}</h2>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M14 2H6C4.89 2 4 2.9 4 4V20C4 21.11 4.89 22 6 22H18C19.11 22 20 21.11 20 20V8L14 2M18 20H6V4H13V9H18V20M17.35 10L15.25 19H13.85L12.05 12.21L10.25 19H8.85L6.65 10H8.15L9.55 16.81L11.35 10H12.65L14.45 16.81L15.85 10H17.35Z\" /></svg>\n </div>\n }\n </div>\n </ng-template>\n\n </yuv-master-details>\n</main>\n\n<router-outlet name=\"modal\"></router-outlet>","import { Route } from '@angular/router';\nimport { YuvTemplatesComponent } from './app-templates.component';\nimport { TemplateManagementComponent } from './pages/management/template-management.component';\n\nexport const YuvTemplateManagerRoutes: Route[] = [\n {\n path: '',\n component: YuvTemplatesComponent,\n children: [\n { path: 'management', component: TemplateManagementComponent }, \n { path: '', redirectTo: 'management', pathMatch: 'full' },\n ]\n },\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["components","modules","i1","i3","i4"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAqCa,eAAe,CAAA;aACnB,IAAS,CAAA,SAAA,GAAG,EAAH,CAAM;AAEb,IAAA,OAAO;AAEP,IAAA,eAAe;AACf,IAAA,WAAW;AACX,IAAA,eAAe;AACf,IAAA,iBAAiB;AACjB,IAAA,cAAc;AAWvB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AA,EAAA,CAAA,YAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACnB,wBAAwB,EAAA,QAAA,EAAA,yBAAA,EAAA,MAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAwBb,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAVvC,SAAS;+BACE,6BAA6B,EAAA,UAAA,EAG3B,IAAI,EAAA,OAAA,EACP,CAAC,GAAG,OAAO,EAAE,GAAG,UAAU,CAAC,EAC9B,IAAA,EAAA;AACJ,wBAAA,mBAAmB,EAAE,qBAAqB;AAC3C,qBAAA,EAAA,QAAA,EAAA,g8GAAA,EAAA,MAAA,EAAA,CAAA,swGAAA,CAAA,EAAA;wDAegC,UAAU,EAAA,CAAA;sBAA1C,WAAW;uBAAC,kBAAkB;;;AErFpB,MAAA,wBAAwB,GAAY;AAC/C,IAAA;AACE,QAAA,IAAI,EAAE,EAAE;AACR,QAAA,SAAS,EAAE,qBAAqB;AAChC,QAAA,QAAQ,EAAE;AACR,YAAA,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,2BAA2B,EAAE;YAC9D,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE;AAC1D;AACF,KAAA;;;ACZH;;AAEG;;;;"}
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GenericObjectType } from '@yuuvis/client-core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import {
|
|
3
|
+
import { TemplateObject, TemplateSearchResponse } from '@yuuvis/app-templates/shared';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class TemplateService {
|
|
6
6
|
#private;
|
|
@@ -13,7 +13,7 @@ export declare class TemplateService {
|
|
|
13
13
|
constructor();
|
|
14
14
|
getAvailableDataObjectTypes(): GenericObjectType[];
|
|
15
15
|
getPage(page?: number): void;
|
|
16
|
-
createTemplate(name: string, description: string, dataObjectType: string): Observable<
|
|
16
|
+
createTemplate(name: string, description: string, dataObjectType: string): Observable<TemplateObject>;
|
|
17
17
|
downloadTemplateContent(template: TemplateObject): void;
|
|
18
18
|
replaceTemplateContent(template: TemplateObject, file: File): Observable<boolean>;
|
|
19
19
|
toggleTemplateState(template: TemplateObject): Observable<boolean>;
|
package/lib/assets/i18n/de.json
CHANGED
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
"yuv.app.templates.object.property.dataObjectType": "Typ",
|
|
21
21
|
"yuv.app.templates.object.property.description": "Beschreibung",
|
|
22
22
|
"yuv.app.templates.object.property.name": "Name",
|
|
23
|
-
"yuv.app.templates.toggledetails.tooltip": ""
|
|
23
|
+
"yuv.app.templates.toggledetails.tooltip": "Vorlagendetails ein-/ausblenden"
|
|
24
24
|
}
|
package/lib/assets/i18n/en.json
CHANGED
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
"yuv.app.templates.object.property.dataObjectType": "Type",
|
|
21
21
|
"yuv.app.templates.object.property.description": "Description",
|
|
22
22
|
"yuv.app.templates.object.property.name": "Name",
|
|
23
|
-
"yuv.app.templates.toggledetails.tooltip": ""
|
|
23
|
+
"yuv.app.templates.toggledetails.tooltip": "Show/hide template details"
|
|
24
24
|
}
|
|
@@ -2,7 +2,7 @@ import { OnInit } from '@angular/core';
|
|
|
2
2
|
import { ListComponent } from '@yuuvis/client-framework/list';
|
|
3
3
|
import { OverflowMenuItem } from '@yuuvis/client-framework/overflow-menu';
|
|
4
4
|
import { Pagination } from '@yuuvis/client-framework/pagination';
|
|
5
|
-
import { TemplateObject, TemplateSearchResponse } from '
|
|
5
|
+
import { TemplateObject, TemplateSearchResponse } from '@yuuvis/app-templates/shared';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
export declare class TemplateManagementComponent implements OnInit {
|
|
8
8
|
#private;
|
package/package.json
CHANGED
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
"name": "@yuuvis/app-templates",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
+
"@angular/material": "^19.2.15",
|
|
5
6
|
"@angular/common": "^19.2.1",
|
|
7
|
+
"@angular/forms": "^19.2.1",
|
|
6
8
|
"@angular/core": "^19.2.1",
|
|
7
|
-
"@yuuvis/
|
|
9
|
+
"@yuuvis/media-viewer": "^2.0.4",
|
|
10
|
+
"@yuuvis/client-shell": "^2.0.15"
|
|
8
11
|
},
|
|
9
12
|
"sideEffects": false,
|
|
10
13
|
"module": "fesm2022/yuuvis-app-templates.mjs",
|
|
@@ -20,10 +23,14 @@
|
|
|
20
23
|
"./extensions": {
|
|
21
24
|
"types": "./extensions/index.d.ts",
|
|
22
25
|
"default": "./fesm2022/yuuvis-app-templates-extensions.mjs"
|
|
26
|
+
},
|
|
27
|
+
"./shared": {
|
|
28
|
+
"types": "./shared/index.d.ts",
|
|
29
|
+
"default": "./fesm2022/yuuvis-app-templates-shared.mjs"
|
|
23
30
|
}
|
|
24
31
|
},
|
|
25
32
|
"dependencies": {
|
|
26
33
|
"tslib": "^2.3.0"
|
|
27
34
|
},
|
|
28
|
-
"version": "1.0.
|
|
35
|
+
"version": "1.0.2"
|
|
29
36
|
}
|
package/shared/README.md
ADDED
|
@@ -32,7 +32,7 @@ export declare enum TemplateManagementEventType {
|
|
|
32
32
|
TEMPLATE_OBJECT_DELETED = "io.yuuvis.app.templates.object.deleted"
|
|
33
33
|
}
|
|
34
34
|
export interface CreateTemplateResult {
|
|
35
|
-
|
|
35
|
+
item: TemplateObject;
|
|
36
36
|
}
|
|
37
37
|
export interface TemplateSearchResponse {
|
|
38
38
|
pageNumber: number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './app-templates.schema';
|