Commit ec7189c4 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch '283912-remove-redundant-text' into 'master'

Remove redundant MR widget text

See merge request gitlab-org/gitlab!52013
parents 750b8b20 3b856b2e
......@@ -15,6 +15,16 @@ export default {
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: {
addNum() {
return Number(this.plan.create);
......@@ -30,23 +40,21 @@ export default {
},
reportChangeText() {
if (this.validPlanValues) {
return s__(
'Terraform|Reported Resource Changes: %{addNum} to add, %{changeNum} to change, %{deleteNum} to delete',
);
return this.$options.i18n.changes;
}
return s__('Terraform|Generating the report caused an error.');
return this.$options.i18n.generationErrored;
},
reportHeaderText() {
if (this.validPlanValues) {
return this.plan.job_name
? s__('Terraform|The Terraform report %{name} was generated in your pipelines.')
: s__('Terraform|A Terraform report was generated in your pipelines.');
? this.$options.i18n.namedReportGenerated
: this.$options.i18n.reportGenerated;
}
return this.plan.job_name
? s__('Terraform|The Terraform report %{name} failed to generate.')
: s__('Terraform|A Terraform report failed to generate.');
? this.$options.i18n.namedReportFailed
: this.$options.i18n.reportFailed;
},
validPlanValues() {
return this.addNum + this.changeNum + this.deleteNum >= 0;
......
---
title: Remove redundant text in Terraform Widget
merge_request: 52013
author:
type: changed
......@@ -27755,10 +27755,10 @@ msgstr[1] ""
msgid "Terraform|%{user} updated %{timeAgo}"
msgstr ""
msgid "Terraform|A Terraform report failed to generate."
msgid "Terraform|A report failed to generate."
msgstr ""
msgid "Terraform|A Terraform report was generated in your pipelines."
msgid "Terraform|A report was generated in your pipelines."
msgstr ""
msgid "Terraform|Actions"
......@@ -27818,10 +27818,10 @@ msgstr ""
msgid "Terraform|States"
msgstr ""
msgid "Terraform|The Terraform report %{name} failed to generate."
msgid "Terraform|The report %{name} failed to generate."
msgstr ""
msgid "Terraform|The Terraform report %{name} was generated in your pipelines."
msgid "Terraform|The report %{name} was generated in your pipelines."
msgstr ""
msgid "Terraform|To remove the State file and its versions, type %{name} to confirm:"
......
......@@ -33,7 +33,7 @@ describe('TerraformPlan', () => {
it('diplays the header text with a name', () => {
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', () => {
});
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', () => {
it('diplays the header text with a name', () => {
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', () => {
});
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', () => {
......
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