Commit 358a6b40 authored by Nicolò Maria Mezzopera's avatar Nicolò Maria Mezzopera

Merge branch '339499-require-string-literal-i18n-helper' into 'master'

Address require-string-literal-i18n-helpers offenses

See merge request gitlab-org/gitlab!72389
parents b07515ab 66dc6d76
<script> <script>
/* eslint-disable @gitlab/require-string-literal-i18n-helpers */
import { GlLink, GlSprintf } from '@gitlab/ui'; import { GlLink, GlSprintf } from '@gitlab/ui';
import { first } from 'lodash'; import { first } from 'lodash';
import { getIdFromGraphQLId } from '~/graphql_shared/utils'; import { getIdFromGraphQLId } from '~/graphql_shared/utils';
...@@ -21,8 +20,6 @@ export default { ...@@ -21,8 +20,6 @@ export default {
combinedUpdateText: s__( combinedUpdateText: s__(
'PackageRegistry|Package updated by commit %{link} on branch %{branch}, built by pipeline %{pipeline}, and published to the registry %{datetime}', 'PackageRegistry|Package updated by commit %{link} on branch %{branch}, built by pipeline %{pipeline}, and published to the registry %{datetime}',
), ),
archivedPipelineMessageSingular: s__('PackageRegistry|Package has %{number} archived update'),
archivedPipelineMessagePlural: s__('PackageRegistry|Package has %{number} archived updates'),
}, },
components: { components: {
GlLink, GlLink,
...@@ -58,14 +55,14 @@ export default { ...@@ -58,14 +55,14 @@ export default {
showPipelinesInfo() { showPipelinesInfo() {
return Boolean(this.firstPipeline?.id); return Boolean(this.firstPipeline?.id);
}, },
archiviedLines() { archivedLines() {
return Math.max(this.pipelines.length - HISTORY_PIPELINES_LIMIT - 1, 0); return Math.max(this.pipelines.length - HISTORY_PIPELINES_LIMIT - 1, 0);
}, },
archivedPipelineMessage() { archivedPipelineMessage() {
return n__( return n__(
this.$options.i18n.archivedPipelineMessageSingular, 'PackageRegistry|Package has %{updatesCount} archived update',
this.$options.i18n.archivedPipelineMessagePlural, 'PackageRegistry|Package has %{updatesCount} archived updates',
this.archiviedLines, this.archivedLines,
); );
}, },
}, },
...@@ -135,10 +132,10 @@ export default { ...@@ -135,10 +132,10 @@ export default {
</gl-sprintf> </gl-sprintf>
</history-item> </history-item>
<history-item v-if="archiviedLines" icon="history" data-testid="archived"> <history-item v-if="archivedLines" icon="history" data-testid="archived">
<gl-sprintf :message="archivedPipelineMessage"> <gl-sprintf :message="archivedPipelineMessage">
<template #number> <template #updatesCount>
<strong>{{ archiviedLines }}</strong> <strong>{{ archivedLines }}</strong>
</template> </template>
</gl-sprintf> </gl-sprintf>
</history-item> </history-item>
......
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