@myrmidon/cadmus-item-editor 0.3.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.
@@ -1 +1 @@
1
- {"version":3,"file":"myrmidon-cadmus-item-editor.mjs","sources":["../../../../projects/myrmidon/cadmus-item-editor/src/lib/missing-parts/missing-parts.component.ts","../../../../projects/myrmidon/cadmus-item-editor/src/lib/missing-parts/missing-parts.component.html","../../../../projects/myrmidon/cadmus-item-editor/src/lib/parts-scope-editor/parts-scope-editor.component.ts","../../../../projects/myrmidon/cadmus-item-editor/src/lib/parts-scope-editor/parts-scope-editor.component.html","../../../../projects/myrmidon/cadmus-item-editor/src/lib/item-editor/item-editor.component.ts","../../../../projects/myrmidon/cadmus-item-editor/src/lib/item-editor/item-editor.component.html","../../../../projects/myrmidon/cadmus-item-editor/src/lib/cadmus-item-editor.module.ts","../../../../projects/myrmidon/cadmus-item-editor/src/public-api.ts","../../../../projects/myrmidon/cadmus-item-editor/src/myrmidon-cadmus-item-editor.ts"],"sourcesContent":["import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';\r\n\r\nimport { PartDefinition, Part, Thesaurus } from '@myrmidon/cadmus-core';\r\n\r\n@Component({\r\n selector: 'cadmus-missing-parts',\r\n templateUrl: './missing-parts.component.html',\r\n styleUrls: ['./missing-parts.component.css'],\r\n})\r\nexport class MissingPartsComponent implements OnInit {\r\n private _partDefinitions?: PartDefinition[];\r\n private _parts?: Part[];\r\n private _typeThesaurus?: Thesaurus;\r\n\r\n public missingDefinitions: PartDefinition[];\r\n\r\n @Input()\r\n public get partDefinitions(): PartDefinition[] | undefined {\r\n return this._partDefinitions;\r\n }\r\n public set partDefinitions(value: PartDefinition[] | undefined) {\r\n this._partDefinitions = value;\r\n this.updateMissing();\r\n }\r\n\r\n @Input()\r\n public get parts(): Part[] | undefined {\r\n return this._parts;\r\n }\r\n public set parts(value: Part[] | undefined) {\r\n this._parts = value;\r\n this.updateMissing();\r\n }\r\n\r\n /**\r\n * The types thesaurus.\r\n */\r\n @Input()\r\n public get typeThesaurus(): Thesaurus | undefined {\r\n return this._typeThesaurus;\r\n }\r\n public set typeThesaurus(value: Thesaurus | undefined) {\r\n this._typeThesaurus = value;\r\n this.updateMissing();\r\n }\r\n\r\n @Output()\r\n public addRequest: EventEmitter<PartDefinition>;\r\n\r\n constructor() {\r\n this.missingDefinitions = [];\r\n this.addRequest = new EventEmitter<PartDefinition>();\r\n }\r\n\r\n ngOnInit(): void {}\r\n\r\n private isPartPresent(typeId: string, roleId?: string): boolean {\r\n if (!this._partDefinitions) {\r\n return false;\r\n }\r\n return this._partDefinitions.some(\r\n (d) => d.typeId === typeId && d.roleId === roleId\r\n );\r\n }\r\n\r\n private updateMissing(): void {\r\n this.missingDefinitions.length = 0;\r\n if (!this._partDefinitions) {\r\n return;\r\n }\r\n\r\n for (let i = 0; i < this._partDefinitions.length; i++) {\r\n const def = this._partDefinitions[i];\r\n if (!this.isPartPresent(def.typeId, def.roleId)) {\r\n this.missingDefinitions.push(def);\r\n }\r\n }\r\n }\r\n}\r\n","<div *ngIf=\"missingDefinitions.length\">\r\n <h3><mat-icon color=\"warn\">warning</mat-icon>&nbsp; Missing Parts</h3>\r\n <table>\r\n <tbody>\r\n <tr *ngFor=\"let def of missingDefinitions\">\r\n <td>\r\n <button type=\"button\" mat-icon-button matTooltip=\"Add this part\">\r\n <mat-icon>add_circle</mat-icon>\r\n </button>\r\n </td>\r\n <td matTooltip=\"def.description\">\r\n <cadmus-part-badge\r\n [partTypeIds]=\"def\"\r\n [facetDefinition]=\"def\"\r\n [typeThesaurus]=\"typeThesaurus\"\r\n ></cadmus-part-badge>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n</div>\r\n","import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';\r\nimport {\r\n FormGroup,\r\n FormArray,\r\n FormBuilder,\r\n FormControl,\r\n Validators,\r\n} from '@angular/forms';\r\n\r\nimport { Part } from '@myrmidon/cadmus-core';\r\nimport { CustomValidators } from '@myrmidon/cadmus-ui';\r\nimport { FacetService } from '@myrmidon/cadmus-api';\r\nimport { EditItemQuery, AppQuery } from '@myrmidon/cadmus-state';\r\nimport { DialogService } from '@myrmidon/ng-mat-tools';\r\n\r\nexport interface PartScopeSetRequest {\r\n ids: string[];\r\n scope: string;\r\n}\r\n\r\n/**\r\n * Parts thesaurus scope dumb editor component.\r\n * This is used to set the thesaurus scope of multiple item's parts at once\r\n * in the item editor.\r\n */\r\n@Component({\r\n selector: 'cadmus-parts-scope-editor',\r\n templateUrl: './parts-scope-editor.component.html',\r\n styleUrls: ['./parts-scope-editor.component.css'],\r\n})\r\nexport class PartsScopeEditorComponent implements OnInit {\r\n private _parts: Part[] | undefined;\r\n\r\n @Input()\r\n public get parts(): Part[] | undefined {\r\n return this._parts;\r\n }\r\n public set parts(value: Part[] | undefined) {\r\n this._parts = value;\r\n this.updateForm();\r\n }\r\n\r\n @Input()\r\n public readonly?: boolean;\r\n\r\n @Output()\r\n public setScopeRequest: EventEmitter<PartScopeSetRequest>;\r\n\r\n public checks: FormArray;\r\n public scope: FormControl;\r\n public form: FormGroup;\r\n\r\n constructor(\r\n private _formBuilder: FormBuilder,\r\n private _facetService: FacetService,\r\n private _dialogService: DialogService,\r\n private _appQuery: AppQuery,\r\n private _itemQuery: EditItemQuery\r\n ) {\r\n // events\r\n this.setScopeRequest = new EventEmitter<PartScopeSetRequest>();\r\n // form\r\n this.checks = _formBuilder.array([], CustomValidators.minChecked(1));\r\n this.scope = _formBuilder.control(null, [\r\n Validators.maxLength(50),\r\n Validators.pattern(/^[-a-zA-Z0-9_]+$/),\r\n ]);\r\n this.form = _formBuilder.group({\r\n checks: this.checks,\r\n scope: this.scope,\r\n });\r\n }\r\n\r\n ngOnInit(): void {}\r\n\r\n private updateForm(): void {\r\n this.checks.clear();\r\n if (!this._parts || this._parts.length === 0) {\r\n return;\r\n }\r\n\r\n for (let i = 0; i < this._parts.length; i++) {\r\n this.checks.push(this._formBuilder.control(false));\r\n }\r\n }\r\n\r\n public getPartColor(typeId: string, roleId: string): string {\r\n const state = this._itemQuery.getValue();\r\n return this._facetService.getPartColor(typeId, roleId, state?.facet);\r\n }\r\n\r\n public getTypeIdName(typeId: string): string {\r\n const state = this._appQuery.getValue();\r\n if (!state || !state.typeThesaurus) {\r\n return typeId;\r\n }\r\n // strip :suffix if any\r\n const i = typeId.lastIndexOf(':');\r\n if (i > -1) {\r\n typeId = typeId.substr(0, i);\r\n }\r\n const entry = state.typeThesaurus.entries?.find((e) => e.id === typeId);\r\n return entry ? entry.value : typeId;\r\n }\r\n\r\n public getRoleIdName(roleId: string): string {\r\n if (!roleId || !roleId.startsWith('fr.')) {\r\n return roleId;\r\n }\r\n return this.getTypeIdName(roleId);\r\n }\r\n\r\n public submit(): void {\r\n if (this.form.invalid || !this._parts) {\r\n return;\r\n }\r\n const ids: string[] = [];\r\n for (let i = 0; i < this.checks.length; i++) {\r\n if (this.checks.controls[i].value === true) {\r\n ids.push(this._parts[i].id);\r\n }\r\n }\r\n\r\n let msg = this.scope.value\r\n ? `Assign scope \"${this.scope.value}\" to ${ids.length} part`\r\n : `Remove scope from ${ids.length} part`;\r\n msg += ids.length > 1 ? 's?' : '?';\r\n\r\n this._dialogService.confirm('Confirm Scopes', msg).subscribe((result) => {\r\n if (!result) {\r\n return;\r\n }\r\n this.setScopeRequest.emit({\r\n ids,\r\n scope: this.scope.value,\r\n });\r\n });\r\n }\r\n}\r\n","<form [formGroup]=\"form\" (submit)=\"submit()\">\r\n <table id=\"parts\">\r\n <thead>\r\n <tr>\r\n <th style=\"min-width: 32px;\"></th>\r\n <th>type</th>\r\n <th>role</th>\r\n <th>scope</th>\r\n <th>modified</th>\r\n <th>user</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr\r\n formArrayName=\"checks\"\r\n *ngFor=\"let ctl of checks.controls; let i = index\"\r\n >\r\n <td>\r\n &nbsp;\r\n <mat-checkbox [formControlName]=\"i\"></mat-checkbox>\r\n </td>\r\n <td>\r\n <span\r\n class=\"model-type\"\r\n [style.background-color]=\"\r\n getPartColor(parts[i].typeId, parts[i].roleId)\r\n \"\r\n >{{ getTypeIdName(parts[i].typeId) }}</span\r\n >\r\n </td>\r\n <td>{{ getRoleIdName(parts[i].roleId) }}</td>\r\n <td>{{ parts[i].thesaurusScope }}</td>\r\n <td>{{ parts[i].timeModified | amLocal | amTimeAgo }}</td>\r\n <td>{{ parts[i].userId }}</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n <div>\r\n <mat-form-field>\r\n <input matInput placeholder=\"scope\" formControlName=\"scope\" />\r\n <mat-error\r\n *ngIf=\"scope.hasError('maxLength') && (scope.dirty || scope.touched)\"\r\n >too long</mat-error\r\n >\r\n <mat-error\r\n *ngIf=\"scope.hasError('pattern') && (scope.dirty || scope.touched)\"\r\n >invalid scope</mat-error\r\n >\r\n </mat-form-field>\r\n </div>\r\n <button\r\n mat-raised-button\r\n color=\"primary\"\r\n type=\"submit\"\r\n [disabled]=\"form.invalid || readonly\"\r\n matTooltip=\"Assign the scope to the checked parts\"\r\n >\r\n assign\r\n </button>\r\n</form>\r\n","import { Component, OnInit } from '@angular/core';\r\nimport {\r\n FormControl,\r\n FormGroup,\r\n FormBuilder,\r\n Validators,\r\n FormArray,\r\n} from '@angular/forms';\r\nimport { ActivatedRoute, Router } from '@angular/router';\r\nimport { MatSnackBar } from '@angular/material/snack-bar';\r\nimport { Observable } from 'rxjs';\r\n\r\nimport { AuthService } from '@myrmidon/cadmus-api';\r\nimport {\r\n Item,\r\n PartGroup,\r\n PartDefinition,\r\n FacetDefinition,\r\n FlagDefinition,\r\n Part,\r\n LibraryRouteService,\r\n User,\r\n LayerPartInfo,\r\n Thesaurus,\r\n ComponentCanDeactivate,\r\n} from '@myrmidon/cadmus-core';\r\nimport {\r\n EditItemQuery,\r\n EditItemService,\r\n AppQuery,\r\n} from '@myrmidon/cadmus-state';\r\nimport { DialogService } from '@myrmidon/ng-mat-tools';\r\n\r\nimport { PartScopeSetRequest } from '../parts-scope-editor/parts-scope-editor.component';\r\n\r\n/**\r\n * Item editor. This can edit a new or existing item's metadata and parts.\r\n */\r\n@Component({\r\n selector: 'cadmus-item-editor',\r\n templateUrl: './item-editor.component.html',\r\n styleUrls: ['./item-editor.component.css'],\r\n})\r\nexport class ItemEditorComponent implements OnInit, ComponentCanDeactivate {\r\n public flagDefinitions: FlagDefinition[];\r\n\r\n public id?: string;\r\n public item$: Observable<Item | undefined>;\r\n public parts$: Observable<Part[] | undefined>;\r\n public partGroups$: Observable<PartGroup[] | undefined>;\r\n public layerPartInfos$: Observable<LayerPartInfo[] | undefined>;\r\n public user?: User;\r\n public userLevel: number;\r\n // lookup data\r\n public facet$: Observable<FacetDefinition | undefined>;\r\n public newPartDefinitions: PartDefinition[];\r\n public facets$: Observable<FacetDefinition[] | undefined>;\r\n public loading$: Observable<boolean | undefined>;\r\n public saving$: Observable<boolean | undefined>;\r\n public deletingPart$: Observable<boolean | undefined>;\r\n public error$: Observable<string | undefined>;\r\n public typeThesaurus$: Observable<Thesaurus | undefined>;\r\n\r\n // new part form\r\n public newPartType: FormControl;\r\n public newPart: FormGroup;\r\n // item metadata form\r\n public title: FormControl;\r\n public sortKey: FormControl;\r\n public description: FormControl;\r\n public facet: FormControl;\r\n public group: FormControl;\r\n public flags: FormControl;\r\n public flagChecks: FormArray;\r\n public metadata: FormGroup;\r\n\r\n constructor(\r\n private _router: Router,\r\n private _route: ActivatedRoute,\r\n private _snackbar: MatSnackBar,\r\n private _appQuery: AppQuery,\r\n private _query: EditItemQuery,\r\n private _editItemService: EditItemService,\r\n private _libraryRouteService: LibraryRouteService,\r\n private _dialogService: DialogService,\r\n private _authService: AuthService,\r\n private _formBuilder: FormBuilder\r\n ) {\r\n this.id = this._route.snapshot.params.id;\r\n this.flagDefinitions = [];\r\n this.newPartDefinitions = [];\r\n if (this.id === 'new') {\r\n this.id = undefined;\r\n }\r\n // new part form\r\n this.newPartType = _formBuilder.control(null, Validators.required);\r\n this.newPart = _formBuilder.group({\r\n newPartType: this.newPartType,\r\n });\r\n // item's metadata form\r\n this.title = _formBuilder.control(null, [\r\n Validators.required,\r\n Validators.maxLength(500),\r\n ]);\r\n this.sortKey = _formBuilder.control(null, [\r\n Validators.required,\r\n Validators.maxLength(500),\r\n ]);\r\n this.sortKey.disable();\r\n this.description = _formBuilder.control(null, [\r\n Validators.required,\r\n Validators.maxLength(1000),\r\n ]);\r\n this.facet = _formBuilder.control(null, Validators.required);\r\n this.group = _formBuilder.control(null, Validators.maxLength(100));\r\n this.flags = _formBuilder.control(0);\r\n this.flagChecks = _formBuilder.array([]);\r\n\r\n this.metadata = _formBuilder.group({\r\n title: this.title,\r\n sortKey: this.sortKey,\r\n description: this.description,\r\n facet: this.facet,\r\n group: this.group,\r\n flagChecks: this.flagChecks,\r\n });\r\n this.userLevel = 0;\r\n\r\n this.item$ = this._query.selectItem();\r\n this.parts$ = this._query.selectParts();\r\n this.partGroups$ = this._query.select((state) => state.partGroups);\r\n this.layerPartInfos$ = this._query.select((state) => state.layerPartInfos);\r\n this.facet$ = this._query.selectFacet();\r\n this.facets$ = this._appQuery.selectFacets();\r\n this.typeThesaurus$ = this._appQuery.selectTypeThesaurus();\r\n this.loading$ = this._query.selectLoading();\r\n this.saving$ = this._query.selectSaving();\r\n this.deletingPart$ = this._query.selectDeletingPart();\r\n this.error$ = this._query.selectError();\r\n }\r\n\r\n ngOnInit(): void {\r\n this._authService.currentUser$.subscribe((user: User | null) => {\r\n this.user = user || undefined;\r\n this.userLevel = this._authService.getCurrentUserLevel();\r\n });\r\n\r\n // rebuild the flags controls array when flags definitions change\r\n this._appQuery.selectFlags().subscribe((defs) => {\r\n this.flagDefinitions = defs;\r\n this.buildFlagsControls();\r\n });\r\n\r\n // when flags controls values change, update the flags value\r\n this.flagChecks.valueChanges.subscribe((_) => {\r\n this.flags.setValue(this.getFlagsValue());\r\n });\r\n\r\n // update the metadata form when item changes\r\n this.item$.subscribe((item) => {\r\n this.updateMetadataForm(item);\r\n this.newPartDefinitions = this.getNewPartDefinitions();\r\n });\r\n\r\n // load the item (if any) and its lookup\r\n this._editItemService.load(this.id);\r\n }\r\n\r\n public canDeactivate(): boolean | Observable<boolean> {\r\n return !this.metadata.dirty;\r\n }\r\n\r\n private getExistingPartTypeAndRoleIds(): {\r\n typeId: string;\r\n roleId?: string;\r\n }[] {\r\n const groups = this._query.getValue().partGroups;\r\n if (!groups) {\r\n return [];\r\n }\r\n const results = [];\r\n for (const group of groups) {\r\n for (const part of group.parts) {\r\n results.push({\r\n typeId: part.typeId,\r\n roleId: part.roleId,\r\n });\r\n }\r\n }\r\n\r\n return results;\r\n }\r\n\r\n private getNewPartDefinitions(): PartDefinition[] {\r\n const facet = this._query.getValue().facet;\r\n if (!facet) {\r\n return [];\r\n }\r\n\r\n const existingTypeRoleIds = this.getExistingPartTypeAndRoleIds();\r\n\r\n const defs: PartDefinition[] = [];\r\n for (const def of facet.partDefinitions) {\r\n // exclude layer parts, as these are in the layers tab\r\n if (def.roleId?.startsWith('fr.')) {\r\n continue;\r\n }\r\n // exclude parts present in the item\r\n if (\r\n existingTypeRoleIds.find((tr) => {\r\n return (\r\n tr.typeId === def.typeId &&\r\n ((!tr.roleId && !def.roleId) || tr.roleId === def.roleId)\r\n );\r\n })\r\n ) {\r\n continue;\r\n }\r\n defs.push(def);\r\n }\r\n // sort by sort key\r\n defs.sort((a, b) => {\r\n return a.sortKey.localeCompare(b.sortKey);\r\n });\r\n return defs;\r\n }\r\n\r\n /**\r\n * Builds the array of flags controls according to the current flags\r\n * definitions and the current flags value.\r\n */\r\n private buildFlagsControls(): void {\r\n this.flagChecks.clear();\r\n\r\n for (const def of this.flagDefinitions) {\r\n const flagValue = def.id;\r\n // tslint:disable-next-line: no-bitwise\r\n const checked = (this.flags.value & flagValue) !== 0;\r\n this.flagChecks.push(this._formBuilder.control(checked));\r\n }\r\n }\r\n\r\n /**\r\n * Update the flags controls from the current flags value.\r\n */\r\n private updateFlagControls(): void {\r\n if (!this.flagDefinitions) {\r\n return;\r\n }\r\n for (let i = 0; i < this.flagDefinitions.length; i++) {\r\n const flagValue = this.flagDefinitions[i].id;\r\n // tslint:disable-next-line: no-bitwise\r\n const checked = (this.flags.value & flagValue) !== 0;\r\n this.flagChecks.at(i).setValue(checked);\r\n }\r\n }\r\n\r\n /**\r\n * Get the flags value from the flags controls.\r\n */\r\n private getFlagsValue(): number {\r\n let flagsValue = 0;\r\n\r\n for (let i = 0; i < this.flagDefinitions.length; i++) {\r\n const flagValue = this.flagDefinitions[i].id;\r\n if (this.flagChecks.at(i).value) {\r\n // tslint:disable-next-line: no-bitwise\r\n flagsValue |= flagValue;\r\n }\r\n }\r\n return flagsValue;\r\n }\r\n\r\n private updateMetadataForm(item?: Item): void {\r\n if (!item) {\r\n this.metadata.reset();\r\n this.updateFlagControls();\r\n } else {\r\n this.title.setValue(item.title);\r\n this.sortKey.setValue(item.sortKey);\r\n this.description.setValue(item.description);\r\n this.facet.setValue(item.facetId);\r\n this.group.setValue(item.groupId);\r\n this.flags.setValue(item.flags);\r\n this.updateFlagControls();\r\n\r\n this.metadata.markAsPristine();\r\n }\r\n }\r\n\r\n public getTypeIdName(typeId: string): string {\r\n const state = this._appQuery.getValue();\r\n if (!state || !state.typeThesaurus) {\r\n return typeId;\r\n }\r\n // strip :suffix if any\r\n const i = typeId.lastIndexOf(':');\r\n if (i > -1) {\r\n typeId = typeId.substr(0, i);\r\n }\r\n const entry = state.typeThesaurus.entries?.find((e) => e.id === typeId);\r\n return entry ? entry.value : typeId;\r\n }\r\n\r\n public getRoleIdName(roleId: string): string {\r\n if (!roleId || !roleId.startsWith('fr.')) {\r\n return roleId;\r\n }\r\n return this.getTypeIdName(roleId);\r\n }\r\n\r\n private tryTrim(value: string): string {\r\n return value ? value.trim() : value;\r\n }\r\n\r\n public save(): void {\r\n if (!this.metadata.valid) {\r\n return;\r\n }\r\n const item = { ...this._query.getValue().item };\r\n if (!item) {\r\n return;\r\n }\r\n item.title = this.tryTrim(this.title.value);\r\n item.sortKey = this.sortKey.value;\r\n item.description = this.tryTrim(this.description.value);\r\n item.facetId = this.tryTrim(this.facet.value);\r\n item.groupId = this.tryTrim(this.group.value);\r\n item.flags = this.flags.value;\r\n // save and reload as edited if was new\r\n this._editItemService.save(item as Item).then((saved) => {\r\n this.metadata.markAsPristine();\r\n if (!item.id) {\r\n this.id = saved.id;\r\n this._router.navigate(['/items', saved.id]);\r\n }\r\n });\r\n }\r\n\r\n private partExists(typeId: string, roleId?: string): boolean {\r\n const groups = this._query.getValue().partGroups;\r\n if (!groups) {\r\n return false;\r\n }\r\n return groups.some((g) => {\r\n return g.parts.some(\r\n (p) =>\r\n p.typeId === typeId && ((!p.roleId && !roleId) || p.roleId === roleId)\r\n );\r\n });\r\n }\r\n\r\n public addPart(def?: PartDefinition): void {\r\n if (!def && !this.newPartType.valid) {\r\n return;\r\n }\r\n if (!this.id) {\r\n this._snackbar.open('Please save the item before adding parts', 'OK', {\r\n duration: 3000,\r\n });\r\n return;\r\n }\r\n const typeId = def ? def.typeId : this.newPartType.value.typeId;\r\n const roleId = def ? def.roleId : this.newPartType.value.roleId;\r\n\r\n if (this.partExists(typeId, roleId)) {\r\n return;\r\n }\r\n\r\n const route = this._libraryRouteService.buildPartEditorRoute(\r\n this.id,\r\n 'new',\r\n typeId,\r\n roleId\r\n );\r\n\r\n // navigate to the editor\r\n this._router.navigate(\r\n [route.route],\r\n route.rid\r\n ? {\r\n queryParams: {\r\n rid: route.rid,\r\n },\r\n }\r\n : {}\r\n );\r\n }\r\n\r\n public editPart(part: Part): void {\r\n // build the target route to the appropriate part editor\r\n const route = this._libraryRouteService.buildPartEditorRoute(\r\n part.itemId,\r\n part.id,\r\n part.typeId,\r\n part.roleId\r\n );\r\n\r\n // navigate to the editor\r\n this._router.navigate(\r\n [route.route],\r\n route.rid\r\n ? {\r\n queryParams: {\r\n rid: route.rid,\r\n },\r\n }\r\n : {}\r\n );\r\n }\r\n\r\n public deletePart(part: Part): void {\r\n this._dialogService\r\n .confirm('Confirm Deletion', `Delete part \"${part.typeId}\"?`)\r\n .subscribe((result) => {\r\n if (!result) {\r\n return;\r\n }\r\n // delete\r\n this._editItemService.deletePart(part.id).then(\r\n (_) => {\r\n // once deleted, refresh new-part definitions\r\n this.newPartDefinitions = this.getNewPartDefinitions();\r\n },\r\n (error) => {\r\n console.error(error);\r\n this._snackbar.open('Error deleting part', 'OK');\r\n }\r\n );\r\n });\r\n }\r\n\r\n public addLayerPart(part: LayerPartInfo): void {\r\n let name = this.getTypeIdName(part.typeId);\r\n if (part.roleId) {\r\n name += ' for ' + this.getRoleIdName(part.roleId);\r\n }\r\n this._dialogService\r\n .confirm('Confirm Addition', `Add layer \"${name}\"?`)\r\n .subscribe((result) => {\r\n if (!result) {\r\n return;\r\n }\r\n this._editItemService.addNewLayerPart(\r\n part.itemId,\r\n part.typeId,\r\n part.roleId\r\n );\r\n });\r\n }\r\n\r\n public setPartsScope(request: PartScopeSetRequest): void {\r\n this._editItemService.setPartThesaurusScope(request.ids, request.scope);\r\n }\r\n}\r\n","<mat-card>\r\n <mat-card-header>\r\n <mat-card-title>\r\n {{ (item$ | async)?.title || \"Item\" }}\r\n </mat-card-title>\r\n <mat-card-subtitle>\r\n {{ (item$ | async)?.description }}\r\n </mat-card-subtitle>\r\n </mat-card-header>\r\n <mat-card-content *ngIf=\"!id || (item$ | async) as item\">\r\n <p *ngIf=\"id\">\r\n ID:\r\n <input\r\n [cdkCopyToClipboard]=\"item.id\"\r\n type=\"text\"\r\n readonly=\"true\"\r\n spellcheck=\"false\"\r\n matTooltip=\"Click to copy\"\r\n [value]=\"item.id\"\r\n class=\"id\"\r\n />\r\n </p>\r\n <p *ngIf=\"id\">\r\n Last saved {{ item.timeModified | amLocal | amTimeAgo }} by\r\n {{ item.userId }} on\r\n {{ item.timeModified | date: \"yyyy-MM-dd HH:mm:ss\" }}.<br />\r\n Created {{ item.timeCreated | amLocal | amTimeAgo }} by\r\n {{ item.creatorId }} on\r\n {{ item.timeCreated | date: \"yyyy-MM-dd HH:mm:ss\" }}.\r\n </p>\r\n <p *ngIf=\"error$ | async as error\">\r\n <mat-error>\r\n {{ error }}\r\n </mat-error>\r\n </p>\r\n\r\n <mat-progress-bar\r\n mode=\"indeterminate\"\r\n *ngIf=\"(loading$ | async) || (saving$ | async)\"\r\n ></mat-progress-bar>\r\n\r\n <!-- item content -->\r\n <mat-tab-group [selectedIndex]=\"id ? 1 : 0\">\r\n <!-- metadata -->\r\n <mat-tab label=\"Metadata\">\r\n <form [formGroup]=\"metadata\" (ngSubmit)=\"save()\">\r\n <!-- title -->\r\n <div>\r\n <mat-form-field>\r\n <input\r\n matInput\r\n type=\"text\"\r\n id=\"title\"\r\n placeholder=\"title\"\r\n formControlName=\"title\"\r\n />\r\n <mat-error\r\n *ngIf=\"\r\n title.hasError('required') && (title.touched || title.dirty)\r\n \"\r\n >enter title</mat-error\r\n >\r\n <mat-error\r\n *ngIf=\"\r\n title.hasError('maxLength') && (title.touched || title.dirty)\r\n \"\r\n >\r\n title too long</mat-error\r\n >\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- sortKey -->\r\n <div>\r\n <mat-form-field>\r\n <input\r\n matInput\r\n type=\"text\"\r\n id=\"sortKey\"\r\n placeholder=\"sort key\"\r\n formControlName=\"sortKey\"\r\n />\r\n <mat-error\r\n *ngIf=\"\r\n sortKey.hasError('required') &&\r\n (sortKey.touched || sortKey.dirty)\r\n \"\r\n >enter sort key</mat-error\r\n >\r\n <mat-error\r\n *ngIf=\"\r\n sortKey.hasError('maxLength') &&\r\n (sortKey.touched || sortKey.dirty)\r\n \"\r\n >sort key too long</mat-error\r\n >\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- description -->\r\n <div>\r\n <mat-form-field class=\"full-width\">\r\n <textarea\r\n rows=\"2\"\r\n matInput\r\n id=\"description\"\r\n placeholder=\"description\"\r\n formControlName=\"description\"\r\n ></textarea>\r\n <mat-error\r\n *ngIf=\"\r\n description.hasError('required') &&\r\n (description.touched || description.dirty)\r\n \"\r\n >enter description</mat-error\r\n >\r\n <mat-error\r\n *ngIf=\"\r\n description.hasError('maxLength') &&\r\n (description.touched || description.dirty)\r\n \"\r\n >description too long</mat-error\r\n >\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- facet -->\r\n <div>\r\n <mat-form-field style=\"width: 400px\">\r\n <mat-select\r\n placeholder=\"facet\"\r\n formControlName=\"facet\"\r\n required=\"true\"\r\n >\r\n <mat-option *ngFor=\"let f of facets$ | async\" [value]=\"f.id\">\r\n {{ f.label }}\r\n </mat-option>\r\n </mat-select>\r\n <mat-error>please select a facet</mat-error>\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- group -->\r\n <div>\r\n <mat-form-field>\r\n <input matInput formControlName=\"group\" placeholder=\"group ID\" />\r\n <mat-error\r\n *ngIf=\"\r\n group.hasError('maxLength') && (group.dirty || group.touched)\r\n \"\r\n >too long</mat-error\r\n >\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- flags -->\r\n <div formArrayName=\"flagChecks\" *ngIf=\"flagDefinitions\">\r\n <mat-checkbox\r\n class=\"flag\"\r\n *ngFor=\"let c of flagChecks.controls; let i = index\"\r\n [formControlName]=\"i\"\r\n >\r\n <span [style.color]=\"'#' + flagDefinitions[i].colorKey\"\r\n >&#x2b24;</span\r\n >\r\n &nbsp;\r\n {{ flagDefinitions[i].label }}\r\n </mat-checkbox>\r\n </div>\r\n <br />\r\n\r\n <div>\r\n <button\r\n type=\"submit\"\r\n mat-raised-button\r\n color=\"primary\"\r\n [disabled]=\"\r\n userLevel < 2 || (saving$ | async) || (loading$ | async)\r\n \"\r\n matTooltip=\"Save metadata\"\r\n *ngIf=\"\r\n user?.roles?.length &&\r\n (user.roles.includes('admin') ||\r\n user.roles.includes('editor') ||\r\n user.roles.includes('operator'))\r\n \"\r\n >\r\n <mat-icon>save</mat-icon> save\r\n </button>\r\n </div>\r\n </form>\r\n </mat-tab>\r\n\r\n <!-- parts -->\r\n <mat-tab label=\"Parts\" *ngIf=\"id\">\r\n <div class=\"new-part\">\r\n <form [formGroup]=\"newPart\">\r\n <mat-form-field>\r\n <mat-select\r\n placeholder=\"part\"\r\n formControlName=\"newPartType\"\r\n required\r\n >\r\n <mat-option *ngFor=\"let p of newPartDefinitions\" [value]=\"p\">\r\n <span [style.color]=\"'#' + p.colorKey\" class=\"new-part-icon\"\r\n >&#x2b24;</span\r\n >\r\n {{ p.name }}\r\n <span *ngIf=\"p.roleId\" class=\"new-part-role\">{{\r\n p.roleId\r\n }}</span>\r\n </mat-option>\r\n </mat-select>\r\n <mat-error>part type required</mat-error>\r\n </mat-form-field>\r\n &nbsp;\r\n <button\r\n mat-stroked-button\r\n color=\"primary\"\r\n type=\"button\"\r\n [disabled]=\"userLevel < 2 || (loading$ | async) || !newPart.valid\"\r\n (click)=\"addPart()\"\r\n matTooltip=\"Add a new part of the selected type\"\r\n >\r\n <mat-icon>add_circle</mat-icon>\r\n add part\r\n </button>\r\n </form>\r\n </div>\r\n\r\n <mat-divider></mat-divider>\r\n\r\n <mat-expansion-panel\r\n *ngFor=\"let group of partGroups$ | async\"\r\n [expanded]=\"true\"\r\n >\r\n <mat-expansion-panel-header>\r\n <mat-panel-title\r\n ><strong>{{ group.label }}</strong></mat-panel-title\r\n >\r\n <mat-panel-description>{{\r\n group.parts.length\r\n }}</mat-panel-description>\r\n </mat-expansion-panel-header>\r\n\r\n <table>\r\n <thead>\r\n <tr>\r\n <th style=\"width: 124px\"></th>\r\n <th>type</th>\r\n <th>role</th>\r\n <th fxHide.xs>modified</th>\r\n <th fxHide.xs>user</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let part of group.parts\">\r\n <!-- edit -->\r\n <td>\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n color=\"primary\"\r\n matTooltip=\"Edit this part\"\r\n [disabled]=\"(loading$ | async) || (deletingPart$ | async)\"\r\n (click)=\"editPart(part)\"\r\n >\r\n <mat-icon>create</mat-icon>\r\n </button>\r\n <!-- delete -->\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Delete this part\"\r\n [disabled]=\"\r\n userLevel < 2 ||\r\n (loading$ | async) ||\r\n (deletingPart$ | async)\r\n \"\r\n (click)=\"deletePart(part)\"\r\n *ngIf=\"\r\n user?.roles?.length &&\r\n (user.roles.includes('admin') ||\r\n user.roles.includes('editor') ||\r\n user.roles.includes('operator'))\r\n \"\r\n >\r\n <mat-icon color=\"warn\">delete</mat-icon>\r\n </button>\r\n <!-- copy -->\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Copy this part ID\"\r\n [cdkCopyToClipboard]=\"part.id\"\r\n >\r\n <mat-icon>assignment</mat-icon>\r\n </button>\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"facet$ | async\"\r\n [badgeType]=\"1\"\r\n [typeThesaurus]=\"typeThesaurus$ | async\"\r\n ></cadmus-part-badge>\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"facet$ | async\"\r\n [badgeType]=\"2\"\r\n [typeThesaurus]=\"typeThesaurus$ | async\"\r\n ></cadmus-part-badge>\r\n </td>\r\n <td fxHide.xs>{{ part.timeModified | amLocal | amTimeAgo }}</td>\r\n <td fxHide.xs>{{ part.userId }}</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </mat-expansion-panel>\r\n\r\n <cadmus-missing-parts\r\n [partDefinitions]=\"(facet$ | async)?.partDefinitions\"\r\n [parts]=\"parts$ | async\"\r\n [typeThesaurus]=\"typeThesaurus$ | async\"\r\n (addRequest)=\"addPart($event)\"\r\n ></cadmus-missing-parts>\r\n </mat-tab>\r\n\r\n <mat-tab label=\"Layers\" *ngIf=\"id\">\r\n <table *ngIf=\"layerPartInfos$ | async as parts\">\r\n <thead>\r\n <th></th>\r\n <th>type</th>\r\n <th>role</th>\r\n <th>frr.</th>\r\n <th>last modified</th>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let part of parts\">\r\n <td>\r\n <button\r\n *ngIf=\"!part.isAbsent\"\r\n type=\"button\"\r\n color=\"primary\"\r\n mat-icon-button\r\n matTooltip=\"Edit this layer part\"\r\n (click)=\"editPart(part)\"\r\n >\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n <button\r\n *ngIf=\"part.isAbsent\"\r\n type=\"button\"\r\n mat-icon-button\r\n color=\"primary\"\r\n matTooltip=\"Add this layer part\"\r\n [disabled]=\"userLevel < 2\"\r\n (click)=\"addLayerPart(part)\"\r\n >\r\n <mat-icon>add_circle</mat-icon>\r\n </button>\r\n <button\r\n *ngIf=\"!part.isAbsent\"\r\n type=\"button\"\r\n mat-icon-button\r\n color=\"warn\"\r\n matTooltip=\"Delete this layer part\"\r\n [disabled]=\"userLevel < 2\"\r\n (click)=\"deletePart(part)\"\r\n >\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n <button\r\n *ngIf=\"!part.isAbsent\"\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Copy this part ID\"\r\n [cdkCopyToClipboard]=\"part.id\"\r\n >\r\n <mat-icon>assignment</mat-icon>\r\n </button>\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"facet$ | async\"\r\n [badgeType]=\"1\"\r\n [typeThesaurus]=\"typeThesaurus$ | async\"\r\n ></cadmus-part-badge>\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"facet$ | async\"\r\n [badgeType]=\"2\"\r\n [typeThesaurus]=\"typeThesaurus$ | async\"\r\n ></cadmus-part-badge>\r\n </td>\r\n <td\r\n [ngClass]=\"{\r\n 'count-n': part.fragmentCount,\r\n 'count-z': !part.fragmentCount\r\n }\"\r\n >\r\n {{ part.fragmentCount }}\r\n </td>\r\n <td>\r\n <span *ngIf=\"!part.isAbsent\">\r\n {{ part.timeModified | amLocal | amTimeAgo }}\r\n </span>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </mat-tab>\r\n\r\n <mat-tab\r\n label=\"Th-Scopes\"\r\n *ngIf=\"parts$ | async | sort: 'typeId' | sort: 'roleId' as parts\"\r\n >\r\n <cadmus-parts-scope-editor\r\n [parts]=\"parts\"\r\n [readonly]=\"userLevel < 2 || (saving$ | async) || (loading$ | async)\"\r\n (setScopeRequest)=\"setPartsScope($event)\"\r\n ></cadmus-parts-scope-editor>\r\n </mat-tab>\r\n </mat-tab-group>\r\n </mat-card-content>\r\n</mat-card>\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { RouterModule } from '@angular/router';\r\nimport { ReactiveFormsModule, FormsModule } from '@angular/forms';\r\nimport { ClipboardModule } from '@angular/cdk/clipboard';\r\n\r\nimport { MomentModule } from 'ngx-moment';\r\n\r\nimport { CadmusCoreModule } from '@myrmidon/cadmus-core';\r\nimport { CadmusMaterialModule } from '@myrmidon/cadmus-material';\r\nimport { CadmusApiModule } from '@myrmidon/cadmus-api';\r\nimport { CadmusUiModule } from '@myrmidon/cadmus-ui';\r\nimport { CadmusStateModule } from '@myrmidon/cadmus-state';\r\nimport { NgToolsModule } from '@myrmidon/ng-tools';\r\nimport { NgMatToolsModule } from '@myrmidon/ng-mat-tools';\r\n\r\nimport { ItemEditorComponent } from './item-editor/item-editor.component';\r\nimport { PartsScopeEditorComponent } from './parts-scope-editor/parts-scope-editor.component';\r\nimport { MissingPartsComponent } from './missing-parts/missing-parts.component';\r\n\r\n// https://github.com/ng-packagr/ng-packagr/issues/778\r\nexport const RouterModuleForChild = RouterModule.forChild([\r\n { path: '', pathMatch: 'full', component: ItemEditorComponent },\r\n]);\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n ReactiveFormsModule,\r\n FormsModule,\r\n RouterModuleForChild,\r\n ClipboardModule,\r\n MomentModule,\r\n // cadmus\r\n CadmusCoreModule,\r\n CadmusMaterialModule,\r\n CadmusApiModule,\r\n CadmusUiModule,\r\n CadmusStateModule,\r\n NgToolsModule,\r\n NgMatToolsModule\r\n ],\r\n declarations: [\r\n ItemEditorComponent,\r\n MissingPartsComponent,\r\n PartsScopeEditorComponent,\r\n ],\r\n exports: [ItemEditorComponent],\r\n})\r\nexport class CadmusItemEditorModule {}\r\n","/*\r\n * Public API Surface of cadmus-item-editor\r\n */\r\n\r\nexport * from './lib/item-editor/item-editor.component';\r\nexport * from './lib/cadmus-item-editor.module';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MASa,qBAAqB;IAwChC;QACE,IAAI,CAAC,kBAAkB,GAAG,EAAE,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,IAAI,YAAY,EAAkB,CAAC;KACtD;IApCD,IACW,eAAe;QACxB,OAAO,IAAI,CAAC,gBAAgB,CAAC;KAC9B;IACD,IAAW,eAAe,CAAC,KAAmC;QAC5D,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC;QAC9B,IAAI,CAAC,aAAa,EAAE,CAAC;KACtB;IAED,IACW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;KACpB;IACD,IAAW,KAAK,CAAC,KAAyB;QACxC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,aAAa,EAAE,CAAC;KACtB;;;;IAKD,IACW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;KAC5B;IACD,IAAW,aAAa,CAAC,KAA4B;QACnD,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;QAC5B,IAAI,CAAC,aAAa,EAAE,CAAC;KACtB;IAUD,QAAQ,MAAW;IAEX,aAAa,CAAC,MAAc,EAAE,MAAe;QACnD,IAAI,CAAC,IAAI,CAAC,g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kBAxBlC,QAAQ;mBAAC;oBACR,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,WAAW;wBACX,oBAAoB;wBACpB,eAAe;wBACf,YAAY;;wBAEZ,gBAAgB;wBAChB,oBAAoB;wBACpB,eAAe;wBACf,cAAc;wBACd,iBAAiB;wBACjB,aAAa;wBACb,gBAAgB;qBACjB;oBACD,YAAY,EAAE;wBACZ,mBAAmB;wBACnB,qBAAqB;wBACrB,yBAAyB;qBAC1B;oBACD,OAAO,EAAE,CAAC,mBAAmB,CAAC;iBAC/B;;;AChDD;;;;ACAA;;;;;;"}
1
+ {"version":3,"file":"myrmidon-cadmus-item-editor.mjs","sources":["../../../../projects/myrmidon/cadmus-item-editor/src/lib/missing-parts/missing-parts.component.ts","../../../../projects/myrmidon/cadmus-item-editor/src/lib/missing-parts/missing-parts.component.html","../../../../projects/myrmidon/cadmus-item-editor/src/lib/parts-scope-editor/parts-scope-editor.component.ts","../../../../projects/myrmidon/cadmus-item-editor/src/lib/parts-scope-editor/parts-scope-editor.component.html","../../../../projects/myrmidon/cadmus-item-editor/src/lib/item-editor/item-editor.component.ts","../../../../projects/myrmidon/cadmus-item-editor/src/lib/item-editor/item-editor.component.html","../../../../projects/myrmidon/cadmus-item-editor/src/lib/cadmus-item-editor.module.ts","../../../../projects/myrmidon/cadmus-item-editor/src/public-api.ts","../../../../projects/myrmidon/cadmus-item-editor/src/myrmidon-cadmus-item-editor.ts"],"sourcesContent":["import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';\r\n\r\nimport { PartDefinition, Part, Thesaurus } from '@myrmidon/cadmus-core';\r\n\r\n@Component({\r\n selector: 'cadmus-missing-parts',\r\n templateUrl: './missing-parts.component.html',\r\n styleUrls: ['./missing-parts.component.css'],\r\n})\r\nexport class MissingPartsComponent implements OnInit {\r\n private _partDefinitions?: PartDefinition[];\r\n private _parts?: Part[];\r\n private _typeThesaurus?: Thesaurus;\r\n\r\n public missingDefinitions: PartDefinition[];\r\n\r\n @Input()\r\n public get partDefinitions(): PartDefinition[] | undefined {\r\n return this._partDefinitions;\r\n }\r\n public set partDefinitions(value: PartDefinition[] | undefined) {\r\n this._partDefinitions = value;\r\n this.updateMissing();\r\n }\r\n\r\n @Input()\r\n public get parts(): Part[] | undefined {\r\n return this._parts;\r\n }\r\n public set parts(value: Part[] | undefined) {\r\n this._parts = value;\r\n this.updateMissing();\r\n }\r\n\r\n /**\r\n * The types thesaurus.\r\n */\r\n @Input()\r\n public get typeThesaurus(): Thesaurus | undefined {\r\n return this._typeThesaurus;\r\n }\r\n public set typeThesaurus(value: Thesaurus | undefined) {\r\n this._typeThesaurus = value;\r\n this.updateMissing();\r\n }\r\n\r\n @Output()\r\n public addRequest: EventEmitter<PartDefinition>;\r\n\r\n constructor() {\r\n this.missingDefinitions = [];\r\n this.addRequest = new EventEmitter<PartDefinition>();\r\n }\r\n\r\n ngOnInit(): void {}\r\n\r\n private isPartPresent(typeId: string, roleId?: string): boolean {\r\n if (!this._partDefinitions) {\r\n return false;\r\n }\r\n return this._partDefinitions.some(\r\n (d) => d.typeId === typeId && d.roleId === roleId\r\n );\r\n }\r\n\r\n private updateMissing(): void {\r\n this.missingDefinitions.length = 0;\r\n if (!this._partDefinitions) {\r\n return;\r\n }\r\n\r\n for (let i = 0; i < this._partDefinitions.length; i++) {\r\n const def = this._partDefinitions[i];\r\n if (!this.isPartPresent(def.typeId, def.roleId)) {\r\n this.missingDefinitions.push(def);\r\n }\r\n }\r\n }\r\n}\r\n","<div *ngIf=\"missingDefinitions.length\">\r\n <h3><mat-icon color=\"warn\">warning</mat-icon>&nbsp; Missing Parts</h3>\r\n <table>\r\n <tbody>\r\n <tr *ngFor=\"let def of missingDefinitions\">\r\n <td>\r\n <button type=\"button\" mat-icon-button matTooltip=\"Add this part\">\r\n <mat-icon>add_circle</mat-icon>\r\n </button>\r\n </td>\r\n <td matTooltip=\"def.description\">\r\n <cadmus-part-badge\r\n [partTypeIds]=\"def\"\r\n [facetDefinition]=\"$any(def)\"\r\n [typeThesaurus]=\"typeThesaurus\"\r\n ></cadmus-part-badge>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n</div>\r\n","import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';\r\nimport {\r\n FormGroup,\r\n FormArray,\r\n FormBuilder,\r\n FormControl,\r\n Validators,\r\n} from '@angular/forms';\r\n\r\nimport { Part } from '@myrmidon/cadmus-core';\r\nimport { CustomValidators } from '@myrmidon/cadmus-ui';\r\nimport { FacetService } from '@myrmidon/cadmus-api';\r\nimport { EditItemQuery, AppQuery } from '@myrmidon/cadmus-state';\r\nimport { DialogService } from '@myrmidon/ng-mat-tools';\r\n\r\nexport interface PartScopeSetRequest {\r\n ids: string[];\r\n scope: string;\r\n}\r\n\r\n/**\r\n * Parts thesaurus scope dumb editor component.\r\n * This is used to set the thesaurus scope of multiple item's parts at once\r\n * in the item editor.\r\n */\r\n@Component({\r\n selector: 'cadmus-parts-scope-editor',\r\n templateUrl: './parts-scope-editor.component.html',\r\n styleUrls: ['./parts-scope-editor.component.css'],\r\n})\r\nexport class PartsScopeEditorComponent implements OnInit {\r\n private _parts: Part[] | undefined;\r\n\r\n @Input()\r\n public get parts(): Part[] | undefined {\r\n return this._parts;\r\n }\r\n public set parts(value: Part[] | undefined) {\r\n this._parts = value;\r\n this.updateForm();\r\n }\r\n\r\n @Input()\r\n public readonly?: boolean;\r\n\r\n @Output()\r\n public setScopeRequest: EventEmitter<PartScopeSetRequest>;\r\n\r\n public checks: FormArray;\r\n public scope: FormControl;\r\n public form: FormGroup;\r\n\r\n constructor(\r\n private _formBuilder: FormBuilder,\r\n private _facetService: FacetService,\r\n private _dialogService: DialogService,\r\n private _appQuery: AppQuery,\r\n private _itemQuery: EditItemQuery\r\n ) {\r\n // events\r\n this.setScopeRequest = new EventEmitter<PartScopeSetRequest>();\r\n // form\r\n this.checks = _formBuilder.array([], CustomValidators.minChecked(1));\r\n this.scope = _formBuilder.control(null, [\r\n Validators.maxLength(50),\r\n Validators.pattern(/^[-a-zA-Z0-9_]+$/),\r\n ]);\r\n this.form = _formBuilder.group({\r\n checks: this.checks,\r\n scope: this.scope,\r\n });\r\n }\r\n\r\n ngOnInit(): void {}\r\n\r\n private updateForm(): void {\r\n this.checks.clear();\r\n if (!this._parts || this._parts.length === 0) {\r\n return;\r\n }\r\n\r\n for (let i = 0; i < this._parts.length; i++) {\r\n this.checks.push(this._formBuilder.control(false));\r\n }\r\n }\r\n\r\n public getPartColor(typeId: string, roleId: string): string {\r\n const state = this._itemQuery.getValue();\r\n return this._facetService.getPartColor(typeId, roleId, state?.facet);\r\n }\r\n\r\n public getTypeIdName(typeId: string): string {\r\n const state = this._appQuery.getValue();\r\n if (!state || !state.typeThesaurus) {\r\n return typeId;\r\n }\r\n // strip :suffix if any\r\n const i = typeId.lastIndexOf(':');\r\n if (i > -1) {\r\n typeId = typeId.substr(0, i);\r\n }\r\n const entry = state.typeThesaurus.entries?.find((e) => e.id === typeId);\r\n return entry ? entry.value : typeId;\r\n }\r\n\r\n public getRoleIdName(roleId: string): string {\r\n if (!roleId || !roleId.startsWith('fr.')) {\r\n return roleId;\r\n }\r\n return this.getTypeIdName(roleId);\r\n }\r\n\r\n public submit(): void {\r\n if (this.form.invalid || !this._parts) {\r\n return;\r\n }\r\n const ids: string[] = [];\r\n for (let i = 0; i < this.checks.length; i++) {\r\n if (this.checks.controls[i].value === true) {\r\n ids.push(this._parts[i].id);\r\n }\r\n }\r\n\r\n let msg = this.scope.value\r\n ? `Assign scope \"${this.scope.value}\" to ${ids.length} part`\r\n : `Remove scope from ${ids.length} part`;\r\n msg += ids.length > 1 ? 's?' : '?';\r\n\r\n this._dialogService.confirm('Confirm Scopes', msg).subscribe((result) => {\r\n if (!result) {\r\n return;\r\n }\r\n this.setScopeRequest.emit({\r\n ids,\r\n scope: this.scope.value,\r\n });\r\n });\r\n }\r\n}\r\n","<form [formGroup]=\"form\" (submit)=\"submit()\">\r\n <table id=\"parts\">\r\n <thead>\r\n <tr>\r\n <th style=\"min-width: 32px\"></th>\r\n <th>type</th>\r\n <th>role</th>\r\n <th>scope</th>\r\n <th>modified</th>\r\n <th>user</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr\r\n formArrayName=\"checks\"\r\n *ngFor=\"let ctl of checks.controls; let i = index\"\r\n >\r\n <td>\r\n &nbsp;\r\n <mat-checkbox [formControlName]=\"i\"></mat-checkbox>\r\n </td>\r\n <td>\r\n <span\r\n class=\"model-type\"\r\n [style.background-color]=\"\r\n getPartColor($any(parts)[i].typeId, $any(parts)[i].roleId)\r\n \"\r\n >{{ getTypeIdName($any(parts)[i].typeId) }}</span\r\n >\r\n </td>\r\n <td>{{ getRoleIdName($any(parts)[i].roleId) }}</td>\r\n <td>{{ $any(parts)[i].thesaurusScope }}</td>\r\n <td>{{ $any(parts)[i].timeModified | date: 'yyyy-MM-dd HH:mm:ss' }}</td>\r\n <td>{{ $any(parts)[i].userId }}</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n <div>\r\n <mat-form-field>\r\n <input matInput placeholder=\"scope\" formControlName=\"scope\" />\r\n <mat-error\r\n *ngIf=\"scope.hasError('maxLength') && (scope.dirty || scope.touched)\"\r\n >too long</mat-error\r\n >\r\n <mat-error\r\n *ngIf=\"scope.hasError('pattern') && (scope.dirty || scope.touched)\"\r\n >invalid scope</mat-error\r\n >\r\n </mat-form-field>\r\n </div>\r\n <button\r\n mat-raised-button\r\n color=\"primary\"\r\n type=\"submit\"\r\n [disabled]=\"form.invalid || readonly\"\r\n matTooltip=\"Assign the scope to the checked parts\"\r\n >\r\n assign\r\n </button>\r\n</form>\r\n","import { Component, OnInit } from '@angular/core';\r\nimport {\r\n FormControl,\r\n FormGroup,\r\n FormBuilder,\r\n Validators,\r\n FormArray,\r\n} from '@angular/forms';\r\nimport { ActivatedRoute, Router } from '@angular/router';\r\nimport { MatSnackBar } from '@angular/material/snack-bar';\r\nimport { Observable } from 'rxjs';\r\n\r\nimport {\r\n Item,\r\n PartGroup,\r\n PartDefinition,\r\n FacetDefinition,\r\n FlagDefinition,\r\n Part,\r\n LibraryRouteService,\r\n LayerPartInfo,\r\n Thesaurus,\r\n ComponentCanDeactivate,\r\n} from '@myrmidon/cadmus-core';\r\nimport {\r\n EditItemQuery,\r\n EditItemService,\r\n AppQuery,\r\n} from '@myrmidon/cadmus-state';\r\nimport { DialogService } from '@myrmidon/ng-mat-tools';\r\n\r\nimport { PartScopeSetRequest } from '../parts-scope-editor/parts-scope-editor.component';\r\nimport { AuthJwtService, User } from '@myrmidon/auth-jwt-login';\r\nimport { UserLevelService } from '@myrmidon/cadmus-api';\r\n\r\n/**\r\n * Item editor. This can edit a new or existing item's metadata and parts.\r\n */\r\n@Component({\r\n selector: 'cadmus-item-editor',\r\n templateUrl: './item-editor.component.html',\r\n styleUrls: ['./item-editor.component.css'],\r\n})\r\nexport class ItemEditorComponent implements OnInit, ComponentCanDeactivate {\r\n public flagDefinitions: FlagDefinition[];\r\n\r\n public id?: string;\r\n public item$: Observable<Item | undefined>;\r\n public parts$: Observable<Part[] | undefined>;\r\n public partGroups$: Observable<PartGroup[] | undefined>;\r\n public layerPartInfos$: Observable<LayerPartInfo[] | undefined>;\r\n public user?: User;\r\n public userLevel: number;\r\n // lookup data\r\n public facet$: Observable<FacetDefinition | undefined>;\r\n public newPartDefinitions: PartDefinition[];\r\n public facets$: Observable<FacetDefinition[] | undefined>;\r\n public loading$: Observable<boolean | undefined>;\r\n public saving$: Observable<boolean | undefined>;\r\n public deletingPart$: Observable<boolean | undefined>;\r\n public error$: Observable<string | undefined>;\r\n public typeThesaurus$: Observable<Thesaurus | undefined>;\r\n\r\n // new part form\r\n public newPartType: FormControl;\r\n public newPart: FormGroup;\r\n // item metadata form\r\n public title: FormControl;\r\n public sortKey: FormControl;\r\n public description: FormControl;\r\n public facet: FormControl;\r\n public group: FormControl;\r\n public flags: FormControl;\r\n public flagChecks: FormArray;\r\n public metadata: FormGroup;\r\n\r\n constructor(\r\n private _router: Router,\r\n private _route: ActivatedRoute,\r\n private _snackbar: MatSnackBar,\r\n private _appQuery: AppQuery,\r\n private _query: EditItemQuery,\r\n private _editItemService: EditItemService,\r\n private _libraryRouteService: LibraryRouteService,\r\n private _dialogService: DialogService,\r\n private _authService: AuthJwtService,\r\n private _userLevelService: UserLevelService,\r\n private _formBuilder: FormBuilder\r\n ) {\r\n this.id = this._route.snapshot.params['id'];\r\n this.flagDefinitions = [];\r\n this.newPartDefinitions = [];\r\n if (this.id === 'new') {\r\n this.id = undefined;\r\n }\r\n // new part form\r\n this.newPartType = _formBuilder.control(null, Validators.required);\r\n this.newPart = _formBuilder.group({\r\n newPartType: this.newPartType,\r\n });\r\n // item's metadata form\r\n this.title = _formBuilder.control(null, [\r\n Validators.required,\r\n Validators.maxLength(500),\r\n ]);\r\n this.sortKey = _formBuilder.control(null, [\r\n Validators.required,\r\n Validators.maxLength(500),\r\n ]);\r\n this.sortKey.disable();\r\n this.description = _formBuilder.control(null, [\r\n Validators.required,\r\n Validators.maxLength(1000),\r\n ]);\r\n this.facet = _formBuilder.control(null, Validators.required);\r\n this.group = _formBuilder.control(null, Validators.maxLength(100));\r\n this.flags = _formBuilder.control(0);\r\n this.flagChecks = _formBuilder.array([]);\r\n\r\n this.metadata = _formBuilder.group({\r\n title: this.title,\r\n sortKey: this.sortKey,\r\n description: this.description,\r\n facet: this.facet,\r\n group: this.group,\r\n flagChecks: this.flagChecks,\r\n });\r\n this.userLevel = 0;\r\n\r\n this.item$ = this._query.selectItem();\r\n this.parts$ = this._query.selectParts();\r\n this.partGroups$ = this._query.select((state) => state.partGroups);\r\n this.layerPartInfos$ = this._query.select((state) => state.layerPartInfos);\r\n this.facet$ = this._query.selectFacet();\r\n this.facets$ = this._appQuery.selectFacets();\r\n this.typeThesaurus$ = this._appQuery.selectTypeThesaurus();\r\n this.loading$ = this._query.selectLoading();\r\n this.saving$ = this._query.selectSaving();\r\n this.deletingPart$ = this._query.selectDeletingPart();\r\n this.error$ = this._query.selectError();\r\n }\r\n\r\n ngOnInit(): void {\r\n this._authService.currentUser$.subscribe((user: User | null) => {\r\n this.user = user || undefined;\r\n this.userLevel = this._userLevelService.getCurrentUserLevel();\r\n });\r\n\r\n // rebuild the flags controls array when flags definitions change\r\n this._appQuery.selectFlags().subscribe((defs) => {\r\n this.flagDefinitions = defs;\r\n this.buildFlagsControls();\r\n });\r\n\r\n // when flags controls values change, update the flags value\r\n this.flagChecks.valueChanges.subscribe((_) => {\r\n this.flags.setValue(this.getFlagsValue());\r\n });\r\n\r\n // update the metadata form when item changes\r\n this.item$.subscribe((item) => {\r\n this.updateMetadataForm(item);\r\n this.newPartDefinitions = this.getNewPartDefinitions();\r\n });\r\n\r\n // load the item (if any) and its lookup\r\n this._editItemService.load(this.id);\r\n }\r\n\r\n public canDeactivate(): boolean | Observable<boolean> {\r\n return !this.metadata.dirty;\r\n }\r\n\r\n private getExistingPartTypeAndRoleIds(): {\r\n typeId: string;\r\n roleId?: string;\r\n }[] {\r\n const groups = this._query.getValue().partGroups;\r\n if (!groups) {\r\n return [];\r\n }\r\n const results = [];\r\n for (const group of groups) {\r\n for (const part of group.parts) {\r\n results.push({\r\n typeId: part.typeId,\r\n roleId: part.roleId,\r\n });\r\n }\r\n }\r\n\r\n return results;\r\n }\r\n\r\n private getNewPartDefinitions(): PartDefinition[] {\r\n const facet = this._query.getValue().facet;\r\n if (!facet) {\r\n return [];\r\n }\r\n\r\n const existingTypeRoleIds = this.getExistingPartTypeAndRoleIds();\r\n\r\n const defs: PartDefinition[] = [];\r\n for (const def of facet.partDefinitions) {\r\n // exclude layer parts, as these are in the layers tab\r\n if (def.roleId?.startsWith('fr.')) {\r\n continue;\r\n }\r\n // exclude parts present in the item\r\n if (\r\n existingTypeRoleIds.find((tr) => {\r\n return (\r\n tr.typeId === def.typeId &&\r\n ((!tr.roleId && !def.roleId) || tr.roleId === def.roleId)\r\n );\r\n })\r\n ) {\r\n continue;\r\n }\r\n defs.push(def);\r\n }\r\n // sort by sort key\r\n defs.sort((a, b) => {\r\n return a.sortKey.localeCompare(b.sortKey);\r\n });\r\n return defs;\r\n }\r\n\r\n /**\r\n * Builds the array of flags controls according to the current flags\r\n * definitions and the current flags value.\r\n */\r\n private buildFlagsControls(): void {\r\n this.flagChecks.clear();\r\n\r\n for (const def of this.flagDefinitions) {\r\n const flagValue = def.id;\r\n // tslint:disable-next-line: no-bitwise\r\n const checked = (this.flags.value & flagValue) !== 0;\r\n this.flagChecks.push(this._formBuilder.control(checked));\r\n }\r\n }\r\n\r\n /**\r\n * Update the flags controls from the current flags value.\r\n */\r\n private updateFlagControls(): void {\r\n if (!this.flagDefinitions) {\r\n return;\r\n }\r\n for (let i = 0; i < this.flagDefinitions.length; i++) {\r\n const flagValue = this.flagDefinitions[i].id;\r\n // tslint:disable-next-line: no-bitwise\r\n const checked = (this.flags.value & flagValue) !== 0;\r\n this.flagChecks.at(i).setValue(checked);\r\n }\r\n }\r\n\r\n /**\r\n * Get the flags value from the flags controls.\r\n */\r\n private getFlagsValue(): number {\r\n let flagsValue = 0;\r\n\r\n for (let i = 0; i < this.flagDefinitions.length; i++) {\r\n const flagValue = this.flagDefinitions[i].id;\r\n if (this.flagChecks.at(i).value) {\r\n // tslint:disable-next-line: no-bitwise\r\n flagsValue |= flagValue;\r\n }\r\n }\r\n return flagsValue;\r\n }\r\n\r\n private updateMetadataForm(item?: Item): void {\r\n if (!item) {\r\n this.metadata.reset();\r\n this.updateFlagControls();\r\n } else {\r\n this.title.setValue(item.title);\r\n this.sortKey.setValue(item.sortKey);\r\n this.description.setValue(item.description);\r\n this.facet.setValue(item.facetId);\r\n this.group.setValue(item.groupId);\r\n this.flags.setValue(item.flags);\r\n this.updateFlagControls();\r\n\r\n this.metadata.markAsPristine();\r\n }\r\n }\r\n\r\n public getTypeIdName(typeId: string): string {\r\n const state = this._appQuery.getValue();\r\n if (!state || !state.typeThesaurus) {\r\n return typeId;\r\n }\r\n // strip :suffix if any\r\n const i = typeId.lastIndexOf(':');\r\n if (i > -1) {\r\n typeId = typeId.substr(0, i);\r\n }\r\n const entry = state.typeThesaurus.entries?.find((e) => e.id === typeId);\r\n return entry ? entry.value : typeId;\r\n }\r\n\r\n public getRoleIdName(roleId: string): string {\r\n if (!roleId || !roleId.startsWith('fr.')) {\r\n return roleId;\r\n }\r\n return this.getTypeIdName(roleId);\r\n }\r\n\r\n private tryTrim(value: string): string {\r\n return value ? value.trim() : value;\r\n }\r\n\r\n public save(): void {\r\n if (!this.metadata.valid) {\r\n return;\r\n }\r\n const item = { ...this._query.getValue().item };\r\n if (!item) {\r\n return;\r\n }\r\n item.title = this.tryTrim(this.title.value);\r\n item.sortKey = this.sortKey.value;\r\n item.description = this.tryTrim(this.description.value);\r\n item.facetId = this.tryTrim(this.facet.value);\r\n item.groupId = this.tryTrim(this.group.value);\r\n item.flags = this.flags.value;\r\n // save and reload as edited if was new\r\n this._editItemService.save(item as Item).then((saved) => {\r\n this.metadata.markAsPristine();\r\n if (!item.id) {\r\n this.id = saved.id;\r\n this._router.navigate(['/items', saved.id]);\r\n }\r\n });\r\n }\r\n\r\n private partExists(typeId: string, roleId?: string): boolean {\r\n const groups = this._query.getValue().partGroups;\r\n if (!groups) {\r\n return false;\r\n }\r\n return groups.some((g) => {\r\n return g.parts.some(\r\n (p) =>\r\n p.typeId === typeId && ((!p.roleId && !roleId) || p.roleId === roleId)\r\n );\r\n });\r\n }\r\n\r\n public addPart(def?: PartDefinition): void {\r\n if (!def && !this.newPartType.valid) {\r\n return;\r\n }\r\n if (!this.id) {\r\n this._snackbar.open('Please save the item before adding parts', 'OK', {\r\n duration: 3000,\r\n });\r\n return;\r\n }\r\n const typeId = def ? def.typeId : this.newPartType.value.typeId;\r\n const roleId = def ? def.roleId : this.newPartType.value.roleId;\r\n\r\n if (this.partExists(typeId, roleId)) {\r\n return;\r\n }\r\n\r\n const route = this._libraryRouteService.buildPartEditorRoute(\r\n this.id,\r\n 'new',\r\n typeId,\r\n roleId\r\n );\r\n\r\n // navigate to the editor\r\n this._router.navigate(\r\n [route.route],\r\n route.rid\r\n ? {\r\n queryParams: {\r\n rid: route.rid,\r\n },\r\n }\r\n : {}\r\n );\r\n }\r\n\r\n public editPart(part: Part): void {\r\n // build the target route to the appropriate part editor\r\n const route = this._libraryRouteService.buildPartEditorRoute(\r\n part.itemId,\r\n part.id,\r\n part.typeId,\r\n part.roleId\r\n );\r\n\r\n // navigate to the editor\r\n this._router.navigate(\r\n [route.route],\r\n route.rid\r\n ? {\r\n queryParams: {\r\n rid: route.rid,\r\n },\r\n }\r\n : {}\r\n );\r\n }\r\n\r\n public deletePart(part: Part): void {\r\n this._dialogService\r\n .confirm('Confirm Deletion', `Delete part \"${part.typeId}\"?`)\r\n .subscribe((result) => {\r\n if (!result) {\r\n return;\r\n }\r\n // delete\r\n this._editItemService.deletePart(part.id).then(\r\n (_) => {\r\n // once deleted, refresh new-part definitions\r\n this.newPartDefinitions = this.getNewPartDefinitions();\r\n },\r\n (error) => {\r\n console.error(error);\r\n this._snackbar.open('Error deleting part', 'OK');\r\n }\r\n );\r\n });\r\n }\r\n\r\n public addLayerPart(part: LayerPartInfo): void {\r\n let name = this.getTypeIdName(part.typeId);\r\n if (part.roleId) {\r\n name += ' for ' + this.getRoleIdName(part.roleId);\r\n }\r\n this._dialogService\r\n .confirm('Confirm Addition', `Add layer \"${name}\"?`)\r\n .subscribe((result) => {\r\n if (!result) {\r\n return;\r\n }\r\n this._editItemService.addNewLayerPart(\r\n part.itemId,\r\n part.typeId,\r\n part.roleId\r\n );\r\n });\r\n }\r\n\r\n public setPartsScope(request: PartScopeSetRequest): void {\r\n this._editItemService.setPartThesaurusScope(request.ids, request.scope);\r\n }\r\n}\r\n","<mat-card>\r\n <mat-card-header>\r\n <mat-card-title>\r\n {{ (item$ | async)?.title || \"Item\" }}\r\n </mat-card-title>\r\n <mat-card-subtitle>\r\n {{ (item$ | async)?.description }}\r\n </mat-card-subtitle>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <p *ngIf=\"id\">\r\n ID:\r\n <input\r\n [cdkCopyToClipboard]=\"(item$ | async)?.id || ''\"\r\n type=\"text\"\r\n readonly=\"true\"\r\n spellcheck=\"false\"\r\n matTooltip=\"Click to copy\"\r\n [value]=\"(item$ | async)?.id\"\r\n class=\"id\"\r\n />\r\n </p>\r\n <p *ngIf=\"item$ | async as item\">\r\n Last saved {{ item.timeModified | date: \"yyyy-MM-dd HH:mm:ss\" }} by\r\n {{ item.userId }}.<br />\r\n Created {{ item.timeCreated | date: \"yyyy-MM-dd HH:mm:ss\" }} by\r\n {{ item.creatorId }}.\r\n </p>\r\n <p *ngIf=\"error$ | async as error\">\r\n <mat-error>\r\n {{ error }}\r\n </mat-error>\r\n </p>\r\n\r\n <mat-progress-bar\r\n mode=\"indeterminate\"\r\n *ngIf=\"(loading$ | async) || (saving$ | async)\"\r\n ></mat-progress-bar>\r\n\r\n <!-- item content -->\r\n <mat-tab-group [selectedIndex]=\"id ? 1 : 0\">\r\n <!-- metadata -->\r\n <mat-tab label=\"Metadata\">\r\n <form [formGroup]=\"metadata\" (ngSubmit)=\"save()\">\r\n <div class=\"form-row\">\r\n <!-- title -->\r\n <mat-form-field style=\"flex: 1 0 auto\">\r\n <input\r\n matInput\r\n type=\"text\"\r\n id=\"title\"\r\n placeholder=\"title\"\r\n formControlName=\"title\"\r\n />\r\n <mat-error\r\n *ngIf=\"\r\n title.hasError('required') && (title.touched || title.dirty)\r\n \"\r\n >enter title</mat-error\r\n >\r\n <mat-error\r\n *ngIf=\"\r\n title.hasError('maxLength') && (title.touched || title.dirty)\r\n \"\r\n >\r\n title too long</mat-error\r\n >\r\n </mat-form-field>\r\n\r\n <!-- sortKey -->\r\n <mat-form-field style=\"flex: 1 0 auto\">\r\n <input\r\n matInput\r\n type=\"text\"\r\n id=\"sortKey\"\r\n placeholder=\"sort key\"\r\n formControlName=\"sortKey\"\r\n />\r\n <mat-error\r\n *ngIf=\"\r\n sortKey.hasError('required') &&\r\n (sortKey.touched || sortKey.dirty)\r\n \"\r\n >enter sort key</mat-error\r\n >\r\n <mat-error\r\n *ngIf=\"\r\n sortKey.hasError('maxLength') &&\r\n (sortKey.touched || sortKey.dirty)\r\n \"\r\n >sort key too long</mat-error\r\n >\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- description -->\r\n <div>\r\n <mat-form-field class=\"full-width\">\r\n <textarea\r\n rows=\"2\"\r\n matInput\r\n id=\"description\"\r\n placeholder=\"description\"\r\n formControlName=\"description\"\r\n ></textarea>\r\n <mat-error\r\n *ngIf=\"\r\n description.hasError('required') &&\r\n (description.touched || description.dirty)\r\n \"\r\n >enter description</mat-error\r\n >\r\n <mat-error\r\n *ngIf=\"\r\n description.hasError('maxLength') &&\r\n (description.touched || description.dirty)\r\n \"\r\n >description too long</mat-error\r\n >\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- facet -->\r\n <div class=\"form-row\">\r\n <mat-form-field>\r\n <mat-select\r\n placeholder=\"facet\"\r\n formControlName=\"facet\"\r\n required=\"true\"\r\n >\r\n <mat-option *ngFor=\"let f of facets$ | async\" [value]=\"f.id\">\r\n {{ f.label }}\r\n </mat-option>\r\n </mat-select>\r\n <mat-error>please select a facet</mat-error>\r\n </mat-form-field>\r\n\r\n <!-- group -->\r\n <mat-form-field>\r\n <input matInput formControlName=\"group\" placeholder=\"group ID\" />\r\n <mat-error\r\n *ngIf=\"\r\n group.hasError('maxLength') && (group.dirty || group.touched)\r\n \"\r\n >too long</mat-error\r\n >\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- flags -->\r\n <fieldset>\r\n <legend>flags</legend>\r\n <div formArrayName=\"flagChecks\" *ngIf=\"flagDefinitions\">\r\n <mat-checkbox\r\n class=\"flag\"\r\n *ngFor=\"let c of flagChecks.controls; let i = index\"\r\n [formControlName]=\"i\"\r\n >\r\n <span [style.color]=\"'#' + flagDefinitions[i].colorKey\"\r\n >&#x2b24;</span\r\n >\r\n &nbsp;\r\n {{ flagDefinitions[i].label }}\r\n </mat-checkbox>\r\n </div>\r\n </fieldset>\r\n <br />\r\n\r\n <div>\r\n <button\r\n type=\"submit\"\r\n mat-raised-button\r\n color=\"primary\"\r\n [disabled]=\"\r\n userLevel < 2 || (saving$ | async) || (loading$ | async)\r\n \"\r\n matTooltip=\"Save metadata\"\r\n *ngIf=\"\r\n user?.roles?.length &&\r\n (user?.roles?.includes('admin') ||\r\n user?.roles?.includes('editor') ||\r\n user?.roles?.includes('operator'))\r\n \"\r\n >\r\n <mat-icon>save</mat-icon> save\r\n </button>\r\n </div>\r\n </form>\r\n </mat-tab>\r\n\r\n <!-- parts -->\r\n <mat-tab label=\"Parts\" *ngIf=\"id\">\r\n <div class=\"new-part\">\r\n <form [formGroup]=\"newPart\">\r\n <mat-form-field>\r\n <mat-select\r\n placeholder=\"part\"\r\n formControlName=\"newPartType\"\r\n required\r\n >\r\n <mat-option *ngFor=\"let p of newPartDefinitions\" [value]=\"p\">\r\n <span [style.color]=\"'#' + p.colorKey\" class=\"new-part-icon\"\r\n >&#x2b24;</span\r\n >\r\n {{ p.name }}\r\n <span *ngIf=\"p.roleId\" class=\"new-part-role\">{{\r\n p.roleId\r\n }}</span>\r\n </mat-option>\r\n </mat-select>\r\n <mat-error>part type required</mat-error>\r\n </mat-form-field>\r\n &nbsp;\r\n <button\r\n mat-stroked-button\r\n color=\"primary\"\r\n type=\"button\"\r\n [disabled]=\"userLevel < 2 || (loading$ | async) || !newPart.valid\"\r\n (click)=\"addPart()\"\r\n matTooltip=\"Add a new part of the selected type\"\r\n >\r\n <mat-icon>add_circle</mat-icon>\r\n add part\r\n </button>\r\n </form>\r\n </div>\r\n\r\n <mat-divider></mat-divider>\r\n\r\n <mat-expansion-panel\r\n *ngFor=\"let group of partGroups$ | async\"\r\n [expanded]=\"true\"\r\n >\r\n <mat-expansion-panel-header>\r\n <mat-panel-title\r\n ><strong>{{ group.label }}</strong></mat-panel-title\r\n >\r\n <mat-panel-description>{{\r\n group.parts.length\r\n }}</mat-panel-description>\r\n </mat-expansion-panel-header>\r\n\r\n <table>\r\n <thead>\r\n <tr>\r\n <th style=\"width: 124px\"></th>\r\n <th>type</th>\r\n <th>role</th>\r\n <th fxHide.xs>modified</th>\r\n <th fxHide.xs>user</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let part of group.parts\">\r\n <!-- edit -->\r\n <td>\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n color=\"primary\"\r\n matTooltip=\"Edit this part\"\r\n [disabled]=\"(loading$ | async) || (deletingPart$ | async)\"\r\n (click)=\"editPart(part)\"\r\n >\r\n <mat-icon>create</mat-icon>\r\n </button>\r\n <!-- delete -->\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Delete this part\"\r\n [disabled]=\"\r\n userLevel < 2 ||\r\n (loading$ | async) ||\r\n (deletingPart$ | async)\r\n \"\r\n (click)=\"deletePart(part)\"\r\n *ngIf=\"\r\n user?.roles?.length &&\r\n (user?.roles?.includes('admin') ||\r\n user?.roles?.includes('editor') ||\r\n user?.roles?.includes('operator'))\r\n \"\r\n >\r\n <mat-icon color=\"warn\">delete</mat-icon>\r\n </button>\r\n <!-- copy -->\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Copy this part ID\"\r\n [cdkCopyToClipboard]=\"part.id\"\r\n >\r\n <mat-icon>assignment</mat-icon>\r\n </button>\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"(facet$ | async) || undefined\"\r\n [badgeType]=\"1\"\r\n [typeThesaurus]=\"(typeThesaurus$ | async) || undefined\"\r\n ></cadmus-part-badge>\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"(facet$ | async) || undefined\"\r\n [badgeType]=\"2\"\r\n [typeThesaurus]=\"(typeThesaurus$ | async) || undefined\"\r\n ></cadmus-part-badge>\r\n </td>\r\n <td fxHide.xs>\r\n {{ part.timeModified | date: \"yyyy-MM-dd HH:mm:ss\" }}\r\n </td>\r\n <td fxHide.xs>{{ part.userId }}</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </mat-expansion-panel>\r\n\r\n <cadmus-missing-parts\r\n [partDefinitions]=\"(facet$ | async)?.partDefinitions\"\r\n [parts]=\"(parts$ | async) || undefined\"\r\n [typeThesaurus]=\"(typeThesaurus$ | async) || undefined\"\r\n (addRequest)=\"addPart($event)\"\r\n ></cadmus-missing-parts>\r\n </mat-tab>\r\n\r\n <mat-tab label=\"Layers\" *ngIf=\"id\">\r\n <table id=\"layers\" *ngIf=\"layerPartInfos$ | async as parts\">\r\n <thead>\r\n <th></th>\r\n <th>type</th>\r\n <th>role</th>\r\n <th>frr.</th>\r\n <th>last modified</th>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let part of parts\">\r\n <td>\r\n <button\r\n *ngIf=\"!part.isAbsent\"\r\n type=\"button\"\r\n color=\"primary\"\r\n mat-icon-button\r\n matTooltip=\"Edit this layer part\"\r\n (click)=\"editPart(part)\"\r\n >\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n <button\r\n *ngIf=\"part.isAbsent\"\r\n type=\"button\"\r\n mat-icon-button\r\n color=\"primary\"\r\n matTooltip=\"Add this layer part\"\r\n [disabled]=\"userLevel < 2\"\r\n (click)=\"addLayerPart(part)\"\r\n >\r\n <mat-icon>add_circle</mat-icon>\r\n </button>\r\n <button\r\n *ngIf=\"!part.isAbsent\"\r\n type=\"button\"\r\n mat-icon-button\r\n color=\"warn\"\r\n matTooltip=\"Delete this layer part\"\r\n [disabled]=\"userLevel < 2\"\r\n (click)=\"deletePart(part)\"\r\n >\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n <button\r\n *ngIf=\"!part.isAbsent\"\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Copy this part ID\"\r\n [cdkCopyToClipboard]=\"part.id\"\r\n >\r\n <mat-icon>assignment</mat-icon>\r\n </button>\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"(facet$ | async) || undefined\"\r\n [badgeType]=\"1\"\r\n [typeThesaurus]=\"(typeThesaurus$ | async) || undefined\"\r\n ></cadmus-part-badge>\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"(facet$ | async) || undefined\"\r\n [badgeType]=\"2\"\r\n [typeThesaurus]=\"(typeThesaurus$ | async) || undefined\"\r\n ></cadmus-part-badge>\r\n </td>\r\n <td\r\n [ngClass]=\"{\r\n 'count-n': part.fragmentCount,\r\n 'count-z': !part.fragmentCount\r\n }\"\r\n >\r\n {{ part.fragmentCount }}\r\n </td>\r\n <td>\r\n <span *ngIf=\"!part.isAbsent\">\r\n {{ part.timeModified | date: \"yyyy-MM-dd HH:mm:ss\" }}\r\n </span>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </mat-tab>\r\n\r\n <mat-tab label=\"Th-Scopes\" *ngIf=\"parts$ | async as parts\">\r\n <!-- [parts]=\"parts | sort: 'typeId' | sort: 'roleId'\" -->\r\n <cadmus-parts-scope-editor\r\n [parts]=\"parts\"\r\n [readonly]=\"\r\n userLevel < 2 || (saving$ | async) || (loading$ | async)\r\n ? true\r\n : false\r\n \"\r\n (setScopeRequest)=\"setPartsScope($event)\"\r\n ></cadmus-parts-scope-editor>\r\n </mat-tab>\r\n </mat-tab-group>\r\n </mat-card-content>\r\n</mat-card>\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { RouterModule } from '@angular/router';\r\nimport { ReactiveFormsModule, FormsModule } from '@angular/forms';\r\nimport { ClipboardModule } from '@angular/cdk/clipboard';\r\n\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatCardModule } from '@angular/material/card';\r\nimport { MatCheckboxModule } from '@angular/material/checkbox';\r\nimport { MatDividerModule } from '@angular/material/divider';\r\nimport { MatExpansionModule } from '@angular/material/expansion';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\r\nimport { MatSelectModule } from '@angular/material/select';\r\nimport { MatTabsModule } from '@angular/material/tabs';\r\n\r\nimport { NgToolsModule } from '@myrmidon/ng-tools';\r\nimport { NgMatToolsModule } from '@myrmidon/ng-mat-tools';\r\nimport { CadmusCoreModule } from '@myrmidon/cadmus-core';\r\nimport { CadmusApiModule } from '@myrmidon/cadmus-api';\r\nimport { CadmusUiModule } from '@myrmidon/cadmus-ui';\r\nimport { CadmusStateModule } from '@myrmidon/cadmus-state';\r\n\r\nimport { ItemEditorComponent } from './item-editor/item-editor.component';\r\nimport { PartsScopeEditorComponent } from './parts-scope-editor/parts-scope-editor.component';\r\nimport { MissingPartsComponent } from './missing-parts/missing-parts.component';\r\n\r\n// https://github.com/ng-packagr/ng-packagr/issues/778\r\nexport const RouterModuleForChild = RouterModule.forChild([\r\n { path: '', pathMatch: 'full', component: ItemEditorComponent },\r\n]);\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n ReactiveFormsModule,\r\n FormsModule,\r\n RouterModuleForChild,\r\n ClipboardModule,\r\n // material\r\n MatButtonModule,\r\n MatCheckboxModule,\r\n MatCardModule,\r\n MatDividerModule,\r\n MatExpansionModule,\r\n MatFormFieldModule,\r\n MatIconModule,\r\n MatInputModule,\r\n MatProgressBarModule,\r\n MatSelectModule,\r\n MatTabsModule,\r\n // cadmus\r\n CadmusCoreModule,\r\n CadmusApiModule,\r\n CadmusUiModule,\r\n CadmusStateModule,\r\n NgToolsModule,\r\n NgMatToolsModule,\r\n ],\r\n declarations: [\r\n ItemEditorComponent,\r\n MissingPartsComponent,\r\n PartsScopeEditorComponent,\r\n ],\r\n exports: [ItemEditorComponent],\r\n})\r\nexport class CadmusItemEditorModule {}\r\n","/*\r\n * Public API Surface of cadmus-item-editor\r\n */\r\n\r\nexport * from './lib/item-editor/item-editor.component';\r\nexport * from './lib/cadmus-item-editor.module';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MASa,qBAAqB;IAwChC;QACE,IAAI,CAAC,kBAAkB,GAAG,EAAE,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,IAAI,YAAY,EAAkB,CAAC;KACtD;IApCD,IACW,eAAe;QACxB,OAAO,IAAI,CAAC,gBAAgB,CAAC;KAC9B;IACD,IAAW,eAAe,CAAC,KAAmC;QAC5D,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC;QAC9B,IAAI,CAAC,aAAa,EAAE,CAAC;KACtB;IAED,IACW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;KACpB;IACD,IAAW,KAAK,CAAC,KAAyB;QACxC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,aAAa,EAAE,CAAC;KACtB;;;;IAKD,IACW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;KAC5B;IACD,IAAW,aAAa,CAAC,KAA4B;QACnD,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;QAC5B,IAAI,CAAC,aAAa,EAAE,CAAC;KACtB;IAUD,QAAQ,MAAW;IAEX,aAAa,CAAC,MAAc,EAAE,MAAe;QACnD,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;YAC1B,OAAO,KAAK,CAAC;SACd;QACD,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAC/B,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,MAAM,IAAI,CAAC,CAAC,MAAM,KAAK,MAAM,CAClD,CAAC;KACH;IAEO,aAAa;QACnB,IAAI,CAAC,kBAAkB,CAAC,MAAM,GAAG,CAAC,CAAC;QACnC,IAAI,CAAC,IA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,sBAAsB;kBAlClC,QAAQ;mBAAC;oBACR,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,WAAW;wBACX,oBAAoB;wBACpB,eAAe;;wBAEf,eAAe;wBACf,iBAAiB;wBACjB,aAAa;wBACb,gBAAgB;wBAChB,kBAAkB;wBAClB,kBAAkB;wBAClB,aAAa;wBACb,cAAc;wBACd,oBAAoB;wBACpB,eAAe;wBACf,aAAa;;wBAEb,gBAAgB;wBAChB,eAAe;wBACf,cAAc;wBACd,iBAAiB;wBACjB,aAAa;wBACb,gBAAgB;qBACjB;oBACD,YAAY,EAAE;wBACZ,mBAAmB;wBACnB,qBAAqB;wBACrB,yBAAyB;qBAC1B;oBACD,OAAO,EAAE,CAAC,mBAAmB,CAAC;iBAC/B;;;ACnED;;;;ACAA;;;;;;"}
@@ -7,17 +7,26 @@ import * as i4 from "@angular/common";
7
7
  import * as i5 from "@angular/forms";
8
8
  import * as i6 from "@angular/router";
9
9
  import * as i7 from "@angular/cdk/clipboard";
10
- import * as i8 from "ngx-moment";
11
- import * as i9 from "@myrmidon/cadmus-core";
12
- import * as i10 from "@myrmidon/cadmus-material";
13
- import * as i11 from "@myrmidon/cadmus-api";
14
- import * as i12 from "@myrmidon/cadmus-ui";
15
- import * as i13 from "@myrmidon/cadmus-state";
16
- import * as i14 from "@myrmidon/ng-tools";
17
- import * as i15 from "@myrmidon/ng-mat-tools";
10
+ import * as i8 from "@angular/material/button";
11
+ import * as i9 from "@angular/material/checkbox";
12
+ import * as i10 from "@angular/material/card";
13
+ import * as i11 from "@angular/material/divider";
14
+ import * as i12 from "@angular/material/expansion";
15
+ import * as i13 from "@angular/material/form-field";
16
+ import * as i14 from "@angular/material/icon";
17
+ import * as i15 from "@angular/material/input";
18
+ import * as i16 from "@angular/material/progress-bar";
19
+ import * as i17 from "@angular/material/select";
20
+ import * as i18 from "@angular/material/tabs";
21
+ import * as i19 from "@myrmidon/cadmus-core";
22
+ import * as i20 from "@myrmidon/cadmus-api";
23
+ import * as i21 from "@myrmidon/cadmus-ui";
24
+ import * as i22 from "@myrmidon/cadmus-state";
25
+ import * as i23 from "@myrmidon/ng-tools";
26
+ import * as i24 from "@myrmidon/ng-mat-tools";
18
27
  export declare const RouterModuleForChild: import("@angular/core").ModuleWithProviders<RouterModule>;
19
28
  export declare class CadmusItemEditorModule {
20
29
  static ɵfac: i0.ɵɵFactoryDeclaration<CadmusItemEditorModule, never>;
21
- static ɵmod: i0.ɵɵNgModuleDeclaration<CadmusItemEditorModule, [typeof i1.ItemEditorComponent, typeof i2.MissingPartsComponent, typeof i3.PartsScopeEditorComponent], [typeof i4.CommonModule, typeof i5.ReactiveFormsModule, typeof i5.FormsModule, typeof i6.RouterModule, typeof i7.ClipboardModule, typeof i8.MomentModule, typeof i9.CadmusCoreModule, typeof i10.CadmusMaterialModule, typeof i11.CadmusApiModule, typeof i12.CadmusUiModule, typeof i13.CadmusStateModule, typeof i14.NgToolsModule, typeof i15.NgMatToolsModule], [typeof i1.ItemEditorComponent]>;
30
+ static ɵmod: i0.ɵɵNgModuleDeclaration<CadmusItemEditorModule, [typeof i1.ItemEditorComponent, typeof i2.MissingPartsComponent, typeof i3.PartsScopeEditorComponent], [typeof i4.CommonModule, typeof i5.ReactiveFormsModule, typeof i5.FormsModule, typeof i6.RouterModule, typeof i7.ClipboardModule, typeof i8.MatButtonModule, typeof i9.MatCheckboxModule, typeof i10.MatCardModule, typeof i11.MatDividerModule, typeof i12.MatExpansionModule, typeof i13.MatFormFieldModule, typeof i14.MatIconModule, typeof i15.MatInputModule, typeof i16.MatProgressBarModule, typeof i17.MatSelectModule, typeof i18.MatTabsModule, typeof i19.CadmusCoreModule, typeof i20.CadmusApiModule, typeof i21.CadmusUiModule, typeof i22.CadmusStateModule, typeof i23.NgToolsModule, typeof i24.NgMatToolsModule], [typeof i1.ItemEditorComponent]>;
22
31
  static ɵinj: i0.ɵɵInjectorDeclaration<CadmusItemEditorModule>;
23
32
  }
@@ -3,11 +3,12 @@ import { FormControl, FormGroup, FormBuilder, FormArray } from '@angular/forms';
3
3
  import { ActivatedRoute, Router } from '@angular/router';
4
4
  import { MatSnackBar } from '@angular/material/snack-bar';
5
5
  import { Observable } from 'rxjs';
6
- import { AuthService } from '@myrmidon/cadmus-api';
7
- import { Item, PartGroup, PartDefinition, FacetDefinition, FlagDefinition, Part, LibraryRouteService, User, LayerPartInfo, Thesaurus, ComponentCanDeactivate } from '@myrmidon/cadmus-core';
6
+ import { Item, PartGroup, PartDefinition, FacetDefinition, FlagDefinition, Part, LibraryRouteService, LayerPartInfo, Thesaurus, ComponentCanDeactivate } from '@myrmidon/cadmus-core';
8
7
  import { EditItemQuery, EditItemService, AppQuery } from '@myrmidon/cadmus-state';
9
8
  import { DialogService } from '@myrmidon/ng-mat-tools';
10
9
  import { PartScopeSetRequest } from '../parts-scope-editor/parts-scope-editor.component';
10
+ import { AuthJwtService, User } from '@myrmidon/auth-jwt-login';
11
+ import { UserLevelService } from '@myrmidon/cadmus-api';
11
12
  import * as i0 from "@angular/core";
12
13
  /**
13
14
  * Item editor. This can edit a new or existing item's metadata and parts.
@@ -22,6 +23,7 @@ export declare class ItemEditorComponent implements OnInit, ComponentCanDeactiva
22
23
  private _libraryRouteService;
23
24
  private _dialogService;
24
25
  private _authService;
26
+ private _userLevelService;
25
27
  private _formBuilder;
26
28
  flagDefinitions: FlagDefinition[];
27
29
  id?: string;
@@ -49,7 +51,7 @@ export declare class ItemEditorComponent implements OnInit, ComponentCanDeactiva
49
51
  flags: FormControl;
50
52
  flagChecks: FormArray;
51
53
  metadata: FormGroup;
52
- constructor(_router: Router, _route: ActivatedRoute, _snackbar: MatSnackBar, _appQuery: AppQuery, _query: EditItemQuery, _editItemService: EditItemService, _libraryRouteService: LibraryRouteService, _dialogService: DialogService, _authService: AuthService, _formBuilder: FormBuilder);
54
+ constructor(_router: Router, _route: ActivatedRoute, _snackbar: MatSnackBar, _appQuery: AppQuery, _query: EditItemQuery, _editItemService: EditItemService, _libraryRouteService: LibraryRouteService, _dialogService: DialogService, _authService: AuthJwtService, _userLevelService: UserLevelService, _formBuilder: FormBuilder);
53
55
  ngOnInit(): void;
54
56
  canDeactivate(): boolean | Observable<boolean>;
55
57
  private getExistingPartTypeAndRoleIds;
package/package.json CHANGED
@@ -1,29 +1,24 @@
1
1
  {
2
2
  "name": "@myrmidon/cadmus-item-editor",
3
- "version": "0.3.0",
4
- "description": "Cadmus - item editor component.",
3
+ "version": "1.0.2",
4
+ "description": "Cadmus - item editor.",
5
5
  "keywords": [
6
6
  "Cadmus"
7
7
  ],
8
- "homepage": "https://github.com/vedph/cadmus_shell",
8
+ "homepage": "https://github.com/vedph/cadmus-shell",
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "https://github.com/vedph/cadmus_shell"
11
+ "url": "https://github.com/vedph/cadmus-shell"
12
12
  },
13
13
  "author": {
14
14
  "name": "Daniele Fusi"
15
15
  },
16
16
  "peerDependencies": {
17
17
  "@angular/common": "^13.0.0",
18
- "@angular/core": "^13.0.0",
19
- "@myrmidon/cadmus-core": "^0.3.0",
20
- "@myrmidon/cadmus-material": "^0.1.0",
21
- "@myrmidon/cadmus-api": "^0.3.0",
22
- "@myrmidon/cadmus-ui": "^0.3.0",
23
- "@myrmidon/cadmus-state": "^0.3.0"
18
+ "@angular/core": "^13.0.0"
24
19
  },
25
20
  "dependencies": {
26
- "tslib": "^2.0.0"
21
+ "tslib": "^2.3.0"
27
22
  },
28
23
  "module": "fesm2015/myrmidon-cadmus-item-editor.mjs",
29
24
  "es2020": "fesm2020/myrmidon-cadmus-item-editor.mjs",