Commit a0b0a6e4 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Address minor review comments

Fixes some basic class issues and some
minor i18n interpolation issues

Apply 5 suggestion(s) to 1 file(s)
parent 68850f67
<script> <script>
import { GlIcon, GlEmptyState, GlLoadingIcon } from '@gitlab/ui'; import { GlIcon, GlEmptyState, GlLoadingIcon, GlSprintf } from '@gitlab/ui';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import { deprecatedCreateFlash as Flash } from '~/flash'; import { deprecatedCreateFlash as Flash } from '~/flash';
import { __ } from '~/locale'; import { __ } from '~/locale';
...@@ -19,6 +19,7 @@ export default { ...@@ -19,6 +19,7 @@ export default {
GlIcon, GlIcon,
GlEmptyState, GlEmptyState,
GlLoadingIcon, GlLoadingIcon,
GlSprintf,
banner, banner,
'stage-issue-component': stageComponent, 'stage-issue-component': stageComponent,
'stage-plan-component': stageComponent, 'stage-plan-component': stageComponent,
...@@ -64,12 +65,6 @@ export default { ...@@ -64,12 +65,6 @@ export default {
}, },
}, },
created() { created() {
// Conditional check placed here to prevent this method from being called on the
// new Value Stream Analytics page (i.e. the new page will be initialized blank and only
// after a group is selected the cycle analyitcs data will be fetched). Once the
// old (current) page has been removed this entire created method as well as the
// variable itself can be completely removed.
// Follow up issue: https://gitlab.com/gitlab-org/gitlab-foss/issues/64490
this.fetchCycleAnalyticsData(); this.fetchCycleAnalyticsData();
}, },
methods: { methods: {
...@@ -138,6 +133,10 @@ export default { ...@@ -138,6 +133,10 @@ export default {
Cookies.set(OVERVIEW_DIALOG_COOKIE, '1', { expires: 365 }); Cookies.set(OVERVIEW_DIALOG_COOKIE, '1', { expires: 365 });
}, },
}, },
dayRangeOptions: [7, 30, 90],
i18n: {
dropdownText: __('Last %{days} days'),
},
}; };
</script> </script>
<template> <template>
...@@ -155,25 +154,19 @@ export default { ...@@ -155,25 +154,19 @@ export default {
<div class="js-ca-dropdown dropdown inline"> <div class="js-ca-dropdown dropdown inline">
<button class="dropdown-menu-toggle" data-toggle="dropdown" type="button"> <button class="dropdown-menu-toggle" data-toggle="dropdown" type="button">
<span class="dropdown-label"> <span class="dropdown-label">
{{ n__('Last %d day', 'Last %d days', startDate) }} <gl-sprintf :message="$options.i18n.dropdownText">
<template #days>{{ startDate }}</template>
</gl-sprintf>
<gl-icon name="chevron-down" class="dropdown-menu-toggle-icon gl-top-3" /> <gl-icon name="chevron-down" class="dropdown-menu-toggle-icon gl-top-3" />
</span> </span>
</button> </button>
<ul class="dropdown-menu dropdown-menu-right"> <ul class="dropdown-menu dropdown-menu-right">
<li> <li v-for="days in $options.dayRangeOptions" :key="`day-range-${days}`">
<a href="#" @click.prevent="handleDateSelect(7)">{{ <a href="#" @click.prevent="handleDateSelect(days)">
n__('Last %d day', 'Last %d days', 7) <gl-sprintf :message="$options.i18n.dropdownText">
}}</a> <template #days>{{ days }}</template>
</li> </gl-sprintf>
<li> </a>
<a href="#" @click.prevent="handleDateSelect(30)">{{
n__('Last %d day', 'Last %d days', 30)
}}</a>
</li>
<li>
<a href="#" @click.prevent="handleDateSelect(90)">{{
n__('Last %d day', 'Last %d days', 90)
}}</a>
</li> </li>
</ul> </ul>
</div> </div>
...@@ -186,7 +179,7 @@ export default { ...@@ -186,7 +179,7 @@ export default {
<nav class="col-headers"> <nav class="col-headers">
<ul> <ul>
<li class="stage-header pl-5"> <li class="stage-header pl-5">
<span class="stage-name.font-weight-bold">{{ <span class="stage-name font-weight-bold">{{
s__('ProjectLifecycle|Stage') s__('ProjectLifecycle|Stage')
}}</span> }}</span>
<span <span
...@@ -199,7 +192,7 @@ export default { ...@@ -199,7 +192,7 @@ export default {
</span> </span>
</li> </li>
<li class="median-header"> <li class="median-header">
<span class="stage-name.font-weight-bold">{{ __('Median') }}</span> <span class="stage-name font-weight-bold">{{ __('Median') }}</span>
<span <span
class="has-tooltip" class="has-tooltip"
data-placement="top" data-placement="top"
...@@ -216,7 +209,7 @@ export default { ...@@ -216,7 +209,7 @@ export default {
<li class="event-header pl-3"> <li class="event-header pl-3">
<span <span
v-if="currentStage && currentStage.legend" v-if="currentStage && currentStage.legend"
class="stage-name.font-weight-bold" class="stage-name font-weight-bold"
>{{ currentStage ? __(currentStage.legend) : __('Related Issues') }}</span >{{ currentStage ? __(currentStage.legend) : __('Related Issues') }}</span
> >
<span <span
...@@ -231,7 +224,7 @@ export default { ...@@ -231,7 +224,7 @@ export default {
</span> </span>
</li> </li>
<li class="total-time-header pr-5 text-right"> <li class="total-time-header pr-5 text-right">
<span class="stage-name.font-weight-bold">{{ __('Time') }}</span> <span class="stage-name font-weight-bold">{{ __('Time') }}</span>
<span <span
class="has-tooltip" class="has-tooltip"
data-placement="top" data-placement="top"
...@@ -250,7 +243,7 @@ export default { ...@@ -250,7 +243,7 @@ export default {
<ul> <ul>
<stage-nav-item <stage-nav-item
v-for="stage in state.stages" v-for="stage in state.stages"
:key="`ca-stage-title-${stage.title}`" :key="stage.title"
:title="stage.title" :title="stage.title"
:is-user-allowed="stage.isUserAllowed" :is-user-allowed="stage.isUserAllowed"
:value="stage.value" :value="stage.value"
......
...@@ -17399,6 +17399,9 @@ msgid_plural "Last %d days" ...@@ -17399,6 +17399,9 @@ msgid_plural "Last %d days"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
msgid "Last %{days} days"
msgstr ""
msgid "Last 2 weeks" msgid "Last 2 weeks"
msgstr "" msgstr ""
......
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