diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-21 09:09:03 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-21 09:09:03 +0300 |
commit | 25c07d7230471a8cc7062e83662a300fb4902fce (patch) | |
tree | 801312092a7062aa2afbef142dbea04115ebae53 /app | |
parent | e1e342d79bcc1f72829cc6d1642f5e7d76750e75 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
12 files changed, 61 insertions, 17 deletions
diff --git a/app/assets/javascripts/behaviors/markdown/render_mermaid.js b/app/assets/javascripts/behaviors/markdown/render_mermaid.js index 479782a1f1f..0cb13815c7e 100644 --- a/app/assets/javascripts/behaviors/markdown/render_mermaid.js +++ b/app/assets/javascripts/behaviors/markdown/render_mermaid.js @@ -140,7 +140,7 @@ function renderMermaids($els) { 'Warning: Displaying this diagram might cause performance issues on this page.', )}</div> <div class="gl-alert-actions"> - <button class="js-lazy-render-mermaid btn gl-alert-action btn-warning btn-md new-gl-button">Display</button> + <button class="js-lazy-render-mermaid btn gl-alert-action btn-warning btn-md gl-button">Display</button> </div> </div> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> diff --git a/app/assets/javascripts/diffs/components/diff_file_header.vue b/app/assets/javascripts/diffs/components/diff_file_header.vue index 53d1383b82e..f4eb7a6cd2f 100644 --- a/app/assets/javascripts/diffs/components/diff_file_header.vue +++ b/app/assets/javascripts/diffs/components/diff_file_header.vue @@ -213,6 +213,8 @@ export default { ref="header" :class="{ 'gl-z-dropdown-menu!': moreActionsShown }" class="js-file-title file-title file-title-flex-parent" + data-qa-selector="file_title_container" + :data-qa-file-name="filePath" @click.self="handleToggleFile" > <div class="file-header-content"> @@ -307,6 +309,7 @@ export default { right toggle-class="btn-icon js-diff-more-actions" class="gl-pt-0!" + data-qa-selector="dropdown_button" @show="setMoreActionsShown(true)" @hidden="setMoreActionsShown(false)" > @@ -340,6 +343,7 @@ export default { ref="ideEditButton" :href="diffFile.ide_edit_path" class="js-ide-edit-blob" + data-qa-selector="edit_in_ide_button" > {{ __('Edit in Web IDE') }} </gl-dropdown-item> diff --git a/app/assets/javascripts/ide/components/activity_bar.vue b/app/assets/javascripts/ide/components/activity_bar.vue index 644808cb83a..16e70382fdd 100644 --- a/app/assets/javascripts/ide/components/activity_bar.vue +++ b/app/assets/javascripts/ide/components/activity_bar.vue @@ -11,7 +11,7 @@ export default { GlTooltip: GlTooltipDirective, }, computed: { - ...mapState(['currentActivityView']), + ...mapState(['currentActivityView', 'stagedFiles']), }, methods: { ...mapActions(['updateActivityBarView']), @@ -81,6 +81,9 @@ export default { @click.prevent="changedActivityView($event, $options.leftSidebarViews.commit.name)" > <gl-icon name="commit" /> + <div v-if="stagedFiles.length > 0" class="ide-commit-badge badge badge-pill"> + {{ stagedFiles.length }} + </div> </button> </li> </ul> diff --git a/app/assets/javascripts/ide/components/new_dropdown/index.vue b/app/assets/javascripts/ide/components/new_dropdown/index.vue index 692878de5e1..bb66d4cc9a6 100644 --- a/app/assets/javascripts/ide/components/new_dropdown/index.vue +++ b/app/assets/javascripts/ide/components/new_dropdown/index.vue @@ -108,6 +108,7 @@ export default { class="d-flex" icon="remove" icon-classes="mr-2" + data-qa-selector="delete_button" @click="deleteEntry(path)" /> </li> diff --git a/app/assets/javascripts/integrations/edit/components/integration_form.vue b/app/assets/javascripts/integrations/edit/components/integration_form.vue index ac8a64d5f3b..3b054be07bb 100644 --- a/app/assets/javascripts/integrations/edit/components/integration_form.vue +++ b/app/assets/javascripts/integrations/edit/components/integration_form.vue @@ -1,6 +1,6 @@ <script> import { mapState, mapActions, mapGetters } from 'vuex'; -import { GlButton, GlModalDirective } from '@gitlab/ui'; +import { GlButton, GlModalDirective, GlSafeHtmlDirective as SafeHtml } from '@gitlab/ui'; import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import eventHub from '../event_hub'; import { integrationLevels } from '../constants'; @@ -28,9 +28,17 @@ export default { GlButton, }, directives: { - 'gl-modal': GlModalDirective, + GlModal: GlModalDirective, + SafeHtml, }, mixins: [glFeatureFlagsMixin()], + props: { + helpHtml: { + type: String, + required: false, + default: '', + }, + }, computed: { ...mapGetters(['currentKey', 'propsSource', 'isDisabled']), ...mapState([ @@ -80,11 +88,17 @@ export default { this.fetchResetIntegration(); }, }, + helpHtmlConfig: { + ADD_TAGS: ['use'], // to support icon SVGs + }, }; </script> <template> <div> + <!-- helpHtml is trusted input --> + <div v-if="helpHtml" v-safe-html:[$options.helpHtmlConfig]="helpHtml"></div> + <override-dropdown v-if="defaultState !== null" :inherit-from-id="defaultState.id" @@ -92,6 +106,7 @@ export default { :learn-more-path="propsSource.learnMorePath" @change="setOverride" /> + <active-checkbox v-if="propsSource.showActive" :key="`${currentKey}-active-checkbox`" /> <jira-trigger-fields v-if="isJira" diff --git a/app/assets/javascripts/integrations/edit/index.js b/app/assets/javascripts/integrations/edit/index.js index 95a53f1beab..4d63bd5ed3a 100644 --- a/app/assets/javascripts/integrations/edit/index.js +++ b/app/assets/javascripts/integrations/edit/index.js @@ -80,21 +80,29 @@ export default (el, defaultEl) => { } const props = parseDatasetToProps(el.dataset); - const initialState = { defaultState: null, customState: props, }; - if (defaultEl) { initialState.defaultState = Object.freeze(parseDatasetToProps(defaultEl.dataset)); } + // Here, we capture the "helpHtml", so we can pass it to the Vue component + // to position it where ever it wants. + // Because this node is a _child_ of `el`, it will be removed when the Vue component is mounted, + // so we don't need to manually remove it. + const helpHtml = el.querySelector('.js-integration-help-html')?.innerHTML; + return new Vue({ el, store: createStore(initialState), render(createElement) { - return createElement(IntegrationForm); + return createElement(IntegrationForm, { + props: { + helpHtml, + }, + }); }, }); }; diff --git a/app/assets/javascripts/vue_shared/components/file_row.vue b/app/assets/javascripts/vue_shared/components/file_row.vue index 96567111bbc..17ebdce232a 100644 --- a/app/assets/javascripts/vue_shared/components/file_row.vue +++ b/app/assets/javascripts/vue_shared/components/file_row.vue @@ -147,6 +147,7 @@ export default { :style="levelIndentation" class="file-row-name" data-qa-selector="file_name_content" + :data-qa-file-name="file.name" data-testid="file-row-name-container" :class="[fileClasses, { 'str-truncated': !truncateMiddle, 'gl-min-w-0': truncateMiddle }]" > diff --git a/app/assets/stylesheets/page_bundles/ide.scss b/app/assets/stylesheets/page_bundles/ide.scss index f6b9473d235..b5b34c0a64e 100644 --- a/app/assets/stylesheets/page_bundles/ide.scss +++ b/app/assets/stylesheets/page_bundles/ide.scss @@ -605,6 +605,17 @@ $ide-commit-header-height: 48px; left: -1px; } } + + .ide-commit-badge { + background-color: var(--ide-highlight-accent, $almost-black) !important; + color: var(--ide-highlight-background, $white) !important; + position: absolute; + left: 38px; + top: $gl-padding-8; + font-size: $gl-font-size-12; + padding: 2px $gl-padding-4; + font-weight: $gl-font-weight-bold !important; + } } .ide-activity-bar { diff --git a/app/views/admin/application_settings/integrations.html.haml b/app/views/admin/application_settings/integrations.html.haml index ed4f63d0b82..6ed6709eca8 100644 --- a/app/views/admin/application_settings/integrations.html.haml +++ b/app/views/admin/application_settings/integrations.html.haml @@ -11,7 +11,7 @@ %h4.gl-alert-title= s_('AdminSettings|Some settings have moved') = html_escape_once(s_('AdminSettings|Elasticsearch, PlantUML, Slack application, Third party offers, Snowplow, Amazon EKS have moved to Settings > General.')).html_safe .gl-alert-actions - = link_to s_('AdminSettings|Go to General Settings'), general_admin_application_settings_path, class: 'btn gl-alert-action btn-info new-gl-button' + = link_to s_('AdminSettings|Go to General Settings'), general_admin_application_settings_path, class: 'btn gl-alert-action btn-info gl-button' %h4= s_('AdminSettings|Apply integration settings to all Projects') %p diff --git a/app/views/shared/_auto_devops_callout.html.haml b/app/views/shared/_auto_devops_callout.html.haml index 443d801d672..d6d84b2181f 100644 --- a/app/views/shared/_auto_devops_callout.html.haml +++ b/app/views/shared/_auto_devops_callout.html.haml @@ -8,7 +8,7 @@ %p - link = link_to(s_('AutoDevOps|Auto DevOps documentation'), help_page_path('topics/autodevops/index.md'), target: '_blank', rel: 'noopener noreferrer') = s_('AutoDevOps|Learn more in the %{link_to_documentation}').html_safe % { link_to_documentation: link } - = link_to s_('AutoDevOps|Enable in settings'), project_settings_ci_cd_path(@project, anchor: 'autodevops-settings'), class: 'btn btn-md new-gl-button js-close-callout' + = link_to s_('AutoDevOps|Enable in settings'), project_settings_ci_cd_path(@project, anchor: 'autodevops-settings'), class: 'btn btn-md btn-default gl-button js-close-callout' %button.gl-banner-close.close.js-close-callout{ type: 'button', 'aria-label' => s_('AutoDevOps|Dismiss Auto DevOps box') } diff --git a/app/views/shared/_no_ssh.html.haml b/app/views/shared/_no_ssh.html.haml index 0a7fa2a3c1e..2c6ceb58654 100644 --- a/app/views/shared/_no_ssh.html.haml +++ b/app/views/shared/_no_ssh.html.haml @@ -6,5 +6,5 @@ .gl-alert-body = s_("MissingSSHKeyWarningLink|You won't be able to pull or push repositories via SSH until you add an SSH key to your profile") .gl-alert-actions - = link_to s_('MissingSSHKeyWarningLink|Add SSH key'), profile_keys_path, class: "btn gl-alert-action btn-warning btn-md new-gl-button" + = link_to s_('MissingSSHKeyWarningLink|Add SSH key'), profile_keys_path, class: "btn gl-alert-action btn-warning btn-md gl-button" = link_to s_("MissingSSHKeyWarningLink|Don't show again"), profile_path(user: {hide_no_ssh_key: true}), method: :put, role: 'button', class: 'btn gl-alert-action btn-md btn-warning gl-button btn-warning-secondary' diff --git a/app/views/shared/_service_settings.html.haml b/app/views/shared/_service_settings.html.haml index 194e0eb57f2..e294608214d 100644 --- a/app/views/shared/_service_settings.html.haml +++ b/app/views/shared/_service_settings.html.haml @@ -1,13 +1,14 @@ = form_errors(integration) -- if lookup_context.template_exists?('help', "projects/services/#{integration.to_param}", true) - = render "projects/services/#{integration.to_param}/help", subject: integration -- elsif integration.help.present? - .info-well - .well-segment - = markdown integration.help - .service-settings - if @default_integration .js-vue-default-integration-settings{ data: integration_form_data(@default_integration, group: @group) } .js-vue-integration-settings{ data: integration_form_data(integration, group: @group) } + .js-integration-help-html + -# All content below will be repositioned in Vue + - if lookup_context.template_exists?('help', "projects/services/#{integration.to_param}", true) + = render "projects/services/#{integration.to_param}/help", subject: integration + - elsif integration.help.present? + .info-well + .well-segment + = markdown integration.help |