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AAOxB,GAAKA,EAAEuB,WAAarE,KAAKF,cAE5E,CAEO,cAAAgG,GACN9F,KAAKF,cAAgBE,KAAKF,aAC1BQ,QAAQC,IAAI,0BAA2BP,KAAKF,cAC5CE,KAAK6F,uBACN,CAEO,wBAAAE,GACN,OAAO/F,KAAKF,aAAe,MAAQ,IACpC,CAEO,YAAMkG,CAAOC,SACbjG,KAAKb,YAAY6G,OAAOC,GAAYC,MAAKxB,IAC9C1E,KAAKL,OAAS+E,EAAO/E,OACrBK,KAAKc,aAAe4D,EAAO5D,YAAY,GAEzC,CAEO,qBAAMqF,SACNnG,KAAKb,YAAYiH,cAAcpG,KAAKX,iBAAiB6G,MAAKxB,IAC/D1E,KAAKT,mBAAqBmF,EAAOF,SACjCxE,KAAKN,YAAcgF,EAAOhF,WAAW,GAEvC,CAEO,eAAM2G,SACNrG,KAAKb,YAAYkH,UAAUrG,KAAKX,gBAAiBW,KAAKJ,WAAYI,KAAKV,iBAAiB4G,MAAKxB,IAC9FA,IACH1E,KAAKT,mBAAqBmF,EAAOF,SACjCxE,KAAKN,YAAcgF,EAAOhF,Y,GAG7B,CAEQ,YAAAkG,CAAaU,EAAWC,GAC/B,OAAGD,EAAIC,GACE,EACAD,EAAIC,EACA,EAEA,CAEZ,GA3RU9H,E,mUAAc,EAD1B,EAAA+H,W,kIAmB4B,KACN,IACH,EAAAC,gBACD,IACK,IACE,IACR,EAAAC,KACS,IACF,OA1BZjI,E","sources":["webpack://client-app/./src/app/project/parameters/list/parameters-list.scss","webpack://client-app/./src/app/project/parameters/list/parameters-list.html","webpack://client-app/./src/app/project/parameters/list/parameters-list.ts"],"sourcesContent":["// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.parameters-list .headers{grid-template-columns:6ch minmax(200px, 400px) repeat(5, minmax(170px, 200px)) minmax(300px, 1fr)}.parameters-list .main .element{grid-template-columns:6ch minmax(200px, 400px) repeat(5, minmax(170px, 200px)) minmax(300px, 1fr)}.parameters-list .main .element .category{margin-right:calc(15px/2);padding:calc(15px/2) calc(15px/1.5);user-select:none}`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/app/project/parameters/list/parameters-list.scss\"],\"names\":[],\"mappings\":\"AAOC,0BACC,iGANuB,CAUvB,gCACC,iGAXsB,CAatB,0CACC,yBAAA,CACA,mCAAA,CACA,gBAAA\",\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Module\nvar code = `<template> <require from=\"./parameters-list.scss\"></require> <top-bar show-search.bind=\"true\" with-breadcrumb.bind=\"true\"> <div slot=\"slot-right\"> <button click.delegate=\"openCreateParameterModal()\" disabled.bind=\"showArchived\" class=\"btn btn-with-theme\" i18n=\"translation:[title]CreateParameter\"> <i class=\"far fa-plus fa-fw\"></i> </button> <button disabled.bind=\"selectedParameters.length < 1\" class=\"btn btn-with-theme\" click.trigger=\"delete()\" i18n=\"translation:[title]Remove\"> <i class=\"fa-solid fa-trash fa-fw\"></i> </button> <button click.delegate=\"openAggregateParameterModal()\" disabled.bind=\"showArchived\" class=\"btn btn-with-theme\" i18n=\"translation:[title]AggregateParameter\"> <i class=\"far fa-project-diagram\"></i> </button> <button click.delegate=\"openBulkParameters()\" disabled.bind=\"showArchived\" class=\"btn btn-with-theme\" i18n=\"translation:[title]Model Parameters\"> <i class=\"fal fa-table fa-fw\"></i> </button> <button if.bind=\"prerelease_archived\" click.delegate=\"toggleArchived()\" class=\"btn btn-with-theme \\${showArchived ? 'btn-outline-info' : ''}\" i18n=\"translation:[title]Show Archived Parameters\"> <i class=\"fal fa-cabinet-filing fa-fw\"></i> </button> <button if.bind=\"showArchived\" click.delegate=\"unArchiveParameter()\" class=\"btn btn-with-theme\" i18n=\"translation:[title]Unarchive Parameter\"> <i class=\"fal fa-ambulance fa-fw\"></i> </button> </div> </top-bar> <div class=\"parameters-list widget-background\" css-grid-table> <div class=\"headers\"> <div class=\"cell\"> <label class=\"checkbox-with-theme\" change.delegate=\"toggleAll()\"> <input type=\"checkbox\" checked.bind=\"allSelected\"> </label> </div> <div class=\"cell\" click.delegate=\"sortBy('name')\"> <span i18n=\"translation:Name\"> Name </span> <span class=\"icon\" show.bind=\"column === 'name'\" innerhtml=\"<i class='fad \\${displayState.icon}'></i>\"></span> </div> <div class=\"cell\" click.delegate=\"sortBy('syncDirection')\"> <span i18n=\"translation:SyncDirection\"> Sync direction </span> <span class=\"icon\" show.bind=\"column === 'syncDirection'\" innerhtml=\"<i class='fad \\${displayState.icon}'></i>\"></span> </div> <div class=\"cell\" click.delegate=\"sortBy('paramType')\"> <span i18n=\"translation:DataType\"> Data type </span> <span class=\"icon\" show.bind=\"column === 'dataType'\" innerhtml=\"<i class='fad \\${displayState.icon}'></i>\"></span> </div> <div class=\"cell\" click.delegate=\"sortBy('scope')\"> <span i18n=\"translation:Scope\"> Scope </span> <span class=\"icon\" show.bind=\"column === 'scope'\" innerhtml=\"<i class='fad \\${displayState.icon}'></i>\"></span> </div> <div class=\"cell\" click.delegate=\"sortBy('valueList')\"> <span i18n=\"translation:ValueList\"> Value list </span> <span class=\"icon\" show.bind=\"column === 'valueList'\" innerhtml=\"<i class='fad \\${displayState.icon}'></i>\"></span> </div> <div class=\"cell\" click.delegate=\"sortBy('created')\"> <span i18n=\"translation:Created\"> Created </span> <span class=\"icon\" show.bind=\"column === 'created'\" innerhtml=\"<i class='fad \\${displayState.icon}'></i>\"></span> </div> <div class=\"cell\"> <span i18n=\"translation:Categories\"> Categories </span> </div> </div> <div class=\"main\"> <div class=\"inner\"> <div if.bind=\"view_parameters.length === 0\" class=\"no-results\"> <span i18n=\"translation:NoContent\">No content</span>... </div> <div if.bind=\"view_parameters.length > 0\"> <div virtual-repeat.for=\"parameter of view_parameters | search: { searchTerm: searchTerm, columns: columnsToSearch } | sort: { propertyName: column, direction: displayState.direction }\" class=\"element\" click.delegate=\"editParameter(parameter, \\$event)\"> <div class=\"cell\"> <label class=\"checkbox-with-theme\" change.delegate=\"toggleParameter()\"> <input type=\"checkbox\" checked.bind=\"parameter.selected\"> </label> </div> <div class=\"cell\" title=\"\\${parameter.name}\"> <span class=\"cell__inner\"> \\${parameter.name} </span> </div> <div class=\"cell\"> <span class=\"cell__inner\" if.bind=\"parameter.sync === 'SyncToAc'\" title=\"Sync to AC\">Revit <i class=\"fad fa-exchange-alt fa-fw\"></i> AC</span> <span class=\"cell__inner\" if.bind=\"parameter.sync === 'SyncToRevit'\" title=\"Sync to Revit\">Revit <i class=\"fad fa-exchange-alt fa-fw fa-rotate-180\"></i> AC</span> <span class=\"cell__inner\" if.bind=\"parameter.sync === 'SyncBothWays'\" title=\"Sync both ways\">Revit <i class=\"fas fa-exchange-alt fa-fw\"></i> AC</span> <span class=\"cell__inner\" if.bind=\"parameter.sync === 'AcOnly'\" title=\"AC only\">AC only <i class=\"fas fa-exchange-alt fa-fw\" style=\"opacity:.4\"></i></span> </div> <div class=\"cell\" title=\"\\${parameter.paramType}\"> <span class=\"cell__inner\"> \\${parameter.paramType} </span> </div> <div class=\"cell\" title=\"\\${parameter.scope}\"> <span class=\"cell__inner\"> \\${parameter.scopeText} </span> </div> <div class=\"cell\" title=\"\\${parameter.valueList}\"> <span class=\"cell__inner\"> \\${parameter.valueList} </span> </div> <div class=\"cell\" title=\"\\${parameter.created}\"> <span class=\"cell__inner\"> \\${parameter.created.substring(0,19)} </span> </div> <div class=\"cell\"> <div class=\"cell__inner\"> <span class=\"category badge badge-default\" repeat.for=\"category of parameter.categories\">\\${category}</span> </div> </div> </div> </div> </div> </div> </div> </template> `;\n// Exports\nexport default code;","import { ParameterTypeEnumDto } from 'app/models/parameter-definition-dto';\r\nimport { ListService } from 'app/services/list-service';\r\nimport { ObjectServiceBuilder } from 'app/services/object-services/object-service-builder';\r\nimport { I18N } from 'aurelia-i18n';\r\nimport { ManageParameter } from './../manage/manage-parameter';\r\nimport { AppContextService } from 'app/services/app-context-service';\r\nimport { ModalService } from 'app/services/modal-service';\r\nimport { Router } from 'aurelia-router';\r\nimport { Subscription, EventAggregator } from 'aurelia-event-aggregator';\r\nimport { autoinject } from 'aurelia-framework';\r\nimport { ApiClient } from 'app/services/api-client';\r\nimport { RequestErrorHandling } from 'app/services/RequestErrorHandling';\r\nimport { ParameterDefinitionDto, SyncDirectionEnum } from 'app/models/parameter-definition-dto';\r\nimport { ErrorService } from 'app/services/error-service';\r\nimport { ParameterDefinitionService } from 'app/services/object-services/parameter-definition-service';\r\nimport { DeletableParameters } from '../deletable/deletable-parameters';\r\nimport { DeletableParametersDto } from 'app/models/deletable-parameters-dto';\r\nimport { AggregateParameter } from '../aggregate/aggregate-parameter';\r\nimport { theParameterTypeEnums } from 'resources/enums/parameter-type-enums';\r\n\r\nimport * as environment from '../../../../../config/environment.json'; // for prerelease. I hate relative paths.\r\n\r\n@autoinject\r\nexport class ParametersList {\r\n\tpublic all_parameters: ParameterDefinitionDto[] = [];\r\n\tpublic view_parameters: ParameterDefinitionDto[] = [];\r\n\r\n\tprivate columnsToSearch: string[] = ['name', 'syncDirection', 'dataType', 'scope', 'valueList'];\r\n\tprivate selectedParameters: ParameterDefinitionDto[] = [];\r\n\tprivate selectedParameterIds: string[] = [];\r\n\tprivate unusedParameterIds: string[] = [];\r\n\tprivate allSelected: boolean = false;\r\n\tpublic column: string = \"name\";\r\n\tpublic displayState: { icon: string, direction: string } | undefined;\r\n\tpublic searchTerm: string = \"\";\r\n\tpublic viewContext: string;\r\n\tprivate subscriptions: Subscription[] = [];\r\n\tprivate paramDefService: ParameterDefinitionService | undefined;\r\n\tprivate showArchived:boolean = false;\r\n\tprerelease_archived:boolean = true; //(environment.testing || environment.debug);\r\n\r\n\tconstructor(private router: Router, \r\n\t\t\t\tprivate apiClient: ApiClient, \r\n\t\t\t\tprivate events: EventAggregator, \r\n\t\t\t\tprivate modal: ModalService, \r\n\t\t\t\tprivate appContext: AppContextService, \r\n\t\t\t\tprivate errorService: ErrorService, \r\n\t\t\t\tprivate i18n: I18N,\r\n\t\t\t\tprivate serviceBuilder:ObjectServiceBuilder,\r\n\t\t\t\tprivate listService: ListService) {\r\n\t\tthis.viewContext = \"TopBar\";\t\t\r\n\t}\r\n\r\n\r\n\tasync activate(params: any, routeConfig: any, navigationInstruction: any) {\r\n\t\tconsole.log('p-l activate', params);\r\n\t\tif (params.projectId) {\r\n\t\t\tthis.appContext.setProject(params.projectId);//in-activate.\r\n\t\t}\r\n\r\n\t\tthis.paramDefService = this.serviceBuilder\r\n\t\t\t.ForAjourCollab_OSB(this.appContext.projectId)\r\n\t\t\t.BuildParameterDefinitionService();\r\n\r\n\t\tif (this.appContext.projectId) {\r\n\t\t\tawait this.getParameters('activate');\t\t\r\n\t\t} \r\n\t\t\r\n\t\tthis.displayState = this.listService.displayState;\r\n\r\n\t\tconst searchHandler = (data: any) => this.handleSearchEvent(data);\r\n\t\tthis.subscriptions = [\r\n\t\t\tthis.events.subscribe(this.viewContext + \":SearchTermChanged\", searchHandler)\r\n\t\t];\r\n\r\n\t}\r\n\r\n\tdetached() {\r\n\t\tthis.subscriptions.forEach(subscription => (\r\n\t\t\tsubscription.dispose()\r\n\t\t));\r\n\t}\r\n\r\n\tprivate handleSearchEvent(data: string) {\r\n\t\tthis.searchTerm = data;\r\n\t}\r\n\r\n\topenAggregateParameterModal() {\r\n\t\tif (this.showArchived) { return; } // you can only use the aggr dialog on the NON-ARCHIVED parameters.\r\n\t\tthis.modal.OpenModal(AggregateParameter, { parameters: this.view_parameters });\t\t\r\n\t}\r\n\r\n\tpublic openCreateParameterModal() {\r\n\t\tif (this.showArchived) { return; } // you can only use the aggr dialog on the NON-ARCHIVED parameters.\r\n\t\tthis.modal.OpenModal(ManageParameter, { parameterId: undefined }).whenClosed(x => {\r\n\t\t\tthis.getParameters('openCreateParameterModal'); \r\n\t\t});\r\n\t}\r\n\r\n\tpublic openBulkParameters() {\r\n\t\tif (this.showArchived) { return; } // you can only use the aggr dialog on the NON-ARCHIVED parameters.\r\n\t\tthis.router.navigate('project/' + this.appContext.projectId + '/parameters/bulk-parameters/');\r\n\t}\r\n\r\n\tpublic editParameter(parameter: ParameterDefinitionDto, event: Event) {\r\n\t\tif ((<HTMLElement>event?.target)?.tagName === 'INPUT') { return true;}\r\n\t\tif (this.showArchived) { return; } // you can only use the aggr dialog on the NON-ARCHIVED parameters.\r\n\t\tthis.modal.OpenModal(ManageParameter, { parameterId: parameter.id }).whenClosed(x => {\r\n\t\t\tthis.getParameters('editParameter'); \r\n\t\t});\r\n\t}\r\n\r\n\tasync unArchiveParameter() {\r\n\t\tconsole.log('impl unArchiveParameter'); //fa-ambulance fa-life-ring\t\r\n\t\tlet paramIds:string[] = this.selectedParameters.map(x=>x.id);\r\n\t\tthis.executeUndelete(paramIds);\t\r\n\t\t/* Consider\r\n\t\thttps://stackoverflow.com/questions/46329194/how-to-refresh-filtered-aurelia-repeat-for-binding\r\n\t\t*/\r\n\t}\r\n\r\n\tasync purge_ArchivedParams() {\r\n\t\tconsole.log('impl purge_ArchivedParams');\r\n\t\tlet ok = this.modal\r\n\t\t.OpenConfirm( //OpenMessage(\r\n\t\t\tthis.i18n.tr(\"Warning\"),\r\n\t\t\tthis.i18n.tr(\"Are you sure you want to permanently delete these parameters?\")\r\n\t\t).whenClosed( x => {\r\n\t\t\tif (x.wasCancelled) { \r\n\t\t\t\tconsole.log('purge cancelled by user.');\r\n\t\t\t\treturn; \r\n\t\t\t}\r\n\t\t\r\n\t\t\tlet purgeIds = this.selectedParameters.map(p => p.id);\r\n\t\t\tfor (let parameterIdToPurge of purgeIds) {\r\n\t\t\t\tthis.executePurge(parameterIdToPurge);\r\n\t\t\t\tconsole.log('attempted to purge', parameterIdToPurge);\r\n\t\t\t}\t\t\r\n\t\t}); // whenClosed.\r\n\t} // purge.\r\n\r\n\tasync delete() {\r\n\t\tif (this.showArchived) {\r\n\t\t\tawait this.purge_ArchivedParams();\r\n\t\t} else {\r\n\t\t\tawait this.delete_normalParams();\r\n\t\t}\r\n\t}\r\n\r\n\tasync delete_normalParams() {\r\n\t\tconsole.log('clearing this.selectedParameterIds of these items:');\r\n\t\tfor (let id of this.selectedParameterIds) {\r\n\t\t\tconsole.log('c-item:', id);\r\n\t\t}\r\n\t\tthis.selectedParameterIds = [];\r\n\r\n\t\tthis.selectedParameters.forEach(selectedParameter => { \r\n\t\t\tthis.selectedParameterIds.push(selectedParameter.id);\r\n\t\t});\r\n\r\n\t\tlet prjApi = this.apiClient.projectWToken(this.appContext.projectId,'Adelete_normalParams');\r\n        let deletableParameters: DeletableParametersDto[] = \r\n\t\t  await prjApi.postJson('ParameterDefinitions/GetDeletable', this.selectedParameterIds)\r\n\t\t\t.jsonResult();\r\n\t\t\t\r\n\t\tdeletableParameters.forEach(element => {\r\n\t\t\tif (!element.isUsed) {\r\n\t\t\t\tthis.unusedParameterIds.push(element.id);\r\n\t\t\t}\r\n\t\t});\r\n\r\n        this.modal.OpenModal(DeletableParameters, deletableParameters).whenClosed(x => {\r\n\t\t\tif (!x.wasCancelled) {\r\n\t\t\t\tif (x.output.length > 0) {\r\n\t\t\t\t\tthis.executeDelete(x.output);\r\n\t\t\t\t}\r\n\t\t\t} else { // we need to do some sort of clean-up I think.\r\n               // https://ajoursystem.atlassian.net/browse/AOC-1253\r\n\t\t\t   // does anyone ever clear this.selectedParameterIds?\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tasync executeDelete(parameterIdsToDelete: string[]) {\r\n\t\tlet result = await this.apiClient.projectWToken(this.appContext.projectId,'AexecuteDelete').postJson('ParameterDefinitions/Delete', parameterIdsToDelete)\r\n\t\t\t.handleError(\"Parameters not saved\", \"The parameters could not be saved.\")\r\n\t\t\t.response();\r\n\t\tif (result.statusCode == 200) {\r\n\t\t\tparameterIdsToDelete.forEach(parameterId => {\r\n\t\t\t\t// in the short term, the user's delete-action just updates the current/temp VIEW:\r\n\t\t\t\tthis.view_parameters.splice(this.view_parameters.findIndex(x => x.id === parameterId), 1);\r\n\t\t\t});\r\n\t\t\tthis.setParametersById(parameterIdsToDelete, true)\r\n\t\t\tthis.selectedParameters = [];\r\n\t\t\tthis.selectedParameterIds = []; // Hvad i alverden er ideen med at rode rundt med disse i længere tid?\r\n\t\t\tthis.unusedParameterIds = [];\r\n\t\t}\t\r\n\t}\r\n\r\n\tasync executeUndelete(parameterIdsToDelete: string[]) {\r\n\t\t// If we do this, we also need the ParameterDTOs to switch \"isDeleted\" state.\r\n\t\tlet result = await this.apiClient.projectWToken(this.appContext.projectId,'AexecuteUndelete').postJson('ParameterDefinitions/Undelete', parameterIdsToDelete)\r\n\t\t\t.handleError(\"Parameters not restored\", \"The parameters could not be restored.\")\r\n\t\t\t.response();\r\n\t\tif (result.statusCode == 200) {\r\n\t\t\tparameterIdsToDelete.forEach(parameterId => {\r\n\t\t\t\t// in the short term, the user's delete-action just updates the current/temp VIEW:\r\n\t\t\t\tthis.view_parameters.splice(this.view_parameters.findIndex(x => x.id === parameterId), 1);\r\n\t\t\t});\r\n\t\t\tthis.setParametersById(parameterIdsToDelete, false)\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetParametersById(parameterIdsToSet: string[], isDeleted: boolean) {\r\n\t\tthis.all_parameters.filter(x => parameterIdsToSet.includes(x.id)).forEach(x => {x.isDeleted = isDeleted; x.selected = false});\r\n\t\tthis.allSelected = false;\r\n\t}\r\n\r\n\tasync executePurge(parameterIdToPurge: string) {\r\n\t\t// If we do this, we also need the ParameterDTOs to switch \"isDeleted\" state.\r\n\t\tlet prjApi = this.apiClient.projectWToken(this.appContext.projectId,'AexecutePurge');\r\n\t\tlet handler:RequestErrorHandling = prjApi.postJson('ParameterDefinitions/PurgeParameter', parameterIdToPurge);\r\n\t\tlet result = await handler.jsonResult();\r\n\t\tconsole.log('PurgeParameter result:', result);\r\n\t\tconsole.log('PurgeParameter couldDeleteParam?', result.couldDeleteParam);\r\n\t\t//JG: we now attempt to log how it went!\r\n\t\tthis.removePurgedParameter_from_ViewParameters(parameterIdToPurge);\r\n\t}\r\n\r\n\tremovePurgedParameter_from_ViewParameters(parameterIdToPurge: string) {\r\n\t\tthis.view_parameters.splice(this.view_parameters.findIndex(x => x.id === parameterIdToPurge), 1);\r\n\t}\r\n\t\r\n\tprivate async getParameters(who: string): Promise<void> {\r\n\t\t//console.log('getParameters(),who:', who);\r\n\t\tlet parameters: ParameterDefinitionDto[] | undefined = await this.paramDefService?.getParameters(); \r\n\t\tif (parameters) {\r\n\t\t\tthis.all_parameters = parameters; \r\n\t\t\tthis.all_parameters.forEach((element: ParameterDefinitionDto | any) => { //Is ParameterDefinitionDto, any is used to satisfy strict mode for now.\r\n\t\t\t\t// JG: Burde sync og paramType her, ikke dels v�re defineret i ParameterDefinitionDto,\r\n\t\t\t\t// dels tilg�et som s�dan? i.e. hvad er grunden til at s�tte dem s�dan her, uden typer?\r\n\t\t\t\tlet syncString:string | undefined = Object.keys(SyncDirectionEnum).find((key: any) => SyncDirectionEnum[key] === element.syncDirection);\r\n\t\t\t\telement['sync'] = syncString;\r\n\t\t\t\t\r\n\t\t\t\tlet paramTypeNumber: number = element.parameterType;\r\n\t\t\t\tlet theEnum: ParameterTypeEnumDto | undefined = theParameterTypeEnums.find(x => x.enumInt == paramTypeNumber); \r\n\t\t\t\tif (theEnum) { \r\n\t\t\t\t\tlet intendedParamType: string = theEnum.enumString;\r\n\t\t\t\t\telement['paramType'] = intendedParamType;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tconsole.log(`${paramTypeNumber} is not in theParameterTypeEnums for ${element}`)\r\n\t\t\t\t\tconsole.log(theParameterTypeEnums);\r\n\t\t\t\t\telement['paramType'] = `missing paramType ${paramTypeNumber}`;\r\n\t\t\t\t}\r\n\t\t\t\telement.categories.sort(this.compareNames);\r\n\t\t\t});\r\n\t\t}\r\n\t\tthis.refreshParametersView();\r\n\t}\r\n\r\n\trefreshParametersView() {\r\n\t\tthis.view_parameters = this.all_parameters.filter(p => p.isDeleted == this.showArchived);\r\n\t\t//console.log('refreshParametersView:#', this.view_parameters.length);\r\n\t}\r\n\r\n\tpublic toggleArchived() {\r\n\t\tthis.showArchived = !this.showArchived;\r\n\t\tconsole.log('showArchivedParameters:', this.showArchived);\r\n\t\tthis.refreshParametersView();\r\n\t}\r\n\r\n\tpublic doShowArchivedParameters():string {\r\n\t\treturn this.showArchived ? 'Yes' : 'No';\r\n\t}\r\n\r\n\tpublic async sortBy(columnName: string) {\r\n\t\tawait this.listService.sortBy(columnName).then(result => {\r\n\t\t\tthis.column = result.column;\r\n\t\t\tthis.displayState = result.displayState;\r\n\t\t});\r\n\t}\r\n\r\n\tpublic async toggleParameter() {\r\n\t\tawait this.listService.toggleElement(this.view_parameters).then(result => {\r\n\t\t\tthis.selectedParameters = result.selected;\r\n\t\t\tthis.allSelected = result.allSelected;\r\n\t\t});\r\n\t}\r\n\r\n\tpublic async toggleAll() {\r\n\t\tawait this.listService.toggleAll(this.view_parameters, this.searchTerm, this.columnsToSearch).then(result => {\r\n\t\t\tif (result) {\r\n\t\t\t\tthis.selectedParameters = result.selected;\r\n\t\t\t\tthis.allSelected = result.allSelected;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tprivate compareNames(a: string, b: string){\r\n\t\tif(a < b){\r\n\t\t\treturn -1;\r\n\t\t}else if(a > b){\r\n      \t\treturn 1;\r\n    \t}else{\r\n      \t\treturn 0;\r\n    \t}\r\n  \t}\r\n}\r\n\r\n"],"names":["___CSS_LOADER_EXPORT___","push","module","id","ParametersList","constructor","router","apiClient","events","modal","appContext","errorService","i18n","serviceBuilder","listService","all_parameters","view_parameters","columnsToSearch","selectedParameters","selectedParameterIds","unusedParameterIds","allSelected","column","searchTerm","subscriptions","showArchived","prerelease_archived","this","viewContext","activate","params","routeConfig","navigationInstruction","console","log","projectId","setProject","paramDefService","ForAjourCollab_OSB","BuildParameterDefinitionService","getParameters","displayState","subscribe","data","handleSearchEvent","detached","forEach","subscription","dispose","openAggregateParameterModal","OpenModal","parameters","openCreateParameterModal","parameterId","undefined","whenClosed","x","openBulkParameters","navigate","editParameter","parameter","event","target","tagName","unArchiveParameter","paramIds","map","executeUndelete","purge_ArchivedParams","OpenConfirm","tr","wasCancelled","purgeIds","p","parameterIdToPurge","executePurge","delete_normalParams","selectedParameter","prjApi","projectWToken","deletableParameters","postJson","jsonResult","element","isUsed","output","length","executeDelete","parameterIdsToDelete","handleError","response","statusCode","splice","findIndex","setParametersById","parameterIdsToSet","isDeleted","filter","includes","selected","handler","result","couldDeleteParam","removePurgedParameter_from_ViewParameters","who","syncString","Object","keys","find","key","syncDirection","paramTypeNumber","parameterType","theEnum","enumInt","intendedParamType","enumString","categories","sort","compareNames","refreshParametersView","toggleArchived","doShowArchivedParameters","sortBy","columnName","then","toggleParameter","toggleElement","toggleAll","a","b","autoinject","EventAggregator","I18N"],"sourceRoot":""}