@myrmidon/cadmus-profile-editor 0.0.1
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"myrmidon-cadmus-profile-editor.mjs","sources":["../../../../projects/myrmidon/cadmus-profile-editor/src/lib/services/facet-definition-validator.service.ts","../../../../projects/myrmidon/cadmus-profile-editor/src/lib/components/part-definition-editor/part-definition-editor.component.ts","../../../../projects/myrmidon/cadmus-profile-editor/src/lib/components/part-definition-editor/part-definition-editor.component.html","../../../../projects/myrmidon/cadmus-profile-editor/src/lib/components/facet-definition-editor/facet-definition-editor.component.ts","../../../../projects/myrmidon/cadmus-profile-editor/src/lib/components/facet-definition-editor/facet-definition-editor.component.html","../../../../projects/myrmidon/cadmus-profile-editor/src/lib/components/facet-definition-list-editor/facet-definition-list-editor.component.ts","../../../../projects/myrmidon/cadmus-profile-editor/src/lib/components/facet-definition-list-editor/facet-definition-list-editor.component.html","../../../../projects/myrmidon/cadmus-profile-editor/src/lib/components/facet-edit-page/facet-edit-page.component.ts","../../../../projects/myrmidon/cadmus-profile-editor/src/lib/components/facet-edit-page/facet-edit-page.component.html","../../../../projects/myrmidon/cadmus-profile-editor/src/lib/cadmus-profile-edit.routes.ts","../../../../projects/myrmidon/cadmus-profile-editor/src/public-api.ts","../../../../projects/myrmidon/cadmus-profile-editor/src/myrmidon-cadmus-profile-editor.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Observable, of } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nimport { FacetDefinition } from '@myrmidon/cadmus-core';\nimport { FacetModelSettings, ThesaurusService } from '@myrmidon/cadmus-api';\n\n/** A single validation issue produced by {@link FacetDefinitionValidatorService}. */\nexport interface FacetValidationIssue {\n severity: 'error' | 'warning' | 'info';\n /** Human-readable description of the issue. */\n message: string;\n}\n\n/** The result returned by {@link FacetDefinitionValidatorService.validate}. */\nexport interface FacetValidationResult {\n issues: FacetValidationIssue[];\n hasErrors: boolean;\n hasWarnings: boolean;\n hasInfos: boolean;\n}\n\n/**\n * Validates a list of {@link FacetDefinition} objects before they are persisted.\n *\n * Rules:\n * - duplicate facet ID → error\n * - facet ID still set to \"new\" → warning (unfilled placeholder)\n * - duplicate facet label → error\n * - duplicate facet color → info\n * - duplicate facet description → info\n * - facet with no part definitions → error\n * - within a facet: two parts with same typeId AND same roleId\n * (including both empty/null) → error\n * (one with a roleId and one without is valid: they serve different roles)\n * - within a facet: duplicate part color → info\n * - within a facet: duplicate part description → info\n * - (when facetModelSettings is provided) for each part/fragment entry in the\n * settings, each thesaurus ID listed in thesauriIds is checked against the\n * existing thesauri: missing required thesauri (prefixed with \"*\") → error;\n * missing optional thesauri → info.\n */\n@Injectable({ providedIn: 'root' })\nexport class FacetDefinitionValidatorService {\n constructor(private _thesaurusService: ThesaurusService) {}\n\n private buildResult(issues: FacetValidationIssue[]): FacetValidationResult {\n return {\n issues,\n hasErrors: issues.some((i) => i.severity === 'error'),\n hasWarnings: issues.some((i) => i.severity === 'warning'),\n hasInfos: issues.some((i) => i.severity === 'info'),\n };\n }\n\n private checkThesauri(\n issues: FacetValidationIssue[],\n existingIds: Set<string>,\n entries: { [key: string]: { thesauriIds?: string[] } },\n kind: 'Part' | 'Fragment',\n ): void {\n for (const [typeId, entry] of Object.entries(entries)) {\n for (const rawId of entry.thesauriIds ?? []) {\n const required = rawId.startsWith('*');\n const bareId = required ? rawId.substring(1) : rawId;\n if (!existingIds.has(bareId)) {\n if (required) {\n issues.push({\n severity: 'error',\n message: `${kind} \"${typeId}\" requires thesaurus \"${bareId}\" which does not exist.`,\n });\n } else {\n issues.push({\n severity: 'info',\n message: `${kind} \"${typeId}\" uses optional thesaurus \"${bareId}\" which does not exist.`,\n });\n }\n }\n }\n }\n }\n\n /**\n * Validate the given list of facet definitions and return a result\n * containing all issues found.\n * @param facets The list of facet definitions to validate.\n * @param facetModelSettings Optional settings; when provided the thesauri\n * referenced by each part/fragment are checked against the server.\n */\n public validate(\n facets: FacetDefinition[],\n facetModelSettings?: FacetModelSettings,\n ): Observable<FacetValidationResult> {\n const issues: FacetValidationIssue[] = [];\n\n const seenIds = new Set<string>();\n const seenLabels = new Set<string>();\n const seenColors = new Set<string>();\n const seenDescriptions = new Set<string>();\n\n for (const facet of facets) {\n const label = `facet \"${facet.id}\"`;\n\n // duplicate / placeholder ID\n if (!facet.id) {\n issues.push({ severity: 'error', message: 'A facet has an empty ID.' });\n } else if (facet.id === 'new') {\n issues.push({\n severity: 'warning',\n message: `Facet has placeholder ID \"new\" — please assign a real ID.`,\n });\n } else if (seenIds.has(facet.id)) {\n issues.push({\n severity: 'error',\n message: `Duplicate facet ID: \"${facet.id}\".`,\n });\n } else {\n seenIds.add(facet.id);\n }\n\n // duplicate label\n if (facet.label) {\n if (seenLabels.has(facet.label)) {\n issues.push({\n severity: 'error',\n message: `Duplicate facet label \"${facet.label}\" in ${label}.`,\n });\n } else {\n seenLabels.add(facet.label);\n }\n }\n\n // duplicate color (info)\n if (facet.colorKey) {\n if (seenColors.has(facet.colorKey)) {\n issues.push({\n severity: 'info',\n message: `Duplicate facet color \"${facet.colorKey}\" in ${label}.`,\n });\n } else {\n seenColors.add(facet.colorKey);\n }\n }\n\n // duplicate description (info)\n if (facet.description) {\n if (seenDescriptions.has(facet.description)) {\n issues.push({\n severity: 'info',\n message: `Duplicate facet description \"${facet.description}\" in ${label}.`,\n });\n } else {\n seenDescriptions.add(facet.description);\n }\n }\n\n // no part definitions\n if (!facet.partDefinitions.length) {\n issues.push({\n severity: 'error',\n message: `${label} has no part definitions.`,\n });\n }\n\n // within-facet checks\n const seenPartKeys = new Set<string>();\n const seenPartColors = new Set<string>();\n const seenPartDescriptions = new Set<string>();\n\n for (const part of facet.partDefinitions) {\n // duplicate typeId + roleId combination\n // key uses empty string for absent roleId so that\n // (typeId, undefined) vs (typeId, \"r1\") are treated as different\n const key = `${part.typeId}|${part.roleId ?? ''}`;\n if (seenPartKeys.has(key)) {\n issues.push({\n severity: 'error',\n message:\n `Duplicate part (typeId \"${part.typeId}\", ` +\n `roleId \"${part.roleId ?? '(none)'}\") in ${label}.`,\n });\n } else {\n seenPartKeys.add(key);\n }\n\n // duplicate part color (info)\n if (part.colorKey) {\n if (seenPartColors.has(part.colorKey)) {\n issues.push({\n severity: 'info',\n message: `Duplicate part color \"${part.colorKey}\" in ${label}.`,\n });\n } else {\n seenPartColors.add(part.colorKey);\n }\n }\n\n // duplicate part description (info)\n if (part.description) {\n if (seenPartDescriptions.has(part.description)) {\n issues.push({\n severity: 'info',\n message: `Duplicate part description \"${part.description}\" for type \"${part.typeId}\" in ${label}.`,\n });\n } else {\n seenPartDescriptions.add(part.description);\n }\n }\n }\n }\n\n // thesaurus coverage check (only when model settings are available)\n if (!facetModelSettings) {\n return of(this.buildResult(issues));\n }\n\n return this._thesaurusService.getThesaurusIds().pipe(\n map((ids) => {\n const existingIds = new Set(ids);\n this.checkThesauri(\n issues,\n existingIds,\n facetModelSettings.parts,\n 'Part',\n );\n if (facetModelSettings.fragments) {\n this.checkThesauri(\n issues,\n existingIds,\n facetModelSettings.fragments,\n 'Fragment',\n );\n }\n return this.buildResult(issues);\n }),\n );\n }\n}\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n Signal,\r\n computed,\r\n effect,\r\n input,\r\n model,\r\n output,\r\n} from '@angular/core';\r\nimport { toSignal } from '@angular/core/rxjs-interop';\r\nimport {\r\n FormBuilder,\r\n FormControl,\r\n FormGroup,\r\n ReactiveFormsModule,\r\n Validators,\r\n} from '@angular/forms';\r\n\r\n// material\r\nimport { MatIconButton } from '@angular/material/button';\r\nimport { MatTooltip } from '@angular/material/tooltip';\r\nimport {\r\n MatError,\r\n MatFormField,\r\n MatInput,\r\n MatLabel,\r\n} from '@angular/material/input';\r\nimport { MatIcon } from '@angular/material/icon';\r\n\r\nimport { PartDefinition } from '@myrmidon/cadmus-core';\r\nimport { FacetModelSettings } from '@myrmidon/cadmus-api';\r\nimport { MatSuffix } from '@angular/material/form-field';\r\nimport { MatOption, MatSelect } from '@angular/material/select';\r\nimport { MatCheckbox } from '@angular/material/checkbox';\r\n\r\n/**\r\n * Editor for a single part definition. This allows users to edit the part definition\r\n * properties: type ID, selected from a list if facet model settings are provided,\r\n * or entered freely if not (but this should not happen, as at least part definitions\r\n * should be present and these provide fallback model settings); role ID, selected\r\n * from a closed list when the part type is a base text part, or entered freely otherwise;\r\n * name; color; group; sort key; description; and whether the part is required or not\r\n * in its facet.\r\n * NOTE: part definition settings are not edited here. They are defined server-side\r\n * and will later be obsoleted.\r\n */\r\n@Component({\r\n selector: 'cadmus-part-definition-editor',\r\n imports: [\r\n ReactiveFormsModule,\r\n MatCheckbox,\r\n MatError,\r\n MatFormField,\r\n MatIcon,\r\n MatIconButton,\r\n MatInput,\r\n MatLabel,\r\n MatOption,\r\n MatSelect,\r\n MatSuffix,\r\n MatTooltip,\r\n ],\r\n templateUrl: './part-definition-editor.component.html',\r\n styleUrl: './part-definition-editor.component.css',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class PartDefinitionEditorComponent {\r\n /**\r\n * The part to edit.\r\n */\r\n public readonly definition = model<PartDefinition | undefined>();\r\n\r\n /**\r\n * The facet models settings, used to get the list of available part type IDs,\r\n * and whether they are base text parts; in this case, the same settings also\r\n * provide the list of their available role IDs from the fragments property.\r\n */\r\n public readonly facetModelSettings = input<FacetModelSettings | undefined>(\r\n undefined,\r\n );\r\n\r\n /**\r\n * The list of available part type IDs, taken from the facet model settings.\r\n * If the facet model settings are not provided, or do not contain any part\r\n * definition, this list is empty and the type ID must be entered freely.\r\n */\r\n public readonly availablePartTypeIds = computed(() => {\r\n const settings = this.facetModelSettings();\r\n return settings?.parts ? Object.keys(settings.parts) : [];\r\n });\r\n\r\n /**\r\n * The list of available fragment IDs, taken from the facet model settings.\r\n * This is used to populate the role ID select when the part type is a base\r\n * text part (i.e. its baseText property in settings is true).\r\n */\r\n public readonly availableFragmentIds = computed(() => {\r\n const settings = this.facetModelSettings();\r\n return settings?.fragments ? Object.keys(settings.fragments) : [];\r\n });\r\n\r\n /**\r\n * True if the part type is a base text part, i.e. if the facet model settings\r\n * for the current part type ID has the baseText property set to true. In this\r\n * case, the role ID select is shown with the list of available fragment IDs\r\n * from the facet model settings; otherwise, a free text input is shown for\r\n * the role ID.\r\n * Initialized in the constructor so it can reactively track typeId changes\r\n * via a toSignal-wrapped valueChanges observable.\r\n */\r\n public readonly isBaseTextPart: Signal<boolean>;\r\n\r\n /** Signal that mirrors typeId.valueChanges so computed() can track it. */\r\n private readonly _typeIdValue: Signal<string>;\r\n\r\n /**\r\n * True to hide the sort key field. This is used when the sort key is\r\n * defined at the level of the part definitions list, and not at the level\r\n * of each part definition.\r\n */\r\n public readonly hideSortKey = input<boolean>(false);\r\n\r\n /**\r\n * Emitted when user requests to cancel the edit and close this editor.\r\n */\r\n public readonly cancelEdit = output();\r\n\r\n public typeId: FormControl<string>;\r\n public roleId: FormControl<string | null>;\r\n public name: FormControl<string>;\r\n public required: FormControl<boolean>;\r\n public description: FormControl<string | null>;\r\n public colorKey: FormControl<string | null>;\r\n public groupKey: FormControl<string | null>;\r\n public sortKey: FormControl<string | null>;\r\n public form: FormGroup;\r\n\r\n constructor(formBuilder: FormBuilder) {\r\n // form\r\n this.typeId = formBuilder.control<string>('', {\r\n validators: [Validators.required, Validators.maxLength(100)],\r\n nonNullable: true,\r\n });\r\n // mirror typeId value as a signal so computed() tracks it reactively\r\n this._typeIdValue = toSignal(this.typeId.valueChanges, {\r\n initialValue: this.typeId.value,\r\n });\r\n this.isBaseTextPart = computed(() => {\r\n const settings = this.facetModelSettings();\r\n return settings?.parts?.[this._typeIdValue()]?.baseText === true;\r\n });\r\n this.roleId = formBuilder.control<string | null>(null);\r\n this.name = formBuilder.control<string>('', {\r\n validators: [Validators.required, Validators.maxLength(100)],\r\n nonNullable: true,\r\n });\r\n this.required = formBuilder.control<boolean>(false, {\r\n nonNullable: true,\r\n });\r\n this.description = formBuilder.control<string | null>(null, {\r\n validators: Validators.maxLength(1000),\r\n });\r\n // color key has form RRGGBB, where RR, GG and BB are hex values\r\n // for red, green and blue\r\n this.colorKey = formBuilder.control<string | null>(null, {\r\n validators: Validators.pattern('^[0-9a-fA-F]{6}$'),\r\n });\r\n this.groupKey = formBuilder.control<string | null>(null);\r\n this.sortKey = formBuilder.control<string | null>(null);\r\n\r\n this.form = formBuilder.group({\r\n typeId: this.typeId,\r\n roleId: this.roleId,\r\n name: this.name,\r\n required: this.required,\r\n description: this.description,\r\n colorKey: this.colorKey,\r\n groupKey: this.groupKey,\r\n sortKey: this.sortKey,\r\n });\r\n\r\n // when model changes, update form\r\n effect(() => {\r\n const data = this.definition();\r\n this.updateForm(data);\r\n });\r\n }\r\n\r\n private updateForm(data: PartDefinition | undefined | null): void {\r\n if (!data) {\r\n this.form.reset();\r\n } else {\r\n this.typeId.setValue(data.typeId);\r\n this.roleId.setValue(data.roleId || null);\r\n this.name.setValue(data.name || '');\r\n this.required.setValue(data.isRequired || false);\r\n this.description.setValue(data.description || null);\r\n this.colorKey.setValue(data.colorKey || null);\r\n this.groupKey.setValue(data.groupKey || null);\r\n this.sortKey.setValue(data.sortKey || null);\r\n this.form.markAsPristine();\r\n }\r\n }\r\n\r\n private getData(): PartDefinition {\r\n return {\r\n typeId: this.typeId.value.trim(),\r\n roleId: this.roleId.value?.trim() || undefined,\r\n name: this.name.value.trim(),\r\n isRequired: this.required.value,\r\n description: this.description.value?.trim() || undefined,\r\n colorKey: this.colorKey.value?.trim() || undefined,\r\n groupKey: this.groupKey.value?.trim() || undefined,\r\n sortKey: this.sortKey.value?.trim() || undefined,\r\n };\r\n }\r\n\r\n public onColorPick(value: string): void {\r\n // native color input returns \"#rrggbb\" — strip the leading \"#\"\r\n this.colorKey.setValue(value.slice(1));\r\n this.colorKey.markAsDirty();\r\n }\r\n\r\n public cancel(): void {\r\n this.cancelEdit.emit();\r\n }\r\n\r\n /**\r\n * Saves the current form data by updating the `data` model signal.\r\n * This method can be called manually (e.g., by a Save button) or\r\n * automatically (via auto-save).\r\n * @param pristine If true (default), the form is marked as pristine\r\n * after saving.\r\n * Set to false for auto-save if you want the form to remain dirty.\r\n */\r\n public save(pristine = true): void {\r\n if (this.form.invalid) {\r\n // show validation errors\r\n this.form.markAllAsTouched();\r\n return;\r\n }\r\n\r\n const data = this.getData();\r\n this.definition.set(data);\r\n\r\n if (pristine) {\r\n this.form.markAsPristine();\r\n }\r\n }\r\n}\r\n","<form [formGroup]=\"form\" (submit)=\"save()\">\r\n <div class=\"form-row\">\r\n <!-- typeId (bound) -->\r\n @if (availablePartTypeIds().length) {\r\n <mat-form-field>\r\n <mat-label>type</mat-label>\r\n <mat-select [formControl]=\"typeId\">\r\n @for (id of availablePartTypeIds(); track id) {\r\n <mat-option [value]=\"id\">{{ id }}</mat-option>\r\n }\r\n </mat-select>\r\n @if (\r\n $any(typeId).errors?.required && (typeId.dirty || typeId.touched)\r\n ) {\r\n <mat-error>type ID required</mat-error>\r\n }\r\n </mat-form-field>\r\n } @else {\r\n <!-- typeId (free) -->\r\n <mat-form-field>\r\n <mat-label>type ID</mat-label>\r\n <input matInput [formControl]=\"typeId\" />\r\n @if (\r\n $any(typeId).errors?.required && (typeId.dirty || typeId.touched)\r\n ) {\r\n <mat-error>type ID required</mat-error>\r\n }\r\n @if (\r\n $any(typeId).errors?.maxLength && (typeId.dirty || typeId.touched)\r\n ) {\r\n <mat-error>type ID too long</mat-error>\r\n }\r\n </mat-form-field>\r\n }\r\n\r\n <!-- roleId is to be selected from a list if the part is a base text part -->\r\n @if (isBaseTextPart()) {\r\n <mat-form-field>\r\n <mat-label>role ID</mat-label>\r\n <mat-select [formControl]=\"roleId\">\r\n @for (e of availableFragmentIds(); track e) {\r\n <mat-option [value]=\"e\">{{ e }}</mat-option>\r\n }\r\n </mat-select>\r\n @if (\r\n $any(roleId).errors?.required && (roleId.dirty || roleId.touched)\r\n ) {\r\n <mat-error>role ID required</mat-error>\r\n }\r\n </mat-form-field>\r\n } @else {\r\n <!-- else roleId is free -->\r\n <mat-form-field>\r\n <mat-label>role ID</mat-label>\r\n <input matInput [formControl]=\"roleId\" />\r\n @if (\r\n $any(roleId).errors?.required && (roleId.dirty || roleId.touched)\r\n ) {\r\n <mat-error>role ID required</mat-error>\r\n }\r\n @if (\r\n $any(roleId).errors?.maxLength && (roleId.dirty || roleId.touched)\r\n ) {\r\n <mat-error>role ID too long</mat-error>\r\n }\r\n </mat-form-field>\r\n }\r\n\r\n <!-- required -->\r\n <mat-checkbox [formControl]=\"required\">required</mat-checkbox>\r\n </div>\r\n\r\n <div class=\"form-row\">\r\n <!-- name -->\r\n <mat-form-field>\r\n <mat-label>name</mat-label>\r\n <input matInput [formControl]=\"name\" />\r\n @if ($any(name).errors?.required && (name.dirty || name.touched)) {\r\n <mat-error>name required</mat-error>\r\n }\r\n @if ($any(name).errors?.maxLength && (name.dirty || name.touched)) {\r\n <mat-error>name too long</mat-error>\r\n }\r\n </mat-form-field>\r\n\r\n <!-- color -->\r\n <mat-form-field class=\"color-input\">\r\n <mat-label>color</mat-label>\r\n <input matInput [formControl]=\"colorKey\" />\r\n @if (\r\n $any(colorKey).errors?.pattern && (colorKey.dirty || colorKey.touched)\r\n ) {\r\n <mat-error>invalid color key</mat-error>\r\n }\r\n <input\r\n type=\"color\"\r\n class=\"color-picker-input\"\r\n #colorPicker\r\n [value]=\"\r\n colorKey.value?.length === 6 ? '#' + colorKey.value : '#000000'\r\n \"\r\n (input)=\"onColorPick(colorPicker.value)\"\r\n />\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matSuffix\r\n matTooltip=\"Pick color\"\r\n (click)=\"colorPicker.click()\"\r\n >\r\n <mat-icon>palette</mat-icon>\r\n </button>\r\n </mat-form-field>\r\n <div class=\"color-sample\" [style.--swatch-color]=\"'#' + colorKey.value\"></div>\r\n\r\n <!-- group -->\r\n <mat-form-field>\r\n <mat-label>group</mat-label>\r\n <input matInput [formControl]=\"groupKey\" />\r\n @if (\r\n $any(groupKey).errors?.maxLength && (groupKey.dirty || groupKey.touched)\r\n ) {\r\n <mat-error>group key too long</mat-error>\r\n }\r\n </mat-form-field>\r\n\r\n <!-- sortKey -->\r\n @if (!hideSortKey()) {\r\n <mat-form-field>\r\n <mat-label>sort key</mat-label>\r\n <input matInput [formControl]=\"sortKey\" />\r\n @if (\r\n $any(sortKey).errors?.maxLength && (sortKey.dirty || sortKey.touched)\r\n ) {\r\n <mat-error>sort key too long</mat-error>\r\n }\r\n </mat-form-field>\r\n }\r\n </div>\r\n\r\n <!-- description -->\r\n <div>\r\n <mat-form-field class=\"long-text\">\r\n <mat-label>description</mat-label>\r\n <textarea matInput [formControl]=\"description\" rows=\"2\"></textarea>\r\n @if (\r\n $any(description).errors?.maxLength &&\r\n (description.dirty || description.touched)\r\n ) {\r\n <mat-error>description too long</mat-error>\r\n }\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- buttons -->\r\n <div>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Discard changes\"\r\n (click)=\"cancel()\"\r\n >\r\n <mat-icon class=\"mat-warn\">clear</mat-icon>\r\n </button>\r\n <button\r\n type=\"submit\"\r\n mat-icon-button\r\n matTooltip=\"Accept changes\"\r\n [disabled]=\"form.invalid || form.pristine\"\r\n >\r\n <mat-icon class=\"mat-primary\">check_circle</mat-icon>\r\n </button>\r\n </div>\r\n</form>\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n effect,\r\n input,\r\n model,\r\n output,\r\n signal,\r\n} from '@angular/core';\r\nimport {\r\n FormBuilder,\r\n FormControl,\r\n FormGroup,\r\n ReactiveFormsModule,\r\n Validators,\r\n} from '@angular/forms';\r\n\r\n// material\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatCheckbox } from '@angular/material/checkbox';\r\nimport {\r\n MatError,\r\n MatFormField,\r\n MatLabel,\r\n MatSuffix,\r\n} from '@angular/material/form-field';\r\nimport {\r\n MatExpansionPanel,\r\n MatExpansionPanelHeader,\r\n MatExpansionPanelTitle,\r\n} from '@angular/material/expansion';\r\nimport { MatIcon } from '@angular/material/icon';\r\nimport { MatInput } from '@angular/material/input';\r\nimport { MatTab, MatTabGroup } from '@angular/material/tabs';\r\nimport { MatTooltip } from '@angular/material/tooltip';\r\n\r\nimport {\r\n ColorToContrastPipe,\r\n EllipsisPipe,\r\n StringToColorPipe,\r\n} from '@myrmidon/ngx-tools';\r\nimport { DialogService } from '@myrmidon/ngx-mat-tools';\r\n\r\nimport { FacetDefinition, PartDefinition } from '@myrmidon/cadmus-core';\r\nimport { FacetModelSettings } from '@myrmidon/cadmus-api';\r\n\r\nimport { PartDefinitionEditorComponent } from '../part-definition-editor/part-definition-editor.component';\r\n\r\n/**\r\n * Editor for a single facet definition and its part definitions.\r\n * This editor is used as a descendant of the facet definition list editor, and allows\r\n * to edit a single facet definition and its part definitions.\r\n */\r\n@Component({\r\n selector: 'cadmus-facet-definition-editor',\r\n imports: [\r\n ReactiveFormsModule,\r\n MatButtonModule,\r\n MatCheckbox,\r\n MatError,\r\n MatExpansionPanel,\r\n MatExpansionPanelHeader,\r\n MatExpansionPanelTitle,\r\n MatFormField,\r\n MatIcon,\r\n MatInput,\r\n MatLabel,\r\n MatSuffix,\r\n MatTab,\r\n MatTabGroup,\r\n MatTooltip,\r\n ColorToContrastPipe,\r\n EllipsisPipe,\r\n StringToColorPipe,\r\n PartDefinitionEditorComponent,\r\n ],\r\n templateUrl: './facet-definition-editor.component.html',\r\n styleUrl: './facet-definition-editor.component.css',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class FacetDefinitionEditorComponent {\r\n /**\r\n * The facet definition to edit.\r\n */\r\n public readonly definition = model<FacetDefinition | undefined>();\r\n\r\n /**\r\n * The facet models settings, used to get the list of available part type IDs,\r\n * and whether they are base text parts; in this case, the same settings also\r\n * provide the list of their available role IDs from the fragments property.\r\n */\r\n public readonly facetModelSettings = input<FacetModelSettings | undefined>(\r\n undefined,\r\n );\r\n\r\n /**\r\n * The list of available part type IDs, taken from the facet model settings.\r\n * If the facet model settings are not provided, or do not contain any part\r\n * definition, this list is empty and the type ID must be entered freely.\r\n */\r\n public readonly availablePartTypeIds = computed(() => {\r\n const settings = this.facetModelSettings();\r\n return settings?.parts ? Object.keys(settings.parts) : [];\r\n });\r\n\r\n /**\r\n * Emitted when user requests to cancel the edit and close this editor.\r\n */\r\n public readonly cancelEdit = output();\r\n\r\n // edited part definition\r\n public readonly edited = signal<PartDefinition | undefined>(undefined);\r\n public readonly editedIndex = signal<number>(-1);\r\n\r\n public id: FormControl<string>;\r\n public label: FormControl<string>;\r\n public colorKey: FormControl<string>;\r\n public description: FormControl<string>;\r\n public partDefinitions: FormControl<PartDefinition[]>;\r\n public form: FormGroup;\r\n\r\n constructor(\r\n formBuilder: FormBuilder,\r\n private _dialogService: DialogService,\r\n ) {\r\n // form\r\n this.id = formBuilder.control('', {\r\n validators: [Validators.required, Validators.maxLength(100)],\r\n nonNullable: true,\r\n });\r\n this.label = formBuilder.control('', {\r\n validators: [Validators.required, Validators.maxLength(100)],\r\n nonNullable: true,\r\n });\r\n // color key is a 6-digit hex string (without #)\r\n this.colorKey = formBuilder.control('', {\r\n validators: [Validators.pattern('^[0-9a-fA-F]{6}$')],\r\n nonNullable: true,\r\n });\r\n this.description = formBuilder.control('', {\r\n validators: [Validators.maxLength(1000)],\r\n nonNullable: true,\r\n });\r\n this.partDefinitions = formBuilder.control([], {\r\n validators: [Validators.required],\r\n nonNullable: true,\r\n });\r\n\r\n this.form = formBuilder.group({\r\n id: this.id,\r\n label: this.label,\r\n colorKey: this.colorKey,\r\n description: this.description,\r\n partDefinitions: this.partDefinitions,\r\n });\r\n\r\n // when model changes, update form\r\n effect(() => {\r\n const data = this.definition();\r\n this.updateForm(data);\r\n });\r\n }\r\n\r\n private updateForm(data: FacetDefinition | undefined | null): void {\r\n if (!data) {\r\n this.form.reset();\r\n } else {\r\n this.id.setValue(data.id);\r\n this.label.setValue(data.label);\r\n this.colorKey.setValue(data.colorKey);\r\n this.description.setValue(data.description);\r\n // sort by sortKey so that the displayed order always matches the key order\r\n const sorted = [...data.partDefinitions].sort((a, b) =>\r\n (a.sortKey ?? '').localeCompare(b.sortKey ?? ''),\r\n );\r\n this.partDefinitions.setValue(sorted);\r\n this.form.markAsPristine();\r\n }\r\n }\r\n\r\n private getDefinition(): FacetDefinition {\r\n return {\r\n id: this.id.value.trim(),\r\n label: this.label.value.trim(),\r\n colorKey: this.colorKey.value,\r\n description: this.description.value.trim(),\r\n partDefinitions: this.partDefinitions.value,\r\n };\r\n }\r\n\r\n //#region Part definitions\r\n private updatePartDefinitionSortKeys(): void {\r\n // assign an ordinal number as a 2-digits number to the sortKey\r\n // of each part definition, so that they are sorted in the order of the list\r\n const entries = this.partDefinitions.value.map((entry, index) => {\r\n return {\r\n ...entry,\r\n sortKey: (index + 1).toString().padStart(2, '0'),\r\n };\r\n });\r\n this.partDefinitions.setValue(entries);\r\n }\r\n\r\n public addPartDefinition(): void {\r\n const definition: PartDefinition = {\r\n typeId: this.availablePartTypeIds().length\r\n ? this.availablePartTypeIds()[0]\r\n : '',\r\n name: 'new',\r\n };\r\n this.editedIndex.set(-1);\r\n this.edited.set(definition);\r\n }\r\n\r\n public editPartDefinition(entry: PartDefinition, index: number): void {\r\n this.editedIndex.set(index);\r\n this.edited.set(structuredClone(entry));\r\n }\r\n\r\n public closePartDefinition(): void {\r\n this.editedIndex.set(-1);\r\n this.edited.set(undefined);\r\n }\r\n\r\n public savePartDefinition(entry: PartDefinition): void {\r\n const entries = [...this.partDefinitions.value];\r\n if (this.editedIndex() === -1) {\r\n entries.push(entry);\r\n } else {\r\n entries.splice(this.editedIndex(), 1, entry);\r\n }\r\n this.partDefinitions.setValue(entries);\r\n this.partDefinitions.markAsDirty();\r\n this.partDefinitions.updateValueAndValidity();\r\n\r\n this.updatePartDefinitionSortKeys();\r\n this.closePartDefinition();\r\n }\r\n\r\n public deletePartDefinition(index: number): void {\r\n const definition = this.partDefinitions.value[index];\r\n this._dialogService\r\n .confirm('Confirmation', `Delete part \"${definition.name}\"?`)\r\n .subscribe((yes: boolean | undefined) => {\r\n if (yes) {\r\n if (this.editedIndex() === index) {\r\n this.closePartDefinition();\r\n }\r\n const definitions = [...this.partDefinitions.value];\r\n definitions.splice(index, 1);\r\n this.partDefinitions.setValue(definitions);\r\n this.partDefinitions.markAsDirty();\r\n this.partDefinitions.updateValueAndValidity();\r\n this.updatePartDefinitionSortKeys();\r\n }\r\n });\r\n }\r\n\r\n public movePartDefinitionUp(index: number): void {\r\n if (index < 1) {\r\n return;\r\n }\r\n const definition = this.partDefinitions.value[index];\r\n const definitions = [...this.partDefinitions.value];\r\n definitions.splice(index, 1);\r\n definitions.splice(index - 1, 0, definition);\r\n this.partDefinitions.setValue(definitions);\r\n this.partDefinitions.markAsDirty();\r\n this.partDefinitions.updateValueAndValidity();\r\n // keep editedIndex in sync\r\n if (this.editedIndex() === index) {\r\n this.editedIndex.set(index - 1);\r\n } else if (this.editedIndex() === index - 1) {\r\n this.editedIndex.set(index);\r\n }\r\n this.updatePartDefinitionSortKeys();\r\n }\r\n\r\n public movePartDefinitionDown(index: number): void {\r\n if (index + 1 >= this.partDefinitions.value.length) {\r\n return;\r\n }\r\n const definition = this.partDefinitions.value[index];\r\n const definitions = [...this.partDefinitions.value];\r\n definitions.splice(index, 1);\r\n definitions.splice(index + 1, 0, definition);\r\n this.partDefinitions.setValue(definitions);\r\n this.partDefinitions.markAsDirty();\r\n this.partDefinitions.updateValueAndValidity();\r\n // keep editedIndex in sync\r\n if (this.editedIndex() === index) {\r\n this.editedIndex.set(index + 1);\r\n } else if (this.editedIndex() === index + 1) {\r\n this.editedIndex.set(index);\r\n }\r\n this.updatePartDefinitionSortKeys();\r\n }\r\n //#endregion\r\n\r\n public onColorPick(value: string): void {\r\n // native color input returns \"#rrggbb\" — strip the leading \"#\"\r\n this.colorKey.setValue(value.slice(1));\r\n this.colorKey.markAsDirty();\r\n }\r\n\r\n public cancel(): void {\r\n this.cancelEdit.emit();\r\n }\r\n\r\n /**\r\n * Saves the current form data by updating the `definition` model signal.\r\n * This method can be called manually (e.g., by a Save button) or\r\n * automatically (via auto-save).\r\n * @param pristine If true (default), the form is marked as pristine\r\n * after saving.\r\n * Set to false for auto-save if you want the form to remain dirty.\r\n */\r\n public save(pristine = true): void {\r\n if (this.form.invalid) {\r\n // show validation errors\r\n this.form.markAllAsTouched();\r\n return;\r\n }\r\n\r\n const data = this.getDefinition();\r\n this.definition.set(data);\r\n\r\n if (pristine) {\r\n this.form.markAsPristine();\r\n }\r\n }\r\n}\r\n","<form [formGroup]=\"form\" (submit)=\"save()\">\r\n <mat-tab-group>\r\n <!-- GENERAL -->\r\n <mat-tab label=\"general\">\r\n <div class=\"form-row\">\r\n <!-- id -->\r\n <mat-form-field>\r\n <mat-label>ID</mat-label>\r\n <input matInput [formControl]=\"id\" />\r\n @if ($any(id).errors?.required && (id.dirty || id.touched)) {\r\n <mat-error>ID required</mat-error>\r\n }\r\n @if ($any(id).errors?.maxLength && (id.dirty || id.touched)) {\r\n <mat-error>ID too long</mat-error>\r\n }\r\n </mat-form-field>\r\n\r\n <!-- label -->\r\n <mat-form-field>\r\n <mat-label>label</mat-label>\r\n <input matInput [formControl]=\"label\" />\r\n @if ($any(label).errors?.required && (label.dirty || label.touched)) {\r\n <mat-error>label required</mat-error>\r\n }\r\n @if (\r\n $any(label).errors?.maxLength && (label.dirty || label.touched)\r\n ) {\r\n <mat-error>label too long</mat-error>\r\n }\r\n </mat-form-field>\r\n\r\n <!-- color -->\r\n <mat-form-field class=\"color-input\">\r\n <mat-label>color</mat-label>\r\n <input matInput [formControl]=\"colorKey\" />\r\n @if (\r\n $any(colorKey).errors?.pattern &&\r\n (colorKey.dirty || colorKey.touched)\r\n ) {\r\n <mat-error>invalid color key</mat-error>\r\n }\r\n <input\r\n type=\"color\"\r\n class=\"color-picker-input\"\r\n #colorPicker\r\n [value]=\"\r\n colorKey.value.length === 6 ? '#' + colorKey.value : '#000000'\r\n \"\r\n (input)=\"onColorPick(colorPicker.value)\"\r\n />\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matSuffix\r\n matTooltip=\"Pick color\"\r\n (click)=\"colorPicker.click()\"\r\n >\r\n <mat-icon>palette</mat-icon>\r\n </button>\r\n </mat-form-field>\r\n <div class=\"color-sample\" [style.--swatch-color]=\"'#' + colorKey.value\"></div>\r\n </div>\r\n\r\n <!-- description -->\r\n <div>\r\n <mat-form-field class=\"long-text\">\r\n <mat-label>description</mat-label>\r\n <textarea matInput [formControl]=\"description\" rows=\"2\"></textarea>\r\n @if (\r\n $any(description).errors?.maxLength &&\r\n (description.dirty || description.touched)\r\n ) {\r\n <mat-error>description too long</mat-error>\r\n }\r\n </mat-form-field>\r\n </div>\r\n </mat-tab>\r\n\r\n <!-- PARTS -->\r\n <mat-tab label=\"parts\">\r\n <div>\r\n <button\r\n type=\"button\"\r\n mat-flat-button\r\n color=\"primary\"\r\n (click)=\"addPartDefinition()\"\r\n >\r\n <mat-icon>add_circle</mat-icon> part\r\n </button>\r\n </div>\r\n @if (partDefinitions.value.length) {\r\n <table>\r\n <thead>\r\n <tr>\r\n <th></th>\r\n <th>required</th>\r\n <th>type ID</th>\r\n <th>role ID</th>\r\n <th>name</th>\r\n <th>group</th>\r\n <th>color</th>\r\n <th>description</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n @for (\r\n entry of partDefinitions.value;\r\n track entry;\r\n let i = $index;\r\n let first = $first;\r\n let last = $last\r\n ) {\r\n <tr [class.selected]=\"i === editedIndex()\">\r\n <td class=\"fit-width\">\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n color=\"primary\"\r\n matTooltip=\"Edit this part definition\"\r\n (click)=\"editPartDefinition(entry, i)\"\r\n >\r\n <mat-icon class=\"mat-primary\">edit</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Move this part definition up\"\r\n [disabled]=\"first\"\r\n (click)=\"movePartDefinitionUp(i)\"\r\n >\r\n <mat-icon>arrow_upward</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Move this part definition down\"\r\n [disabled]=\"last\"\r\n (click)=\"movePartDefinitionDown(i)\"\r\n >\r\n <mat-icon>arrow_downward</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n color=\"warn\"\r\n matTooltip=\"Delete this part definition\"\r\n (click)=\"deletePartDefinition(i)\"\r\n >\r\n <mat-icon class=\"mat-warn\">remove_circle</mat-icon>\r\n </button>\r\n </td>\r\n <td class=\"fit-width\">\r\n <mat-checkbox\r\n [checked]=\"entry.isRequired\"\r\n disabled\r\n ></mat-checkbox>\r\n </td>\r\n <td>{{ entry.typeId }}</td>\r\n <td>{{ entry.roleId }}</td>\r\n <td>{{ entry.name }}</td>\r\n <td>{{ entry.groupKey }}</td>\r\n <td>\r\n <span\r\n class=\"color-swatch\"\r\n [style.background-color]=\"'#' + entry.colorKey\"\r\n [style.color]=\"('#' + entry.colorKey) | colorToContrast\"\r\n >\r\n {{ entry.colorKey }}\r\n </span>\r\n </td>\r\n <td>{{ entry.description | ellipsis: 50 }}</td>\r\n </tr>\r\n }\r\n </tbody>\r\n </table>\r\n }\r\n @if (edited()) {\r\n <fieldset>\r\n <mat-expansion-panel [expanded]=\"edited()\" [disabled]=\"!edited()\">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>Part #{{ editedIndex() + 1 }}</mat-panel-title>\r\n </mat-expansion-panel-header>\r\n <cadmus-part-definition-editor\r\n [facetModelSettings]=\"facetModelSettings()\"\r\n [hideSortKey]=\"true\"\r\n [definition]=\"edited()\"\r\n (definitionChange)=\"savePartDefinition($event!)\"\r\n (cancelEdit)=\"closePartDefinition()\"\r\n />\r\n </mat-expansion-panel>\r\n </fieldset>\r\n }\r\n </mat-tab>\r\n </mat-tab-group>\r\n\r\n <!-- buttons -->\r\n <div>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Discard changes\"\r\n (click)=\"cancel()\"\r\n >\r\n <mat-icon class=\"mat-warn\">clear</mat-icon>\r\n </button>\r\n <button\r\n type=\"submit\"\r\n mat-icon-button\r\n matTooltip=\"Accept changes\"\r\n [disabled]=\"form.invalid || form.pristine\"\r\n >\r\n <mat-icon class=\"mat-primary\">check_circle</mat-icon>\r\n </button>\r\n </div>\r\n</form>\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n OnInit,\r\n output,\r\n signal,\r\n} from '@angular/core';\r\nimport { from, of } from 'rxjs';\r\nimport { catchError, concatMap, map, take, tap, toArray } from 'rxjs/operators';\r\n\r\n// material\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatSnackBar } from '@angular/material/snack-bar';\r\nimport { MatIcon } from '@angular/material/icon';\r\nimport { MatTooltip } from '@angular/material/tooltip';\r\nimport {\r\n MatExpansionPanel,\r\n MatExpansionPanelHeader,\r\n MatExpansionPanelTitle,\r\n MatExpansionPanelDescription,\r\n} from '@angular/material/expansion';\r\nimport { MatProgressBar } from '@angular/material/progress-bar';\r\n\r\nimport { DialogService } from '@myrmidon/ngx-mat-tools';\r\nimport {\r\n ColorToContrastPipe,\r\n EllipsisPipe,\r\n StringToColorPipe,\r\n} from '@myrmidon/ngx-tools';\r\n\r\nimport { FacetDefinition } from '@myrmidon/cadmus-core';\r\nimport { FacetModelSettings, FacetService } from '@myrmidon/cadmus-api';\r\n\r\nimport {\r\n FacetDefinitionValidatorService,\r\n FacetValidationResult,\r\n} from '../../services/facet-definition-validator.service';\r\nimport { FacetDefinitionEditorComponent } from '../facet-definition-editor/facet-definition-editor.component';\r\n\r\n/**\r\n * Editor for a list of facet definitions. Cadmus facet definitions represent the data\r\n * types of items, and define all the parts which can be included in an item. Some of\r\n * them are required, others are optional. There can be multiple parts of the same type\r\n * in the same item, provided that their roleId is different.\r\n * This editor is used to edit the list of facet definitions from the current profile.\r\n * As the top level editor, it loads and saves the facet definitions list via API\r\n * services, and allows to add, edit, delete and reorder facet definitions.\r\n * The actual editing of a facet definition is delegated to descendant dumb components.\r\n * All edits happen in memory until the user clicks the Save button, which saves all\r\n * facet definitions to the server, and shows the result of the operation.\r\n */\r\n@Component({\r\n selector: 'cadmus-facet-definition-list-editor',\r\n imports: [\r\n MatButtonModule,\r\n MatExpansionPanel,\r\n MatExpansionPanelDescription,\r\n MatExpansionPanelHeader,\r\n MatExpansionPanelTitle,\r\n MatIcon,\r\n MatTooltip,\r\n MatProgressBar,\r\n ColorToContrastPipe,\r\n EllipsisPipe,\r\n StringToColorPipe,\r\n FacetDefinitionEditorComponent,\r\n ],\r\n templateUrl: './facet-definition-list-editor.component.html',\r\n styleUrl: './facet-definition-list-editor.component.css',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class FacetDefinitionListEditorComponent implements OnInit {\r\n public readonly edited = signal<FacetDefinition | undefined>(undefined);\r\n public readonly editedIndex = signal<number>(-1);\r\n public readonly dirty = signal<boolean>(false);\r\n public readonly facets = signal<FacetDefinition[]>([]);\r\n public readonly busy = signal<boolean>(false);\r\n public readonly saveResult = signal<string | undefined>(undefined);\r\n /** True after at least one facet was successfully saved; prompts an app reload. */\r\n public readonly reloadNeeded = signal<boolean>(false);\r\n /** Last validation result, set by validate() and by save(). */\r\n public readonly validationResult = signal<FacetValidationResult | undefined>(\r\n undefined,\r\n );\r\n\r\n /**\r\n * The facet models settings, used to get the list of available part type IDs,\r\n * and whether they are base text parts; in this case, the same settings also\r\n * provide the list of their available role IDs from the fragments property.\r\n */\r\n public readonly facetModelSettings = signal<FacetModelSettings | undefined>(\r\n undefined,\r\n );\r\n\r\n public readonly dirtyChange = output<boolean>();\r\n public readonly editorClose = output<void>();\r\n\r\n constructor(\r\n private _dialogService: DialogService,\r\n private _facetService: FacetService,\r\n private _validator: FacetDefinitionValidatorService,\r\n private _snackbar: MatSnackBar,\r\n ) {}\r\n\r\n public ngOnInit(): void {\r\n // load facets once at start\r\n this.busy.set(true);\r\n this._facetService.getFacets().subscribe({\r\n next: (facets) => {\r\n this.facets.set(facets);\r\n this.busy.set(false);\r\n },\r\n error: (error) => {\r\n console.error(error);\r\n this.busy.set(false);\r\n this._snackbar.open('Error loading facets', 'Close');\r\n },\r\n });\r\n\r\n // load facet model settings once at start\r\n this._facetService.getFacetModelSettings().subscribe({\r\n next: (settings) => {\r\n this.facetModelSettings.set(settings);\r\n },\r\n error: (error) => {\r\n console.error(error);\r\n this._snackbar.open('Error loading facet model settings', 'Close');\r\n },\r\n });\r\n }\r\n\r\n public addFacet(): void {\r\n const entry: FacetDefinition = {\r\n id: 'new',\r\n label: 'New facet',\r\n colorKey: 'default',\r\n description: '',\r\n partDefinitions: [],\r\n };\r\n this.editedIndex.set(-1);\r\n this.edited.set(entry);\r\n }\r\n\r\n public editFacet(facet: FacetDefinition, index: number): void {\r\n this.editedIndex.set(index);\r\n this.edited.set(structuredClone(facet));\r\n }\r\n\r\n public closeFacet(): void {\r\n this.editedIndex.set(-1);\r\n this.edited.set(undefined);\r\n }\r\n\r\n public saveFacet(facet: FacetDefinition): void {\r\n const entries = [...this.facets()];\r\n if (this.editedIndex() === -1) {\r\n entries.push(facet);\r\n } else {\r\n entries.splice(this.editedIndex(), 1, facet);\r\n }\r\n this.facets.set(entries);\r\n this.closeFacet();\r\n this.dirty.set(true);\r\n this.dirtyChange.emit(true);\r\n }\r\n\r\n public deleteFacet(index: number): void {\r\n this._dialogService\r\n .confirm('Confirmation', `Delete facet ${this.edited()?.label}?`)\r\n .subscribe((yes: boolean | undefined) => {\r\n if (yes) {\r\n if (this.editedIndex() === index) {\r\n this.closeFacet();\r\n }\r\n const entries = [...this.facets()];\r\n entries.splice(index, 1);\r\n this.facets.set(entries);\r\n this.dirty.set(true);\r\n this.dirtyChange.emit(true);\r\n }\r\n });\r\n }\r\n\r\n public moveFacetUp(index: number): void {\r\n if (index < 1) {\r\n return;\r\n }\r\n const facet = this.facets()[index];\r\n const facets = [...this.facets()];\r\n facets.splice(index, 1);\r\n facets.splice(index - 1, 0, facet);\r\n this.facets.set(facets);\r\n this.dirty.set(true);\r\n this.dirtyChange.emit(true);\r\n // keep editedIndex in sync\r\n if (this.editedIndex() === index) {\r\n this.editedIndex.set(index - 1);\r\n } else if (this.editedIndex() === index - 1) {\r\n this.editedIndex.set(index);\r\n }\r\n }\r\n\r\n public moveFacetDown(index: number): void {\r\n if (index + 1 >= this.facets().length) {\r\n return;\r\n }\r\n const facet = this.facets()[index];\r\n const facets = [...this.facets()];\r\n facets.splice(index, 1);\r\n facets.splice(index + 1, 0, facet);\r\n this.facets.set(facets);\r\n this.dirty.set(true);\r\n this.dirtyChange.emit(true);\r\n // keep editedIndex in sync\r\n if (this.editedIndex() === index) {\r\n this.editedIndex.set(index + 1);\r\n } else if (this.editedIndex() === index + 1) {\r\n this.editedIndex.set(index);\r\n }\r\n }\r\n\r\n public reloadApp(): void {\r\n window.location.href = '/';\r\n }\r\n\r\n public close(): void {\r\n this.editorClose.emit();\r\n }\r\n\r\n /** Run validation and update validationResult; returns the observable. */\r\n private runValidation() {\r\n return this._validator\r\n .validate(this.facets(), this.facetModelSettings())\r\n .pipe(tap((result) => this.validationResult.set(result)));\r\n }\r\n\r\n /** Trigger validation from the template and update the displayed result. */\r\n public validate(): void {\r\n this.runValidation().pipe(take(1)).subscribe();\r\n }\r\n\r\n /** Persist all facets to the server; called only after all gates pass. */\r\n private doSave(): void {\r\n const facets = this.facets();\r\n this.busy.set(true);\r\n this.saveResult.set(undefined);\r\n\r\n from(facets)\r\n .pipe(\r\n concatMap((facet) =>\r\n this._facetService.addFacet(facet).pipe(\r\n map(() => true),\r\n catchError(() => of(false)),\r\n ),\r\n ),\r\n toArray(),\r\n )\r\n .subscribe((results) => {\r\n const saved: string[] = [];\r\n const failed: string[] = [];\r\n results.forEach((ok, i) => {\r\n if (ok) {\r\n saved.push(facets[i].id);\r\n } else {\r\n failed.push(facets[i].id);\r\n }\r\n });\r\n this.busy.set(false);\r\n this.dirty.set(failed.length > 0);\r\n this.dirtyChange.emit(failed.length > 0);\r\n if (saved.length > 0) {\r\n this.reloadNeeded.set(true);\r\n }\r\n const parts: string[] = [];\r\n if (saved.length) {\r\n parts.push(`Saved: ${saved.join(', ')}`);\r\n }\r\n if (failed.length) {\r\n parts.push(`Failed: ${failed.join(', ')}`);\r\n }\r\n this.saveResult.set(parts.join(' | '));\r\n });\r\n }\r\n\r\n /**\r\n * Final confirmation gate before the actual write.\r\n * Always shown, even when there are no warnings or errors.\r\n */\r\n private confirmAndSave(): void {\r\n this._dialogService\r\n .confirm(\r\n 'Save facets',\r\n 'Saving replaces ALL facet definitions on the server. ' +\r\n 'This may affect every item in the database. Proceed?',\r\n )\r\n .subscribe((ok) => {\r\n if (ok) {\r\n this.doSave();\r\n }\r\n });\r\n }\r\n\r\n public downloadFacets(): void {\r\n const replacer = (_key: string, value: unknown) =>\r\n value === null || value === false ? undefined : value;\r\n const dataStr =\r\n 'data:text/json;charset=utf-8,' +\r\n encodeURIComponent(JSON.stringify(this.facets(), replacer, 2));\r\n const dlAnchorElem = document.createElement('a');\r\n dlAnchorElem.setAttribute('href', dataStr);\r\n dlAnchorElem.setAttribute('download', 'facets.json');\r\n dlAnchorElem.click();\r\n }\r\n\r\n /**\r\n * Validate the current facets, then — if there are no blocking errors —\r\n * walk the user through confirmation gates before saving.\r\n *\r\n * Gates (in order):\r\n * 1. Validation errors → block save, show results.\r\n * 2. Validation warnings → ask user to confirm before continuing.\r\n * 3. Final critical-operation confirmation → always shown.\r\n */\r\n public save(): void {\r\n if (!this.facets().length) {\r\n return;\r\n }\r\n\r\n this.runValidation()\r\n .pipe(take(1))\r\n .subscribe((result) => {\r\n if (result.hasErrors) {\r\n // validation result is already displayed; nothing more to do\r\n return;\r\n }\r\n\r\n if (result.hasWarnings) {\r\n const warnCount = result.issues.filter(\r\n (i) => i.severity === 'warning',\r\n ).length;\r\n this._dialogService\r\n .confirm(\r\n 'Warnings',\r\n `There ${warnCount === 1 ? 'is 1 warning' : `are ${warnCount} warnings`}. ` +\r\n 'Review the validation results below. Proceed anyway?',\r\n )\r\n .subscribe((ok) => {\r\n if (ok) {\r\n this.confirmAndSave();\r\n }\r\n });\r\n } else {\r\n this.confirmAndSave();\r\n }\r\n });\r\n }\r\n}\r\n","<div>\r\n <div class=\"form-row\">\r\n <button type=\"button\" mat-flat-button color=\"primary\" (click)=\"addFacet()\">\r\n <mat-icon>add_circle</mat-icon> facet\r\n </button>\r\n <button type=\"button\" mat-flat-button (click)=\"validate()\">\r\n <mat-icon>fact_check</mat-icon> validate\r\n </button>\r\n <button type=\"button\" mat-flat-button (click)=\"downloadFacets()\">\r\n <mat-icon>download</mat-icon> download\r\n </button>\r\n <button type=\"button\" mat-flat-button color=\"warn\" (click)=\"save()\">\r\n <mat-icon>save</mat-icon> save\r\n </button>\r\n </div>\r\n <div>\r\n @if (busy()) {\r\n <mat-progress-bar mode=\"indeterminate\" color=\"accent\" />\r\n }\r\n </div>\r\n @if (validationResult(); as vr) {\r\n <mat-expansion-panel [expanded]=\"true\">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>Validation result</mat-panel-title>\r\n <mat-panel-description>\r\n {{ vr.issues.length }} issue{{ vr.issues.length !== 1 ? \"s\" : \"\" }}\r\n </mat-panel-description>\r\n </mat-expansion-panel-header>\r\n <div class=\"validation-result\">\r\n @if (!vr.issues.length) {\r\n <span>No issues found.</span>\r\n } @else {\r\n <div class=\"validation-issues\">\r\n @for (issue of vr.issues; track $index) {\r\n <div class=\"validation-issue {{ issue.severity }}\">\r\n <mat-icon>{{\r\n issue.severity === \"error\"\r\n ? \"error\"\r\n : issue.severity === \"warning\"\r\n ? \"warning\"\r\n : \"info\"\r\n }}</mat-icon>\r\n <span>{{ issue.message }}</span>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </mat-expansion-panel>\r\n }\r\n @if (reloadNeeded()) {\r\n <div class=\"reload-notice\">\r\n <mat-icon>info</mat-icon>\r\n <span\r\n >Facet definitions are cached at startup. Please reload the app to apply\r\n the changes.</span\r\n >\r\n <button\r\n type=\"button\"\r\n mat-flat-button\r\n color=\"primary\"\r\n (click)=\"reloadApp()\"\r\n >\r\n <mat-icon>refresh</mat-icon>\r\n reload app\r\n </button>\r\n </div>\r\n }\r\n @if (facets().length) {\r\n <table class=\"margin-top\">\r\n <thead>\r\n <tr>\r\n <th></th>\r\n <th>ID</th>\r\n <th>label</th>\r\n <th>color</th>\r\n <th>parts</th>\r\n <th>description</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n @for (\r\n entry of facets();\r\n track entry;\r\n let i = $index;\r\n let first = $first;\r\n let last = $last\r\n ) {\r\n <tr [class.selected]=\"i === editedIndex()\">\r\n <td class=\"fit-width\">\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n color=\"primary\"\r\n matTooltip=\"Edit this facet\"\r\n (click)=\"editFacet(entry, i)\"\r\n >\r\n <mat-icon class=\"mat-primary\">edit</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Move this facet up\"\r\n [disabled]=\"first\"\r\n (click)=\"moveFacetUp(i)\"\r\n >\r\n <mat-icon>arrow_upward</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Move this facet down\"\r\n [disabled]=\"last\"\r\n (click)=\"moveFacetDown(i)\"\r\n >\r\n <mat-icon>arrow_downward</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n color=\"warn\"\r\n matTooltip=\"Delete this facet\"\r\n (click)=\"deleteFacet(i)\"\r\n >\r\n <mat-icon class=\"mat-warn\">remove_circle</mat-icon>\r\n </button>\r\n </td>\r\n <td>{{ entry.id }}</td>\r\n <td>{{ entry.label }}</td>\r\n <td>\r\n <span\r\n class=\"color-swatch\"\r\n [style.background-color]=\"'#' + entry.colorKey\"\r\n [style.color]=\"('#' + entry.colorKey) | colorToContrast\"\r\n >\r\n {{ entry.colorKey }}\r\n </span>\r\n </td>\r\n <td>{{ entry.partDefinitions.length }}</td>\r\n <td>{{ entry.description | ellipsis: 50 }}</td>\r\n </tr>\r\n }\r\n </tbody>\r\n </table>\r\n }\r\n @if (edited()) {\r\n <fieldset>\r\n <mat-expansion-panel [expanded]=\"edited()\" [disabled]=\"!edited()\">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>Facet #{{ editedIndex() + 1 }}</mat-panel-title>\r\n </mat-expansion-panel-header>\r\n <cadmus-facet-definition-editor\r\n [facetModelSettings]=\"facetModelSettings()\"\r\n [definition]=\"edited()\"\r\n (definitionChange)=\"saveFacet($event!)\"\r\n (cancelEdit)=\"closeFacet()\"\r\n />\r\n </mat-expansion-panel>\r\n </fieldset>\r\n }\r\n</div>\r\n","import { ChangeDetectionStrategy, Component, signal } from '@angular/core';\n\nimport {\n MatCard,\n MatCardContent,\n MatCardHeader,\n MatCardTitle,\n} from '@angular/material/card';\nimport { MatIcon } from '@angular/material/icon';\n\nimport { ComponentCanDeactivate } from '@myrmidon/cadmus-core';\n\nimport { FacetDefinitionListEditorComponent } from '../facet-definition-list-editor/facet-definition-list-editor.component';\n\n@Component({\n selector: 'cadmus-facet-edit-page',\n imports: [\n MatCard,\n MatCardContent,\n MatCardHeader,\n MatCardTitle,\n MatIcon,\n FacetDefinitionListEditorComponent,\n ],\n templateUrl: './facet-edit-page.component.html',\n styleUrl: './facet-edit-page.component.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FacetEditPageComponent implements ComponentCanDeactivate {\n private readonly _dirty = signal<boolean>(false);\n\n public canDeactivate(): boolean {\n return !this._dirty();\n }\n\n public onDirtyChange(dirty: boolean): void {\n this._dirty.set(dirty);\n }\n}\n","<mat-card>\r\n <mat-card-header>\r\n <mat-icon mat-card-avatar>dashboard</mat-icon>\r\n <mat-card-title>Edit Facets</mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <div class=\"margin-top\">\r\n <cadmus-facet-definition-list-editor (dirtyChange)=\"onDirtyChange($event)\" />\r\n </div>\r\n </mat-card-content>\r\n</mat-card>\r\n","import { Routes } from '@angular/router';\n\nimport { pendingChangesGuard } from '@myrmidon/cadmus-core';\n\nimport { FacetEditPageComponent } from './components/facet-edit-page/facet-edit-page.component';\n\nexport const CADMUS_PROFILE_EDIT_ROUTES: Routes = [\n {\n path: 'facets',\n pathMatch: 'full',\n component: FacetEditPageComponent,\n canDeactivate: [pendingChangesGuard],\n },\n];\n","/*\r\n * Public API Surface of cadmus-profile-editor\r\n */\r\n\r\nexport * from './lib/services/facet-definition-validator.service';\r\nexport * from './lib/components/facet-definition-editor/facet-definition-editor.component';\r\nexport * from './lib/components/facet-definition-list-editor/facet-definition-list-editor.component';\r\nexport * from './lib/components/part-definition-editor/part-definition-editor.component';\r\nexport * from './lib/components/facet-edit-page/facet-edit-page.component';\r\nexport * from './lib/cadmus-profile-edit.routes';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","MatError","MatFormField","MatLabel","i2","i3.FacetDefinitionValidatorService"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAsBA;;;;;;;;;;;;;;;;;;;AAmBG;MAEU,+BAA+B,CAAA;AACtB,IAAA,iBAAA;AAApB,IAAA,WAAA,CAAoB,iBAAmC,EAAA;QAAnC,IAAA,CAAA,iBAAiB,GAAjB,iBAAiB;IAAqB;AAElD,IAAA,WAAW,CAAC,MAA8B,EAAA;QAChD,OAAO;YACL,MAAM;AACN,YAAA,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,QAAQ,KAAK,OAAO,CAAC;AACrD,YAAA,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,QAAQ,KAAK,SAAS,CAAC;AACzD,YAAA,QAAQ,EAAE,MAAM,CAAC,IAAI,CA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.0.1",
|
|
4
|
+
"description": "Cadmus - profile editor components.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"Cadmus"
|
|
7
|
+
],
|
|
8
|
+
"homepage": "https://github.com/vedph/cadmus-shell-v3",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/vedph/cadmus-shell-v3"
|
|
12
|
+
},
|
|
13
|
+
"author": {
|
|
14
|
+
"name": "Daniele Fusi"
|
|
15
|
+
},
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"@angular/common": "^21.2.0",
|
|
18
|
+
"@angular/core": "^21.2.0"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"tslib": "^2.3.0"
|
|
22
|
+
},
|
|
23
|
+
"sideEffects": false,
|
|
24
|
+
"module": "fesm2022/myrmidon-cadmus-profile-editor.mjs",
|
|
25
|
+
"typings": "types/myrmidon-cadmus-profile-editor.d.ts",
|
|
26
|
+
"exports": {
|
|
27
|
+
"./package.json": {
|
|
28
|
+
"default": "./package.json"
|
|
29
|
+
},
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./types/myrmidon-cadmus-profile-editor.d.ts",
|
|
32
|
+
"default": "./fesm2022/myrmidon-cadmus-profile-editor.mjs"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { FacetDefinition, PartDefinition, ComponentCanDeactivate } from '@myrmidon/cadmus-core';
|
|
3
|
+
import { ThesaurusService, FacetModelSettings, FacetService } from '@myrmidon/cadmus-api';
|
|
4
|
+
import * as _angular_core from '@angular/core';
|
|
5
|
+
import { OnInit, Signal } from '@angular/core';
|
|
6
|
+
import { FormControl, FormGroup, FormBuilder } from '@angular/forms';
|
|
7
|
+
import { DialogService } from '@myrmidon/ngx-mat-tools';
|
|
8
|
+
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
9
|
+
import { Routes } from '@angular/router';
|
|
10
|
+
|
|
11
|
+
/** A single validation issue produced by {@link FacetDefinitionValidatorService}. */
|
|
12
|
+
interface FacetValidationIssue {
|
|
13
|
+
severity: 'error' | 'warning' | 'info';
|
|
14
|
+
/** Human-readable description of the issue. */
|
|
15
|
+
message: string;
|
|
16
|
+
}
|
|
17
|
+
/** The result returned by {@link FacetDefinitionValidatorService.validate}. */
|
|
18
|
+
interface FacetValidationResult {
|
|
19
|
+
issues: FacetValidationIssue[];
|
|
20
|
+
hasErrors: boolean;
|
|
21
|
+
hasWarnings: boolean;
|
|
22
|
+
hasInfos: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Validates a list of {@link FacetDefinition} objects before they are persisted.
|
|
26
|
+
*
|
|
27
|
+
* Rules:
|
|
28
|
+
* - duplicate facet ID → error
|
|
29
|
+
* - facet ID still set to "new" → warning (unfilled placeholder)
|
|
30
|
+
* - duplicate facet label → error
|
|
31
|
+
* - duplicate facet color → info
|
|
32
|
+
* - duplicate facet description → info
|
|
33
|
+
* - facet with no part definitions → error
|
|
34
|
+
* - within a facet: two parts with same typeId AND same roleId
|
|
35
|
+
* (including both empty/null) → error
|
|
36
|
+
* (one with a roleId and one without is valid: they serve different roles)
|
|
37
|
+
* - within a facet: duplicate part color → info
|
|
38
|
+
* - within a facet: duplicate part description → info
|
|
39
|
+
* - (when facetModelSettings is provided) for each part/fragment entry in the
|
|
40
|
+
* settings, each thesaurus ID listed in thesauriIds is checked against the
|
|
41
|
+
* existing thesauri: missing required thesauri (prefixed with "*") → error;
|
|
42
|
+
* missing optional thesauri → info.
|
|
43
|
+
*/
|
|
44
|
+
declare class FacetDefinitionValidatorService {
|
|
45
|
+
private _thesaurusService;
|
|
46
|
+
constructor(_thesaurusService: ThesaurusService);
|
|
47
|
+
private buildResult;
|
|
48
|
+
private checkThesauri;
|
|
49
|
+
/**
|
|
50
|
+
* Validate the given list of facet definitions and return a result
|
|
51
|
+
* containing all issues found.
|
|
52
|
+
* @param facets The list of facet definitions to validate.
|
|
53
|
+
* @param facetModelSettings Optional settings; when provided the thesauri
|
|
54
|
+
* referenced by each part/fragment are checked against the server.
|
|
55
|
+
*/
|
|
56
|
+
validate(facets: FacetDefinition[], facetModelSettings?: FacetModelSettings): Observable<FacetValidationResult>;
|
|
57
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<FacetDefinitionValidatorService, never>;
|
|
58
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<FacetDefinitionValidatorService>;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Editor for a single facet definition and its part definitions.
|
|
63
|
+
* This editor is used as a descendant of the facet definition list editor, and allows
|
|
64
|
+
* to edit a single facet definition and its part definitions.
|
|
65
|
+
*/
|
|
66
|
+
declare class FacetDefinitionEditorComponent {
|
|
67
|
+
private _dialogService;
|
|
68
|
+
/**
|
|
69
|
+
* The facet definition to edit.
|
|
70
|
+
*/
|
|
71
|
+
readonly definition: _angular_core.ModelSignal<FacetDefinition | undefined>;
|
|
72
|
+
/**
|
|
73
|
+
* The facet models settings, used to get the list of available part type IDs,
|
|
74
|
+
* and whether they are base text parts; in this case, the same settings also
|
|
75
|
+
* provide the list of their available role IDs from the fragments property.
|
|
76
|
+
*/
|
|
77
|
+
readonly facetModelSettings: _angular_core.InputSignal<FacetModelSettings | undefined>;
|
|
78
|
+
/**
|
|
79
|
+
* The list of available part type IDs, taken from the facet model settings.
|
|
80
|
+
* If the facet model settings are not provided, or do not contain any part
|
|
81
|
+
* definition, this list is empty and the type ID must be entered freely.
|
|
82
|
+
*/
|
|
83
|
+
readonly availablePartTypeIds: _angular_core.Signal<string[]>;
|
|
84
|
+
/**
|
|
85
|
+
* Emitted when user requests to cancel the edit and close this editor.
|
|
86
|
+
*/
|
|
87
|
+
readonly cancelEdit: _angular_core.OutputEmitterRef<void>;
|
|
88
|
+
readonly edited: _angular_core.WritableSignal<PartDefinition | undefined>;
|
|
89
|
+
readonly editedIndex: _angular_core.WritableSignal<number>;
|
|
90
|
+
id: FormControl<string>;
|
|
91
|
+
label: FormControl<string>;
|
|
92
|
+
colorKey: FormControl<string>;
|
|
93
|
+
description: FormControl<string>;
|
|
94
|
+
partDefinitions: FormControl<PartDefinition[]>;
|
|
95
|
+
form: FormGroup;
|
|
96
|
+
constructor(formBuilder: FormBuilder, _dialogService: DialogService);
|
|
97
|
+
private updateForm;
|
|
98
|
+
private getDefinition;
|
|
99
|
+
private updatePartDefinitionSortKeys;
|
|
100
|
+
addPartDefinition(): void;
|
|
101
|
+
editPartDefinition(entry: PartDefinition, index: number): void;
|
|
102
|
+
closePartDefinition(): void;
|
|
103
|
+
savePartDefinition(entry: PartDefinition): void;
|
|
104
|
+
deletePartDefinition(index: number): void;
|
|
105
|
+
movePartDefinitionUp(index: number): void;
|
|
106
|
+
movePartDefinitionDown(index: number): void;
|
|
107
|
+
onColorPick(value: string): void;
|
|
108
|
+
cancel(): void;
|
|
109
|
+
/**
|
|
110
|
+
* Saves the current form data by updating the `definition` model signal.
|
|
111
|
+
* This method can be called manually (e.g., by a Save button) or
|
|
112
|
+
* automatically (via auto-save).
|
|
113
|
+
* @param pristine If true (default), the form is marked as pristine
|
|
114
|
+
* after saving.
|
|
115
|
+
* Set to false for auto-save if you want the form to remain dirty.
|
|
116
|
+
*/
|
|
117
|
+
save(pristine?: boolean): void;
|
|
118
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<FacetDefinitionEditorComponent, never>;
|
|
119
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<FacetDefinitionEditorComponent, "cadmus-facet-definition-editor", never, { "definition": { "alias": "definition"; "required": false; "isSignal": true; }; "facetModelSettings": { "alias": "facetModelSettings"; "required": false; "isSignal": true; }; }, { "definition": "definitionChange"; "cancelEdit": "cancelEdit"; }, never, never, true, never>;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Editor for a list of facet definitions. Cadmus facet definitions represent the data
|
|
124
|
+
* types of items, and define all the parts which can be included in an item. Some of
|
|
125
|
+
* them are required, others are optional. There can be multiple parts of the same type
|
|
126
|
+
* in the same item, provided that their roleId is different.
|
|
127
|
+
* This editor is used to edit the list of facet definitions from the current profile.
|
|
128
|
+
* As the top level editor, it loads and saves the facet definitions list via API
|
|
129
|
+
* services, and allows to add, edit, delete and reorder facet definitions.
|
|
130
|
+
* The actual editing of a facet definition is delegated to descendant dumb components.
|
|
131
|
+
* All edits happen in memory until the user clicks the Save button, which saves all
|
|
132
|
+
* facet definitions to the server, and shows the result of the operation.
|
|
133
|
+
*/
|
|
134
|
+
declare class FacetDefinitionListEditorComponent implements OnInit {
|
|
135
|
+
private _dialogService;
|
|
136
|
+
private _facetService;
|
|
137
|
+
private _validator;
|
|
138
|
+
private _snackbar;
|
|
139
|
+
readonly edited: _angular_core.WritableSignal<FacetDefinition | undefined>;
|
|
140
|
+
readonly editedIndex: _angular_core.WritableSignal<number>;
|
|
141
|
+
readonly dirty: _angular_core.WritableSignal<boolean>;
|
|
142
|
+
readonly facets: _angular_core.WritableSignal<FacetDefinition[]>;
|
|
143
|
+
readonly busy: _angular_core.WritableSignal<boolean>;
|
|
144
|
+
readonly saveResult: _angular_core.WritableSignal<string | undefined>;
|
|
145
|
+
/** True after at least one facet was successfully saved; prompts an app reload. */
|
|
146
|
+
readonly reloadNeeded: _angular_core.WritableSignal<boolean>;
|
|
147
|
+
/** Last validation result, set by validate() and by save(). */
|
|
148
|
+
readonly validationResult: _angular_core.WritableSignal<FacetValidationResult | undefined>;
|
|
149
|
+
/**
|
|
150
|
+
* The facet models settings, used to get the list of available part type IDs,
|
|
151
|
+
* and whether they are base text parts; in this case, the same settings also
|
|
152
|
+
* provide the list of their available role IDs from the fragments property.
|
|
153
|
+
*/
|
|
154
|
+
readonly facetModelSettings: _angular_core.WritableSignal<FacetModelSettings | undefined>;
|
|
155
|
+
readonly dirtyChange: _angular_core.OutputEmitterRef<boolean>;
|
|
156
|
+
readonly editorClose: _angular_core.OutputEmitterRef<void>;
|
|
157
|
+
constructor(_dialogService: DialogService, _facetService: FacetService, _validator: FacetDefinitionValidatorService, _snackbar: MatSnackBar);
|
|
158
|
+
ngOnInit(): void;
|
|
159
|
+
addFacet(): void;
|
|
160
|
+
editFacet(facet: FacetDefinition, index: number): void;
|
|
161
|
+
closeFacet(): void;
|
|
162
|
+
saveFacet(facet: FacetDefinition): void;
|
|
163
|
+
deleteFacet(index: number): void;
|
|
164
|
+
moveFacetUp(index: number): void;
|
|
165
|
+
moveFacetDown(index: number): void;
|
|
166
|
+
reloadApp(): void;
|
|
167
|
+
close(): void;
|
|
168
|
+
/** Run validation and update validationResult; returns the observable. */
|
|
169
|
+
private runValidation;
|
|
170
|
+
/** Trigger validation from the template and update the displayed result. */
|
|
171
|
+
validate(): void;
|
|
172
|
+
/** Persist all facets to the server; called only after all gates pass. */
|
|
173
|
+
private doSave;
|
|
174
|
+
/**
|
|
175
|
+
* Final confirmation gate before the actual write.
|
|
176
|
+
* Always shown, even when there are no warnings or errors.
|
|
177
|
+
*/
|
|
178
|
+
private confirmAndSave;
|
|
179
|
+
downloadFacets(): void;
|
|
180
|
+
/**
|
|
181
|
+
* Validate the current facets, then — if there are no blocking errors —
|
|
182
|
+
* walk the user through confirmation gates before saving.
|
|
183
|
+
*
|
|
184
|
+
* Gates (in order):
|
|
185
|
+
* 1. Validation errors → block save, show results.
|
|
186
|
+
* 2. Validation warnings → ask user to confirm before continuing.
|
|
187
|
+
* 3. Final critical-operation confirmation → always shown.
|
|
188
|
+
*/
|
|
189
|
+
save(): void;
|
|
190
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<FacetDefinitionListEditorComponent, never>;
|
|
191
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<FacetDefinitionListEditorComponent, "cadmus-facet-definition-list-editor", never, {}, { "dirtyChange": "dirtyChange"; "editorClose": "editorClose"; }, never, never, true, never>;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Editor for a single part definition. This allows users to edit the part definition
|
|
196
|
+
* properties: type ID, selected from a list if facet model settings are provided,
|
|
197
|
+
* or entered freely if not (but this should not happen, as at least part definitions
|
|
198
|
+
* should be present and these provide fallback model settings); role ID, selected
|
|
199
|
+
* from a closed list when the part type is a base text part, or entered freely otherwise;
|
|
200
|
+
* name; color; group; sort key; description; and whether the part is required or not
|
|
201
|
+
* in its facet.
|
|
202
|
+
* NOTE: part definition settings are not edited here. They are defined server-side
|
|
203
|
+
* and will later be obsoleted.
|
|
204
|
+
*/
|
|
205
|
+
declare class PartDefinitionEditorComponent {
|
|
206
|
+
/**
|
|
207
|
+
* The part to edit.
|
|
208
|
+
*/
|
|
209
|
+
readonly definition: _angular_core.ModelSignal<PartDefinition | undefined>;
|
|
210
|
+
/**
|
|
211
|
+
* The facet models settings, used to get the list of available part type IDs,
|
|
212
|
+
* and whether they are base text parts; in this case, the same settings also
|
|
213
|
+
* provide the list of their available role IDs from the fragments property.
|
|
214
|
+
*/
|
|
215
|
+
readonly facetModelSettings: _angular_core.InputSignal<FacetModelSettings | undefined>;
|
|
216
|
+
/**
|
|
217
|
+
* The list of available part type IDs, taken from the facet model settings.
|
|
218
|
+
* If the facet model settings are not provided, or do not contain any part
|
|
219
|
+
* definition, this list is empty and the type ID must be entered freely.
|
|
220
|
+
*/
|
|
221
|
+
readonly availablePartTypeIds: Signal<string[]>;
|
|
222
|
+
/**
|
|
223
|
+
* The list of available fragment IDs, taken from the facet model settings.
|
|
224
|
+
* This is used to populate the role ID select when the part type is a base
|
|
225
|
+
* text part (i.e. its baseText property in settings is true).
|
|
226
|
+
*/
|
|
227
|
+
readonly availableFragmentIds: Signal<string[]>;
|
|
228
|
+
/**
|
|
229
|
+
* True if the part type is a base text part, i.e. if the facet model settings
|
|
230
|
+
* for the current part type ID has the baseText property set to true. In this
|
|
231
|
+
* case, the role ID select is shown with the list of available fragment IDs
|
|
232
|
+
* from the facet model settings; otherwise, a free text input is shown for
|
|
233
|
+
* the role ID.
|
|
234
|
+
* Initialized in the constructor so it can reactively track typeId changes
|
|
235
|
+
* via a toSignal-wrapped valueChanges observable.
|
|
236
|
+
*/
|
|
237
|
+
readonly isBaseTextPart: Signal<boolean>;
|
|
238
|
+
/** Signal that mirrors typeId.valueChanges so computed() can track it. */
|
|
239
|
+
private readonly _typeIdValue;
|
|
240
|
+
/**
|
|
241
|
+
* True to hide the sort key field. This is used when the sort key is
|
|
242
|
+
* defined at the level of the part definitions list, and not at the level
|
|
243
|
+
* of each part definition.
|
|
244
|
+
*/
|
|
245
|
+
readonly hideSortKey: _angular_core.InputSignal<boolean>;
|
|
246
|
+
/**
|
|
247
|
+
* Emitted when user requests to cancel the edit and close this editor.
|
|
248
|
+
*/
|
|
249
|
+
readonly cancelEdit: _angular_core.OutputEmitterRef<void>;
|
|
250
|
+
typeId: FormControl<string>;
|
|
251
|
+
roleId: FormControl<string | null>;
|
|
252
|
+
name: FormControl<string>;
|
|
253
|
+
required: FormControl<boolean>;
|
|
254
|
+
description: FormControl<string | null>;
|
|
255
|
+
colorKey: FormControl<string | null>;
|
|
256
|
+
groupKey: FormControl<string | null>;
|
|
257
|
+
sortKey: FormControl<string | null>;
|
|
258
|
+
form: FormGroup;
|
|
259
|
+
constructor(formBuilder: FormBuilder);
|
|
260
|
+
private updateForm;
|
|
261
|
+
private getData;
|
|
262
|
+
onColorPick(value: string): void;
|
|
263
|
+
cancel(): void;
|
|
264
|
+
/**
|
|
265
|
+
* Saves the current form data by updating the `data` model signal.
|
|
266
|
+
* This method can be called manually (e.g., by a Save button) or
|
|
267
|
+
* automatically (via auto-save).
|
|
268
|
+
* @param pristine If true (default), the form is marked as pristine
|
|
269
|
+
* after saving.
|
|
270
|
+
* Set to false for auto-save if you want the form to remain dirty.
|
|
271
|
+
*/
|
|
272
|
+
save(pristine?: boolean): void;
|
|
273
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PartDefinitionEditorComponent, never>;
|
|
274
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PartDefinitionEditorComponent, "cadmus-part-definition-editor", never, { "definition": { "alias": "definition"; "required": false; "isSignal": true; }; "facetModelSettings": { "alias": "facetModelSettings"; "required": false; "isSignal": true; }; "hideSortKey": { "alias": "hideSortKey"; "required": false; "isSignal": true; }; }, { "definition": "definitionChange"; "cancelEdit": "cancelEdit"; }, never, never, true, never>;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
declare class FacetEditPageComponent implements ComponentCanDeactivate {
|
|
278
|
+
private readonly _dirty;
|
|
279
|
+
canDeactivate(): boolean;
|
|
280
|
+
onDirtyChange(dirty: boolean): void;
|
|
281
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<FacetEditPageComponent, never>;
|
|
282
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<FacetEditPageComponent, "cadmus-facet-edit-page", never, {}, {}, never, never, true, never>;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
declare const CADMUS_PROFILE_EDIT_ROUTES: Routes;
|
|
286
|
+
|
|
287
|
+
export { CADMUS_PROFILE_EDIT_ROUTES, FacetDefinitionEditorComponent, FacetDefinitionListEditorComponent, FacetDefinitionValidatorService, FacetEditPageComponent, PartDefinitionEditorComponent };
|
|
288
|
+
export type { FacetValidationIssue, FacetValidationResult };
|