CLOSE_BUTTON: string;
SAVE_BUTTON: string;
- constructor(private TranslateService: TranslateService) {
- this.TranslateService.languageChangedObservable.subscribe(lang => {
- this.EDIT_TITLE = this.TranslateService.translate('INTERFACE_EDIT_TITLE');
- this.CANCEL_BUTTON = this.TranslateService.translate("INTERFACE_CANCEL_BUTTON");
- this.CLOSE_BUTTON = this.TranslateService.translate("INTERFACE_CLOSE_BUTTON");
- this.SAVE_BUTTON = this.TranslateService.translate("INTERFACE_SAVE_BUTTON");
+ constructor(private translateService: TranslateService) {
+ this.translateService.languageChangedObservable.subscribe(lang => {
+ this.EDIT_TITLE = this.translateService.translate('INTERFACE_EDIT_TITLE');
+ this.CANCEL_BUTTON = this.translateService.translate("INTERFACE_CANCEL_BUTTON");
+ this.CLOSE_BUTTON = this.translateService.translate("INTERFACE_CLOSE_BUTTON");
+ this.SAVE_BUTTON = this.translateService.translate("INTERFACE_SAVE_BUTTON");
});
}
}
constructor(
- private TranslateService: TranslateService,
- private PluginsService: PluginsService,
+ private translateService: TranslateService,
+ private pluginsService: PluginsService,
private topologyTemplateService: TopologyTemplateService,
private toscaArtifactService: ToscaArtifactService,
private modalServiceNg2: ModalService,
private workspaceService: WorkspaceService,
@Inject("Notification") private Notification: any,
) {
- this.modalTranslation = new ModalTranslation(TranslateService);
+ this.modalTranslation = new ModalTranslation(translateService);
}
ngOnInit(): void {
).length === 0;
}
- private enableOrDisableSaveButton = (): boolean => {
- return this.isViewOnly;
+ private enableOrDisableSaveButton = (isValid): boolean => {
+ return isValid;
}
onSelectInterfaceOperation(interfaceModel: UIInterfaceModel, operation: InterfaceOperationModel) {
selectedInterface: interfaceModel ? interfaceModel : new UIInterfaceModel(),
selectedInterfaceOperation: operation ? operation : new InterfaceOperationModel(),
validityChangedCallback: this.enableOrDisableSaveButton,
- isViewOnly: this.isViewOnly
+ isViewOnly: this.isViewOnly,
+ isEdit: true,
+ modelName: this.componentMetaData.model
}
);
this.modalInstance.instance.open();
}
private updateInterfaceOperation() {
- this.isLoading = true;
+ this.modalServiceNg2.currentModal.instance.dynamicContent.instance.isLoading = true;
const interfaceOperationHandlerComponentInstance: InterfaceOperationHandlerComponent = this.modalInstance.instance.dynamicContent.instance;
const operationUpdated: InterfaceOperationModel = interfaceOperationHandlerComponentInstance.operationToUpdate;
const isArtifactChecked = interfaceOperationHandlerComponentInstance.enableAddArtifactImplementation;
if (!isArtifactChecked) {
let artifactName = interfaceOperationHandlerComponentInstance.artifactName;
artifactName = artifactName === undefined ? '' : artifactName;
- operationUpdated.implementation = new ArtifactModel({'artifactName': artifactName} as ArtifactModel);
+ operationUpdated.implementation = new ArtifactModel({'artifactName': artifactName, 'artifactVersion': ''} as ArtifactModel);
}
this.topologyTemplateService.updateComponentInstanceInterfaceOperation(
this.componentMetaData.uniqueId,
.subscribe((updatedComponentInstance: ComponentInstance) => {
this.componentInstanceSelected = new ComponentInstance(updatedComponentInstance);
this.initComponentInstanceInterfaceOperations();
+ this.modalServiceNg2.currentModal.instance.dynamicContent.instance.isLoading = false;
+ this.modalServiceNg2.closeCurrentModal();
+ }, () => {
+ this.modalServiceNg2.currentModal.instance.dynamicContent.instance.isLoading = false;
+ this.modalServiceNg2.closeCurrentModal();
});
- this.modalServiceNg2.closeCurrentModal();
- this.isLoading = false;
}
loadDeployedArtifacts() {