Commit 5868a89d authored by lauraMon's avatar lauraMon

Allows internationalization of details status dropdown

parent d7df9c2c
...@@ -12,7 +12,6 @@ import { ...@@ -12,7 +12,6 @@ import {
GlButton, GlButton,
} from '@gitlab/ui'; } from '@gitlab/ui';
import createFlash from '~/flash'; import createFlash from '~/flash';
import { capitalizeFirstCharacter } from '~/lib/utils/text_utility';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import query from '../graphql/queries/details.query.graphql'; import query from '../graphql/queries/details.query.graphql';
import { fetchPolicies } from '~/lib/graphql'; import { fetchPolicies } from '~/lib/graphql';
...@@ -23,9 +22,9 @@ import updateAlertStatus from '../graphql/mutations/update_alert_status.graphql' ...@@ -23,9 +22,9 @@ import updateAlertStatus from '../graphql/mutations/update_alert_status.graphql'
export default { export default {
statuses: { statuses: {
triggered: s__('AlertManagement|Triggered'), TRIGGERED: s__('AlertManagement|Triggered'),
acknowledged: s__('AlertManagement|Acknowledged'), ACKNOWLEDGED: s__('AlertManagement|Acknowledged'),
resolved: s__('AlertManagement|Resolved'), RESOLVED: s__('AlertManagement|Resolved'),
}, },
i18n: { i18n: {
errorMsg: s__( errorMsg: s__(
...@@ -100,7 +99,6 @@ export default { ...@@ -100,7 +99,6 @@ export default {
}, },
}, },
methods: { methods: {
capitalizeFirstCharacter,
dismissError() { dismissError() {
this.isErrorDismissed = true; this.isErrorDismissed = true;
}, },
...@@ -177,11 +175,7 @@ export default { ...@@ -177,11 +175,7 @@ export default {
> >
<h2 data-testid="title">{{ alert.title }}</h2> <h2 data-testid="title">{{ alert.title }}</h2>
</div> </div>
<gl-dropdown <gl-dropdown :text="$options.statuses[alert.status]" class="gl-absolute gl-right-0" right>
:text="capitalizeFirstCharacter(alert.status.toLowerCase())"
class="gl-absolute gl-right-0"
right
>
<gl-dropdown-item <gl-dropdown-item
v-for="(label, field) in $options.statuses" v-for="(label, field) in $options.statuses"
:key="field" :key="field"
......
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