diff options
Diffstat (limited to 'app')
32 files changed, 253 insertions, 136 deletions
diff --git a/app/assets/javascripts/dropzone_input.js b/app/assets/javascripts/dropzone_input.js index 9ee4f7cf4aa..17744e2c6ab 100644 --- a/app/assets/javascripts/dropzone_input.js +++ b/app/assets/javascripts/dropzone_input.js @@ -46,7 +46,6 @@ export default function dropzoneInput(form, config = { parallelUploads: 2 }) { let hasPlainText; formTextarea.wrap('<div class="div-dropzone"></div>'); - formTextarea.on('paste', (event) => handlePaste(event)); // Add dropzone area to the form. const $mdArea = formTextarea.closest('.md-area'); @@ -60,6 +59,8 @@ export default function dropzoneInput(form, config = { parallelUploads: 2 }) { return null; } + formTextarea.on('paste', (event) => handlePaste(event)); + const dropzone = $formDropzone.dropzone({ url: uploadsPath, dictDefaultMessage: '', diff --git a/app/assets/javascripts/organizations/new/components/app.vue b/app/assets/javascripts/organizations/new/components/app.vue index ee50afd3613..3a2b786dbae 100644 --- a/app/assets/javascripts/organizations/new/components/app.vue +++ b/app/assets/javascripts/organizations/new/components/app.vue @@ -42,7 +42,12 @@ export default { } = await this.$apollo.mutate({ mutation: organizationCreateMutation, variables: { - input: { name: formValues.name, path: formValues.path, avatar: formValues.avatar }, + input: { + name: formValues.name, + path: formValues.path, + description: formValues.description, + avatar: formValues.avatar, + }, }, context: { hasUpload: formValues.avatar instanceof File, diff --git a/app/assets/javascripts/organizations/new/index.js b/app/assets/javascripts/organizations/new/index.js index 9c7e5344800..563e366b2c6 100644 --- a/app/assets/javascripts/organizations/new/index.js +++ b/app/assets/javascripts/organizations/new/index.js @@ -13,7 +13,9 @@ export const initOrganizationsNew = () => { const { dataset: { appData }, } = el; - const { organizationsPath, rootUrl } = convertObjectPropsToCamelCase(JSON.parse(appData)); + const { organizationsPath, rootUrl, previewMarkdownPath } = convertObjectPropsToCamelCase( + JSON.parse(appData), + ); const apolloProvider = new VueApollo({ defaultClient: createDefaultClient(), @@ -26,6 +28,7 @@ export const initOrganizationsNew = () => { provide: { organizationsPath, rootUrl, + previewMarkdownPath, }, render(createElement) { return createElement(App); diff --git a/app/assets/javascripts/organizations/settings/general/components/organization_settings.vue b/app/assets/javascripts/organizations/settings/general/components/organization_settings.vue index 283a652f90e..1cea2ceeb90 100644 --- a/app/assets/javascripts/organizations/settings/general/components/organization_settings.vue +++ b/app/assets/javascripts/organizations/settings/general/components/organization_settings.vue @@ -6,6 +6,7 @@ import NewEditForm from '~/organizations/shared/components/new_edit_form.vue'; import { FORM_FIELD_NAME, FORM_FIELD_ID, + FORM_FIELD_DESCRIPTION, FORM_FIELD_AVATAR, } from '~/organizations/shared/constants'; import SettingsBlock from '~/vue_shared/components/settings/settings_block.vue'; @@ -29,7 +30,7 @@ export default { ), successMessage: s__('Organization|Organization was successfully updated.'), }, - fieldsToRender: [FORM_FIELD_NAME, FORM_FIELD_ID, FORM_FIELD_AVATAR], + fieldsToRender: [FORM_FIELD_NAME, FORM_FIELD_ID, FORM_FIELD_DESCRIPTION, FORM_FIELD_AVATAR], data() { return { loading: false, @@ -66,6 +67,7 @@ export default { input: { id: convertToGraphQLId(TYPE_ORGANIZATION, this.organization.id), name: formValues.name, + description: formValues.description, ...this.avatarInput(formValues), }, }, diff --git a/app/assets/javascripts/organizations/settings/general/index.js b/app/assets/javascripts/organizations/settings/general/index.js index 138606a0aab..3ac1243ff0f 100644 --- a/app/assets/javascripts/organizations/settings/general/index.js +++ b/app/assets/javascripts/organizations/settings/general/index.js @@ -13,9 +13,12 @@ export const initOrganizationsSettingsGeneral = () => { const { dataset: { appData }, } = el; - const { organization, organizationsPath, rootUrl } = convertObjectPropsToCamelCase( - JSON.parse(appData), - ); + const { + organization, + organizationsPath, + rootUrl, + previewMarkdownPath, + } = convertObjectPropsToCamelCase(JSON.parse(appData)); const apolloProvider = new VueApollo({ defaultClient: createDefaultClient(), @@ -29,6 +32,7 @@ export const initOrganizationsSettingsGeneral = () => { organization, organizationsPath, rootUrl, + previewMarkdownPath, }, render(createElement) { return createElement(App); diff --git a/app/assets/javascripts/organizations/shared/components/new_edit_form.vue b/app/assets/javascripts/organizations/shared/components/new_edit_form.vue index 3567fa490ea..49519369e9a 100644 --- a/app/assets/javascripts/organizations/shared/components/new_edit_form.vue +++ b/app/assets/javascripts/organizations/shared/components/new_edit_form.vue @@ -4,10 +4,13 @@ import { formValidators } from '@gitlab/ui/dist/utils'; import { s__, __ } from '~/locale'; import { slugify } from '~/lib/utils/text_utility'; import AvatarUploadDropzone from '~/vue_shared/components/upload_dropzone/avatar_upload_dropzone.vue'; +import MarkdownField from '~/vue_shared/components/markdown/field.vue'; +import { helpPagePath } from '~/helpers/help_page_helper'; import { FORM_FIELD_NAME, FORM_FIELD_ID, FORM_FIELD_PATH, + FORM_FIELD_DESCRIPTION, FORM_FIELD_AVATAR, FORM_FIELD_PATH_VALIDATORS, } from '../constants'; @@ -21,12 +24,27 @@ export default { GlButton, OrganizationUrlField, AvatarUploadDropzone, + MarkdownField, }, i18n: { cancel: __('Cancel'), }, formId: 'new-organization-form', - inject: ['organizationsPath'], + markdownDocsPath: helpPagePath('user/organization/index', { + anchor: 'organization-description-supported-markdown', + }), + restrictedToolBarItems: [ + 'code', + 'quote', + 'bullet-list', + 'numbered-list', + 'task-list', + 'collapsible-section', + 'table', + 'attach-file', + 'full-screen', + ], + inject: ['organizationsPath', 'previewMarkdownPath'], props: { loading: { type: Boolean, @@ -39,6 +57,7 @@ export default { return { [FORM_FIELD_NAME]: '', [FORM_FIELD_PATH]: '', + [FORM_FIELD_DESCRIPTION]: '', [FORM_FIELD_AVATAR]: null, }; }, @@ -47,7 +66,7 @@ export default { type: Array, required: false, default() { - return [FORM_FIELD_NAME, FORM_FIELD_PATH, FORM_FIELD_AVATAR]; + return [FORM_FIELD_NAME, FORM_FIELD_PATH, FORM_FIELD_DESCRIPTION, FORM_FIELD_AVATAR]; }, }, submitButtonText: { @@ -102,6 +121,12 @@ export default { class: 'gl-w-full', }, }, + [FORM_FIELD_DESCRIPTION]: { + label: s__('Organization|Organization description (optional)'), + groupAttrs: { + class: 'gl-w-full common-note-form', + }, + }, [FORM_FIELD_AVATAR]: { label: s__('Organization|Organization avatar'), groupAttrs: { @@ -137,6 +162,7 @@ export default { formFieldsInputEvent(event); this.hasPathBeenManuallySet = true; }, + helpPagePath, }, }; </script> @@ -159,6 +185,28 @@ export default { @blur="blur" /> </template> + <template #input(description)="{ id, value, input, blur }"> + <div class="gl-md-form-input-xl"> + <markdown-field + :can-attach-file="false" + :markdown-preview-path="previewMarkdownPath" + :markdown-docs-path="$options.markdownDocsPath" + :textarea-value="value" + :restricted-tool-bar-items="$options.restrictedToolBarItems" + > + <template #textarea> + <textarea + :id="id" + :value="value" + class="note-textarea js-gfm-input markdown-area" + maxlength="1024" + @input="input($event.target.value)" + @blur="blur" + ></textarea> + </template> + </markdown-field> + </div> + </template> <template #input(avatar)="{ input, value }"> <avatar-upload-dropzone :value="value" @@ -169,9 +217,14 @@ export default { </template> </gl-form-fields> <div class="gl-display-flex gl-gap-3"> - <gl-button type="submit" variant="confirm" class="js-no-auto-disable" :loading="loading">{{ - submitButtonText - }}</gl-button> + <gl-button + type="submit" + variant="confirm" + class="js-no-auto-disable" + :loading="loading" + data-testid="submit-button" + >{{ submitButtonText }}</gl-button + > <gl-button v-if="showCancelButton" :href="organizationsPath">{{ $options.i18n.cancel }}</gl-button> diff --git a/app/assets/javascripts/organizations/shared/components/organization_url_field.vue b/app/assets/javascripts/organizations/shared/components/organization_url_field.vue index d36f62477e6..c4b31e6b8a6 100644 --- a/app/assets/javascripts/organizations/shared/components/organization_url_field.vue +++ b/app/assets/javascripts/organizations/shared/components/organization_url_field.vue @@ -39,7 +39,7 @@ export default { </script> <template> - <gl-form-input-group> + <gl-form-input-group class="gl-md-form-input-xl"> <template #prepend> <gl-input-group-text class="organization-root-path"> <gl-truncate :text="baseUrl" position="middle" /> @@ -50,7 +50,7 @@ export default { :id="id" :value="value" :placeholder="$options.i18n.pathPlaceholder" - class="gl-h-auto! gl-md-form-input-lg" + class="gl-h-auto!" @input="$emit('input', $event)" @blur="$emit('blur', $event)" /> diff --git a/app/assets/javascripts/organizations/shared/constants.js b/app/assets/javascripts/organizations/shared/constants.js index 9f3d066f984..c4f4f348ff2 100644 --- a/app/assets/javascripts/organizations/shared/constants.js +++ b/app/assets/javascripts/organizations/shared/constants.js @@ -4,6 +4,7 @@ import { s__ } from '~/locale'; export const FORM_FIELD_NAME = 'name'; export const FORM_FIELD_ID = 'id'; export const FORM_FIELD_PATH = 'path'; +export const FORM_FIELD_DESCRIPTION = 'description'; export const FORM_FIELD_AVATAR = 'avatar'; export const FORM_FIELD_PATH_VALIDATORS = [ diff --git a/app/assets/javascripts/organizations/show/components/app.vue b/app/assets/javascripts/organizations/show/components/app.vue index 47264d80454..4cd5ada1d66 100644 --- a/app/assets/javascripts/organizations/show/components/app.vue +++ b/app/assets/javascripts/organizations/show/components/app.vue @@ -1,11 +1,12 @@ <script> import OrganizationAvatar from './organization_avatar.vue'; +import OrganizationDescription from './organization_description.vue'; import GroupsAndProjects from './groups_and_projects.vue'; import AssociationCounts from './association_counts.vue'; export default { name: 'OrganizationShowApp', - components: { OrganizationAvatar, GroupsAndProjects, AssociationCounts }, + components: { OrganizationAvatar, OrganizationDescription, GroupsAndProjects, AssociationCounts }, props: { organization: { type: Object, @@ -26,6 +27,7 @@ export default { <template> <div class="gl-py-6"> <organization-avatar :organization="organization" /> + <organization-description :organization="organization" /> <association-counts :association-counts="associationCounts" :groups-and-projects-organization-path="groupsAndProjectsOrganizationPath" diff --git a/app/assets/javascripts/organizations/show/components/organization_description.vue b/app/assets/javascripts/organizations/show/components/organization_description.vue new file mode 100644 index 00000000000..6222bdcd082 --- /dev/null +++ b/app/assets/javascripts/organizations/show/components/organization_description.vue @@ -0,0 +1,24 @@ +<script> +import SafeHtml from '~/vue_shared/directives/safe_html'; + +export default { + name: 'OrganizationDescription', + directives: { + SafeHtml, + }, + props: { + organization: { + type: Object, + required: true, + }, + }, +}; +</script> + +<template> + <div + v-if="organization.description_html" + v-safe-html="organization.description_html" + class="gl-mt-5 md" + ></div> +</template> diff --git a/app/assets/javascripts/vue_shared/components/markdown/header.vue b/app/assets/javascripts/vue_shared/components/markdown/header.vue index cffd8471d18..525f684df86 100644 --- a/app/assets/javascripts/vue_shared/components/markdown/header.vue +++ b/app/assets/javascripts/vue_shared/components/markdown/header.vue @@ -382,6 +382,7 @@ export default { @click="handleQuote" /> <toolbar-button + v-if="!restrictedToolBarItems.includes('code')" v-show="!previewMarkdown" tag="`" tag-block="```" diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index ce8ccb2bc08..cd9bbf45727 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -27,7 +27,5 @@ // JH-only stylesheets @import 'application_jh'; -/* print styles */ -@media print { - @import 'print'; -} +// print styles +@import 'print'; diff --git a/app/assets/stylesheets/emoji_sprites.scss b/app/assets/stylesheets/emoji_sprites.scss index 5a5f39a4b77..10bf54b4ffb 100644 --- a/app/assets/stylesheets/emoji_sprites.scss +++ b/app/assets/stylesheets/emoji_sprites.scss @@ -7176,7 +7176,7 @@ } .emoji-icon { - background-image: image-url('emoji.png'); + background-image: url('emoji.png'); background-repeat: no-repeat; color: transparent; text-indent: -99em; @@ -7190,7 +7190,7 @@ only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx) { - background-image: image-url('emoji@2x.png'); + background-image: url('emoji@2x.png'); background-size: 860px 840px; } /* stylelint-enable media-feature-name-no-vendor-prefix */ diff --git a/app/assets/stylesheets/fonts.scss b/app/assets/stylesheets/fonts.scss index 6886e751b72..f776328ebdf 100644 --- a/app/assets/stylesheets/fonts.scss +++ b/app/assets/stylesheets/fonts.scss @@ -11,7 +11,7 @@ Usage: font-style: normal; /* stylelint-disable-next-line property-no-unknown */ font-named-instance: 'Regular'; - src: font-url('gitlab-sans/GitLabSans.woff2') format('woff2'); + src: url('gitlab-sans/GitLabSans.woff2') format('woff2'); } @font-face { @@ -21,7 +21,7 @@ Usage: font-style: italic; /* stylelint-disable-next-line property-no-unknown */ font-named-instance: 'Regular'; - src: font-url('gitlab-sans/GitLabSans-Italic.woff2') format('woff2'); + src: url('gitlab-sans/GitLabSans-Italic.woff2') format('woff2'); } /* ------------------------------------------------------- @@ -35,7 +35,7 @@ Usage: font-weight: 100 900; font-display: swap; font-style: normal; - src: font-url('gitlab-mono/GitLabMono.woff2') format('woff2'); + src: url('gitlab-mono/GitLabMono.woff2') format('woff2'); } @font-face { @@ -43,7 +43,7 @@ Usage: font-weight: 100 900; font-display: swap; font-style: italic; - src: font-url('gitlab-mono/GitLabMono-Italic.woff2') format('woff2'); + src: url('gitlab-mono/GitLabMono-Italic.woff2') format('woff2'); } // This isn't the best solution, but we needed a quick fix diff --git a/app/assets/stylesheets/framework/diffs.scss b/app/assets/stylesheets/framework/diffs.scss index b948a57ea33..c9ef9349c36 100644 --- a/app/assets/stylesheets/framework/diffs.scss +++ b/app/assets/stylesheets/framework/diffs.scss @@ -225,7 +225,7 @@ $diff-file-header: 41px; width: 15px; position: absolute; top: 0; - background: image-url('swipemode_sprites.gif') 0 3px no-repeat; + background: url('swipemode_sprites.gif') 0 3px no-repeat; } .bottom-handle { @@ -234,7 +234,7 @@ $diff-file-header: 41px; width: 15px; position: absolute; bottom: 0; - background: image-url('swipemode_sprites.gif') 0 -11px no-repeat; + background: url('swipemode_sprites.gif') 0 -11px no-repeat; } } } @@ -272,7 +272,7 @@ $diff-file-header: 41px; left: 12px; height: 10px; width: 276px; - background: image-url('onion_skin_sprites.gif') -4px -20px repeat-x; + background: url('onion_skin_sprites.gif') -4px -20px repeat-x; } .dragger { @@ -282,7 +282,7 @@ $diff-file-header: 41px; top: 0; height: 14px; width: 14px; - background: image-url('onion_skin_sprites.gif') 0 -34px repeat-x; + background: url('onion_skin_sprites.gif') 0 -34px repeat-x; cursor: pointer; } @@ -293,7 +293,7 @@ $diff-file-header: 41px; right: 0; height: 10px; width: 10px; - background: image-url('onion_skin_sprites.gif') -2px 0 no-repeat; + background: url('onion_skin_sprites.gif') -2px 0 no-repeat; } .opaque { @@ -303,7 +303,7 @@ $diff-file-header: 41px; left: 0; height: 10px; width: 10px; - background: image-url('onion_skin_sprites.gif') -2px -10px no-repeat; + background: url('onion_skin_sprites.gif') -2px -10px no-repeat; } } } @@ -770,12 +770,12 @@ table.code { .frame.click-to-comment, .btn-transparent.image-diff-overlay-add-comment { position: relative; - cursor: image-url('illustrations/image_comment_light_cursor.svg') $image-comment-cursor-left-offset $image-comment-cursor-top-offset, + cursor: url('illustrations/image_comment_light_cursor.svg') $image-comment-cursor-left-offset $image-comment-cursor-top-offset, auto; // Retina cursor - cursor: image-set(image-url('illustrations/image_comment_light_cursor.svg') 1x, - image-url('illustrations/image_comment_light_cursor@2x.svg') 2x) $image-comment-cursor-left-offset $image-comment-cursor-top-offset, + cursor: image-set(url('illustrations/image_comment_light_cursor.svg') 1x, + url('illustrations/image_comment_light_cursor@2x.svg') 2x) $image-comment-cursor-left-offset $image-comment-cursor-top-offset, auto; .comment-indicator { diff --git a/app/assets/stylesheets/framework/dropdowns.scss b/app/assets/stylesheets/framework/dropdowns.scss index 8282f6143c2..649ceb95731 100644 --- a/app/assets/stylesheets/framework/dropdowns.scss +++ b/app/assets/stylesheets/framework/dropdowns.scss @@ -575,7 +575,7 @@ left: 1rem; width: 1rem; height: 1rem; - mask-image: asset_url('icons-stacked.svg#check'); + mask-image: url('icons-stacked.svg#check'); mask-repeat: no-repeat; mask-size: cover; mask-position: center center; diff --git a/app/assets/stylesheets/framework/files.scss b/app/assets/stylesheets/framework/files.scss index 9cb264c992b..7dcde5f0b3c 100644 --- a/app/assets/stylesheets/framework/files.scss +++ b/app/assets/stylesheets/framework/files.scss @@ -420,7 +420,7 @@ span.idiff { @include gl-h-5; @include gl-float-left; background-color: $gray-400; - mask-image: asset_url('icons-stacked.svg#doc-versions'); + mask-image: url('icons-stacked.svg#doc-versions'); mask-repeat: no-repeat; mask-size: cover; mask-position: center; diff --git a/app/assets/stylesheets/framework/source_editor.scss b/app/assets/stylesheets/framework/source_editor.scss index a09ab7ed64c..2b597634519 100644 --- a/app/assets/stylesheets/framework/source_editor.scss +++ b/app/assets/stylesheets/framework/source_editor.scss @@ -78,7 +78,7 @@ @include gl-mr-2; @include gl-w-4; @include gl-h-4; - mask-image: asset_url('icons-stacked.svg#link'); + mask-image: url('icons-stacked.svg#link'); mask-repeat: no-repeat; mask-size: cover; mask-position: center; diff --git a/app/assets/stylesheets/framework/typography.scss b/app/assets/stylesheets/framework/typography.scss index 8153c4d4717..15e794fc347 100644 --- a/app/assets/stylesheets/framework/typography.scss +++ b/app/assets/stylesheets/framework/typography.scss @@ -495,7 +495,7 @@ &::after { @include gl-dark-invert-keep-hue; - content: image-url('icon_anchor.svg'); + content: url('icon_anchor.svg'); visibility: hidden; } } diff --git a/app/assets/stylesheets/highlight/common.scss b/app/assets/stylesheets/highlight/common.scss index 23fa1326881..3fd72904655 100644 --- a/app/assets/stylesheets/highlight/common.scss +++ b/app/assets/stylesheets/highlight/common.scss @@ -118,7 +118,7 @@ @include gl-w-5; @include gl-h-5; background-color: rgba($color, 0.3); - mask-image: asset_url('icons-stacked.svg##{$icon}'); + mask-image: url('icons-stacked.svg##{$icon}'); mask-repeat: no-repeat; mask-size: cover; mask-position: center; diff --git a/app/assets/stylesheets/pages/issues.scss b/app/assets/stylesheets/pages/issues.scss index 9748983d1ae..f57a8519992 100644 --- a/app/assets/stylesheets/pages/issues.scss +++ b/app/assets/stylesheets/pages/issues.scss @@ -225,7 +225,7 @@ ul.related-merge-requests > li gl-emoji { &::after { @include gl-dark-invert-keep-hue; - content: image-url('icon_anchor.svg'); + content: url('icon_anchor.svg'); visibility: hidden; } } diff --git a/app/assets/stylesheets/pages/notes.scss b/app/assets/stylesheets/pages/notes.scss index 483d151adab..30c34c5ef32 100644 --- a/app/assets/stylesheets/pages/notes.scss +++ b/app/assets/stylesheets/pages/notes.scss @@ -966,7 +966,7 @@ $system-note-icon-m-left: $avatar-m-left + $icon-size-diff / $avatar-m-ratio; .unified-diff-components-diff-note-button { &::before { background-color: $blue-500; - mask-image: asset_url('icons-stacked.svg#comment'); + mask-image: url('icons-stacked.svg#comment'); mask-repeat: no-repeat; mask-size: cover; mask-position: center; diff --git a/app/assets/stylesheets/print.scss b/app/assets/stylesheets/print.scss index 315b9c829a7..d6fcfb3461d 100644 --- a/app/assets/stylesheets/print.scss +++ b/app/assets/stylesheets/print.scss @@ -4,97 +4,99 @@ @import '@gitlab/ui/src/scss/variables'; @import '@gitlab/ui/src/scss/utility-mixins/index'; -.md h1, -.md h2, -.md h3, -.md h4, -.md h5, -.md h6 { - margin-top: 17px; -} +@media print { + .md h1, + .md h2, + .md h3, + .md h4, + .md h5, + .md h6 { + margin-top: 17px; + } -.md h1 { - font-size: 30px; -} + .md h1 { + font-size: 30px; + } -.md h2 { - font-size: 22px; -} + .md h2 { + font-size: 22px; + } -.md h3 { - font-size: 18px; - font-weight: 600; -} + .md h3 { + font-size: 18px; + font-weight: 600; + } -.md { - print-color-adjust: exact; - -webkit-print-color-adjust: exact; + .md { + print-color-adjust: exact; + -webkit-print-color-adjust: exact; - // fix blockquote style in print - blockquote { - &::before { - position: absolute; - top: 0; - left: -4px; - content: ' '; - height: 100%; - width: 4px; - background-color: $gray-100; - } + // fix blockquote style in print + blockquote { + &::before { + position: absolute; + top: 0; + left: -4px; + content: ' '; + height: 100%; + width: 4px; + background-color: $gray-100; + } - position: relative; - font-size: inherit; - @include gl-text-gray-700; - @include gl-py-3; - @include gl-pl-6; - @include gl-my-3; - @include gl-mx-0; - @include gl-inset-border-l-4-gray-100; - margin-left: 4px; - border: 0 !important; + position: relative; + font-size: inherit; + @include gl-text-gray-700; + @include gl-py-3; + @include gl-pl-6; + @include gl-my-3; + @include gl-mx-0; + @include gl-inset-border-l-4-gray-100; + margin-left: 4px; + border: 0 !important; + } } -} -header, -nav, -.nav-sidebar, -.super-sidebar, -.profiler-results, -.tree-ref-holder, -.tree-holder .breadcrumb, -.nav, -.btn, -ul.notes-form, -.issuable-gutter-toggle, -.gutter-toggle, -.issuable-details .content-block-small, -.edit-link, -.note-action-button, -.right-sidebar, -.flash-container, -copy-code, -#js-peek { - display: none !important; -} + header, + nav, + .nav-sidebar, + .super-sidebar, + .profiler-results, + .tree-ref-holder, + .tree-holder .breadcrumb, + .nav, + .btn, + ul.notes-form, + .issuable-gutter-toggle, + .gutter-toggle, + .issuable-details .content-block-small, + .edit-link, + .note-action-button, + .right-sidebar, + .flash-container, + copy-code, + #js-peek { + display: none !important; + } -pre { - page-break-before: avoid; - page-break-inside: auto; -} + pre { + page-break-before: avoid; + page-break-inside: auto; + } -.page-gutter { - padding-top: 0; - padding-left: 0; -} + .page-gutter { + padding-top: 0; + padding-left: 0; + } -.right-sidebar { - top: 0; -} + .right-sidebar { + top: 0; + } -a[href]::after { - content: none !important; -} + a[href]::after { + content: none !important; + } -.with-performance-bar .layout-page { - padding-top: 0; + .with-performance-bar .layout-page { + padding-top: 0; + } } diff --git a/app/assets/stylesheets/snippets.scss b/app/assets/stylesheets/snippets.scss index 91b381462be..e1b14df683e 100644 --- a/app/assets/stylesheets/snippets.scss +++ b/app/assets/stylesheets/snippets.scss @@ -15,8 +15,7 @@ .gl-snippet-icon { display: inline-block; - /* stylelint-disable-next-line function-url-quotes */ - background: url(asset_path('ext_snippet_icons/ext_snippet_icons.png')) no-repeat; + background: url('ext_snippet_icons/ext_snippet_icons.png') no-repeat; overflow: hidden; text-align: left; width: 16px; diff --git a/app/controllers/concerns/preview_markdown.rb b/app/controllers/concerns/preview_markdown.rb index 7f1b961e92a..8bd120b5ed5 100644 --- a/app/controllers/concerns/preview_markdown.rb +++ b/app/controllers/concerns/preview_markdown.rb @@ -44,6 +44,7 @@ module PreviewMarkdown when 'groups' then { group: group, issuable_reference_expansion_enabled: true } when 'projects' then projects_filter_params when 'timeline_events' then timeline_events_filter_params + when 'organizations' then { pipeline: :description } else {} end.merge( requested_path: params[:path], diff --git a/app/controllers/organizations/organizations_controller.rb b/app/controllers/organizations/organizations_controller.rb index 9f09627b1e4..0596441591d 100644 --- a/app/controllers/organizations/organizations_controller.rb +++ b/app/controllers/organizations/organizations_controller.rb @@ -2,9 +2,11 @@ module Organizations class OrganizationsController < ApplicationController + include PreviewMarkdown + feature_category :cell - skip_before_action :authenticate_user!, except: [:index, :new, :users] + skip_before_action :authenticate_user!, only: [:show, :groups_and_projects] def index; end diff --git a/app/finders/ci/runner_jobs_finder.rb b/app/finders/ci/runner_jobs_finder.rb index b659eda6646..91d8eccff21 100644 --- a/app/finders/ci/runner_jobs_finder.rb +++ b/app/finders/ci/runner_jobs_finder.rb @@ -13,7 +13,13 @@ module Ci end def execute - items = @runner.builds + items = if params[:system_id].blank? + runner.builds + else + runner_manager = Ci::RunnerManager.for_runner(runner).with_system_xid(params[:system_id]).first + Ci::Build.belonging_to_runner_manager(runner_manager&.id) + end + items = by_permission(items) items = by_status(items) sort_items(items) diff --git a/app/helpers/organizations/organization_helper.rb b/app/helpers/organizations/organization_helper.rb index b6d39276a03..445dd3a1f6f 100644 --- a/app/helpers/organizations/organization_helper.rb +++ b/app/helpers/organizations/organization_helper.rb @@ -4,7 +4,8 @@ module Organizations module OrganizationHelper def organization_show_app_data(organization) { - organization: organization.slice(:id, :name).merge({ avatar_url: organization.avatar_url(size: 128) }), + organization: organization.slice(:id, :name, :description_html) + .merge({ avatar_url: organization.avatar_url(size: 128) }), groups_and_projects_organization_path: groups_and_projects_organization_path(organization), # TODO: Update counts to use real data # https://gitlab.com/gitlab-org/gitlab/-/issues/424531 @@ -17,18 +18,14 @@ module Organizations end def organization_new_app_data - { - organizations_path: organizations_path, - root_url: root_url - }.to_json + shared_new_settings_general_app_data.to_json end def organization_settings_general_app_data(organization) { - organization: organization.slice(:id, :name, :path).merge({ avatar: organization.avatar_url(size: 192) }), - organizations_path: organizations_path, - root_url: root_url - }.to_json + organization: organization.slice(:id, :name, :path, :description) + .merge({ avatar: organization.avatar_url(size: 192) }) + }.merge(shared_new_settings_general_app_data).to_json end def organization_groups_and_projects_app_data @@ -66,6 +63,14 @@ module Organizations } end + def shared_new_settings_general_app_data + { + preview_markdown_path: preview_markdown_organizations_path, + organizations_path: organizations_path, + root_url: root_url + } + end + # See UsersHelper#admin_users_paths for inspiration to this method def organizations_users_paths { diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 23185548554..66e9e20f3dc 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -190,6 +190,10 @@ module Ci # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/123131 scope :with_runner_type, -> (runner_type) { joins(:runner).where(runner: { runner_type: runner_type }) } + scope :belonging_to_runner_manager, -> (runner_machine_id) { + joins(:runner_manager_build).where(p_ci_runner_machine_builds: { runner_machine_id: runner_machine_id }) + } + scope :with_secure_reports_from_config_options, -> (job_types) do joins(:metadata).where("#{Ci::BuildMetadata.quoted_table_name}.config_options -> 'artifacts' -> 'reports' ?| array[:job_types]", job_types: job_types) end diff --git a/app/models/ci/runner_manager.rb b/app/models/ci/runner_manager.rb index 71005f4341a..44fe1bdd67d 100644 --- a/app/models/ci/runner_manager.rb +++ b/app/models/ci/runner_manager.rb @@ -55,6 +55,10 @@ module Ci where(runner_id: runner_id) end + scope :with_system_xid, ->(system_xid) do + where(system_xid: system_xid) + end + scope :with_running_builds, -> do where('EXISTS(?)', Ci::Build.select(1) diff --git a/app/models/organizations/organization.rb b/app/models/organizations/organization.rb index be96939daa8..7f86bf81375 100644 --- a/app/models/organizations/organization.rb +++ b/app/models/organizations/organization.rb @@ -30,7 +30,7 @@ module Organizations 'organizations/path': true, length: { minimum: 2, maximum: 255 } - delegate :description, :avatar, :avatar_url, :remove_avatar!, to: :organization_detail + delegate :description, :description_html, :avatar, :avatar_url, :remove_avatar!, to: :organization_detail accepts_nested_attributes_for :organization_detail diff --git a/app/models/organizations/organization_detail.rb b/app/models/organizations/organization_detail.rb index b69ec5eae76..018e7579c5b 100644 --- a/app/models/organizations/organization_detail.rb +++ b/app/models/organizations/organization_detail.rb @@ -6,7 +6,7 @@ module Organizations include Avatarable include WithUploads - cache_markdown_field :description + cache_markdown_field :description, pipeline: :description belongs_to :organization, inverse_of: :organization_detail |