summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/pages/dashboard
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-08-20 18:42:06 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-08-20 18:42:06 +0000
commit6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch)
tree78be5963ec075d80116a932011d695dd33910b4e /app/assets/javascripts/pages/dashboard
parent1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff)
downloadgitlab-ce-6e4e1050d9dba2b7b2523fdd1768823ab85feef4.tar.gz
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'app/assets/javascripts/pages/dashboard')
-rw-r--r--app/assets/javascripts/pages/dashboard/issues/index.js1
-rw-r--r--app/assets/javascripts/pages/dashboard/merge_requests/index.js1
-rw-r--r--app/assets/javascripts/pages/dashboard/projects/index/components/customize_homepage_banner.vue66
-rw-r--r--app/assets/javascripts/pages/dashboard/projects/index/index.js (renamed from app/assets/javascripts/pages/dashboard/projects/index.js)3
-rw-r--r--app/assets/javascripts/pages/dashboard/projects/index/init_customize_homepage_banner.js16
-rw-r--r--app/assets/javascripts/pages/dashboard/todos/index/todos.js2
6 files changed, 88 insertions, 1 deletions
diff --git a/app/assets/javascripts/pages/dashboard/issues/index.js b/app/assets/javascripts/pages/dashboard/issues/index.js
index 2ffeed8a584..71cdaf45052 100644
--- a/app/assets/javascripts/pages/dashboard/issues/index.js
+++ b/app/assets/javascripts/pages/dashboard/issues/index.js
@@ -8,6 +8,7 @@ document.addEventListener('DOMContentLoaded', () => {
initFilteredSearch({
page: FILTERED_SEARCH.ISSUES,
filteredSearchTokenKeys: IssuableFilteredSearchTokenKeys,
+ useDefaultState: true,
});
projectSelect();
diff --git a/app/assets/javascripts/pages/dashboard/merge_requests/index.js b/app/assets/javascripts/pages/dashboard/merge_requests/index.js
index 24d7b592948..10df18c85e7 100644
--- a/app/assets/javascripts/pages/dashboard/merge_requests/index.js
+++ b/app/assets/javascripts/pages/dashboard/merge_requests/index.js
@@ -10,6 +10,7 @@ document.addEventListener('DOMContentLoaded', () => {
initFilteredSearch({
page: FILTERED_SEARCH.MERGE_REQUESTS,
filteredSearchTokenKeys: IssuableFilteredSearchTokenKeys,
+ useDefaultState: true,
});
projectSelect();
diff --git a/app/assets/javascripts/pages/dashboard/projects/index/components/customize_homepage_banner.vue b/app/assets/javascripts/pages/dashboard/projects/index/components/customize_homepage_banner.vue
new file mode 100644
index 00000000000..6b907f31a37
--- /dev/null
+++ b/app/assets/javascripts/pages/dashboard/projects/index/components/customize_homepage_banner.vue
@@ -0,0 +1,66 @@
+<script>
+import { GlBanner } from '@gitlab/ui';
+import { s__ } from '~/locale';
+import axios from '~/lib/utils/axios_utils';
+
+export default {
+ components: {
+ GlBanner,
+ },
+ inject: {
+ svgPath: {
+ default: '',
+ },
+ preferencesBehaviorPath: {
+ default: '',
+ },
+ calloutsPath: {
+ default: '',
+ },
+ calloutsFeatureId: {
+ default: '',
+ },
+ },
+ i18n: {
+ title: s__('CustomizeHomepageBanner|Do you want to customize this page?'),
+ body: s__(
+ 'CustomizeHomepageBanner|This page shows a list of your projects by default but it can be changed to show projects\' activity, groups, your to-do list, assigned issues, assigned merge requests, and more. You can change this under "Homepage content" in your preferences',
+ ),
+ button_text: s__('CustomizeHomepageBanner|Go to preferences'),
+ },
+ data() {
+ return {
+ visible: true,
+ };
+ },
+ methods: {
+ handleClose() {
+ axios
+ .post(this.calloutsPath, {
+ feature_name: this.calloutsFeatureId,
+ })
+ .catch(e => {
+ // eslint-disable-next-line @gitlab/require-i18n-strings, no-console
+ console.error('Failed to dismiss banner.', e);
+ });
+
+ this.visible = false;
+ },
+ },
+};
+</script>
+
+<template>
+ <gl-banner
+ v-if="visible"
+ :title="$options.i18n.title"
+ :button-text="$options.i18n.button_text"
+ :button-link="preferencesBehaviorPath"
+ :svg-path="svgPath"
+ @close="handleClose"
+ >
+ <p>
+ {{ $options.i18n.body }}
+ </p>
+ </gl-banner>
+</template>
diff --git a/app/assets/javascripts/pages/dashboard/projects/index.js b/app/assets/javascripts/pages/dashboard/projects/index/index.js
index 01001d4f3ff..b3c95f4ac1f 100644
--- a/app/assets/javascripts/pages/dashboard/projects/index.js
+++ b/app/assets/javascripts/pages/dashboard/projects/index/index.js
@@ -1,5 +1,8 @@
import ProjectsList from '~/projects_list';
+import initCustomizeHomepageBanner from './init_customize_homepage_banner';
document.addEventListener('DOMContentLoaded', () => {
new ProjectsList(); // eslint-disable-line no-new
+
+ initCustomizeHomepageBanner();
});
diff --git a/app/assets/javascripts/pages/dashboard/projects/index/init_customize_homepage_banner.js b/app/assets/javascripts/pages/dashboard/projects/index/init_customize_homepage_banner.js
new file mode 100644
index 00000000000..c0735dde1da
--- /dev/null
+++ b/app/assets/javascripts/pages/dashboard/projects/index/init_customize_homepage_banner.js
@@ -0,0 +1,16 @@
+import Vue from 'vue';
+import CustomizeHomepageBanner from './components/customize_homepage_banner.vue';
+
+export default () => {
+ const el = document.querySelector('.js-customize-homepage-banner');
+
+ if (!el) {
+ return false;
+ }
+
+ return new Vue({
+ el,
+ provide: { ...el.dataset },
+ render: createElement => createElement(CustomizeHomepageBanner),
+ });
+};
diff --git a/app/assets/javascripts/pages/dashboard/todos/index/todos.js b/app/assets/javascripts/pages/dashboard/todos/index/todos.js
index 5230bdf9cdd..f76b4b44452 100644
--- a/app/assets/javascripts/pages/dashboard/todos/index/todos.js
+++ b/app/assets/javascripts/pages/dashboard/todos/index/todos.js
@@ -7,7 +7,7 @@ import UsersSelect from '~/users_select';
import { isMetaClick } from '~/lib/utils/common_utils';
import { addDelimiter } from '~/lib/utils/text_utility';
import { __ } from '~/locale';
-import flash from '~/flash';
+import { deprecatedCreateFlash as flash } from '~/flash';
import axios from '~/lib/utils/axios_utils';
export default class Todos {