Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ffa2b3a8
Commit
ffa2b3a8
authored
Mar 08, 2020
by
Ezekiel Kigbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Applying patch from @pslaughter
parent
1ed0e173
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
37 deletions
+43
-37
ee/app/assets/javascripts/analytics/cycle_analytics/components/base.vue
...javascripts/analytics/cycle_analytics/components/base.vue
+3
-0
ee/app/assets/javascripts/analytics/cycle_analytics/components/url_sync.vue
...scripts/analytics/cycle_analytics/components/url_sync.vue
+29
-0
ee/app/assets/javascripts/analytics/cycle_analytics/store/actions.js
...ts/javascripts/analytics/cycle_analytics/store/actions.js
+11
-37
No files found.
ee/app/assets/javascripts/analytics/cycle_analytics/components/base.vue
View file @
ffa2b3a8
...
...
@@ -13,6 +13,7 @@ import StageDropdownFilter from './stage_dropdown_filter.vue';
import
SummaryTable
from
'
./summary_table.vue
'
;
import
StageTable
from
'
./stage_table.vue
'
;
import
TasksByTypeChart
from
'
./tasks_by_type_chart.vue
'
;
import
UrlSync
from
'
./url_sync.vue
'
;
export
default
{
name
:
'
CycleAnalytics
'
,
...
...
@@ -27,6 +28,7 @@ export default {
StageDropdownFilter
,
Scatterplot
,
TasksByTypeChart
,
UrlSync
,
},
mixins
:
[
glFeatureFlagsMixin
()],
props
:
{
...
...
@@ -203,6 +205,7 @@ export default {
<
template
>
<div
class=
"js-cycle-analytics"
>
<url-sync
/>
<div
class=
"page-title-holder d-flex align-items-center"
>
<h3
class=
"page-title"
>
{{
__
(
'
Value Stream Analytics
'
)
}}
</h3>
</div>
...
...
ee/app/assets/javascripts/analytics/cycle_analytics/components/url_sync.vue
0 → 100644
View file @
ffa2b3a8
<
script
>
import
{
mapState
,
mapGetters
}
from
'
vuex
'
;
import
{
historyPushState
}
from
'
~/lib/utils/common_utils
'
;
import
{
setUrlParams
}
from
'
~/lib/utils/url_utility
'
;
import
{
toYmd
}
from
'
../../shared/utils
'
;
export
default
{
computed
:
{
...
mapGetters
([
'
currentGroupPath
'
,
'
selectedProjectIds
'
]),
...
mapState
([
'
startDate
'
,
'
endDate
'
]),
query
()
{
return
{
group_id
:
this
.
currentGroupPath
,
'
project_ids[]
'
:
this
.
selectedProjectIds
,
created_after
:
toYmd
(
this
.
startDate
),
created_before
:
toYmd
(
this
.
endDate
),
};
},
},
watch
:
{
query
()
{
historyPushState
(
setUrlParams
(
this
.
query
,
window
.
location
.
href
,
true
));
},
},
render
()
{
return
this
.
$slots
.
default
;
},
};
</
script
>
ee/app/assets/javascripts/analytics/cycle_analytics/store/actions.js
View file @
ffa2b3a8
import
dateFormat
from
'
dateformat
'
;
import
Api
from
'
ee/api
'
;
import
{
getDayDifference
,
getDateInPast
}
from
'
~/lib/utils/datetime_utility
'
;
import
{
historyPushState
}
from
'
~/lib/utils/common_utils
'
;
import
{
setUrlParams
}
from
'
~/lib/utils/url_utility
'
;
import
createFlash
from
'
~/flash
'
;
import
createFlash
,
{
hideFlash
}
from
'
~/flash
'
;
import
{
__
,
sprintf
}
from
'
~/locale
'
;
import
httpStatus
from
'
~/lib/utils/http_status
'
;
import
*
as
types
from
'
./mutation_types
'
;
import
{
dateFormats
}
from
'
../../shared/constants
'
;
import
{
toYmd
}
from
'
../../shared/utils
'
;
import
{
removeFlash
}
from
'
../utils
'
;
const
removeError
=
()
=>
{
const
flashEl
=
document
.
querySelector
(
'
.flash-alert
'
);
if
(
flashEl
)
{
hideFlash
(
flashEl
);
}
};
const
handleErrorOrRethrow
=
({
action
,
error
})
=>
{
if
(
error
?.
response
?.
status
===
httpStatus
.
FORBIDDEN
)
{
...
...
@@ -26,50 +29,21 @@ const isStageNameExistsError = ({ status, errors }) => {
return
false
;
};
const
updateUrlParams
=
(
{
getters
:
{
currentGroupPath
,
selectedProjectIds
}
},
additionalParams
=
{},
)
=>
{
historyPushState
(
setUrlParams
(
{
group_id
:
currentGroupPath
,
'
project_ids[]
'
:
selectedProjectIds
,
...
additionalParams
,
},
window
.
location
.
href
,
true
,
),
);
};
export
const
setFeatureFlags
=
({
commit
},
featureFlags
)
=>
commit
(
types
.
SET_FEATURE_FLAGS
,
featureFlags
);
export
const
setSelectedGroup
=
({
commit
,
getters
},
group
)
=>
{
export
const
setSelectedGroup
=
({
commit
},
group
)
=>
{
commit
(
types
.
SET_SELECTED_GROUP
,
group
);
updateUrlParams
({
getters
});
};
export
const
setSelectedProjects
=
({
commit
,
getters
},
projects
)
=>
{
export
const
setSelectedProjects
=
({
commit
},
projects
)
=>
{
commit
(
types
.
SET_SELECTED_PROJECTS
,
projects
);
updateUrlParams
({
getters
});
};
export
const
setSelectedStage
=
({
commit
},
stage
)
=>
commit
(
types
.
SET_SELECTED_STAGE
,
stage
);
export
const
setDateRange
=
(
{
commit
,
dispatch
,
getters
},
{
skipFetch
=
false
,
startDate
,
endDate
},
)
=>
{
export
const
setDateRange
=
({
commit
,
dispatch
},
{
skipFetch
=
false
,
startDate
,
endDate
})
=>
{
commit
(
types
.
SET_DATE_RANGE
,
{
startDate
,
endDate
});
updateUrlParams
(
{
getters
},
{
created_after
:
toYmd
(
startDate
),
created_before
:
toYmd
(
endDate
),
},
);
if
(
skipFetch
)
return
false
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment