diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-13 12:10:52 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-13 12:10:52 +0300 |
commit | ab9c1dbb2dc0e591a6ce4466e15766d99f4abf4b (patch) | |
tree | 228f0953c110a7a2a4438666994995c702bac6de /app | |
parent | e6f170581eddc84da845d4f2e511f4776848e9f7 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
14 files changed, 49 insertions, 96 deletions
diff --git a/app/assets/javascripts/groups/members/components/app.vue b/app/assets/javascripts/groups/members/components/app.vue index f6f3a955813..34a2c67fa9f 100644 --- a/app/assets/javascripts/groups/members/components/app.vue +++ b/app/assets/javascripts/groups/members/components/app.vue @@ -5,12 +5,10 @@ import MembersTable from '~/members/components/table/members_table.vue'; import FilterSortContainer from '~/members/components/filter_sort/filter_sort_container.vue'; import { scrollToElement } from '~/lib/utils/common_utils'; import { HIDE_ERROR } from '~/members/store/mutation_types'; -import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; export default { name: 'GroupMembersApp', components: { MembersTable, FilterSortContainer, GlAlert }, - mixins: [glFeatureFlagsMixin()], computed: { ...mapState(['showError', 'errorMessage']), }, @@ -36,7 +34,7 @@ export default { <gl-alert v-if="showError" ref="errorAlert" variant="danger" @dismiss="hideError">{{ errorMessage }}</gl-alert> - <filter-sort-container v-if="glFeatures.groupMembersFilteredSearch" /> + <filter-sort-container /> <members-table /> </div> </template> diff --git a/app/assets/javascripts/jira_connect/components/app.vue b/app/assets/javascripts/jira_connect/components/app.vue index 4a58113db1f..275a66d5956 100644 --- a/app/assets/javascripts/jira_connect/components/app.vue +++ b/app/assets/javascripts/jira_connect/components/app.vue @@ -1,16 +1,12 @@ <script> +import { mapState } from 'vuex'; import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; export default { name: 'JiraConnectApp', mixins: [glFeatureFlagsMixin()], computed: { - state() { - return this.$root.$data.state || {}; - }, - error() { - return this.state.error; - }, + ...mapState(['errorMessage']), showNewUi() { return this.glFeatures.newJiraConnectUi; }, @@ -21,7 +17,7 @@ export default { <template> <div> <div v-if="showNewUi"> - <h3>{{ s__('Integrations|Linked namespaces') }}</h3> + <h3 data-testid="new-jira-connect-ui-heading">{{ s__('Integrations|Linked namespaces') }}</h3> </div> </div> </template> diff --git a/app/assets/javascripts/jira_connect/index.js b/app/assets/javascripts/jira_connect/index.js index bd261750ccd..05f13de6f53 100644 --- a/app/assets/javascripts/jira_connect/index.js +++ b/app/assets/javascripts/jira_connect/index.js @@ -1,23 +1,21 @@ import Vue from 'vue'; +import Vuex from 'vuex'; import $ from 'jquery'; import setConfigs from '@gitlab/ui/dist/config'; import Translate from '~/vue_shared/translate'; import GlFeatureFlagsPlugin from '~/vue_shared/gl_feature_flags_plugin'; -import App from './components/app.vue'; +import JiraConnectApp from './components/app.vue'; import { addSubscription, removeSubscription } from '~/jira_connect/api'; +import createStore from './store'; +import { SET_ERROR_MESSAGE } from './store/mutation_types'; -const store = { - state: { - error: '', - }, - setErrorMessage(errorMessage) { - this.state.error = errorMessage; - }, -}; +Vue.use(Vuex); + +const store = createStore(); /** - * Initialize necessary form handlers for the Jira Connect app + * Initialize form handlers for the Jira Connect app */ const initJiraFormHandlers = () => { const reqComplete = () => { @@ -27,7 +25,7 @@ const initJiraFormHandlers = () => { const reqFailed = (res, fallbackErrorMessage) => { const { responseJSON: { error = fallbackErrorMessage } = {} } = res || {}; - store.setErrorMessage(error); + store.commit(SET_ERROR_MESSAGE, error); // eslint-disable-next-line no-alert alert(error); }; @@ -79,11 +77,9 @@ function initJiraConnect() { return new Vue({ el, - data: { - state: store.state, - }, + store, render(createElement) { - return createElement(App, {}); + return createElement(JiraConnectApp, {}); }, }); } diff --git a/app/assets/javascripts/jira_connect/store/index.js b/app/assets/javascripts/jira_connect/store/index.js new file mode 100644 index 00000000000..aa7e14269a4 --- /dev/null +++ b/app/assets/javascripts/jira_connect/store/index.js @@ -0,0 +1,9 @@ +import Vuex from 'vuex'; +import mutations from './mutations'; +import state from './state'; + +export default () => + new Vuex.Store({ + state, + mutations, + }); diff --git a/app/assets/javascripts/jira_connect/store/mutation_types.js b/app/assets/javascripts/jira_connect/store/mutation_types.js new file mode 100644 index 00000000000..7f6ff1256bb --- /dev/null +++ b/app/assets/javascripts/jira_connect/store/mutation_types.js @@ -0,0 +1 @@ +export const SET_ERROR_MESSAGE = 'SET_ERROR_MESSAGE'; diff --git a/app/assets/javascripts/jira_connect/store/mutations.js b/app/assets/javascripts/jira_connect/store/mutations.js new file mode 100644 index 00000000000..c3acd07f89f --- /dev/null +++ b/app/assets/javascripts/jira_connect/store/mutations.js @@ -0,0 +1,7 @@ +import { SET_ERROR_MESSAGE } from './mutation_types'; + +export default { + [SET_ERROR_MESSAGE](state, errorMessage) { + state.errorMessage = errorMessage; + }, +}; diff --git a/app/assets/javascripts/jira_connect/store/state.js b/app/assets/javascripts/jira_connect/store/state.js new file mode 100644 index 00000000000..079b8350770 --- /dev/null +++ b/app/assets/javascripts/jira_connect/store/state.js @@ -0,0 +1,3 @@ +export default () => ({ + errorMessage: undefined, +}); diff --git a/app/assets/javascripts/pages/projects/pipelines/new/index.js b/app/assets/javascripts/pages/projects/pipelines/new/index.js index d5563143f0c..08c31f2b3c6 100644 --- a/app/assets/javascripts/pages/projects/pipelines/new/index.js +++ b/app/assets/javascripts/pages/projects/pipelines/new/index.js @@ -3,17 +3,15 @@ import NewBranchForm from '~/new_branch_form'; import setupNativeFormVariableList from '~/ci_variable_list/native_form_variable_list'; import initNewPipeline from '~/pipeline_new/index'; -document.addEventListener('DOMContentLoaded', () => { - const el = document.getElementById('js-new-pipeline'); +const el = document.getElementById('js-new-pipeline'); - if (el) { - initNewPipeline(); - } else { - new NewBranchForm($('.js-new-pipeline-form')); // eslint-disable-line no-new +if (el) { + initNewPipeline(); +} else { + new NewBranchForm($('.js-new-pipeline-form')); // eslint-disable-line no-new - setupNativeFormVariableList({ - container: $('.js-ci-variable-list-section'), - formField: 'variables_attributes', - }); - } -}); + setupNativeFormVariableList({ + container: $('.js-ci-variable-list-section'), + formField: 'variables_attributes', + }); +} diff --git a/app/assets/stylesheets/framework/highlight.scss b/app/assets/stylesheets/framework/highlight.scss index 73a2170fc68..28577e2801e 100644 --- a/app/assets/stylesheets/framework/highlight.scss +++ b/app/assets/stylesheets/framework/highlight.scss @@ -45,7 +45,8 @@ a { font-family: $monospace-font; - display: block; + display: flex; + justify-content: flex-end; font-size: $code-font-size !important; white-space: nowrap; diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 24282a50cce..3cb7373a970 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -103,14 +103,6 @@ class ApplicationController < ActionController::Base head :forbidden, retry_after: Gitlab::Auth::UniqueIpsLimiter.config.unique_ips_limit_time_window end - rescue_from GRPC::Unavailable, Gitlab::Git::CommandError do |exception| - log_exception(exception) - - headers['Retry-After'] = exception.retry_after if exception.respond_to?(:retry_after) - - render_503 - end - def redirect_back_or_default(default: root_path, options: {}) redirect_back(fallback_location: default, **options) end @@ -246,19 +238,6 @@ class ApplicationController < ActionController::Base head :unprocessable_entity end - def render_503 - respond_to do |format| - format.html do - render( - file: Rails.root.join("public", "503"), - layout: false, - status: :service_unavailable - ) - end - format.any { head :service_unavailable } - end - end - def no_cache_headers DEFAULT_GITLAB_NO_CACHE_HEADERS.each do |k, v| headers[k] = v diff --git a/app/controllers/groups/group_members_controller.rb b/app/controllers/groups/group_members_controller.rb index d1b09e1b49e..5df7ff0632a 100644 --- a/app/controllers/groups/group_members_controller.rb +++ b/app/controllers/groups/group_members_controller.rb @@ -14,10 +14,6 @@ class Groups::GroupMembersController < Groups::ApplicationController # Authorize before_action :authorize_admin_group_member!, except: admin_not_required_endpoints - before_action do - push_frontend_feature_flag(:group_members_filtered_search, @group, default_enabled: true) - end - skip_before_action :check_two_factor_requirement, only: :leave skip_cross_project_access_check :index, :create, :update, :destroy, :request_access, :approve_access_request, :leave, :resend_invite, diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 3744517934a..2635a93433f 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -94,7 +94,7 @@ class ProjectsController < Projects::ApplicationController redirect_to(edit_project_path(@project, anchor: 'js-general-project-settings')) end else - flash.now[:alert] = result[:message] + flash[:alert] = result[:message] @project.reset format.html { render_edit } diff --git a/app/views/admin/dev_ops_report/show.html.haml b/app/views/admin/dev_ops_report/show.html.haml index 19ce285162f..733c0de9fe9 100644 --- a/app/views/admin/dev_ops_report/show.html.haml +++ b/app/views/admin/dev_ops_report/show.html.haml @@ -3,7 +3,7 @@ .container .gl-mt-3 - - if Gitlab.ee? && License.feature_available?(:devops_adoption) + - if Gitlab.ee? && Feature.enabled?(:devops_adoption_feature, default_enabled: false) && License.feature_available?(:devops_adoption) = render_if_exists 'admin/dev_ops_report/devops_tabs' - else = render 'report' diff --git a/app/views/groups/group_members/index.html.haml b/app/views/groups/group_members/index.html.haml index 9a7cfc0a573..e3fd9d4bb17 100644 --- a/app/views/groups/group_members/index.html.haml +++ b/app/views/groups/group_members/index.html.haml @@ -3,8 +3,6 @@ - show_invited_members = can_manage_members && @invited_members.exists? - show_access_requests = can_manage_members && @requesters.exists? - invited_active = params[:search_invited].present? || params[:invited_members_page].present? -- filtered_search_enabled = Feature.enabled?(:group_members_filtered_search, @group, default_enabled: true) -- form_item_label_css_class = 'label-bold gl-mr-2 gl-mb-0 gl-py-2 align-self-md-center' .js-remove-member-modal .project-members-page.gl-mt-3 @@ -51,52 +49,23 @@ %span.badge.badge-pill= @requesters.count .tab-content #tab-members.tab-pane{ class: ('active' unless invited_active) } - - unless filtered_search_enabled - = render 'shared/members/tab_pane/header' do - = render 'shared/members/tab_pane/title' do - = html_escape(_('Members with access to %{strong_start}%{group_name}%{strong_end}')) % { group_name: @group.name, strong_start: '<strong>'.html_safe, strong_end: '</strong>'.html_safe } - = form_tag group_group_members_path(@group), method: :get, class: 'user-search-form gl-display-flex gl-md-align-items-center gl-flex-wrap gl-flex-direction-column gl-md-flex-direction-row gl-mx-n3 gl-my-n3', data: { testid: 'user-search-form' } do - .gl-px-3.gl-py-2 - .search-control-wrap.gl-relative - = render 'shared/members/search_field' - - if can_manage_members - = render 'shared/members/tab_pane/form_item' do - = label_tag '2fa', _('2FA'), class: form_item_label_css_class - = render 'shared/members/filter_2fa_dropdown' - = render 'shared/members/tab_pane/form_item' do - = label_tag :sort_by, _('Sort by'), class: form_item_label_css_class - = render 'shared/members/sort_dropdown' .js-group-members-list{ data: group_members_list_data_attributes(@group, @members) } .loading .spinner.spinner-md = paginate @members, theme: 'gitlab', params: { invited_members_page: nil, search_invited: nil } - if @group.shared_with_group_links.any? #tab-groups.tab-pane - - unless filtered_search_enabled - = render 'shared/members/tab_pane/header' do - = render 'shared/members/tab_pane/title' do - = html_escape(_('Groups with access to %{strong_start}%{group_name}%{strong_end}')) % { group_name: @group.name, strong_start: '<strong>'.html_safe, strong_end: '</strong>'.html_safe } .js-group-linked-list{ data: linked_groups_list_data_attributes(@group) } .loading .spinner.spinner-md - if show_invited_members #tab-invited-members.tab-pane{ class: ('active' if invited_active) } - - unless filtered_search_enabled - = render 'shared/members/tab_pane/header' do - = render 'shared/members/tab_pane/title' do - = html_escape(_('Members invited to %{strong_start}%{group_name}%{strong_end}')) % { group_name: @group.name, strong_start: '<strong>'.html_safe, strong_end: '</strong>'.html_safe } - = form_tag group_group_members_path(@group), method: :get, class: 'user-search-form', data: { testid: 'user-search-form' } do - = render 'shared/members/search_field', name: 'search_invited' .js-group-invited-members-list{ data: group_members_list_data_attributes(@group, @invited_members) } .loading .spinner.spinner-md = paginate @invited_members, param_name: 'invited_members_page', theme: 'gitlab', params: { page: nil } - if show_access_requests #tab-access-requests.tab-pane - - unless filtered_search_enabled - = render 'shared/members/tab_pane/header' do - = render 'shared/members/tab_pane/title' do - = html_escape(_('Users requesting access to %{strong_start}%{group_name}%{strong_end}')) % { group_name: @group.name, strong_start: '<strong>'.html_safe, strong_end: '</strong>'.html_safe } .js-group-access-requests-list{ data: group_members_list_data_attributes(@group, @requesters) } .loading .spinner.spinner-md |