From 583bde3f83951fa4c294804edc2e9c57fb293733 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 4 Sep 2020 03:08:22 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .../components/invite_members_banner.vue | 42 ++++++ .../groups/init_invite_members_banner.js | 21 +++ .../pages/groups/shared/group_details.js | 2 + .../javascripts/snippets/components/edit.vue | 30 ++--- .../components/snippet_visibility_edit.vue | 50 +++----- app/assets/javascripts/snippets/constants.js | 12 -- app/assets/javascripts/snippets/index.js | 13 +- .../queries/snippet_visibility.query.graphql | 5 - app/assets/javascripts/snippets/utils/blob.js | 15 --- .../concerns/authenticates_with_two_factor.rb | 6 +- app/helpers/groups_helper.rb | 15 +++ app/views/groups/show.html.haml | 6 + app/views/layouts/_page.html.haml | 1 + app/views/shared/snippets/_form.html.haml | 3 +- .../cat-time-precision-2fa-ldap.yml | 5 + .../invite_your_teammates_banner_a.yml | 7 + doc/.vale/gitlab/RelativeLinks.yml | 2 +- doc/api/pages_domains.md | 34 +++-- doc/ci/environments/incremental_rollouts.md | 2 +- doc/ci/examples/README.md | 1 + doc/ci/yaml/README.md | 2 +- doc/install/installation.md | 4 +- doc/install/requirements.md | 4 +- .../getting_started/pages_from_scratch.md | 2 +- lib/tasks/gettext.rake | 4 +- locale/gitlab.pot | 9 ++ scripts/lint-doc.sh | 2 +- .../components/invite_members_banner_spec.js | 76 +++++++++++ .../snippet_visibility_edit_spec.js.snap | 8 -- .../frontend/snippets/components/edit_spec.js | 7 - .../snippet_visibility_edit_spec.js | 120 ++++++------------ spec/helpers/groups_helper_spec.rb | 44 +++++++ 32 files changed, 333 insertions(+), 221 deletions(-) create mode 100644 app/assets/javascripts/groups/components/invite_members_banner.vue create mode 100644 app/assets/javascripts/groups/init_invite_members_banner.js delete mode 100644 app/assets/javascripts/snippets/queries/snippet_visibility.query.graphql create mode 100644 changelogs/unreleased/cat-time-precision-2fa-ldap.yml create mode 100644 config/feature_flags/development/invite_your_teammates_banner_a.yml create mode 100644 spec/frontend/groups/components/invite_members_banner_spec.js diff --git a/app/assets/javascripts/groups/components/invite_members_banner.vue b/app/assets/javascripts/groups/components/invite_members_banner.vue new file mode 100644 index 00000000000..83a23134279 --- /dev/null +++ b/app/assets/javascripts/groups/components/invite_members_banner.vue @@ -0,0 +1,42 @@ + + + diff --git a/app/assets/javascripts/groups/init_invite_members_banner.js b/app/assets/javascripts/groups/init_invite_members_banner.js new file mode 100644 index 00000000000..dbc3ed65a4f --- /dev/null +++ b/app/assets/javascripts/groups/init_invite_members_banner.js @@ -0,0 +1,21 @@ +import Vue from 'vue'; +import InviteMembersBanner from '~/groups/components/invite_members_banner.vue'; + +export default function initInviteMembersBanner() { + const el = document.querySelector('.js-group-invite-members-banner'); + + if (!el) { + return false; + } + + const { svgPath, inviteMembersPath } = el.dataset; + + return new Vue({ + el, + provide: { + svgPath, + inviteMembersPath, + }, + render: createElement => createElement(InviteMembersBanner), + }); +} diff --git a/app/assets/javascripts/pages/groups/shared/group_details.js b/app/assets/javascripts/pages/groups/shared/group_details.js index 37b253d7c48..8546b1f759f 100644 --- a/app/assets/javascripts/pages/groups/shared/group_details.js +++ b/app/assets/javascripts/pages/groups/shared/group_details.js @@ -8,6 +8,7 @@ import NotificationsForm from '~/notifications_form'; import ProjectsList from '~/projects_list'; import ShortcutsNavigation from '~/behaviors/shortcuts/shortcuts_navigation'; import GroupTabs from './group_tabs'; +import initInviteMembersBanner from '~/groups/init_invite_members_banner'; export default function initGroupDetails(actionName = 'show') { const newGroupChildWrapper = document.querySelector('.js-new-project-subgroup'); @@ -27,4 +28,5 @@ export default function initGroupDetails(actionName = 'show') { if (newGroupChildWrapper) { new NewGroupChild(newGroupChildWrapper); } + initInviteMembersBanner(); } diff --git a/app/assets/javascripts/snippets/components/edit.vue b/app/assets/javascripts/snippets/components/edit.vue index 1a539aa0876..3d2eaebf1cb 100644 --- a/app/assets/javascripts/snippets/components/edit.vue +++ b/app/assets/javascripts/snippets/components/edit.vue @@ -6,21 +6,19 @@ import { __, sprintf } from '~/locale'; import TitleField from '~/vue_shared/components/form/title.vue'; import { redirectTo, joinPaths } from '~/lib/utils/url_utility'; import FormFooterActions from '~/vue_shared/components/form/form_footer_actions.vue'; -import { SNIPPET_MARK_EDIT_APP_START } from '~/performance_constants'; import UpdateSnippetMutation from '../mutations/updateSnippet.mutation.graphql'; import CreateSnippetMutation from '../mutations/createSnippet.mutation.graphql'; import { getSnippetMixin } from '../mixins/snippets'; import { + SNIPPET_VISIBILITY_PRIVATE, SNIPPET_CREATE_MUTATION_ERROR, SNIPPET_UPDATE_MUTATION_ERROR, - SNIPPET_VISIBILITY_PRIVATE, } from '../constants'; -import defaultVisibilityQuery from '../queries/snippet_visibility.query.graphql'; - import SnippetBlobActionsEdit from './snippet_blob_actions_edit.vue'; import SnippetVisibilityEdit from './snippet_visibility_edit.vue'; import SnippetDescriptionEdit from './snippet_description_edit.vue'; +import { SNIPPET_MARK_EDIT_APP_START } from '~/performance_constants'; export default { components: { @@ -33,15 +31,6 @@ export default { GlLoadingIcon, }, mixins: [getSnippetMixin], - apollo: { - defaultVisibility: { - query: defaultVisibilityQuery, - manual: true, - result({ data: { selectedLevel } }) { - this.selectedLevelDefault = selectedLevel; - }, - }, - }, props: { markdownPreviewPath: { type: String, @@ -67,7 +56,6 @@ export default { isUpdating: false, newSnippet: false, actions: [], - selectedLevelDefault: SNIPPET_VISIBILITY_PRIVATE, }; }, computed: { @@ -110,13 +98,6 @@ export default { descriptionFieldId() { return `${this.isProjectSnippet ? 'project' : 'personal'}_snippet_description`; }, - newSnippetSchema() { - return { - title: '', - description: '', - visibilityLevel: this.selectedLevelDefault, - }; - }, }, beforeCreate() { performance.mark(SNIPPET_MARK_EDIT_APP_START); @@ -145,7 +126,7 @@ export default { }, onNewSnippetFetched() { this.newSnippet = true; - this.snippet = this.newSnippetSchema; + this.snippet = this.$options.newSnippetSchema; }, onExistingSnippetFetched() { this.newSnippet = false; @@ -203,6 +184,11 @@ export default { this.actions = actions; }, }, + newSnippetSchema: { + title: '', + description: '', + visibilityLevel: SNIPPET_VISIBILITY_PRIVATE, + }, };