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D3B,EAAA6L,W,uBAuC8B,EAAAC,iBAAqC,IAA+B,IAAkC,IAA+BC,QAAyB,EAAAC,gBAA+B,EAAAC,KAA8B,IAAgD,IAAqC,EAAAC,UAA2B,QAtC7VlM,E,6KCbN,MAAMmM,EACZ,MAAAC,CAAOC,EAAwB3K,EAAwCI,GAEtE,IAAI4B,QAAQ2I,KAAqB3I,QAAQhC,KAAmBgC,QAAQ5B,GACnE,OAAOuK,EACR,IAAInH,EAAgBxD,EAAe8D,MAAKZ,GAAKA,EAAEa,SAAW4G,IACtDC,EAAMxK,EAAiB0D,MAAKZ,GAAKA,EAAE2H,kBAAmBrH,aAAa,EAAbA,EAAee,eAEzE,OAAOvC,QAAQ4I,GAAOA,aAAG,EAAHA,EAAKE,UAAY,EACxC,EAIM,MAAMC,EACZ,MAAAL,CAAO9G,EAAiB0D,GACvB,OAAItF,QAAQ4B,IAAiB5B,QAAQsF,GAE9BA,EAAaxD,MAAKZ,GAAKA,EAAEV,IAAMoB,IAAaT,KAD3CmE,EAAaxD,MAAKZ,GAAa,GAARA,EAAEV,KAASW,IAE3C,E","sources":["webpack://client-app/./src/app/project/parameters/manage/manage-parameter.ts","webpack://client-app/./src/app/project/parameters/manage/type-id-to-string-converters.ts"],"sourcesContent":["import { Router } from 'aurelia-router';\r\nimport { EventAggregator, Subscription } from 'aurelia-event-aggregator';\r\nimport { I18N } from 'aurelia-i18n';\r\nimport { ModalService } from 'app/services/modal-service';\r\nimport { AppContextService } from 'app/services/app-context-service';\r\nimport { ApiClient } from 'app/services/api-client';\r\nimport { DialogController } from 'aurelia-dialog';\r\nimport { ParameterDefinitionDto, Category, RevitEnumPair, DisplayUnitTypesOnProject, ParameterTypeEnumDto, BuiltInParameterEnum, SyncDirectionEnum } from 'app/models/parameter-definition-dto';\r\nimport { autoinject, observable, TaskQueue } from 'aurelia-framework';\r\nimport { ValueListService } from \"../../../services/value-list/value-list-service\";\r\nimport { ValueListDto } from \"../../../models/value-list-dtos\";\r\nimport { ObjectServiceBuilder } from \"../../../services/object-services/object-service-builder\";\r\nimport { AocParameterDefinitionService } from \"../../../services/object-services/aoc-parameter-definition-service\";\r\n\r\n@autoinject\r\nexport class ManageParameter {\r\n\tpublic errorMessage: string = \"\";\r\n\tpublic characterCount: number = 0;\r\n\tpublic activeStep: number = 1;\r\n\tpublic editMode: boolean = false;\r\n\tpublic totalSteps: number = 5; // we hardcode this - it must match the number of section-steps in the manage-parameter.html view.\r\n\tpublic wizardOptions: Object | undefined;\r\n\tpublic parameter: ParameterDefinitionDto | undefined;\r\n\tpublic originalParameter: ParameterDefinitionDto | undefined;\r\n\tpublic categories: Category[] = [];\r\n\tpublic parameterTypes: ParameterTypeEnumDto[] = [];\r\n\tpublic builtInParameters: BuiltInParameterEnum[] = [];\r\n\tpublic unitTypes: RevitEnumPair[] = [];\r\n\tpublic groups: RevitEnumPair[] = [];\r\n\tpublic displayUnitTypes: DisplayUnitTypesOnProject[] = [];\r\n\tpublic searchTerm: string = \"\";\r\n\tpublic viewContext: string;\r\n\tprivate subscriptions: Subscription[] = [];\r\n\tpublic valueLists: ValueListDto[] = [];\r\n\tpublic currentParameters: any[] = [];\r\n\t@observable public selectedStartFromId: number = 4;\r\n\tpublic parameterTypeLocked: boolean = false;\r\n\tpublic loading: boolean = false;\r\n\tpublic submitClicked: boolean = false;\r\n\t@observable public bindAllCategories: boolean = false;\r\n\t@observable public bindNoCategories: boolean = false;\r\n\t@observable public selectedModelId: number = -1;\r\n\t@observable public selectedBuiltInParameter: number = -1;\r\n\t@observable public selectedParameterType: number = 1;\r\n\tprivate parameterDefinitionService: AocParameterDefinitionService | undefined = undefined;\r\n\r\n\tsetActiveStep(newStep:number, who:string) {\r\n\t\tconsole.log(`activeStep, ${this.getActiveStep()} -> ${newStep}, total: ${this.totalSteps}, ${who}`)\r\n\t\tthis.activeStep = newStep;\r\n\t}\r\n\r\n\tgetActiveStep():number { return this.activeStep; }\r\n\r\n\tconstructor(protected dialog: DialogController, private apiClient: ApiClient, private appContext: AppContextService, private modal: ModalService, private element: Element, private events: EventAggregator, private i18n: I18N, private serviceBuilder: ObjectServiceBuilder, private valueListService: ValueListService, private taskQueue: TaskQueue, private router: Router) {\r\n\t\tthis.viewContext = \"ParameterDefinition\";\r\n\t\t// this.dialog.settings.keyboard = true; //false; // WTF?\r\n\t\tthis.dialog.settings.overlayDismiss = false;\r\n\t\tthis.parameterDefinitionService = serviceBuilder\r\n\t\t\t.ForAjourCollab_OSB(appContext.projectId)\r\n\t\t\t.BuildParameterDefinitionService();\r\n\t}\r\n\r\n\tbindAllCategoriesChanged(newValue: boolean, oldValue: boolean) {\r\n\t\tif (!Boolean(this.parameter)) { return; }\r\n\r\n\t\tif (this.bindAllCategories) {\r\n\t\t\tif (this.parameter?.scope === 0) { //Type parameters\r\n\t\t\t\tthis.parameter.builtInCategories = this.categories.filter(c => c.allowsBoundParametersAsType).map(c => c.id);\r\n\t\t\t} else if (this.parameter?.scope === 1) { //Instance parameters\r\n\t\t\t\tthis.parameter.builtInCategories = this.categories.filter(c => c.allowsBoundParametersAsInstance).map(c => c.id);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tbindNoCategoriesChanged(newValue: boolean, oldValue: boolean){\r\n\t\tif (!Boolean(this.parameter)){return;}\r\n\r\n\t\tif ( this.parameter && this.bindNoCategories){\r\n\t\t\tthis.parameter.builtInCategories = []\r\n\t\t}\r\n\t}\r\n\r\n\tselectedStartFromIdChanged(newValue: any, oldValue: any) {\r\n\t\tif (!Boolean(this.parameter)) { return; } \r\n\r\n\t\tconsole.log('selectedStartFromIdChanged', newValue, oldValue);\r\n\t\t/* JG: It appears 'startFrom' is an anonymous enum,\r\n\t\t * where the values mean:\r\n\t\t * <1> a parameter with origin in the RevitProject.\r\n\t\t * <4> a parameter with a custom origin locally defined in the AOC project itself.\r\n\t\t * It seems further values are currently disabled.\r\n\t\t */\r\n\t\tif (this.parameter) {\r\n\t\t\tif (newValue === 1) { // JG: This anonymous enum-value means 'from the RevitProject'.\r\n\t\t\t\t\r\n\t\t\t\tthis.parameter.syncDirection = SyncDirectionEnum.SyncToAc; //1;\r\n\t\t\t\t\r\n\t\t\t\tif (this.parameterDefinitionService && this.currentParameters.length === 0){\r\n\t\t\t\t\tthis.loading = true;\r\n\t\t\t\t\tthis.parameterDefinitionService.getRevitParameters().then(result => {\r\n\t\t\t\t\t\tthis.currentParameters = result.map(x => { return { id: x.id, name: x.name } });\r\n\t\t\t\t\t\tthis.loading = false;\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t} else { // JG: This 'not-1' case means 4 aka 'custom-defined in AOC'.\r\n\t\t\t\tthis.parameter.syncDirection = SyncDirectionEnum.SyncToRevit; //0;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tselectedModelIdChanged(newValue: number, oldValue: number) {\r\n\t\tif (!Boolean(this.parameter)) { return; }\r\n\r\n\t\tif (newValue == -1)\r\n\t\t\treturn;\r\n\t\tif (this.parameterDefinitionService) {\r\n\t\t\tthis.parameterDefinitionService.getRevitParameterById(newValue + \"\").then(result => {\r\n\t\t\t\tif (this.parameter) {\r\n\t\t\t\t\tthis.selectedBuiltInParameter = result.builtInParameter;\r\n\t\t\t\t\tthis.selectedParameterType = result.parameterType;\r\n\t\t\t\t\tthis.parameter.parameterType = result.parameterType;\r\n\t\t\t\t\tthis.parameter.builtInParameter = result.builtInParameter;\r\n\t\t\t\t\tthis.parameter.unitType = result.unitType;\r\n\t\t\t\t\tthis.parameter.builtInCategories = result.builtInCategories;\r\n\t\t\t\t\tthis.parameter.sharedParamId = result.sharedParamId;\r\n\t\t\t\t\tthis.parameter.createInRevit = result.createInRevit;\r\n\t\t\t\t\tthis.parameter.scope = result.scope;\r\n\t\t\t\t\tthis.parameter.storageType = result.storageType;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (!this.editMode && this.parameter.name === \"\")\r\n\t\t\t\t\tthis.parameter.name = result.name;\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t}\r\n\t}\r\n\r\n\treadonly ParameterType_Text: number = 1;\r\n\treadonly BuiltInParam_Invalid: number = -1;\r\n\treadonly ParameterType_Invalid: number = 0;\r\n\r\n\tselectedBuiltInParameterChanged(newValue: number, oldValue: number) {\r\n\t\tif (!Boolean(this.parameter) || !Boolean(this.parameterTypes) || !Boolean(this.builtInParameters) \r\n\t\t|| !this.parameter || !this.parameterDefinitionService) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.parameter.builtInParameter = newValue;\r\n\r\n\t\tlet builtInParameter = this.builtInParameters.find(x => x.enumInt == newValue);\r\n\t\tif (!this.editMode) { // i.e. create-mode.\r\n\t\t\tif (newValue == this.BuiltInParam_Invalid) \r\n\t\t\t\tthis.parameter.sharedParamId = this.parameterDefinitionService.createGuid();\r\n\t\t\telse \r\n\t\t\t\tthis.parameter.sharedParamId = \"00000000-0000-0000-0000-000000000000\";\r\n\t\t}\r\n\r\n\t\tlet isBuiltIn = (newValue < this.BuiltInParam_Invalid);\r\n\t\tlet found = Boolean(builtInParameter);\r\n\t\tif (isBuiltIn && found) { // Only affect parameterType, if you are a builtin, AND we know you.\r\n\t\t\t// (JG: Hmm, Invalid findes ikke som -1, men som 0..?)\r\n\t\t\tlet paramId = !Boolean(builtInParameter) || builtInParameter?.parameterType_Id == -1 ? this.ParameterType_Text : builtInParameter?.parameterType_Id;\r\n\t\t\tlet parameterType = this.parameterTypes.find(x => x.enumInt == paramId); // (why?)\r\n\t\t\tif (parameterType) {\r\n\t\t\t\tthis.selectedParameterType = parameterType.enumInt;\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.parameterTypeLocked = (isBuiltIn && found) || this.editMode;\r\n\t}\r\n\r\n\tselectedParameterTypeChanged(newValue: number, oldValue: number) {\r\n\t\tif (!Boolean(this.parameter) || !Boolean(this.parameterTypes) || !this.parameter) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.parameter.parameterType = newValue;\r\n\t\tlet hasParameterType = (newValue != this.ParameterType_Invalid);\r\n\r\n\t\tlet parameterType = this.parameterTypes.find(x => x.enumInt == newValue);\r\n\t\tif (parameterType) {\r\n\t\t\tthis.parameter.parameterType = newValue; //parameterType.enumInt;\r\n\t\t\tthis.parameter.unitType = parameterType.unitType_Id;\r\n\t\t\tif (hasParameterType) {\r\n\t\t\t\t// JG: Do not touch the storageType, unless you have a proper ParameterType\r\n\t\t\t\t// (ParameterType INVALID is legal, but means parametertype does NOT control the storage type!)\r\n\t\t\t\tthis.parameter.storageType = parameterType.storageType;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tasync activate(model: any) {\r\n\t\tthis.loading = true;\r\n\t\tthis.getWizardOptions();\r\n\r\n\t\tPromise.all([\r\n\t\t\tthis.parameterDefinitionService?.GetParameterTypeEnums(),\r\n\t\t\tthis.parameterDefinitionService?.GetBuiltInParameterEnums(),\r\n\t\t\tthis.parameterDefinitionService?.GetCategories(),\r\n\t\t\tthis.parameterDefinitionService?.GetDisplayUnitTypesForProject(),\r\n\t\t\tthis.parameterDefinitionService?.GetUnitTypeEnums(),\r\n\t\t\tthis.parameterDefinitionService?.GetParameterGroupEnums(),\r\n\t\t\tthis.valueListService.getValueListsOnProject(),\r\n\t\t\t//this.parameterDefinitionService.getRevitParameters()\r\n\t\t]).then(result => {\r\n\t\t\tthis.parameterTypes = result[0]!;\r\n\t\t\tthis.builtInParameters = result[1]!;\r\n\t\t\tthis.categories = result[2]!;\r\n\t\t\tthis.displayUnitTypes = result[3]!;\r\n\t\t\tthis.unitTypes = result[4]!;\r\n\t\t\tthis.groups = result[5]!;\r\n\t\t\tthis.valueLists = result[6];\r\n\t\t\tif (this.valueLists.find(x => x.id === \"00000000-0000-0000-0000-000000000000\") === undefined) {\r\n\t\t\t\tthis.valueLists = \r\n\t\t\t\t[\r\n\t\t\t\t\t{ \r\n\t\t\t\t\t\tid: \"00000000-0000-0000-0000-000000000000\", \r\n\t\t\t\t\t\torgId: \"00000000-0000-0000-0000-000000000000\", \r\n\t\t\t\t\t\tname: \"(No Value List)\", \r\n\t\t\t\t\t\titems: [], \r\n\t\t\t\t\t\tsourceProjectId: \"00000000-0000-0000-0000-000000000000\", \r\n\t\t\t\t\t\tselected: false, \r\n\t\t\t\t\t\tinEditMode: false, \r\n\t\t\t\t\t\teditName: \"\" },\r\n\t\t\t\t\t ...this.valueLists\r\n\t\t\t\t];\r\n\t\t\t}\r\n\t\t\t//this.currentParameters = result[7].map(x => { return { id: x.id, name: x.name } });\r\n\t\t\tif (Boolean(model.parameterId)) {\r\n\t\t\t\tthis.editMode = true;\r\n\t\t\t\tthis.parameterDefinitionService?.getProjectParameterById(model.parameterId).then(result => {\r\n\t\t\t\t\tthis.selectedBuiltInParameter = result.builtInParameter;\r\n\t\t\t\t\tthis.selectedParameterType = result.parameterType;\r\n\t\t\t\t\tthis.parameter = result;\r\n\t\t\t\t\tthis.originalParameter = Object.assign({}, this.parameter);\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tthis.parameter = this.parameterDefinitionService?.newParameter();\r\n\t\t\t}\r\n\t\t\tthis.parameterTypeLocked = Boolean(this.selectedBuiltInParameter !== -1) || this.editMode;\r\n\r\n\t\t\t//this.broken_initTotalSteps(); JG: This cannot work this way!\r\n\t\t}).finally(() => {\r\n\t\t\tthis.loading = false;\r\n\t\t});\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\tbroken_initTotalSteps() {\r\n\t\t// JG: This cannot work this way!\r\n\t\t/* The problem is, that totalSteps is USED inside the manage-parameter.html view,\r\n\t\tand this is in conflict with totalSteps being CALCULATED based on the same view!\r\n\t\t(IE the correct value can only be calculated AFTER the view has been initialized/loaded,\r\n\t\tbut we were also USING totalSteps DURING its setup!)\r\n\t\t The result was a race condition, which causes totalSteps to sometimes be 0 instead of the correct value.\r\n\t\t*/\r\n\t\tthis.taskQueue.queueTask(() => {\r\n\t\t\tthis.totalSteps = document.querySelectorAll('section[data-step]').length;\r\n\t\t});\r\n\t}\r\n\r\n\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\tunlockParameterType() {\r\n\t\tif (this.selectedBuiltInParameter === this.BuiltInParam_Invalid) {\r\n\t\t\tthis.modal.OpenConfirm(this.i18n.tr('Warning'), this.i18n.tr('Changing the parameter type can potentially damage your project if values are bound to this parameter! Are you sure you wish to unlock?'))\r\n\t\t\t\t.whenClosed(x => {\r\n\t\t\t\t\tif (!x.wasCancelled) {\r\n\t\t\t\t\t\tthis.parameterTypeLocked = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tprivate handleSearchEvent(data: string | undefined) {\r\n\t\tif (data === undefined) return;\r\n\t\tthis.searchTerm = data;\r\n\t}\r\n\r\n\tprivate getWizardOptions() {\r\n\t\t// A multidimensional object for the options available in the wizard for setting up a parameter (the object below is a dummy)\r\n\r\n\t\tthis.wizardOptions = {\r\n\t\t\tscopes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: 0,\r\n\t\t\t\t\tname: 'Type'\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tid: 1,\r\n\t\t\t\t\tname: 'Instance'\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tid: 2,\r\n\t\t\t\t\tname: 'Project'\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tid: 3,\r\n\t\t\t\t\tname: 'Material'\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\tstartFrom: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: 1,\r\n\t\t\t\t\tname: 'Model'\r\n\t\t\t\t},\r\n\t\t\t\t// {\r\n\t\t\t\t// \tid: '2',\r\n\t\t\t\t// \tname: 'AO'\r\n\t\t\t\t// },\r\n\t\t\t\t// {\r\n\t\t\t\t// \tid: '3',\r\n\t\t\t\t// \tname: 'Existing'\r\n\t\t\t\t// },\r\n\t\t\t\t{\r\n\t\t\t\t\tid: 4,\r\n\t\t\t\t\tname: 'Custom'\r\n\t\t\t\t},\r\n\t\t\t],\r\n\t\t\tproperties: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: '1',\r\n\t\t\t\t\tname: 'Group (From Revit)'\r\n\t\t\t\t},\r\n\t\t\t],\r\n\t\t\tsyncDirections: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: 0,\r\n\t\t\t\t\tname: 'Sync to Revit'\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tid: 1,\r\n\t\t\t\t\tname: 'Sync to AC'\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tid: 2,\r\n\t\t\t\t\tname: 'Sync both ways'\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tid: 3,\r\n\t\t\t\t\tname: 'AC only'\r\n\t\t\t\t},\r\n\t\t\t],\r\n\t\t\tstorageTypes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: 0,\r\n\t\t\t\t\tname: 'None'\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tid: 1,\r\n\t\t\t\t\tname: 'Integer'\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tid: 2,\r\n\t\t\t\t\tname: 'Double'\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tid: 3,\r\n\t\t\t\t\tname: 'String'\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tid: 4,\r\n\t\t\t\t\tname: 'Element Id'\r\n\t\t\t\t},\r\n\t\t\t\t// {\r\n\t\t\t\t// \tid: '5',\r\n\t\t\t\t// \tname: 'Measure'\r\n\t\t\t\t// },\r\n\t\t\t\t// {\r\n\t\t\t\t// \tid: '6',\r\n\t\t\t\t// \tname: 'URL'\r\n\t\t\t\t// },\r\n\t\t\t\t// {\r\n\t\t\t\t// \tid: '7',\r\n\t\t\t\t// \tname: 'Text_multiline'\r\n\t\t\t\t// },\r\n\t\t\t]\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tpublic submit() {\r\n\t\tthis.submitClicked = true;\r\n\t\t// Save edit or create\r\n\t\tif (Boolean(this.originalParameter)) {\r\n\t\t\tthis.saveEdit();\r\n\t\t} else {\r\n\t\t\tthis.create();\r\n\t\t}\r\n\t}\r\n\r\n\tprivate resetErrorMessage() {\r\n\t\tthis.errorMessage = \"\";\r\n\t}\r\n\r\n\tprivate create() {\r\n\t\tthis.resetErrorMessage();\r\n\t\tif (!this.isNameValid(this.parameter?.name)) {\r\n\t\t\tthis.setActiveStep(2,'create');//mp.create\r\n\t\t\tthis.errorMessage = this.i18n.tr(\"InvalidParameterName\");\r\n\t\t\tthis.submitClicked = false;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (this.parameter) {\r\n\t\t\tthis.apiClient.projectWToken(this.appContext.projectId,'Acreate').postJson('ParameterDefinitions/Create', this.parameter)\r\n\t\t\t.handleError(this.i18n.tr('Error_Title_Generic'), this.i18n.tr('Error_Message_ParameterDefinition_Create').replace('{0}', this.parameter.name))\r\n\t\t\t.jsonResult()\r\n\t\t\t.then(response => {\r\n\t\t\t\tif (this.parameter) {\r\n\t\t\t\t\tthis.parameter.id = response;\r\n\t\t\t\t\tthis.saveEdit();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tprivate saveEdit() {\r\n\t\t// do actual edit action\r\n\t\tif (!this.validateForm()) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconsole.log('saveEdit, origSP:', this.originalParameter ? this.originalParameter.sharedParamId : 'no-original');\r\n\t\tconsole.log('saveEdit, curSP:', this.parameter ? this.parameter.sharedParamId : 'no-param');\r\n\t\tconsole.log('saveEdit, BIP:', this.parameter ? this.parameter.builtInParameter : 'no-paramB');\r\n\r\n\t\tif (this.parameter) {\r\n\t\t\tthis.apiClient.projectWToken(this.appContext.projectId,'AsaveEdit').postJson('ParameterDefinitions/Update', this.parameter)\r\n\t\t\t.handleError(this.i18n.tr('Error_Title_Generic'), this.i18n.tr('Error_Message_ParameterDefinition_Save').replace('{0}', this.parameter.name))\r\n\t\t\t.response()\r\n\t\t\t.finally(() => {\r\n\t\t\t\tthis.submitClicked = false;\r\n\t\t\t\tthis.dialog.close(true);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tprivate parameterHasChanged(): Boolean {\r\n\t\treturn !this.editMode || this.originalParameter?.builtInParameter !== this.parameter?.builtInParameter\r\n\t\t\t|| this.originalParameter?.classificationId !== this.parameter?.classificationId\r\n\t\t\t|| this.originalParameter?.createInRevit !== this.parameter?.createInRevit\r\n\t\t\t|| this.originalParameter?.group !== this.parameter?.group\r\n\t\t\t|| this.originalParameter?.id !== this.parameter?.id\r\n\t\t\t|| this.originalParameter?.name !== this.parameter?.name\r\n\t\t\t|| this.originalParameter?.parameterType !== this.parameter?.parameterType\r\n\t\t\t|| this.originalParameter?.scope !== this.parameter?.scope\r\n\t\t\t|| this.originalParameter?.sharedParamId !== this.parameter?.sharedParamId\r\n\t\t\t|| this.originalParameter?.storageType !== this.parameter?.storageType\r\n\t\t\t|| this.originalParameter?.syncDirection !== this.parameter?.syncDirection\r\n\t\t\t|| this.originalParameter?.unitType !== this.parameter?.unitType\r\n\t\t\t|| this.originalParameter?.valueListEnforced !== this.parameter?.valueListEnforced\r\n\t\t\t|| this.originalParameter?.valueList_Id !== this.parameter?.valueList_Id;\r\n\t}\r\n\r\n\tpublic close() {\r\n\t\t// If any inputs are filled, warn the user that they will lose that data if they confirm the cancel action\r\n\r\n\t\tif (this.parameterHasChanged()) {\r\n\t\t\tthis.modal.OpenConfirm(this.i18n.tr('Warning'), this.i18n.tr('Warning_Message_ParameterDefinition_Close')).whenClosed(x => {\r\n\t\t\t\tif (!x.wasCancelled) {\r\n\t\t\t\t\tthis.dialog.cancel();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.dialog.cancel();\r\n\t\t}\r\n\t}\r\n\r\n\tpublic previousStep() {\r\n\t\tif (this.getActiveStep() > 1) {\r\n\t\t\tthis.setActiveStep( this.getActiveStep() - 1, 'previousStep'); // -= 1;\r\n\t\t}\r\n\t}\r\n\r\n\tpublic nextStep() {\r\n\t\tif (this.getActiveStep() < this.totalSteps) {\r\n\t\t\tthis.setActiveStep(this.getActiveStep() + 1, 'nextStep'); // += 1;\r\n\t\t}\r\n\t}\r\n\r\n\tpublic goToStep(event: any) {\r\n\t\tlet dataset_step = event.target.closest('.section').dataset.step;\r\n\t\tconsole.log('goToStep uses dataset_step:', dataset_step);\r\n\t\tlet newStep = parseInt(dataset_step);\r\n\t\tthis.setActiveStep(newStep, 'goToStep');\r\n\t}\r\n\r\n\tprivate validateForm(): Boolean | undefined {\r\n\t\t// Validate all step inputs are filled\r\n\t\tthis.resetErrorMessage();\r\n\t\tif (!this.isNameValid(this.parameter?.name)) {\r\n\t\t\tthis.setActiveStep(2,'validateForm-badName');\r\n\t\t\tthis.errorMessage = this.i18n.tr(\"InvalidParameterName\");\r\n\t\t\tconsole.error(\"Parameter name is invalid\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(this.parameter) {\r\n\t\t\tif (!this.isGuid(this.parameter?.sharedParamId)) {\r\n\t\t\t\tthis.setActiveStep(1, 'validateForm-badSP');\r\n\t\t\t\tthis.errorMessage = this.i18n.tr(\"InvalidGuidForSharedParameterId\");\r\n\t\t\t\tconsole.error(\"Invalid guid for shared parameter type\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}\r\n\r\n\tisGuid(stringToTest: string): Boolean {\r\n\t\tif (stringToTest[0] === \"{\") {\r\n\t\t\tstringToTest = stringToTest.substring(1, stringToTest.length - 1);\r\n\t\t}\r\n\t\tlet regexGuid = /^(\\{){0,1}[0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}(\\}){0,1}$/gi;\r\n\t\treturn regexGuid.test(stringToTest);\r\n\t}\r\n\r\n\tisNameValid(name: string | undefined) {\r\n\t\treturn name !== undefined\r\n\t\t\t&& name !== null\r\n\t\t\t&& name.length > 0\r\n\t\t\t&& name.replace(/ /g, '') !== \"\"\r\n\t}\r\n\r\n\tpublic customTooltipCharacterCount() {\r\n\t\t//Is an Element, but due to strict mode it is set as any\r\n\t\tlet element: any | null = this.element.querySelector('#parameter-custom-tooltip');\r\n\t\tif (element) {\r\n\t\t\tthis.characterCount = element[\"textLength\"];;\r\n\t\t}\r\n\t}\r\n\r\n\tpublic addCategory(category: Category) {\r\n\t\tthis.parameter?.builtInCategories.push(category.id);\r\n\r\n\t\tif(this.bindNoCategories === true){\r\n\t\t\tthis.bindNoCategories = false;\r\n\t\t}\r\n\t}\r\n\r\n\tpublic removeCategory(category: Category) {\r\n\t\tconst index: number | undefined = this.parameter?.builtInCategories.findIndex(x => x === category.id);\r\n\t\tif (index && index > -1) {\r\n\t\t\tthis.parameter?.builtInCategories.splice(index, 1);\r\n\t\t}\r\n\t}\r\n}\r\n","import {DisplayUnitTypesOnProject, ParameterTypeEnumDto} from \"../../../models/parameter-definition-dto\";\r\n\r\nexport class ParameterTypeToUnitTypeValueConverter{\r\n\ttoView(parameterTypeId:number, parameterTypes: ParameterTypeEnumDto[], displayUnitTypes : DisplayUnitTypesOnProject[]){\r\n\t\t\r\n\t\tif(!Boolean(parameterTypeId) || !Boolean(parameterTypes)|| !Boolean(displayUnitTypes))\r\n\t\t\treturn parameterTypeId;\r\n\t\tlet parameterType = parameterTypes.find(x => x.enumInt == parameterTypeId);\r\n\t\tlet val = displayUnitTypes.find(x => x.unitTypeEnumInt == parameterType?.unitType_Id);\r\n\t\t\r\n\t\treturn Boolean(val) ? val?.unitShort : \"\";\r\n\t}\r\n}\r\n\r\n\r\nexport class StorageTypeToStringValueConverter{\r\n\ttoView(storageType:any, storageTypes:any[]){\r\n\t\tif(!Boolean(storageType) || !Boolean(storageTypes))\r\n\t\t\treturn storageTypes.find(x => x.id == 0).name;\r\n\t\treturn storageTypes.find(x => x.id == storageType).name;\r\n\t}\r\n}\r\n"],"names":["ManageParameter","setActiveStep","newStep","who","console","log","this","getActiveStep","totalSteps","activeStep","constructor","dialog","apiClient","appContext","modal","element","events","i18n","serviceBuilder","valueListService","taskQueue","router","errorMessage","characterCount","editMode","categories","parameterTypes","builtInParameters","unitTypes","groups","displayUnitTypes","searchTerm","subscriptions","valueLists","currentParameters","selectedStartFromId","parameterTypeLocked","loading","submitClicked","bindAllCategories","bindNoCategories","selectedModelId","selectedBuiltInParameter","selectedParameterType","parameterDefinitionService","undefined","ParameterType_Text","BuiltInParam_Invalid","ParameterType_Invalid","viewContext","settings","overlayDismiss","ForAjourCollab_OSB","projectId","BuildParameterDefinitionService","bindAllCategoriesChanged","newValue","oldValue","Boolean","parameter","scope","builtInCategories","filter","c","allowsBoundParametersAsType","map","id","allowsBoundParametersAsInstance","bindNoCategoriesChanged","selectedStartFromIdChanged","syncDirection","SyncToAc","length","getRevitParameters","then","result","x","name","SyncToRevit","selectedModelIdChanged","getRevitParameterById","builtInParameter","parameterType","unitType","sharedParamId","createInRevit","storageType","selectedBuiltInParameterChanged","find","enumInt","createGuid","isBuiltIn","found","paramId","parameterType_Id","selectedParameterTypeChanged","hasParameterType","unitType_Id","activate","model","getWizardOptions","Promise","all","GetParameterTypeEnums","GetBuiltInParameterEnums","GetCategories","GetDisplayUnitTypesForProject","GetUnitTypeEnums","GetParameterGroupEnums","getValueListsOnProject","orgId","items","sourceProjectId","selected","inEditMode","editName","parameterId","getProjectParameterById","originalParameter","Object","assign","newParameter","finally","subscribe","data","handleSearchEvent","broken_initTotalSteps","queueTask","document","querySelectorAll","detached","forEach","subscription","dispose","unlockParameterType","OpenConfirm","tr","whenClosed","wasCancelled","wizardOptions","scopes","startFrom","properties","syncDirections","storageTypes","submit","saveEdit","create","resetErrorMessage","isNameValid","projectWToken","postJson","handleError","replace","jsonResult","response","validateForm","close","parameterHasChanged","classificationId","group","valueListEnforced","valueList_Id","cancel","previousStep","nextStep","goToStep","event","dataset_step","target","closest","dataset","step","parseInt","isGuid","error","stringToTest","substring","test","customTooltipCharacterCount","querySelector","addCategory","category","push","removeCategory","index","findIndex","splice","observable","autoinject","DialogController","Element","EventAggregator","I18N","TaskQueue","ParameterTypeToUnitTypeValueConverter","toView","parameterTypeId","val","unitTypeEnumInt","unitShort","StorageTypeToStringValueConverter"],"sourceRoot":""}