{"version":3,"file":"522.0e3f7489373dc061.js","sources":["./src/app/core/entity/model/entity-update.ts","./src/app/features/dashboard-widgets/shortcut-dashboard-widget/shortcut-dashboard/shortcut-dashboard.component.html","./src/app/features/dashboard-widgets/shortcut-dashboard-widget/shortcut-dashboard/shortcut-dashboard.component.ts"],"sourceRoot":"webpack:///","sourcesContent":["import { Entity } from \"./entity\";\n\n/**\n * Interface that conveys an updated entity as well as information\n * on the update-type\n */\nexport interface UpdatedEntity {\n /**\n * The updated entity\n */\n entity: T;\n\n /**\n * The type of the update, either:\n * \"new\" - a new entity was created,\n * \"update\" - an existing entity was updated\n * \"remove\" - the entity was deleted\n */\n type: \"new\" | \"update\" | \"remove\";\n}\n\n/**\n * Updates a list of entities given an updated version of the entity. This updated version\n * can either be a new entity (that should be inserted into the list), or an existing entity\n * that should be updated or deleted.\n * The given array will not be mutated but will be returned when the given new entity\n * or type is illegal\n * @param next An entity that should be updated as well as the type of update. This, as well as the entity\n * may be undefined or null. In this event, the entities-array is returned as is.\n * @param entities The entities to update, must be defined\n * @param addIfMissing (Optional) whether to add an entity that comes through an update event but is not part of the array yet,\n * default is to add, disable this if you do special filtering or calculations on the data\n * @return An array of the given entities with the update applied\n */\nexport function applyUpdate(\n entities: T[],\n next: UpdatedEntity,\n addIfMissing: boolean = true,\n): T[] {\n if (!next || !next.entity || !entities) {\n return entities;\n }\n\n if (\n (next.type === \"new\" || (addIfMissing && next.type === \"update\")) &&\n !entities.find((e) => e.getId() === next.entity.getId())\n ) {\n return [next.entity].concat(entities);\n }\n\n if (next.type === \"update\") {\n return entities.map((e) =>\n e.getId() === next.entity.getId() ? next.entity : e,\n );\n }\n\n if (next.type === \"remove\") {\n return entities.filter((e) => e.getId() !== next.entity.getId());\n }\n\n return entities;\n}\n","\n
\n \n \n \n \n \n \n \n \n \n\n \n \n \n\n \n \n \n\n \n
\n \n \n {{ row.label }}\n \n \n \n \n
\n
\n\n","import { Component, Input } from \"@angular/core\";\nimport { MenuItem } from \"../../../../core/ui/navigation/menu-item\";\nimport { MatTableModule } from \"@angular/material/table\";\nimport { DynamicComponent } from \"../../../../core/config/dynamic-components/dynamic-component.decorator\";\nimport { FaDynamicIconComponent } from \"../../../../core/common-components/fa-dynamic-icon/fa-dynamic-icon.component\";\nimport { RouterLink } from \"@angular/router\";\nimport { DashboardListWidgetComponent } from \"../../../../core/dashboard/dashboard-list-widget/dashboard-list-widget.component\";\nimport { RoutePermissionsService } from \"../../../../core/config/dynamic-routing/route-permissions.service\";\nimport { FaIconComponent } from \"@fortawesome/angular-fontawesome\";\nimport { MatIconButton } from \"@angular/material/button\";\nimport { MatTooltip } from \"@angular/material/tooltip\";\nimport { LocationStrategy } from \"@angular/common\";\nimport { AlertService } from \"../../../../core/alerts/alert.service\";\nimport { Clipboard } from \"@angular/cdk/clipboard\";\n\n/**\n * A simple list of shortcuts displayed as a dashboard widget for easy access to important navigation.\n */\n@DynamicComponent(\"ShortcutDashboard\")\n@Component({\n selector: \"app-shortcut-dashboard\",\n templateUrl: \"./shortcut-dashboard.component.html\",\n styleUrls: [\"./shortcut-dashboard.component.scss\"],\n imports: [\n DashboardListWidgetComponent,\n MatTableModule,\n FaDynamicIconComponent,\n RouterLink,\n FaIconComponent,\n MatIconButton,\n MatTooltip,\n ],\n standalone: true,\n})\nexport class ShortcutDashboardComponent {\n /** displayed entries, each representing one line displayed as a shortcut */\n @Input() set shortcuts(items: MenuItem[]) {\n this.routePermissionsService\n .filterPermittedRoutes(items)\n .then((res) => (this._shortcuts = res));\n }\n get shortcuts(): MenuItem[] {\n return this._shortcuts;\n }\n _shortcuts: MenuItem[] = [];\n\n @Input() subtitle: string =\n $localize`:dashboard widget subtitle:Quick Actions`;\n @Input() explanation: string =\n $localize`:dashboard widget explanation:Shortcuts to quickly navigate to common actions`;\n\n constructor(\n private routePermissionsService: RoutePermissionsService,\n private locationStrategy: LocationStrategy,\n private clipboard: Clipboard,\n private alertService: AlertService,\n ) {}\n\n async copyAbsoluteLink2Clipboard(link: string) {\n const externalLink =\n window.location.origin + this.locationStrategy.prepareExternalUrl(link);\n const success = this.clipboard.copy(externalLink);\n if (success) {\n this.alertService.addInfo(\"Link copied: \" + externalLink);\n }\n }\n}\n"],"names":["applyUpdate","entities","next","addIfMissing","entity","type","find","e","getId","concat","map","filter","i0","row_r1","link","icon","row_r2","label","row_r4","_r3","$implicit","ctx_r4","copyAbsoluteLink2Clipboard","_c1","ShortcutDashboardComponent","shortcuts","items","this","routePermissionsService","filterPermittedRoutes","then","res","_shortcuts","constructor","locationStrategy","clipboard","alertService","subtitle","$localize","explanation","_this","_asyncToGenerator","externalLink","window","location","origin","prepareExternalUrl","copy","addInfo","i1","i2","i3","i4","selectors","inputs","standalone","features","decls","vars","consts","i18n_0","ShortcutDashboardComponent_td_9_Template","ShortcutDashboardComponent_td_11_Template","ShortcutDashboardComponent_td_13_Template","ShortcutDashboardComponent_tr_14_Template","ctx","_c0","DashboardListWidgetComponent","MatTableModule","i5","FaDynamicIconComponent","RouterLink","FaIconComponent","MatIconButton","MatTooltip","styles","__decorate","DynamicComponent","tslib__WEBPACK_IMPORTED_MODULE_13__","Sn","RoutePermissionsService","LocationStrategy","Clipboard","AlertService"],"mappings":";;iGAkCM,SAAUA,EACdC,EACAC,EACAC,GAAwB,GAExB,OAAKD,GAASA,EAAKE,QAAWH,GAKb,QAAdC,EAAKG,MAAmBF,GAA8B,WAAdD,EAAKG,QAC7CJ,EAASK,KAAMC,GAAMA,EAAEC,UAAYN,EAAKE,OAAOI,SAEzC,CAACN,EAAKE,QAAQK,OAAOR,GAGZ,WAAdC,EAAKG,KACAJ,EAASS,IAAKH,GACnBA,EAAEC,UAAYN,EAAKE,OAAOI,QAAUN,EAAKE,OAASG,GAIpC,WAAdL,EAAKG,KACAJ,EAASU,OAAQJ,GAAMA,EAAEC,UAAYN,EAAKE,OAAOI,SAGnDP,EApBEA,CAqBX,+UC9CQW,MAAA,WACEA,MAAA,4BACFA,kCAF0CA,MAAA,aAAAC,EAAAC,MACn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