diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-26 06:10:34 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-26 06:10:34 +0000 |
commit | fb553bbc1899eddaddb07cd9685cdabffbed9962 (patch) | |
tree | 473f1ad59a01e98d6ee1a04f462e524bb585f1e4 /app/assets | |
parent | a51e52bf5b7a708255a858ca51de8d4a6e58b074 (diff) | |
download | gitlab-ce-fb553bbc1899eddaddb07cd9685cdabffbed9962.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets')
5 files changed, 40 insertions, 13 deletions
diff --git a/app/assets/javascripts/milestone_select.js b/app/assets/javascripts/milestone_select.js index 53598165384..52f6786ca28 100644 --- a/app/assets/javascripts/milestone_select.js +++ b/app/assets/javascripts/milestone_select.js @@ -72,8 +72,8 @@ export default class MilestoneSelect { return initDeprecatedJQueryDropdown($dropdown, { showMenuAbove, data: (term, callback) => { - let contextId = $dropdown.get(0).dataset.projectId; - let getMilestones = Api.projectMilestones; + let contextId = parseInt($dropdown.get(0).dataset.projectId, 10); + let getMilestones = Api.projectMilestones.bind(Api); const reqParams = { state: 'active', include_parent_milestones: true }; if (term) { @@ -83,7 +83,7 @@ export default class MilestoneSelect { if (!contextId) { contextId = $dropdown.get(0).dataset.groupId; delete reqParams.include_parent_milestones; - getMilestones = Api.groupMilestones; + getMilestones = Api.groupMilestones.bind(Api); } // We don't use $.data() as it caches initial value and never updates! diff --git a/app/assets/javascripts/snippets/components/edit.vue b/app/assets/javascripts/snippets/components/edit.vue index 5bca486b92e..227d9043d7f 100644 --- a/app/assets/javascripts/snippets/components/edit.vue +++ b/app/assets/javascripts/snippets/components/edit.vue @@ -4,7 +4,7 @@ import { GlButton, GlLoadingIcon } from '@gitlab/ui'; import { deprecatedCreateFlash as Flash } from '~/flash'; import { __, sprintf } from '~/locale'; import TitleField from '~/vue_shared/components/form/title.vue'; -import { redirectTo } from '~/lib/utils/url_utility'; +import { redirectTo, joinPaths } from '~/lib/utils/url_utility'; import FormFooterActions from '~/vue_shared/components/form/form_footer_actions.vue'; import UpdateSnippetMutation from '../mutations/updateSnippet.mutation.graphql'; @@ -88,9 +88,7 @@ export default { }, cancelButtonHref() { if (this.newSnippet) { - return this.projectPath - ? `${gon.relative_url_root}${this.projectPath}/-/snippets` - : `${gon.relative_url_root}/-/snippets`; + return joinPaths('/', gon.relative_url_root, this.projectPath, '-/snippets'); } return this.snippet.webUrl; }, diff --git a/app/assets/javascripts/snippets/components/snippet_header.vue b/app/assets/javascripts/snippets/components/snippet_header.vue index 05a09347d06..0ca69f3161a 100644 --- a/app/assets/javascripts/snippets/components/snippet_header.vue +++ b/app/assets/javascripts/snippets/components/snippet_header.vue @@ -17,6 +17,7 @@ import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue'; import DeleteSnippetMutation from '../mutations/deleteSnippet.mutation.graphql'; import CanCreatePersonalSnippet from '../queries/userPermissions.query.graphql'; import CanCreateProjectSnippet from '../queries/projectPermissions.query.graphql'; +import { joinPaths } from '~/lib/utils/url_utility'; export default { components: { @@ -96,8 +97,8 @@ export default { condition: this.canCreateSnippet, text: __('New snippet'), href: this.snippet.project - ? `${this.snippet.project.webUrl}/-/snippets/new` - : `${gon.relative_url_root}/-/snippets/new`, + ? joinPaths(this.snippet.project.webUrl, '-/snippets/new') + : joinPaths('/', gon.relative_url_root, '/-/snippets/new'), variant: 'success', category: 'secondary', cssClass: 'ml-2', diff --git a/app/assets/javascripts/whats_new/components/app.vue b/app/assets/javascripts/whats_new/components/app.vue index d974556cb9e..9a06383a57b 100644 --- a/app/assets/javascripts/whats_new/components/app.vue +++ b/app/assets/javascripts/whats_new/components/app.vue @@ -6,8 +6,26 @@ export default { components: { GlDrawer, }, + props: { + features: { + type: String, + required: false, + default: null, + }, + }, computed: { ...mapState(['open']), + parsedFeatures() { + let features; + + try { + features = JSON.parse(this.$props.features) || []; + } catch (err) { + features = []; + } + + return features; + }, }, methods: { ...mapActions(['closeDrawer']), @@ -22,7 +40,12 @@ export default { <h4>{{ __("What's new at GitLab") }}</h4> </template> <template> - <div></div> + <ul> + <li v-for="feature in parsedFeatures" :key="feature.title"> + <h5>{{ feature.title }}</h5> + <p>{{ feature.body }}</p> + </li> + </ul> </template> </gl-drawer> </div> diff --git a/app/assets/javascripts/whats_new/index.js b/app/assets/javascripts/whats_new/index.js index c9ee3404d2a..a6519ab63b1 100644 --- a/app/assets/javascripts/whats_new/index.js +++ b/app/assets/javascripts/whats_new/index.js @@ -4,16 +4,21 @@ import Trigger from './components/trigger.vue'; import store from './store'; export default () => { + const whatsNewElm = document.getElementById('whats-new-app'); + // eslint-disable-next-line no-new new Vue({ - el: document.getElementById('whats-new-app'), + el: whatsNewElm, store, components: { App, }, - render(createElement) { - return createElement('app'); + return createElement('app', { + props: { + features: whatsNewElm.getAttribute('data-features'), + }, + }); }, }); |