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mBgC,QAAQ5B,GACnE,OAAOoK,EACR,IAAIlH,EAAgBtD,EAAe4D,MAAKX,GAAKA,EAAEY,SAAW2G,IACtDC,EAAMrK,EAAiBwD,MAAKX,GAAKA,EAAEyH,kBAAmBpH,aAAa,EAAbA,EAAee,eAEzE,OAAOrC,QAAQyI,GAAOA,aAAG,EAAHA,EAAKE,UAAY,EACxC,EAIM,MAAMC,EACZL,OAAO7G,EAAiB0D,GACvB,OAAIpF,QAAQ0B,IAAiB1B,QAAQoF,GAE9BA,EAAaxD,MAAKX,GAAKA,EAAET,IAAMkB,IAAaR,KAD3CkE,EAAaxD,MAAKX,GAAa,GAARA,EAAET,KAASU,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).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).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","length","getRevitParameters","then","result","x","name","selectedModelIdChanged","getRevitParameterById","builtInParameter","parameterType","unitType","sharedParamId","createInRevit","storageType","selectedBuiltInParameterChanged","find","enumInt","createGuid","isBuiltIn","found","paramId","parameterType_Id","selectedParameterTypeChanged","hasParameterType","unitType_Id","async","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","I18N","TaskQueue","ParameterTypeToUnitTypeValueConverter","toView","parameterTypeId","val","unitTypeEnumInt","unitShort","StorageTypeToStringValueConverter"],"sourceRoot":""}