Skip to content

Commit

Permalink
fix: fix modal bug and add invalid condition
Browse files Browse the repository at this point in the history
Signed-off-by: yuda <[email protected]>
  • Loading branch information
yuda110 committed May 8, 2024
1 parent 68ff0c9 commit dfd3257
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const {
}, {
name(value) {
if (!value) return i18n.t('INVENTORY.ASSET_ANALYSIS.NAME_REQUIRED');
if (value.length > 40) return i18n.t('INVENTORY.ASSET_ANALYSIS.MAX_LENGTH_INVALID', { max: 40 });
if (state.existingNameList.find((d) => d === value)) return i18n.t('INVENTORY.ASSET_ANALYSIS.NAME_DUPLICATED');
return true;
},
Expand Down Expand Up @@ -128,8 +129,8 @@ const updateMetricName = async () => {
metric_id: state.currentMetricId,
name: name.value,
});
await assetAnalysisPageStore.loadMetric(state.currentMetricId);
state.proxyVisible = false;
await assetAnalysisPageStore.loadMetric(state.currentMetricId);
showSuccessMessage(i18n.t('INVENTORY.ASSET_ANALYSIS.ALT_S_UPDATE_METRIC_NAME'), '');
} catch (e) {
ErrorHandler.handleRequestError(e, i18n.t('INVENTORY.ASSET_ANALYSIS.ALT_E_UPDATE_METRIC_NAME'));
Expand All @@ -141,8 +142,8 @@ const updateMetricExampleName = async () => {
example_id: state.currentMetricExampleId,
name: name.value,
});
await assetAnalysisPageStore.loadMetricExamples(assetAnalysisPageGetters.namespaceId);
state.proxyVisible = false;
await assetAnalysisPageStore.loadMetricExamples(assetAnalysisPageGetters.namespaceId);
showSuccessMessage(i18n.t('INVENTORY.ASSET_ANALYSIS.ALT_S_UPDATE_METRIC_NAME'), '');
} catch (e) {
ErrorHandler.handleRequestError(e, i18n.t('INVENTORY.ASSET_ANALYSIS.ALT_E_UPDATE_METRIC_NAME'));
Expand Down
21 changes: 21 additions & 0 deletions packages/language-pack/console-translation-2.8.babel
Original file line number Diff line number Diff line change
Expand Up @@ -45003,6 +45003,27 @@
</concept_node>
</children>
</folder_node>
<concept_node>
<name>MAX_LENGTH_INVALID</name>
<definition_loaded>false</definition_loaded>
<description/>
<comment/>
<default_text/>
<translations>
<translation>
<language>en-US</language>
<approved>true</approved>
</translation>
<translation>
<language>ja-JP</language>
<approved>true</approved>
</translation>
<translation>
<language>ko-KR</language>
<approved>true</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>MONTHLY</name>
<definition_loaded>false</definition_loaded>
Expand Down
1 change: 1 addition & 0 deletions packages/language-pack/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2520,6 +2520,7 @@
"TITLE": "Get stared with Asset Analysis",
"UPCOMING": "Upcoming"
},
"MAX_LENGTH_INVALID": "{max} characters in max.",
"MONTHLY": "Monthly",
"NAME": "Name",
"NAME_DUPLICATED": "Name is duplicated.",
Expand Down
1 change: 1 addition & 0 deletions packages/language-pack/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -2520,6 +2520,7 @@
"TITLE": "リソース分析を開始する",
"UPCOMING": "今後の"
},
"MAX_LENGTH_INVALID": "{max}文字以内で入力してください",
"MONTHLY": "月別データ",
"NAME": "名前",
"NAME_DUPLICATED": "重複した名前です。",
Expand Down
1 change: 1 addition & 0 deletions packages/language-pack/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -2520,6 +2520,7 @@
"TITLE": "리소스 분석 시작하기",
"UPCOMING": "지원 예정"
},
"MAX_LENGTH_INVALID": "{max}자 이하로 입력해 주세요.",
"MONTHLY": "월별 데이터",
"NAME": "이름",
"NAME_DUPLICATED": "중복된 이름입니다.",
Expand Down

0 comments on commit dfd3257

Please sign in to comment.