summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/view-models
diff options
context:
space:
mode:
authorvasraz <vasyl.razinkov@est.tech>2023-09-14 17:54:11 +0100
committerVasyl Razinkov <vasyl.razinkov@est.tech>2023-09-14 17:05:59 +0000
commit458bf21d934e356c20b69a1c7b0aae79197e1023 (patch)
tree8594155677af5d12d7d4451200d9ab4e9363964a /catalog-ui/src/app/view-models
parentcec4c5b5fac4fc0567535fa7254aae29160b2a0a (diff)
Improve error reporting during the service import
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Change-Id: I407d18e3b1c0757efb4623d73b21d98cbb76310a Issue-ID: SDC-4623
Diffstat (limited to 'catalog-ui/src/app/view-models')
-rw-r--r--catalog-ui/src/app/view-models/workspace/tabs/general/general-view-model.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/catalog-ui/src/app/view-models/workspace/tabs/general/general-view-model.ts b/catalog-ui/src/app/view-models/workspace/tabs/general/general-view-model.ts
index 685f564f27..5065023cb4 100644
--- a/catalog-ui/src/app/view-models/workspace/tabs/general/general-view-model.ts
+++ b/catalog-ui/src/app/view-models/workspace/tabs/general/general-view-model.ts
@@ -304,8 +304,8 @@ export class GeneralViewModel {
const errorMsg = this.$filter('translate')('IMPORT_FAILURE_MESSAGE_TEXT');
console.error(errorMsg, error);
const errorDetails = {
- 'Error': error.reason,
- 'Details': error.message
+ 'Error': this.capitalize(error.reason),
+ 'Details': this.capitalize(error.message)
};
this.modalServiceSdcUI.openErrorDetailModal('Error', this.$filter('translate')('IMPORT_FAILURE_MESSAGE_TEXT'),
'error-modal', errorDetails);
@@ -339,7 +339,6 @@ export class GeneralViewModel {
this.$scope.isShowOnboardingSelectionBrowse = false;
}
-
//init file extensions based on the file that was imported.
if (this.$scope.component.isResource() && (<Resource>this.$scope.component).importedFile) {
let fileName:string = (<Resource>this.$scope.component).importedFile.filename;
@@ -357,8 +356,6 @@ export class GeneralViewModel {
//(<Resource>this.$scope.component).importedFile.filetype="csar";
}
-
-
this.$scope.setValidState(true);
this.$scope.calculateUnique = (mainCategory:string, subCategory:string):string => {
@@ -375,7 +372,6 @@ export class GeneralViewModel {
this.$scope.originComponent.contactId = this.$scope.component.contactId;
}
-
this.$scope.$on('$destroy', () => {
this.EventListenerService.unRegisterObserver(EVENTS.ON_LIFECYCLE_CHANGE_WITH_SAVE);
this.EventListenerService.unRegisterObserver(EVENTS.ON_LIFECYCLE_CHANGE);
@@ -383,6 +379,10 @@ export class GeneralViewModel {
};
+ private capitalize(s) {
+ return s && s[0].toUpperCase() + s.slice(1);
+ }
+
// Convert category string MainCategory_#_SubCategory to Array with one item (like the server except)
private convertCategoryStringToOneArray = ():IMainCategory[] => {
let tmp = this.$scope.component.selectedCategory.split("_#_");