Commit 3b856b2e authored by Emily Ring's avatar Emily Ring Committed by Jose Ivan Vargas

Remove redundant MR widget text

parent 50b64375
...@@ -15,6 +15,16 @@ export default { ...@@ -15,6 +15,16 @@ export default {
type: Object, type: Object,
}, },
}, },
i18n: {
changes: s__(
'Terraform|Reported Resource Changes: %{addNum} to add, %{changeNum} to change, %{deleteNum} to delete',
),
generationErrored: s__('Terraform|Generating the report caused an error.'),
namedReportFailed: s__('Terraform|The report %{name} failed to generate.'),
namedReportGenerated: s__('Terraform|The report %{name} was generated in your pipelines.'),
reportFailed: s__('Terraform|A report failed to generate.'),
reportGenerated: s__('Terraform|A report was generated in your pipelines.'),
},
computed: { computed: {
addNum() { addNum() {
return Number(this.plan.create); return Number(this.plan.create);
...@@ -30,23 +40,21 @@ export default { ...@@ -30,23 +40,21 @@ export default {
}, },
reportChangeText() { reportChangeText() {
if (this.validPlanValues) { if (this.validPlanValues) {
return s__( return this.$options.i18n.changes;
'Terraform|Reported Resource Changes: %{addNum} to add, %{changeNum} to change, %{deleteNum} to delete',
);
} }
return s__('Terraform|Generating the report caused an error.'); return this.$options.i18n.generationErrored;
}, },
reportHeaderText() { reportHeaderText() {
if (this.validPlanValues) { if (this.validPlanValues) {
return this.plan.job_name return this.plan.job_name
? s__('Terraform|The Terraform report %{name} was generated in your pipelines.') ? this.$options.i18n.namedReportGenerated
: s__('Terraform|A Terraform report was generated in your pipelines.'); : this.$options.i18n.reportGenerated;
} }
return this.plan.job_name return this.plan.job_name
? s__('Terraform|The Terraform report %{name} failed to generate.') ? this.$options.i18n.namedReportFailed
: s__('Terraform|A Terraform report failed to generate.'); : this.$options.i18n.reportFailed;
}, },
validPlanValues() { validPlanValues() {
return this.addNum + this.changeNum + this.deleteNum >= 0; return this.addNum + this.changeNum + this.deleteNum >= 0;
......
---
title: Remove redundant text in Terraform Widget
merge_request: 52013
author:
type: changed
...@@ -27752,10 +27752,10 @@ msgstr[1] "" ...@@ -27752,10 +27752,10 @@ msgstr[1] ""
msgid "Terraform|%{user} updated %{timeAgo}" msgid "Terraform|%{user} updated %{timeAgo}"
msgstr "" msgstr ""
msgid "Terraform|A Terraform report failed to generate." msgid "Terraform|A report failed to generate."
msgstr "" msgstr ""
msgid "Terraform|A Terraform report was generated in your pipelines." msgid "Terraform|A report was generated in your pipelines."
msgstr "" msgstr ""
msgid "Terraform|Actions" msgid "Terraform|Actions"
...@@ -27815,10 +27815,10 @@ msgstr "" ...@@ -27815,10 +27815,10 @@ msgstr ""
msgid "Terraform|States" msgid "Terraform|States"
msgstr "" msgstr ""
msgid "Terraform|The Terraform report %{name} failed to generate." msgid "Terraform|The report %{name} failed to generate."
msgstr "" msgstr ""
msgid "Terraform|The Terraform report %{name} was generated in your pipelines." msgid "Terraform|The report %{name} was generated in your pipelines."
msgstr "" msgstr ""
msgid "Terraform|To remove the State file and its versions, type %{name} to confirm:" msgid "Terraform|To remove the State file and its versions, type %{name} to confirm:"
......
...@@ -33,7 +33,7 @@ describe('TerraformPlan', () => { ...@@ -33,7 +33,7 @@ describe('TerraformPlan', () => {
it('diplays the header text with a name', () => { it('diplays the header text with a name', () => {
expect(wrapper.text()).toContain( expect(wrapper.text()).toContain(
`The Terraform report ${validPlanWithName.job_name} was generated in your pipelines.`, `The report ${validPlanWithName.job_name} was generated in your pipelines.`,
); );
}); });
...@@ -55,7 +55,7 @@ describe('TerraformPlan', () => { ...@@ -55,7 +55,7 @@ describe('TerraformPlan', () => {
}); });
it('diplays the header text without a name', () => { it('diplays the header text without a name', () => {
expect(wrapper.text()).toContain('A Terraform report was generated in your pipelines.'); expect(wrapper.text()).toContain('A report was generated in your pipelines.');
}); });
}); });
...@@ -70,7 +70,7 @@ describe('TerraformPlan', () => { ...@@ -70,7 +70,7 @@ describe('TerraformPlan', () => {
it('diplays the header text with a name', () => { it('diplays the header text with a name', () => {
expect(wrapper.text()).toContain( expect(wrapper.text()).toContain(
`The Terraform report ${invalidPlanWithName.job_name} failed to generate.`, `The report ${invalidPlanWithName.job_name} failed to generate.`,
); );
}); });
...@@ -85,7 +85,7 @@ describe('TerraformPlan', () => { ...@@ -85,7 +85,7 @@ describe('TerraformPlan', () => {
}); });
it('diplays the header text without a name', () => { it('diplays the header text without a name', () => {
expect(wrapper.text()).toContain('A Terraform report failed to generate.'); expect(wrapper.text()).toContain('A report failed to generate.');
}); });
it('does not render button because url is missing', () => { it('does not render button because url is missing', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment