Commit 186e8c43 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Adds create value stream button

Adds the valueStreamAnalyticsCreateMultipleValueStreams
feature flag to toggle the button on and off
parent 29b8e564
<script> <script>
import { GlEmptyState, GlLoadingIcon } from '@gitlab/ui'; import { GlEmptyState, GlLoadingIcon, GlButton } from '@gitlab/ui';
import { GlBreakpointInstance as bp } from '@gitlab/ui/dist/utils';
import { mapActions, mapState, mapGetters } from 'vuex'; import { mapActions, mapState, mapGetters } from 'vuex';
import { featureAccessLevel } from '~/pages/projects/shared/permissions/constants'; import { featureAccessLevel } from '~/pages/projects/shared/permissions/constants';
import { PROJECTS_PER_PAGE, STAGE_ACTIONS } from '../constants'; import { PROJECTS_PER_PAGE, STAGE_ACTIONS } from '../constants';
...@@ -25,6 +26,7 @@ export default { ...@@ -25,6 +26,7 @@ export default {
components: { components: {
DateRange, DateRange,
DurationChart, DurationChart,
GlButton,
GlLoadingIcon, GlLoadingIcon,
GlEmptyState, GlEmptyState,
GroupsDropdownFilter, GroupsDropdownFilter,
...@@ -111,9 +113,15 @@ export default { ...@@ -111,9 +113,15 @@ export default {
// https://gitlab.com/gitlab-org/gitlab/-/issues/223735 // https://gitlab.com/gitlab-org/gitlab/-/issues/223735
return this.featureFlags.hasFilterBar && this.currentGroupPath; return this.featureFlags.hasFilterBar && this.currentGroupPath;
}, },
canCreateMultipleValueStreams() {
return Boolean(this.featureFlags.hasCreateMultipleValueStreams);
},
isLoadingTypeOfWork() { isLoadingTypeOfWork() {
return this.isLoadingTasksByTypeChartTopLabels || this.isLoadingTasksByTypeChart; return this.isLoadingTasksByTypeChartTopLabels || this.isLoadingTasksByTypeChart;
}, },
isXSBreakpoint() {
return bp.getBreakpointSize() === 'xs';
},
hasDateRangeSet() { hasDateRangeSet() {
return this.startDate && this.endDate; return this.startDate && this.endDate;
}, },
...@@ -190,6 +198,9 @@ export default { ...@@ -190,6 +198,9 @@ export default {
onStageReorder(data) { onStageReorder(data) {
this.reorderStage(data); this.reorderStage(data);
}, },
onCreateValueStream() {
// stub handler - to be implemented in a follow up
},
}, },
multiProjectSelect: true, multiProjectSelect: true,
dateOptions: [7, 30, 90], dateOptions: [7, 30, 90],
...@@ -208,8 +219,19 @@ export default { ...@@ -208,8 +219,19 @@ export default {
</script> </script>
<template> <template>
<div> <div>
<div class="mb-3"> <div
class="mb-3 gl-display-flex gl-flex-direction-column gl-sm-flex-direction-row gl-justify-content-space-between"
>
<h3>{{ __('Value Stream Analytics') }}</h3> <h3>{{ __('Value Stream Analytics') }}</h3>
<div
class="gl-align-self-center"
:class="{
'gl-w-full': isXSBreakpoint,
'gl-mt-5': !isXSBreakpoint,
}"
>
<gl-button @click="onCreateValueStream">{{ __('Create new value stream') }}</gl-button>
</div>
</div> </div>
<div class="mw-100"> <div class="mw-100">
<div class="mt-3 py-2 px-3 bg-gray-light border-top border-bottom"> <div class="mt-3 py-2 px-3 bg-gray-light border-top border-bottom">
......
...@@ -14,11 +14,18 @@ export default () => { ...@@ -14,11 +14,18 @@ export default () => {
cycleAnalyticsScatterplotMedianEnabled: hasDurationChartMedian = false, cycleAnalyticsScatterplotMedianEnabled: hasDurationChartMedian = false,
valueStreamAnalyticsPathNavigation: hasPathNavigation = false, valueStreamAnalyticsPathNavigation: hasPathNavigation = false,
valueStreamAnalyticsFilterBar: hasFilterBar = false, valueStreamAnalyticsFilterBar: hasFilterBar = false,
valueStreamAnalyticsCreateMultipleValueStreams: hasCreateMultipleValueStreams = false,
} = gon?.features; } = gon?.features;
store.dispatch('initializeCycleAnalytics', { store.dispatch('initializeCycleAnalytics', {
...initialData, ...initialData,
featureFlags: { hasDurationChart, hasDurationChartMedian, hasPathNavigation, hasFilterBar }, featureFlags: {
hasDurationChart,
hasDurationChartMedian,
hasPathNavigation,
hasFilterBar,
hasCreateMultipleValueStreams,
},
}); });
return new Vue({ return new Vue({
......
...@@ -16,6 +16,7 @@ class Analytics::CycleAnalyticsController < Analytics::ApplicationController ...@@ -16,6 +16,7 @@ class Analytics::CycleAnalyticsController < Analytics::ApplicationController
push_frontend_feature_flag(:cycle_analytics_scatterplot_median_enabled, default_enabled: true) push_frontend_feature_flag(:cycle_analytics_scatterplot_median_enabled, default_enabled: true)
push_frontend_feature_flag(:value_stream_analytics_path_navigation, @group) push_frontend_feature_flag(:value_stream_analytics_path_navigation, @group)
push_frontend_feature_flag(:value_stream_analytics_filter_bar, @group) push_frontend_feature_flag(:value_stream_analytics_filter_bar, @group)
push_frontend_feature_flag(:value_stream_analytics_create_multiple_value_streams, @group)
end end
private private
......
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