Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2020-06-11 15:08:36 +00:00
parent 0526dc1e68
commit 018431c70e
97 changed files with 816 additions and 312 deletions

View File

@ -162,7 +162,6 @@ linters:
- "app/views/projects/_home_panel.html.haml"
- "app/views/projects/_import_project_pane.html.haml"
- "app/views/projects/_issuable_by_email.html.haml"
- "app/views/projects/_md_preview.html.haml"
- "app/views/projects/_readme.html.haml"
- "app/views/projects/artifacts/_artifact.html.haml"
- "app/views/projects/artifacts/_tree_file.html.haml"
@ -267,7 +266,6 @@ linters:
- "app/views/projects/triggers/_index.html.haml"
- "app/views/projects/triggers/_trigger.html.haml"
- "app/views/projects/triggers/edit.html.haml"
- "app/views/projects/wikis/_pages_wiki_page.html.haml"
- "app/views/search/results/_issue.html.haml"
- "app/views/search/results/_note.html.haml"
- "app/views/search/results/_snippet_blob.html.haml"
@ -277,6 +275,7 @@ linters:
- "app/views/shared/_delete_label_modal.html.haml"
- "app/views/shared/_group_form.html.haml"
- "app/views/shared/_group_tips.html.haml"
- "app/views/shared/_md_preview.html.haml"
- "app/views/shared/_milestone_expired.html.haml"
- "app/views/shared/_no_password.html.haml"
- "app/views/shared/_ping_consent.html.haml"
@ -313,6 +312,7 @@ linters:
- "app/views/shared/snippets/_snippet.html.haml"
- "app/views/shared/web_hooks/_form.html.haml"
- "app/views/shared/web_hooks/_hook.html.haml"
- "app/views/shared/wikis/_pages_wiki_page.html.haml"
- "app/views/u2f/_authenticate.html.haml"
- "app/views/u2f/_register.html.haml"
- "app/views/users/_deletion_guidance.html.haml"

View File

@ -86,7 +86,7 @@ class ListIssue {
}
setLoadingState(key, value) {
this.isLoading[key] = value;
boardsStore.setIssueLoadingState(this, key, value);
}
update() {

View File

@ -805,6 +805,10 @@ const boardsStore = {
}
},
setIssueLoadingState(issue, key, value) {
issue.isLoading[key] = value;
},
updateIssueData(issue, newData) {
Object.assign(issue, newData);
},

View File

@ -3,9 +3,9 @@ import CiVariableSettings from './components/ci_variable_settings.vue';
import createStore from './store';
import { parseBoolean } from '~/lib/utils/common_utils';
export default () => {
const el = document.getElementById('js-ci-project-variables');
const { endpoint, projectId, group, maskableRegex, protectedByDefault } = el.dataset;
export default (containerId = 'js-ci-project-variables') => {
const containerEl = document.getElementById(containerId);
const { endpoint, projectId, group, maskableRegex, protectedByDefault } = containerEl.dataset;
const isGroup = parseBoolean(group);
const isProtectedByDefault = parseBoolean(protectedByDefault);
@ -18,7 +18,7 @@ export default () => {
});
return new Vue({
el,
el: containerEl,
store,
render(createElement) {
return createElement(CiVariableSettings);

View File

@ -2,8 +2,12 @@ import initSettingsPanels from '~/settings_panels';
import projectSelect from '~/project_select';
import selfMonitor from '~/self_monitor';
import maintenanceModeSettings from '~/maintenance_mode_settings';
import initVariableList from '~/ci_variable_list';
document.addEventListener('DOMContentLoaded', () => {
if (gon.features?.ciInstanceVariablesUi) {
initVariableList('js-instance-variables');
}
selfMonitor();
maintenanceModeSettings();
// Initialize expandable settings panels

View File

@ -1,41 +1,3 @@
import $ from 'jquery';
import Vue from 'vue';
import Translate from '~/vue_shared/translate';
import csrf from '~/lib/utils/csrf';
import ShortcutsWiki from '~/behaviors/shortcuts/shortcuts_wiki';
import Wikis from './wikis';
import ZenMode from '../../../zen_mode';
import GLForm from '../../../gl_form';
import deleteWikiModal from './components/delete_wiki_modal.vue';
import initWikis from '~/pages/shared/wikis';
document.addEventListener('DOMContentLoaded', () => {
new Wikis(); // eslint-disable-line no-new
new ShortcutsWiki(); // eslint-disable-line no-new
new ZenMode(); // eslint-disable-line no-new
new GLForm($('.wiki-form')); // eslint-disable-line no-new
const deleteWikiModalWrapperEl = document.getElementById('delete-wiki-modal-wrapper');
if (deleteWikiModalWrapperEl) {
Vue.use(Translate);
const { deleteWikiUrl, pageTitle } = deleteWikiModalWrapperEl.dataset;
// eslint-disable-next-line no-new
new Vue({
el: deleteWikiModalWrapperEl,
data: {
deleteWikiUrl: '',
},
render(createElement) {
return createElement(deleteWikiModal, {
props: {
pageTitle,
deleteWikiUrl,
csrfToken: csrf.token,
},
});
},
});
}
});
document.addEventListener('DOMContentLoaded', initWikis);

View File

@ -0,0 +1,41 @@
import $ from 'jquery';
import Vue from 'vue';
import Translate from '~/vue_shared/translate';
import csrf from '~/lib/utils/csrf';
import ShortcutsWiki from '~/behaviors/shortcuts/shortcuts_wiki';
import Wikis from './wikis';
import ZenMode from '../../../zen_mode';
import GLForm from '../../../gl_form';
import deleteWikiModal from './components/delete_wiki_modal.vue';
export default () => {
new Wikis(); // eslint-disable-line no-new
new ShortcutsWiki(); // eslint-disable-line no-new
new ZenMode(); // eslint-disable-line no-new
new GLForm($('.wiki-form')); // eslint-disable-line no-new
const deleteWikiModalWrapperEl = document.getElementById('delete-wiki-modal-wrapper');
if (deleteWikiModalWrapperEl) {
Vue.use(Translate);
const { deleteWikiUrl, pageTitle } = deleteWikiModalWrapperEl.dataset;
// eslint-disable-next-line no-new
new Vue({
el: deleteWikiModalWrapperEl,
data: {
deleteWikiUrl: '',
},
render(createElement) {
return createElement(deleteWikiModal, {
props: {
pageTitle,
deleteWikiUrl,
csrfToken: csrf.token,
},
});
},
});
}
};

View File

@ -0,0 +1,3 @@
@import "./themes/dark";
@import "./application";

View File

@ -1,7 +1,7 @@
.popover {
max-width: $popover-max-width;
border: 1px solid $gray-200;
box-shadow: 0 2px 3px 1px $gray-200;
box-shadow: $popover-box-shadow;
font-size: $gl-font-size-small;
/**

View File

@ -111,7 +111,7 @@ pre {
hr {
margin: 24px 0;
border-top: 1px solid darken($gray-normal, 8%);
border-top: 1px solid $gray-darker;
}
.str-truncated {

View File

@ -657,6 +657,7 @@
.dropdown-input-field,
.default-dropdown-input {
background-color: $input-bg;
display: block;
width: 100%;
min-height: 30px;

View File

@ -96,7 +96,7 @@
}
.name {
background-color: $white-normal;
background-color: $gray-50;
color: $gl-text-color-secondary;
border-radius: 2px 0 0 2px;
margin-right: 1px;
@ -259,6 +259,7 @@
flex: 1;
position: relative;
min-width: 0;
background-color: $input-bg;
}
.filtered-search-input-dropdown-menu {

View File

@ -308,6 +308,7 @@ body {
);
}
&.gl-dark,
&.ui-light {
@include gitlab-theme(
$gray-700,
@ -388,4 +389,15 @@ body {
color: $gray-900;
}
}
&.gl-dark {
@include gitlab-theme(
$gray-900,
$gray-500,
$gray-700,
$gray-800,
$gray-50,
$gray-100
);
}
}

View File

@ -72,6 +72,7 @@
.select2-drop,
.select2-drop.select2-drop-above {
background: $white;
box-shadow: 0 2px 4px $dropdown-shadow-color;
border-radius: $border-radius-base;
border: 1px solid $border-color;
@ -166,7 +167,8 @@
input {
padding: $grid-size;
background: $white image-url('select2.png');
background: transparent image-url('select2.png');
color: $gl-text-color;
background-clip: content-box;
background-origin: content-box;
background-repeat: no-repeat;

View File

@ -73,108 +73,106 @@ $size-scale: (
'xl': #{70 * $grid-size}
);
/*
* Color schema
*/
$darken-normal-factor: 7%;
$darken-dark-factor: 10%;
$darken-border-factor: 5%;
$darken-border-dashed-factor: 25%;
// Color schema
$darken-normal-factor: 7% !default;
$darken-dark-factor: 10% !default;
$darken-border-factor: 5% !default;
$darken-border-dashed-factor: 25% !default;
$white: #fff;
$white-normal: #f0f0f0;
$white-dark: #eaeaea;
$white-transparent: rgba(255, 255, 255, 0.8);
$white: #fff !default;
$white-normal: #f0f0f0 !default;
$white-dark: #eaeaea !default;
$white-transparent: rgba(255, 255, 255, 0.8) !default;
$gray-lightest: #fdfdfd;
$gray-light: #fafafa;
$gray-lighter: #f9f9f9;
$gray-normal: #f5f5f5;
$gray-dark: darken($gray-light, $darken-dark-factor);
$gray-darker: #eee;
$gray-darkest: #c4c4c4;
$gray-lightest: #fdfdfd !default;
$gray-light: #fafafa !default;
$gray-lighter: #f9f9f9 !default;
$gray-normal: #f5f5f5 !default;
$gray-dark: darken($gray-light, $darken-dark-factor) !default;
$gray-darker: #eee !default;
$gray-darkest: #c4c4c4 !default;
$purple: #6d49cb;
$purple-light: #ede8fb;
$purple: #6d49cb !default;
$purple-light: #ede8fb !default;
$black: #000;
$black-transparent: rgba(0, 0, 0, 0.3);
$almost-black: #242424;
$black: #000 !default;
$black-transparent: rgba(0, 0, 0, 0.3) !default;
$almost-black: #242424 !default;
$t-gray-a-02: rgba($black, 0.02);
$t-gray-a-04: rgba($black, 0.04);
$t-gray-a-06: rgba($black, 0.06);
$t-gray-a-08: rgba($black, 0.08);
$t-gray-a-02: rgba($black, 0.02) !default;
$t-gray-a-04: rgba($black, 0.04) !default;
$t-gray-a-06: rgba($black, 0.06) !default;
$t-gray-a-08: rgba($black, 0.08) !default;
$gl-gray-100: #ddd;
$gl-gray-200: #ccc;
$gl-gray-350: #aaa;
$gl-gray-400: #999;
$gl-gray-500: #777;
$gl-gray-600: #666;
$gl-gray-700: #555;
$gl-gray-800: #333;
$gl-gray-100: #ddd !default;
$gl-gray-200: #ccc !default;
$gl-gray-350: #aaa !default;
$gl-gray-400: #999 !default;
$gl-gray-500: #777 !default;
$gl-gray-600: #666 !default;
$gl-gray-700: #555 !default;
$gl-gray-800: #333 !default;
$green-50: #f1fdf6;
$green-100: #dcf5e7;
$green-200: #b3e6c8;
$green-300: #75d09b;
$green-400: #37b96d;
$green-500: #1aaa55;
$green-600: #168f48;
$green-700: #12753a;
$green-800: #0e5a2d;
$green-900: #0a4020;
$green-950: #072b15;
$green-50: #f1fdf6 !default;
$green-100: #dcf5e7 !default;
$green-200: #263a2e !default;
$green-300: #75d09b !default;
$green-400: #37b96d !default;
$green-500: #1aaa55 !default;
$green-600: #168f48 !default;
$green-700: #12753a !default;
$green-800: #0e5a2d !default;
$green-900: #0a4020 !default;
$green-950: #072b15 !default;
$blue-50: #f6fafe;
$blue-100: #e4f0fb;
$blue-200: #b8d6f4;
$blue-300: #73afea;
$blue-400: #418cd8;
$blue-500: #1f78d1;
$blue-600: #1b69b6;
$blue-700: #17599c;
$blue-800: #134a81;
$blue-900: #0f3b66;
$blue-950: #0a2744;
$blue-50: #f6fafe !default;
$blue-100: #e4f0fb !default;
$blue-200: #b8d6f4 !default;
$blue-300: #73afea !default;
$blue-400: #418cd8 !default;
$blue-500: #1f78d1 !default;
$blue-600: #1b69b6 !default;
$blue-700: #17599c !default;
$blue-800: #134a81 !default;
$blue-900: #0f3b66 !default;
$blue-950: #0a2744 !default;
$orange-50: #fffaf4;
$orange-100: #fff1de;
$orange-200: #fed69f;
$orange-300: #fdbc60;
$orange-400: #fca429;
$orange-500: #fc9403;
$orange-600: #de7e00;
$orange-700: #c26700;
$orange-800: #a35200;
$orange-900: #853c00;
$orange-950: #592800;
$orange-50: #fffaf4 !default;
$orange-100: #fff1de !default;
$orange-200: #fed69f !default;
$orange-300: #fdbc60 !default;
$orange-400: #fca429 !default;
$orange-500: #fc9403 !default;
$orange-600: #de7e00 !default;
$orange-700: #c26700 !default;
$orange-800: #a35200 !default;
$orange-900: #853c00 !default;
$orange-950: #592800 !default;
$red-50: #fef6f5;
$red-100: #fbe5e1;
$red-200: #f2b4a9;
$red-300: #ea8271;
$red-400: #e05842;
$red-500: #db3b21;
$red-600: #c0341d;
$red-700: #a62d19;
$red-800: #8b2615;
$red-900: #711e11;
$red-950: #4b140b;
$red-50: #fef6f5 !default;
$red-100: #fbe5e1 !default;
$red-200: #f2b4a9 !default;
$red-300: #ea8271 !default;
$red-400: #e05842 !default;
$red-500: #db3b21 !default;
$red-600: #c0341d !default;
$red-700: #a62d19 !default;
$red-800: #8b2615 !default;
$red-900: #711e11 !default;
$red-950: #4b140b !default;
$gray-10: #fafafa;
$gray-50: #f0f0f0;
$gray-100: #dbdbdb;
$gray-200: #dfdfdf;
$gray-300: #ccc;
$gray-400: #bababa;
$gray-500: #a7a7a7;
$gray-600: #919191;
$gray-700: #707070;
$gray-800: #4f4f4f;
$gray-900: #2e2e2e;
$gray-950: #1f1f1f;
$gray-10: #fafafa !default;
$gray-50: #f0f0f0 !default;
$gray-100: #dbdbdb !default;
$gray-200: #dfdfdf !default;
$gray-300: #ccc !default;
$gray-400: #bababa !default;
$gray-500: #a7a7a7 !default;
$gray-600: #919191 !default;
$gray-700: #707070 !default;
$gray-800: #4f4f4f !default;
$gray-900: #2e2e2e !default;
$gray-950: #1f1f1f !default;
$greens: (
'50': $green-50,
@ -325,8 +323,8 @@ $theme-light-red-500: #c24b38;
$theme-light-red-600: #b03927;
$theme-light-red-700: #a62e21;
$border-white-light: darken($white, $darken-border-factor);
$border-white-normal: darken($white-normal, $darken-border-factor);
$border-white-light: darken($white, $darken-border-factor) !default;
$border-white-normal: darken($white-normal, $darken-border-factor) !default;
$border-gray-light: darken($gray-light, $darken-border-factor);
$border-gray-normal: darken($gray-normal, $darken-border-factor);
@ -335,7 +333,7 @@ $border-gray-normal-dashed: darken($gray-normal, $darken-border-dashed-factor);
/*
* UI elements
*/
$border-color: #e5e5e5;
$border-color: $gray-200;
$shadow-color: $t-gray-a-08;
$well-expand-item: #e8f2f7;
$well-inner-border: #eef0f2;
@ -356,7 +354,7 @@ $gl-text-color-secondary: $gray-700;
$gl-text-color-tertiary: $gray-600;
$gl-text-color-quaternary: #d6d6d6;
$gl-text-color-inverted: $white;
$gl-text-color-secondary-inverted: rgba(255, 255, 255, 0.85);
$gl-text-color-secondary-inverted: rgba($white, 0.85);
$gl-text-color-disabled: $gray-600;
$gl-grayish-blue: #7f8fa4;
$gl-gray-dark: #313236;
@ -435,7 +433,6 @@ $layout-link-gray: #7e7c7c;
$btn-side-margin: 10px;
$btn-sm-side-margin: 7px;
$btn-margin-5: 5px;
$sidebar-block-hover-color: #ebebeb;
$count-arrow-border: #dce0e5;
$general-hover-transition-duration: 100ms;
$general-hover-transition-curve: linear;
@ -491,8 +488,8 @@ $line-number-select: #fbf2da;
$line-target-blue: $blue-50;
$line-select-yellow: #fcf8e7;
$line-select-yellow-dark: #f0e2bd;
$dark-diff-match-bg: rgba(255, 255, 255, 0.3);
$dark-diff-match-color: rgba(255, 255, 255, 0.1);
$dark-diff-match-bg: rgba($white, 0.3);
$dark-diff-match-color: rgba($white, 0.1);
$diff-image-info-color: #808080;
$diff-view-modes-color: #808080;
$diff-view-modes-border: #c1c1c1;
@ -520,7 +517,7 @@ $dropdown-shadow-color: rgba(#000, 0.1);
$dropdown-title-btn-color: #bfbfbf;
$dropdown-input-fa-color: #c7c7c7;
$dropdown-input-focus-shadow: rgba($blue-300, 0.4);
$dropdown-loading-bg: rgba(#fff, 0.6);
$dropdown-loading-bg: rgba($white, 0.6);
$dropdown-chevron-size: 10px;
$dropdown-toggle-active-border-color: darken($border-color, 14%);
$dropdown-fade-mask-height: 32px;
@ -534,9 +531,9 @@ $filtered-search-term-shadow-color: rgba(0, 0, 0, 0.09);
/*
* Contextual Sidebar
*/
$link-active-background: rgba(0, 0, 0, 0.04);
$link-hover-background: rgba(0, 0, 0, 0.06);
$inactive-badge-background: rgba(0, 0, 0, 0.08);
$link-active-background: rgba($black, 0.04);
$link-hover-background: rgba($gray-900, 0.06);
$inactive-badge-background: rgba($black, 0.08);
$sidebar-toggle-height: 60px;
$sidebar-toggle-width: 40px;
$sidebar-milestone-toggle-bottom-margin: 10px;
@ -544,8 +541,8 @@ $sidebar-milestone-toggle-bottom-margin: 10px;
/*
* Buttons
*/
$btn-active-gray: #ececec;
$btn-active-gray-light: #e4e7ed;
$btn-active-gray: $gray-50;
$btn-active-gray-light: $gray-50;
$btn-white-active: #848484;
$gl-btn-padding: 10px;
$gl-btn-line-height: 16px;
@ -602,12 +599,12 @@ $note-icon-gutter-width: 55px;
/*
* Identicon
*/
$identicon-red: #ffebee;
$identicon-purple: #f3e5f5;
$identicon-indigo: #e8eaf6;
$identicon-blue: #e3f2fd;
$identicon-teal: #e0f2f1;
$identicon-orange: #fbe9e7;
$identicon-red: #ffebee !default;
$identicon-purple: #f3e5f5 !default;
$identicon-indigo: #e8eaf6 !default;
$identicon-blue: #e3f2fd !default;
$identicon-teal: #e0f2f1 !default;
$identicon-orange: #fbe9e7 !default;
/*
* Calendar
@ -871,6 +868,7 @@ $priority-label-empty-state-width: 114px;
Popovers
*/
$popover-max-width: 384px;
$popover-box-shadow: 0 2px 3px 1px $gray-200;
/*
Issues Analytics

View File

@ -36,5 +36,5 @@ pre.commit-message {
}
.gl-label-text-dark {
color: $gl-gray-800;
color: $gl-text-color;
}

View File

@ -396,7 +396,7 @@
overflow: hidden;
&:hover {
background-color: $sidebar-block-hover-color;
background-color: $gray-200;
}
&.issuable-sidebar-header {

View File

@ -15,6 +15,10 @@
}
.application-theme {
$ui-dark-bg: #2e2e2e;
$ui-light-bg: #dfdfdf;
$ui-dark-mode-bg: #1f1f1f;
label {
margin: 0 $gl-padding-32 $gl-padding 0;
text-align: center;
@ -60,11 +64,17 @@
}
&.ui-dark {
background-color: $gray-900;
background-color: $ui-dark-bg;
border: solid 1px $border-color;
}
&.ui-light {
background-color: $gray-200;
background-color: $ui-light-bg;
}
&.gl-dark {
background-color: $ui-dark-mode-bg;
border: solid 1px $border-color;
}
}

View File

@ -0,0 +1,131 @@
$gray-10: #1f1f1f;
$gray-50: #2e2e2e;
$gray-100: #4f4f4f;
$gray-200: #707070;
$gray-300: #919191;
$gray-400: #a7a7a7;
$gray-500: #bababa;
$gray-600: #ccc;
$gray-700: #dfdfdf;
$gray-800: #f2f2f2;
$gray-900: #fafafa;
$gray-950: #fff;
$gl-gray-100: #333;
$gl-gray-200: #555;
$gl-gray-350: #666;
$gl-gray-400: #777;
$gl-gray-500: #999;
$gl-gray-600: #aaa;
$gl-gray-700: #ccc;
$gl-gray-800: #ddd;
$green-50: #072b15;
$green-100: #0a4020;
$green-200: #0e5a2d;
$green-300: #12753a;
$green-400: #168f48;
$green-500: #1aaa55;
$green-600: #37b96d;
$green-700: #75d09b;
$green-800: #b3e6c8;
$green-900: #dcf5e7;
$green-950: #f1fdf6;
$blue-50: #0a2744;
$blue-100: #0f3b66;
$blue-200: #134a81;
$blue-300: #17599c;
$blue-400: #1b69b6;
$blue-500: #1f78d1;
$blue-600: #418cd8;
$blue-700: #73afea;
$blue-800: #b8d6f4;
$blue-900: #e4f0fb;
$blue-950: #f6fafe;
$orange-50: #592800;
$orange-100: #853c00;
$orange-200: #a35200;
$orange-300: #c26700;
$orange-400: #de7e00;
$orange-500: #fc9403;
$orange-600: #fca429;
$orange-700: #fdbc60;
$orange-800: #fed69f;
$orange-900: #fff1de;
$orange-950: #fffaf4;
$red-50: #4b140b;
$red-100: #711e11;
$red-200: #8b2615;
$red-300: #a62d19;
$red-400: #c0341d;
$red-500: #db3b21;
$red-600: #e05842;
$red-700: #ea8271;
$red-800: #f2b4a9;
$red-900: #fbe5e1;
$red-950: #fef6f5;
$indigo-50: #1a1a40;
$indigo-100: #292961;
$indigo-200: #393982;
$indigo-300: #4b4ba3;
$indigo-400: #5b5bbd;
$indigo-500: #6666c4;
$indigo-600: #7c7ccc;
$indigo-700: #a6a6de;
$indigo-800: #d1d1f0;
$indigo-900: #ebebfa;
$indigo-950: #f7f7ff;
$gray-lightest: #222;
$gray-light: $gray-50;
$gray-lighter: #303030;
$gray-normal: #333;
$gray-dark: $gray-100;
$gray-darker: #4f4f4f;
$gray-darkest: #c4c4c4;
$black: #fff;
$white: #333;
$white-light: #2b2b2b;
$white-normal: #333;
$white-dark: #444;
$border-white-light: $gray-900;
$border-white-normal: $gray-900;
$body-bg: $gray-50;
$input-bg: $gray-100;
$input-focus-bg: $gray-50;
$input-color: $gray-900;
$input-group-addon-bg: $gray-900;
$tooltip-bg: $gray-800;
$tooltip-color: $gray-10;
$popover-color: $gray-950;
$popover-box-shadow: 0 2px 3px 1px $gray-700;
$popover-arrow-outer-color: $gray-800;
$secondary: $gray-600;
.gl-label {
filter: brightness(0.9) contrast(1.1);
}
// white-ish text for light labels
// and for scoped label value (the right section)
.gl-label-text-light.gl-label-text-light,
.gl-label-text-dark + .gl-label-text-dark {
color: $gray-900;
}
// duplicated class as the original .atwho-view style is added later
.atwho-view.atwho-view {
background-color: $white;
color: $gray-900;
border-color: $gray-800;
}

View File

@ -12,6 +12,10 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
before_action :whitelist_query_limiting, only: [:usage_data]
before_action only: [:ci_cd] do
push_frontend_feature_flag(:ci_instance_variables_ui, default_enabled: true)
end
VALID_SETTING_PANELS = %w(general integrations repository
ci_cd reporting metrics_and_profiling
network preferences).freeze

View File

@ -34,6 +34,8 @@ module WikiActions
).page(params[:page])
@wiki_entries = WikiPage.group_by_directory(@wiki_pages)
render 'shared/wikis/pages'
end
# rubocop:enable Gitlab/ModuleWithInstanceVariables
@ -54,7 +56,7 @@ module WikiActions
@ref = params[:version_id]
@path = page.path
render 'show'
render 'shared/wikis/show'
elsif file_blob
send_blob(wiki.repository, file_blob, allow_caching: container.public?)
elsif show_create_form?
@ -63,14 +65,15 @@ module WikiActions
@page = build_page(title: title)
render 'edit'
render 'shared/wikis/edit'
else
render 'empty'
render 'shared/wikis/empty'
end
end
# rubocop:enable Gitlab/ModuleWithInstanceVariables
def edit
render 'shared/wikis/edit'
end
# rubocop:disable Gitlab/ModuleWithInstanceVariables
@ -85,11 +88,11 @@ module WikiActions
notice: _('Wiki was successfully updated.')
)
else
render 'edit'
render 'shared/wikis/edit'
end
rescue WikiPage::PageChangedError, WikiPage::PageRenameError, Gitlab::Git::Wiki::OperationError => e
@error = e
render 'edit'
render 'shared/wikis/edit'
end
# rubocop:enable Gitlab/ModuleWithInstanceVariables
@ -103,13 +106,12 @@ module WikiActions
notice: _('Wiki was successfully updated.')
)
else
render action: "edit"
render 'shared/wikis/edit'
end
rescue Gitlab::Git::Wiki::OperationError => e
@page = build_page(wiki_params)
@error = e
render 'edit'
render 'shared/wikis/edit'
end
# rubocop:enable Gitlab/ModuleWithInstanceVariables
@ -119,9 +121,11 @@ module WikiActions
@page_versions = Kaminari.paginate_array(page.versions(page: params[:page].to_i),
total_count: page.count_versions)
.page(params[:page])
render 'shared/wikis/history'
else
redirect_to(
wiki_page_path(wiki, :home),
wiki_path(wiki),
notice: _("Page not found")
)
end
@ -132,12 +136,12 @@ module WikiActions
def destroy
WikiPages::DestroyService.new(container: container, current_user: current_user).execute(page)
redirect_to wiki_page_path(wiki, :home),
redirect_to wiki_path(wiki),
status: :found,
notice: _("Page was successfully deleted")
rescue Gitlab::Git::Wiki::OperationError => e
@error = e
render 'edit'
render 'shared/wikis/edit'
end
# rubocop:enable Gitlab/ModuleWithInstanceVariables

View File

@ -305,8 +305,12 @@ module GitlabRoutingHelper
# Wikis
def wiki_path(wiki, **options)
Gitlab::UrlBuilder.wiki_url(wiki, only_path: true, **options)
end
def wiki_page_path(wiki, page, **options)
Gitlab::UrlBuilder.wiki_page_url(wiki, page, **options, only_path: true)
Gitlab::UrlBuilder.wiki_page_url(wiki, page, only_path: true, **options)
end
private

View File

@ -544,11 +544,6 @@ module ProjectsHelper
end
end
def project_wiki_path_with_version(proj, page, version, is_newest)
url_params = is_newest ? {} : { version_id: version }
project_wiki_path(proj, page, url_params)
end
def project_status_css_class(status)
case status
when "started"

View File

@ -22,7 +22,7 @@ module WikiHelper
page_slug_split
.map do |dir_or_page|
current_slug = "#{current_slug}#{dir_or_page}/"
add_to_breadcrumb_dropdown link_to(WikiPage.unhyphenize(dir_or_page).capitalize, project_wiki_path(@project, current_slug)), location: :after
add_to_breadcrumb_dropdown link_to(WikiPage.unhyphenize(dir_or_page).capitalize, wiki_page_path(@wiki, current_slug)), location: :after
end
end
@ -32,7 +32,7 @@ module WikiHelper
content_tag(:div, class: 'alert alert-danger') do
case error
when WikiPage::PageChangedError
page_link = link_to s_("WikiPageConflictMessage|the page"), project_wiki_path(@project, @page), target: "_blank"
page_link = link_to s_("WikiPageConflictMessage|the page"), wiki_page_path(@wiki, @page), target: "_blank"
concat(
(s_("WikiPageConflictMessage|Someone edited the page the same time you did. Please check out %{page_link} and make sure your changes will not unintentionally remove theirs.") % { page_link: page_link }).html_safe
)
@ -45,26 +45,63 @@ module WikiHelper
end
def wiki_attachment_upload_url
expose_url(api_v4_projects_wikis_attachments_path(id: @project.id))
expose_url(api_v4_projects_wikis_attachments_path(id: @wiki.container.id))
end
def wiki_sort_controls(project, sort, direction)
sort ||= ProjectWiki::TITLE_ORDER
def wiki_sort_controls(wiki, sort, direction)
sort ||= Wiki::TITLE_ORDER
link_class = 'btn btn-default has-tooltip reverse-sort-btn qa-reverse-sort rspec-reverse-sort'
reversed_direction = direction == 'desc' ? 'asc' : 'desc'
icon_class = direction == 'desc' ? 'highest' : 'lowest'
link_to(project_wikis_pages_path(project, sort: sort, direction: reversed_direction),
link_to(wiki_path(wiki, action: :pages, sort: sort, direction: reversed_direction),
type: 'button', class: link_class, title: _('Sort direction')) do
sprite_icon("sort-#{icon_class}", size: 16)
end
end
def wiki_sort_title(key)
if key == ProjectWiki::CREATED_AT_ORDER
if key == Wiki::CREATED_AT_ORDER
s_("Wiki|Created date")
else
s_("Wiki|Title")
end
end
def wiki_empty_state_messages(wiki)
case wiki.container
when Project
{
writable: {
title: s_('WikiEmpty|The wiki lets you write documentation for your project'),
body: s_("WikiEmpty|A wiki is where you can store all the details about your project. This can include why you've created it, its principles, how to use it, and so on.")
},
issuable: {
title: s_('WikiEmpty|This project has no wiki pages'),
body: s_('WikiEmptyIssueMessage|You must be a project member in order to add wiki pages. If you have suggestions for how to improve the wiki for this project, consider opening an issue in the %{issues_link}.')
},
readonly: {
title: s_('WikiEmpty|This project has no wiki pages'),
body: s_('WikiEmpty|You must be a project member in order to add wiki pages.')
}
}
when Group
{
writable: {
title: s_('WikiEmpty|The wiki lets you write documentation for your group'),
body: s_("WikiEmpty|A wiki is where you can store all the details about your group. This can include why you've created it, its principles, how to use it, and so on.")
},
issuable: {
title: s_('WikiEmpty|This group has no wiki pages'),
body: s_('WikiEmptyIssueMessage|You must be a group member in order to add wiki pages. If you have suggestions for how to improve the wiki for this group, consider opening an issue in the %{issues_link}.')
},
readonly: {
title: s_('WikiEmpty|This group has no wiki pages'),
body: s_('WikiEmpty|You must be a group member in order to add wiki pages.')
}
}
else
raise NotImplementedError, "Unknown wiki container type #{wiki.container.class.name}"
end
end
end

View File

@ -15,6 +15,6 @@ class WikiDirectory
# Relative path to the partial to be used when rendering collections
# of this object.
def to_partial_path
'projects/wikis/wiki_directory'
'../shared/wikis/wiki_directory'
end
end

View File

@ -261,8 +261,7 @@ class WikiPage
# Relative path to the partial to be used when rendering collections
# of this object.
def to_partial_path
# TODO: Move into shared/ with https://gitlab.com/gitlab-org/gitlab/-/issues/196054
'projects/wikis/wiki_page'
'../shared/wikis/wiki_page'
end
def id

View File

@ -3,6 +3,8 @@
module AlertManagement
module Alerts
class UpdateService
include Gitlab::Utils::StrongMemoize
# @param alert [AlertManagement::Alert]
# @param current_user [User]
# @param params [Hash] Attributes of the alert
@ -19,6 +21,7 @@ module AlertManagement
filter_assignees
if alert.update(params)
assign_todo
success
else
error(alert.errors.full_messages.to_sentence)
@ -29,6 +32,12 @@ module AlertManagement
attr_reader :alert, :current_user, :params
def assign_todo
return unless assignee
todo_service.assign_alert(alert, assignee)
end
def allowed?
current_user.can?(:update_alert_management_alert, alert)
end
@ -36,8 +45,20 @@ module AlertManagement
def filter_assignees
return if params[:assignees].nil?
# Take first assignee while multiple are not currently supported
params[:assignees] = Array(params[:assignees].first)
params[:assignees] = Array(assignee)
end
def assignee
strong_memoize(:assignee) do
# Take first assignee while multiple are not currently supported
params[:assignees]&.first
end
end
def todo_service
strong_memoize(:todo_service) do
TodoService.new
end
end
def success

View File

@ -136,7 +136,7 @@ module Projects
def ensure_wiki_exists
ProjectWiki.new(project, project.owner).wiki
rescue ProjectWiki::CouldNotCreateWikiError
rescue Wiki::CouldNotCreateWikiError
log_error("Could not create wiki for #{project.full_name}")
Gitlab::Metrics.counter(:wiki_can_not_be_created_total, 'Counts the times we failed to create a wiki').increment
end

View File

@ -0,0 +1,20 @@
- expanded = local_assigns.fetch(:expanded)
%h4
= _('Variables')
= link_to icon('question-circle'), help_page_path('ci/variables/README', anchor: 'variables'), target: '_blank', rel: 'noopener noreferrer'
%button.btn.btn-default.js-settings-toggle{ type: 'button' }
= expanded ? _('Collapse') : _('Expand')
%p
= _('Environment variables are applied to all project environments in this instance via the Runner. You can use environment variables for passwords, secret keys, etc. Make variables available to the running application by prepending the variable key with <code>K8S_SECRET_</code>. You can set variables to be:').html_safe
%ul
%li
= _('<code>Protected</code> to expose them to protected branches or tags only.').html_safe
%li
= _('<code>Masked</code> to prevent the values from being displayed in job logs (must match certain regexp requirements).').html_safe
%p
= link_to _('More information'), help_page_path('ci/variables/README', anchor: 'instance-level-cicd-environment-variables')

View File

@ -2,6 +2,17 @@
- page_title _("CI/CD")
- @content_class = "limit-container-width" unless fluid_layout
- if ::Gitlab::Ci::Features.instance_variables_ui_enabled?
%section.settings.no-animate#js-ci-cd-variables{ class: ('expanded' if expanded_by_default?) }
.settings-header
= render 'admin/application_settings/ci/header', expanded: expanded_by_default?
.settings-content
- if ci_variable_protected_by_default?
%p.settings-message.text-center
- link_start = '<a href="%{url}">'.html_safe % { url: help_page_path('ci/variables/README', anchor: 'protected-variables') }
= s_('Environment variables on this GitLab instance are configured to be %{link_start}protected%{link_end} by default').html_safe % { link_start: link_start, link_end: '</a>'.html_safe }
#js-instance-variables{ data: { endpoint: admin_ci_variables_path, group: 'true', maskable_regex: ci_variable_maskable_regex, protected_by_default: ci_variable_protected_by_default?.to_s} }
%section.settings.as-ci-cd.no-animate#js-ci-cd-settings{ class: ('expanded' if expanded_by_default?) }
.settings-header
%h4

View File

@ -11,8 +11,8 @@
.col-form-label.col-sm-2
= f.label :description, "Description"
.col-sm-10
= render layout: 'projects/md_preview', locals: { url: group_preview_markdown_path } do
= render 'projects/zen', f: f, attr: :description, classes: 'note-textarea', placeholder: 'Write milestone description...', supports_autocomplete: false
= render layout: 'shared/md_preview', locals: { url: group_preview_markdown_path } do
= render 'shared/zen', f: f, attr: :description, classes: 'note-textarea', placeholder: 'Write milestone description...', supports_autocomplete: false
.clearfix
.error-alert
= render "shared/milestones/form_dates", f: f

View File

@ -47,7 +47,10 @@
= favicon_link_tag favicon, id: 'favicon', data: { original_href: favicon }, type: 'image/png'
= stylesheet_link_tag "application", media: "all"
- if user_application_theme == 'gl-dark'
= stylesheet_link_tag "application_dark", media: "all"
- else
= stylesheet_link_tag "application", media: "all"
= stylesheet_link_tag "print", media: "print"
= stylesheet_link_tag "disable_animations", media: "all" if Rails.env.test? || Gitlab.config.gitlab['disable_animations']
= stylesheet_link_tag 'performance_bar' if performance_bar_enabled?

View File

@ -290,7 +290,7 @@
= render 'layouts/nav/sidebar/analytics_links', links: project_analytics_navbar_links(@project, current_user)
- if project_nav_tab? :wiki
- wiki_url = project_wiki_path(@project, :home)
- wiki_url = wiki_path(@project.wiki)
= nav_link(controller: :wikis) do
= link_to wiki_url, class: 'shortcuts-wiki', data: { qa_selector: 'wiki_link' } do
.nav-icon-container

View File

@ -14,4 +14,4 @@
- if can_create_wiki
%p
= _("Add a homepage to your wiki that contains information about your project and GitLab will display it here instead of this message.")
= link_to _("Create your first page"), project_wiki_path(@project, :home) + '?view=create', class: "btn btn-primary"
= link_to _("Create your first page"), wiki_path(@project.wiki) + '?view=create', class: "btn btn-primary"

View File

@ -28,7 +28,7 @@
.file-buttons
- if is_markdown
= render 'projects/blob/markdown_buttons', show_fullscreen_button: false
= render 'shared/blob/markdown_buttons', show_fullscreen_button: false
= button_tag class: 'soft-wrap-toggle btn', type: 'button', tabindex: '-1' do
%span.no-wrap
= custom_icon('icon_no_wrap')

View File

@ -1,4 +1,4 @@
= icon('info-circle fw')
= succeed '.' do
To learn more about this project, read
= link_to "the wiki", project_wiki_path(viewer.project, :home)
= link_to "the wiki", wiki_path(viewer.project.wiki)

View File

@ -12,8 +12,8 @@
.col-form-label.col-sm-2
= f.label :description, _('Description')
.col-sm-10
= render layout: 'projects/md_preview', locals: { url: preview_markdown_path(@project) } do
= render 'projects/zen', f: f, attr: :description, classes: 'qa-milestone-description note-textarea', placeholder: _('Write milestone description...')
= render layout: 'shared/md_preview', locals: { url: preview_markdown_path(@project) } do
= render 'shared/zen', f: f, attr: :description, classes: 'qa-milestone-description note-textarea', placeholder: _('Write milestone description...')
= render 'shared/notes/hints'
.clearfix
.error-alert

View File

@ -46,8 +46,8 @@
- replacements = { releases_page_link_start: releases_page_link_start, docs_link_start: docs_link_start, link_end: link_end }
= s_('TagsPage|Optionally, create a public Release of your project, based on this tag. Release notes are displayed on the %{releases_page_link_start}Releases%{link_end} page. %{docs_link_start}More information%{link_end}').html_safe % replacements
= render layout: 'projects/md_preview', locals: { url: preview_markdown_path(@project), referenced_users: true } do
= render 'projects/zen', attr: :release_description, classes: 'note-textarea', placeholder: s_('TagsPage|Write your release notes or drag files here…'), current_text: @release_description
= render layout: 'shared/md_preview', locals: { url: preview_markdown_path(@project), referenced_users: true } do
= render 'shared/zen', attr: :release_description, classes: 'note-textarea', placeholder: s_('TagsPage|Write your release notes or drag files here…'), current_text: @release_description
= render 'shared/notes/hints'
.form-actions
= button_tag s_('TagsPage|Create tag'), class: 'btn btn-success'

View File

@ -10,8 +10,8 @@
= form_for(@release, method: :put, url: project_tag_release_path(@project, @tag.name),
html: { class: 'common-note-form release-form js-quick-submit' }) do |f|
= render layout: 'projects/md_preview', locals: { url: preview_markdown_path(@project), referenced_users: true } do
= render 'projects/zen', f: f, attr: :description, classes: 'note-textarea', placeholder: "Write your release notes or drag files here…"
= render layout: 'shared/md_preview', locals: { url: preview_markdown_path(@project), referenced_users: true } do
= render 'shared/zen', f: f, attr: :description, classes: 'note-textarea', placeholder: "Write your release notes or drag files here…"
= render 'shared/notes/hints'
.error-alert
.prepend-top-default

View File

@ -1,9 +0,0 @@
- if (@page && @page.persisted?)
- if can?(current_user, :create_wiki, @project)
= link_to project_wikis_new_path(@project), class: "add-new-wiki btn btn-success", role: "button", data: { qa_selector: 'new_page_button' } do
= s_("Wiki|New page")
= link_to project_wiki_history_path(@project, @page), class: "btn", role: "button", data: { qa_selector: 'page_history_button' } do
= s_("Wiki|Page history")
- if can?(current_user, :create_wiki, @project) && @page.latest? && @valid_encoding
= link_to project_wiki_edit_path(@project, @page), class: "btn js-wiki-edit", role: "button", data: { qa_selector: 'edit_page_button' } do
= _("Edit")

View File

@ -1 +0,0 @@
= render "#{context}_wiki_page", wiki_page: wiki_page

View File

@ -34,4 +34,4 @@
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:4567, CTRL+C to stop
= render 'sidebar'
= render 'shared/wikis/sidebar'

View File

@ -18,7 +18,7 @@
= _("Preview")
%li.md-header-toolbar.active
= render 'projects/blob/markdown_buttons', show_fullscreen_button: true
= render 'shared/blob/markdown_buttons', show_fullscreen_button: true
.md-write-holder
= yield

View File

@ -1,30 +1,31 @@
- layout_path = 'shared/empty_states/wikis_layout'
- messages = wiki_empty_state_messages(@wiki)
- if can?(current_user, :create_wiki, @project)
- create_path = project_wiki_path(@project, params[:id], { view: 'create' })
- if can?(current_user, :create_wiki, @wiki.container)
- create_path = wiki_page_path(@wiki, params[:id], view: 'create')
- create_link = link_to s_('WikiEmpty|Create your first page'), create_path, class: 'btn btn-success qa-create-first-page-link', title: s_('WikiEmpty|Create your first page')
= render layout: layout_path, locals: { image_path: 'illustrations/wiki_login_empty.svg' } do
%h4.text-left
= s_('WikiEmpty|The wiki lets you write documentation for your project')
= messages.dig(:writable, :title)
%p.text-left
= s_("WikiEmpty|A wiki is where you can store all the details about your project. This can include why you've created it, its principles, how to use it, and so on.")
= messages.dig(:writable, :body)
= create_link
- elsif can?(current_user, :read_issue, @project)
- elsif @project && can?(current_user, :read_issue, @project)
- issues_link = link_to s_('WikiEmptyIssueMessage|issue tracker'), project_issues_path(@project)
- new_issue_link = link_to s_('WikiEmpty|Suggest wiki improvement'), new_project_issue_path(@project), class: 'btn btn-success', title: s_('WikiEmptyIssueMessage|Suggest wiki improvement')
= render layout: layout_path, locals: { image_path: 'illustrations/wiki_logout_empty.svg' } do
%h4
= s_('WikiEmpty|This project has no wiki pages')
= messages.dig(:issuable, :title)
%p.text-left
= s_('WikiEmptyIssueMessage|You must be a project member in order to add wiki pages. If you have suggestions for how to improve the wiki for this project, consider opening an issue in the %{issues_link}.').html_safe % { issues_link: issues_link }
= messages.dig(:issuable, :body).html_safe % { issues_link: issues_link }
= new_issue_link
- else
= render layout: layout_path, locals: { image_path: 'illustrations/wiki_logout_empty.svg' } do
%h4
= s_('WikiEmpty|This project has no wiki pages')
= messages.dig(:readonly, :title)
%p
= s_('WikiEmpty|You must be a project member in order to add wiki pages.')
= messages.dig(:readonly, :body)

View File

@ -18,8 +18,8 @@
- if model.is_a?(Issuable)
= render 'shared/issuable/form/template_selector', issuable: model
= render layout: 'projects/md_preview', locals: { url: preview_url, referenced_users: true } do
= render 'projects/zen', f: form, attr: :description,
= render layout: 'shared/md_preview', locals: { url: preview_url, referenced_users: true } do
= render 'shared/zen', f: form, attr: :description,
classes: 'note-textarea qa-issuable-form-description rspec-issuable-form-description',
placeholder: placeholder,
supports_quick_actions: supports_quick_actions

View File

@ -2,8 +2,8 @@
= form_tag '#', method: :put, class: 'edit-note common-note-form js-quick-submit' do
= hidden_field_tag :target_id, '', class: 'js-form-target-id'
= hidden_field_tag :target_type, '', class: 'js-form-target-type'
= render layout: 'projects/md_preview', locals: { url: preview_markdown_path(project), referenced_users: true } do
= render 'projects/zen', attr: 'note[note]', classes: 'note-textarea js-note-text js-task-list-field', placeholder: _("Write a comment or drag your files here…")
= render layout: 'shared/md_preview', locals: { url: preview_markdown_path(project), referenced_users: true } do
= render 'shared/zen', attr: 'note[note]', classes: 'note-textarea js-note-text js-task-list-field', placeholder: _("Write a comment or drag your files here…")
= render 'shared/notes/hints'
.note-form-actions.clearfix

View File

@ -25,8 +25,8 @@
= f.hidden_field :position
.discussion-form-container.discussion-with-resolve-btn.flex-column.p-0
= render layout: 'projects/md_preview', locals: { url: preview_url, referenced_users: true } do
= render 'projects/zen', f: f,
= render layout: 'shared/md_preview', locals: { url: preview_url, referenced_users: true } do
= render 'shared/zen', f: f,
attr: :note,
classes: 'note-textarea js-note-text',
placeholder: _("Write a comment or drag your files here…"),

View File

@ -19,8 +19,8 @@
.js-collapsed{ class: ('d-none' if is_expanded) }
= text_field_tag nil, nil, class: 'form-control', placeholder: description_placeholder, data: { qa_selector: 'description_placeholder' }
.js-expanded{ class: ('d-none' if !is_expanded) }
= render layout: 'projects/md_preview', locals: { url: preview_markdown_path(@project), referenced_users: true } do
= render 'projects/zen', f: f, attr: :description, classes: 'note-textarea', placeholder: description_placeholder, qa_selector: 'snippet_description_field'
= render layout: 'shared/md_preview', locals: { url: preview_markdown_path(@project), referenced_users: true } do
= render 'shared/zen', f: f, attr: :description, classes: 'note-textarea', placeholder: description_placeholder, qa_selector: 'snippet_description_field'
= render 'shared/notes/hints'
.form-group.file-editor

View File

@ -1,7 +1,14 @@
- form_classes = 'wiki-form common-note-form prepend-top-default js-quick-submit'
- form_classes += ' js-new-wiki-page' unless @page.persisted?
- form_classes = %w[wiki-form common-note-form prepend-top-default js-quick-submit]
= form_for [@project.namespace.becomes(Namespace), @project, @page], method: @page.persisted? ? :put : :post,
- if @page.persisted?
- form_action = wiki_page_path(@wiki, @page)
- form_method = :put
- else
- form_action = wiki_path(@wiki, action: :create)
- form_method = :post
- form_classes << 'js-new-wiki-page'
= form_for @page, url: form_action, method: form_method,
html: { class: form_classes },
data: { uploads_path: uploads_path } do |f|
= form_errors(@page, truncate: :title)
@ -28,14 +35,14 @@
.col-sm-12= f.label :format, class: 'control-label-full-width'
.col-sm-12
.select-wrapper
= f.select :format, options_for_select(ProjectWiki::MARKUPS, {selected: @page.format}), {}, class: 'form-control select-control'
= f.select :format, options_for_select(Wiki::MARKUPS, {selected: @page.format}), {}, class: 'form-control select-control'
= icon('chevron-down')
.form-group.row
.col-sm-12= f.label :content, class: 'control-label-full-width'
.col-sm-12
= render layout: 'projects/md_preview', locals: { url: project_wiki_preview_markdown_path(@project, @page.slug) } do
= render 'projects/zen', f: f, attr: :content, classes: 'note-textarea qa-wiki-content-textarea', placeholder: s_("WikiPage|Write your content or drag files here…")
= render layout: 'shared/md_preview', locals: { url: wiki_page_path(@wiki, @page, action: :preview_markdown) } do
= render 'shared/zen', f: f, attr: :content, classes: 'note-textarea qa-wiki-content-textarea', placeholder: s_("WikiPage|Write your content or drag files here…")
= render 'shared/notes/hints'
.clearfix
@ -65,8 +72,8 @@
- if @page && @page.persisted?
= f.submit _("Save changes"), class: 'btn-success btn qa-save-changes-button'
.float-right
= link_to _("Cancel"), project_wiki_path(@project, @page), class: 'btn btn-cancel btn-grouped'
= link_to _("Cancel"), wiki_page_path(@wiki, @page), class: 'btn btn-cancel btn-grouped'
- else
= f.submit s_("Wiki|Create page"), class: 'btn-success btn qa-create-page-button rspec-create-page-button'
.float-right
= link_to _("Cancel"), project_wiki_path(@project, :home), class: 'btn btn-cancel'
= link_to _("Cancel"), wiki_path(@wiki), class: 'btn btn-cancel'

View File

@ -0,0 +1,9 @@
- if @page&.persisted?
- if can?(current_user, :create_wiki, @wiki.container)
= link_to wiki_path(@wiki, action: :new), class: "btn btn-success", role: "button", data: { qa_selector: 'new_page_button' } do
= s_("Wiki|New page")
= link_to wiki_page_path(@wiki, @page, action: :history), class: "btn", role: "button", data: { qa_selector: 'page_history_button' } do
= s_("Wiki|Page history")
- if can?(current_user, :create_wiki, @wiki.container) && @page.latest? && @valid_encoding
= link_to wiki_page_path(@wiki, @page, action: :edit), class: "btn js-wiki-edit", role: "button", data: { qa_selector: 'edit_page_button' } do
= _("Edit")

View File

@ -1,5 +1,5 @@
%li
= link_to wiki_page.title, project_wiki_path(@project, wiki_page)
= link_to wiki_page.title, wiki_page_path(@wiki, wiki_page)
%small (#{wiki_page.format})
.float-right
- if wiki_page.last_version

View File

@ -4,7 +4,7 @@
%a.gutter-toggle.float-right.d-block.d-sm-block.d-md-none.js-sidebar-wiki-toggle{ href: "#" }
= icon('angle-double-right')
- git_access_url = project_wikis_git_access_path(@project)
- git_access_url = wiki_path(@wiki, action: :git_access)
= link_to git_access_url, class: active_nav_link?(path: 'wikis#git_access') ? 'active' : '', data: { qa_selector: 'clone_repository_link' } do
= icon('cloud-download', class: 'append-right-5')
%span= _("Clone repository")
@ -18,5 +18,5 @@
= render @sidebar_wiki_entries, context: 'sidebar'
.block.w-100
- if @sidebar_limited
= link_to project_wikis_pages_path(@project), class: 'btn btn-block' do
= link_to wiki_path(@wiki, action: :pages), class: 'btn btn-block' do
= s_("Wiki|View All Pages")

View File

@ -1,3 +1,3 @@
%li{ class: active_when(params[:id] == wiki_page.slug) }
= link_to project_wiki_path(@project, wiki_page) do
= link_to wiki_page_path(@wiki, wiki_page) do
= wiki_page.human_title

View File

@ -0,0 +1 @@
= render "shared/wikis/#{context}_wiki_page", wiki_page: wiki_page

View File

@ -1,5 +1,5 @@
- @content_class = "limit-container-width" unless fluid_layout
- add_to_breadcrumbs _("Wiki"), project_wiki_path(@project, @page)
- add_to_breadcrumbs _("Wiki"), wiki_page_path(@wiki, @page)
- breadcrumb_title @page.persisted? ? _("Edit") : _("New")
- page_title @page.persisted? ? _("Edit") : _("New"), @page.human_title, _("Wiki")
@ -12,7 +12,7 @@
.nav-text
%h2.wiki-page-title
- if @page.persisted?
= link_to @page.human_title, project_wiki_path(@project, @page)
= link_to @page.human_title, wiki_page_path(@wiki, @page)
%span.light
&middot;
= s_("Wiki|Edit Page")
@ -21,11 +21,11 @@
.nav-controls.pb-md-3.pb-lg-0
- if @page.persisted?
= link_to project_wiki_history_path(@project, @page), class: "btn" do
= link_to wiki_page_path(@wiki, @page, action: :history), class: "btn" do
= s_("Wiki|Page history")
- if can?(current_user, :admin_wiki, @project)
#delete-wiki-modal-wrapper{ data: { delete_wiki_url: project_wiki_path(@project, @page), page_title: @page.human_title } }
- if can?(current_user, :admin_wiki, @wiki.container)
#delete-wiki-modal-wrapper{ data: { delete_wiki_url: wiki_page_path(@wiki, @page), page_title: @page.human_title } }
= render 'form', uploads_path: wiki_attachment_upload_url
= render 'shared/wikis/form', uploads_path: wiki_attachment_upload_url
= render 'sidebar'
= render 'shared/wikis/sidebar'

View File

@ -6,7 +6,7 @@
.nav-text
%h2.wiki-page-title
= link_to @page.human_title, project_wiki_path(@project, @page)
= link_to @page.human_title, wiki_page_path(@wiki, @page)
%span.light
&middot;
= _("History")
@ -25,8 +25,7 @@
- commit = version
%tr
%td
= link_to project_wiki_path_with_version(@project, @page,
commit.id, index == 0) do
= link_to wiki_page_path(@wiki, @page, version_id: index == 0 ? nil : commit.id) do
= truncate_sha(commit.id)
%td
= commit.author_name
@ -39,4 +38,4 @@
= version.format
= paginate @page_versions, theme: 'gitlab'
= render 'sidebar'
= render 'shared/wikis/sidebar'

View File

@ -1,4 +1,4 @@
- add_to_breadcrumbs "Wiki", project_wiki_path(@project, :home)
- add_to_breadcrumbs "Wiki", wiki_path(@wiki)
- breadcrumb_title s_("Wiki|Pages")
- page_title s_("Wiki|Pages"), _("Wiki")
- sort_title = wiki_sort_title(params[:sort])
@ -10,7 +10,7 @@
= s_("Wiki|Wiki Pages")
.nav-controls.pb-md-3.pb-lg-0
= link_to project_wikis_git_access_path(@project), class: 'btn' do
= link_to wiki_path(@wiki, action: :git_access), class: 'btn' do
= icon('cloud-download')
= _("Clone repository")
@ -22,9 +22,9 @@
= icon('chevron-down')
%ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable.dropdown-menu-sort
%li
= sortable_item(s_("Wiki|Title"), project_wikis_pages_path(@project, sort: ProjectWiki::TITLE_ORDER), sort_title)
= sortable_item(s_("Wiki|Created date"), project_wikis_pages_path(@project, sort: ProjectWiki::CREATED_AT_ORDER), sort_title)
= wiki_sort_controls(@project, params[:sort], params[:direction])
= sortable_item(s_("Wiki|Title"), wiki_path(@wiki, action: :pages, sort: Wiki::TITLE_ORDER), sort_title)
= sortable_item(s_("Wiki|Created date"), wiki_path(@wiki, action: :pages, sort: Wiki::CREATED_AT_ORDER), sort_title)
= wiki_sort_controls(@wiki, params[:sort], params[:direction])
%ul.wiki-pages-list.content-list
= render @wiki_entries, context: 'pages'

View File

@ -2,7 +2,7 @@
- breadcrumb_title @page.human_title
- wiki_breadcrumb_dropdown_links(@page.slug)
- page_title @page.human_title, _("Wiki")
- add_to_breadcrumbs _("Wiki"), project_wiki_path(@project, :home)
- add_to_breadcrumbs _("Wiki"), wiki_path(@wiki)
.wiki-page-header.top-area.has-sidebar-toggle.flex-column.flex-lg-row
%button.btn.btn-default.sidebar-toggle.js-sidebar-wiki-toggle{ role: "button", type: "button" }
@ -16,17 +16,17 @@
#{time_ago_with_tooltip(@page.last_version.authored_date)}
.nav-controls.pb-md-3.pb-lg-0
= render 'main_links'
= render 'shared/wikis/main_links'
- if @page.historical?
.warning_message
= s_("WikiHistoricalPage|This is an old version of this page.")
- most_recent_link = link_to s_("WikiHistoricalPage|most recent version"), project_wiki_path(@project, @page)
- history_link = link_to s_("WikiHistoricalPage|history"), project_wiki_history_path(@project, @page)
- most_recent_link = link_to s_("WikiHistoricalPage|most recent version"), wiki_page_path(@wiki, @page)
- history_link = link_to s_("WikiHistoricalPage|history"), wiki_page_path(@wiki, @page, action: :history)
= (s_("WikiHistoricalPage|You can view the %{most_recent_link} or browse the %{history_link}.") % { most_recent_link: most_recent_link, history_link: history_link }).html_safe
.prepend-top-default.append-bottom-default
.md{ data: { qa_selector: 'wiki_page_content' } }
= render_wiki_content(@page)
= render 'sidebar'
= render 'shared/wikis/sidebar'

View File

@ -0,0 +1,5 @@
---
title: Add todo when alert is assigned to a user
merge_request: 34104
author:
type: added

View File

@ -0,0 +1,5 @@
---
title: Remove setLoadingState logic from issue model
merge_request: 32226
author: nuwe1
type: other

View File

@ -0,0 +1,5 @@
---
title: New instance-level variables UI
merge_request: 33510
author:
type: added

View File

@ -0,0 +1,5 @@
---
title: Add dark theme (alpha)
merge_request: 28252
author:
type: added

View File

@ -164,6 +164,8 @@ module Gitlab
config.assets.paths << Gemojione.images_path
config.assets.paths << "#{config.root}/vendor/assets/fonts"
config.assets.precompile << "application_dark.css"
config.assets.precompile << "print.css"
config.assets.precompile << "mailer.css"
config.assets.precompile << "mailer_client_specific.css"

View File

@ -427,6 +427,51 @@ Once you set them, they will be available for all subsequent pipelines. Any grou
![CI/CD settings - inherited variables](img/inherited_group_variables_v12_5.png)
## Instance-level CI/CD environment variables
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/14108) in GitLab 13.0.
Instance variables are useful for no longer needing to manually enter the same credentials repeatedly for all your projects. Instance-level variables are available to all projects and groups on the instance.
NOTE: **Note:**
The maximum number of instance-level variables is [planned to be 25](https://gitlab.com/gitlab-org/gitlab/-/issues/216097).
You can define instance-level variables via the UI or [API](../../api/instance_level_ci_variables.md).
To add an instance-level variable:
1. Navigate to your admin area's **Settings > CI/CD** and expand the **Variables** section.
1. Click the **Add variable** button, and fill in the details:
- **Key**: Must be one line, using only letters, numbers, or `_` (underscore), with no spaces.
- **Value**: 700 characters allowed.
- **Type**: `File` or `Variable`.
- **Protect variable** (Optional): If selected, the variable will only be available in pipelines that run on protected branches or tags.
- **Mask variable** (Optional): If selected, the variable's **Value** will not be shown in job logs. The variable will not be saved if the value does not meet the [masking requirements](#masked-variable-requirements).
After a variable is created, you can update any of the details by clicking the **{pencil}** **Edit** button.
### Enable or disable UI interface for instance-level CI/CD variables
The UI interface for Instance-level CI/CD variables is under development but ready for production use.
It is deployed behind a feature flag that is **enabled by default**.
[GitLab administrators with access to the GitLab Rails console](../../administration/feature_flags.md) can opt to disable it for your instance.
NOTE: **Note:**
This feature will not work if the [instance-level CI/CD variables API feature flag is disabled](../../api/instance_level_ci_variables.md#enable-or-disable-instance-level-cicd-variables-core-only).
To disable it:
```ruby
Feature.disable(:instance_variables_ui)
```
To enable it:
```ruby
Feature.enable(:instance_variables_ui)
```
## Inherit environment variables
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/22638) in GitLab 13.0.

View File

@ -36,6 +36,29 @@ The default theme is Indigo. You can choose between 10 themes:
![Profile preferences navigation themes](img/profil-preferences-navigation-theme.png)
## Dark mode
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/28252) in GitLab 13.1 as an Alpha release.
GitLab has started work on dark mode! The dark mode Alpha release is available in the
spirit of iteration and the lower expectations of
[Alpha versions](https://about.gitlab.com/handbook/product/#alpha).
Progress on dark mode is tracked in the [Dark theme epic](https://gitlab.com/groups/gitlab-org/-/epics/2902). See the epic for:
- A list of known issues.
- Our planned direction and next steps.
If you find an issue that isnt listed, please leave a comment on the epic or create a
new issue.
Dark mode is available as a navigation theme, for MVC and compatibility reasons. In
the future, we plan to make it configurable in its own section along with support for
[different navigation themes](https://gitlab.com/gitlab-org/gitlab/-/issues/219512).
NOTE: **Note:**
Dark theme currently only works with the 'Dark' syntax highlighting.
## Syntax highlighting theme
NOTE: **Note:**

View File

@ -24,7 +24,7 @@ module API
params :common_wiki_page_params do
optional :format,
type: String,
values: ProjectWiki::MARKUPS.values.map(&:to_s),
values: Wiki::MARKUPS.values.map(&:to_s),
default: 'markdown',
desc: 'Format of a wiki page. Available formats are markdown, rdoc, asciidoc and org'
end

View File

@ -25,6 +25,10 @@ module Gitlab
def self.pipeline_fixed_notifications?
::Feature.enabled?(:ci_pipeline_fixed_notifications)
end
def self.instance_variables_ui_enabled?
::Feature.enabled?(:ci_instance_variables_ui, default_enabled: true)
end
end
end
end

View File

@ -247,8 +247,8 @@ module Gitlab
request = Gitaly::CommitsByMessageRequest.new(
repository: @gitaly_repo,
query: query,
revision: revision.to_s.force_encoding(Encoding::ASCII_8BIT),
path: path.to_s.force_encoding(Encoding::ASCII_8BIT),
revision: encode_binary(revision),
path: encode_binary(path),
limit: limit.to_i,
offset: offset.to_i
)

View File

@ -23,7 +23,8 @@ module Gitlab
Theme.new(9, 'Red', 'ui-red'),
Theme.new(10, 'Light Red', 'ui-light-red'),
Theme.new(2, 'Dark', 'ui-dark'),
Theme.new(3, 'Light', 'ui-light')
Theme.new(3, 'Light', 'ui-light'),
Theme.new(11, 'Dark Mode (alpha)', 'gl-dark')
].freeze
# Convenience method to get a space-separated String of all the theme

View File

@ -39,7 +39,7 @@ module Gitlab
when User
instance.user_url(object, **options)
when Wiki
wiki_page_url(object, Wiki::HOMEPAGE, **options)
wiki_url(object, **options)
when WikiPage
wiki_page_url(object.wiki, object, **options)
when ::DesignManagement::Design
@ -78,12 +78,21 @@ module Gitlab
end
end
def wiki_url(wiki, **options)
return wiki_page_url(wiki, Wiki::HOMEPAGE, **options) unless options[:action]
options[:controller] = 'projects/wikis'
options[:namespace_id] = wiki.container.namespace
options[:project_id] = wiki.container
instance.url_for(**options)
end
def wiki_page_url(wiki, page, **options)
if wiki.container.is_a?(Project)
instance.project_wiki_url(wiki.container, page, **options)
else
raise NotImplementedError.new("No URL builder defined for #{wiki.container.inspect} wikis")
end
options[:action] ||= :show
options[:id] = page
wiki_url(wiki, **options)
end
def design_url(design, **options)

View File

@ -903,6 +903,12 @@ msgstr ""
msgid "<code>\"johnsmith@example.com\": \"johnsmith@example.com\"</code> will add \"By <a href=\"#\">johnsmith@example.com</a>\" to all issues and comments originally created by johnsmith@example.com. By default, the email address or username is masked to ensure the user's privacy. Use this option if you want to show the full email address."
msgstr ""
msgid "<code>Masked</code> to prevent the values from being displayed in job logs (must match certain regexp requirements)."
msgstr ""
msgid "<code>Protected</code> to expose them to protected branches or tags only."
msgstr ""
msgid "<namespace / project>"
msgstr ""
@ -8489,12 +8495,18 @@ msgstr ""
msgid "Environment scope"
msgstr ""
msgid "Environment variables are applied to all project environments in this instance via the Runner. You can use environment variables for passwords, secret keys, etc. Make variables available to the running application by prepending the variable key with <code>K8S_SECRET_</code>. You can set variables to be:"
msgstr ""
msgid "Environment variables are applied to environments via the runner. They can be protected by only exposing them to protected branches or tags. Additionally, they can be masked so they are hidden in job logs, though they must match certain regexp requirements to do so. You can use environment variables for passwords, secret keys, or whatever you want."
msgstr ""
msgid "Environment variables are configured by your administrator to be %{link_start}protected%{link_end} by default"
msgstr ""
msgid "Environment variables on this GitLab instance are configured to be %{link_start}protected%{link_end} by default"
msgstr ""
msgid "Environment:"
msgstr ""
@ -25286,12 +25298,18 @@ msgstr ""
msgid "WikiEmptyIssueMessage|Suggest wiki improvement"
msgstr ""
msgid "WikiEmptyIssueMessage|You must be a group member in order to add wiki pages. If you have suggestions for how to improve the wiki for this group, consider opening an issue in the %{issues_link}."
msgstr ""
msgid "WikiEmptyIssueMessage|You must be a project member in order to add wiki pages. If you have suggestions for how to improve the wiki for this project, consider opening an issue in the %{issues_link}."
msgstr ""
msgid "WikiEmptyIssueMessage|issue tracker"
msgstr ""
msgid "WikiEmpty|A wiki is where you can store all the details about your group. This can include why you've created it, its principles, how to use it, and so on."
msgstr ""
msgid "WikiEmpty|A wiki is where you can store all the details about your project. This can include why you've created it, its principles, how to use it, and so on."
msgstr ""
@ -25301,12 +25319,21 @@ msgstr ""
msgid "WikiEmpty|Suggest wiki improvement"
msgstr ""
msgid "WikiEmpty|The wiki lets you write documentation for your group"
msgstr ""
msgid "WikiEmpty|The wiki lets you write documentation for your project"
msgstr ""
msgid "WikiEmpty|This group has no wiki pages"
msgstr ""
msgid "WikiEmpty|This project has no wiki pages"
msgstr ""
msgid "WikiEmpty|You must be a group member in order to add wiki pages."
msgstr ""
msgid "WikiEmpty|You must be a project member in order to add wiki pages."
msgstr ""

View File

@ -40,8 +40,8 @@
"@babel/plugin-syntax-import-meta": "^7.8.3",
"@babel/preset-env": "^7.8.4",
"@gitlab/at.js": "1.5.5",
"@gitlab/svgs": "1.138.0",
"@gitlab/ui": "16.6.0",
"@gitlab/svgs": "1.139.0",
"@gitlab/ui": "16.8.1",
"@gitlab/visual-review-tools": "1.6.1",
"@rails/actioncable": "^6.0.3-1",
"@sentry/browser": "^5.10.2",

View File

@ -31,7 +31,7 @@ module QA
element :submit_button
end
view 'app/views/projects/_zen.html.haml' do
view 'app/views/shared/_zen.html.haml' do
# This 'element' is here only to ensure the changes in the view source aren't mistakenly changed
element :_, "qa_selector = local_assigns.fetch(:qa_selector, '')" # rubocop:disable QA/ElementWithPattern
end

View File

@ -14,7 +14,7 @@ module QA
end
view 'app/views/shared/form_elements/_description.html.haml' do
element :issue_description_textarea, "render 'projects/zen', f: form, attr: :description" # rubocop:disable QA/ElementWithPattern
element :issue_description_textarea, "render 'shared/zen', f: form, attr: :description" # rubocop:disable QA/ElementWithPattern
end
def add_title(title)

View File

@ -5,7 +5,7 @@ module QA
module Project
module Wiki
class Edit < Page::Base
view 'app/views/projects/wikis/_form.html.haml' do
view 'app/views/shared/wikis/_form.html.haml' do
element :wiki_title_textbox
element :wiki_content_textarea
element :wiki_message_textbox

View File

@ -7,16 +7,16 @@ module QA
class Show < Page::Base
include Component::LazyLoader
view 'app/views/projects/wikis/_sidebar.html.haml' do
view 'app/views/shared/wikis/_sidebar.html.haml' do
element :clone_repository_link
end
view 'app/views/projects/wikis/show.html.haml' do
view 'app/views/shared/wikis/show.html.haml' do
element :wiki_page_title
element :wiki_page_content
end
view 'app/views/projects/wikis/_main_links.html.haml' do
view 'app/views/shared/wikis/_main_links.html.haml' do
element :new_page_button
element :page_history_button
element :edit_page_button

View File

@ -84,7 +84,7 @@ describe 'Project active tab' do
context 'on project Wiki' do
before do
visit project_wiki_path(project, :home)
visit wiki_path(project.wiki)
end
it_behaves_like 'page has active tab', 'Wiki'

View File

@ -94,7 +94,7 @@ describe 'Edit Project Settings' do
{
builds: project_job_path(project, job),
issues: project_issues_path(project),
wiki: project_wiki_path(project, :home),
wiki: wiki_path(project.wiki),
snippets: project_snippets_path(project),
merge_requests: project_merge_requests_path(project)
}

View File

@ -29,7 +29,7 @@ RSpec.describe 'User updates wiki page' do
click_on('Cancel')
end
expect(current_path).to eq project_wiki_path(project, :home)
expect(current_path).to eq wiki_path(project.wiki)
end
it 'updates a page that has a path', :js do

View File

@ -12,6 +12,8 @@ RSpec.describe 'User views empty wiki' do
element = page.find('.row.empty-state')
expect(element).to have_content('This project has no wiki pages')
expect(element).to have_content('You must be a project member')
expect(element).to have_content('improve the wiki for this project')
expect(element).to have_link("issue tracker", href: project_issues_path(project))
expect(element).to have_link("Suggest wiki improvement", href: new_project_issue_path(project))
end
@ -24,6 +26,7 @@ RSpec.describe 'User views empty wiki' do
element = page.find('.row.empty-state')
expect(element).to have_content('This project has no wiki pages')
expect(element).to have_content('You must be a project member')
expect(element).to have_no_link('Suggest wiki improvement')
end
end
@ -66,9 +69,10 @@ RSpec.describe 'User views empty wiki' do
it 'show "create first page" message' do
visit(project_wikis_path(project))
element = page.find('.row.empty-state')
expect(element).to have_content('your project', count: 2)
element.click_link 'Create your first page'
expect(page).to have_button('Create page')

View File

@ -1,4 +1,4 @@
import Wikis from '~/pages/projects/wikis/wikis';
import Wikis from '~/pages/shared/wikis/wikis';
import { setHTMLFixture } from './helpers/fixtures';
describe('Wikis', () => {

View File

@ -22,12 +22,12 @@ describe WikiHelper do
end
describe '#wiki_sort_controls' do
let(:project) { create(:project) }
let(:wiki_link) { helper.wiki_sort_controls(project, sort, direction) }
let(:wiki) { create(:project_wiki) }
let(:wiki_link) { helper.wiki_sort_controls(wiki, sort, direction) }
let(:classes) { "btn btn-default has-tooltip reverse-sort-btn qa-reverse-sort rspec-reverse-sort" }
def expected_link(sort, direction, icon_class)
path = "/#{project.full_path}/-/wikis/pages?direction=#{direction}&sort=#{sort}"
path = "/#{wiki.project.full_path}/-/wikis/pages?direction=#{direction}&sort=#{sort}"
helper.link_to(path, type: 'button', class: classes, title: 'Sort direction') do
helper.sprite_icon("sort-#{icon_class}", size: 16)

View File

@ -326,4 +326,59 @@ describe Gitlab::GitalyClient::CommitService do
client.find_commits(order: 'default', author: "Billy Baggins <bilbo@shire.com>")
end
end
describe '#commits_by_message' do
shared_examples 'a CommitsByMessageRequest' do
let(:commits) { create_list(:gitaly_commit, 2) }
before do
request = Gitaly::CommitsByMessageRequest.new(
repository: repository_message,
query: query,
revision: (options[:revision] || '').dup.force_encoding(Encoding::ASCII_8BIT),
path: (options[:path] || '').dup.force_encoding(Encoding::ASCII_8BIT),
limit: (options[:limit] || 1000).to_i,
offset: (options[:offset] || 0).to_i
)
allow_any_instance_of(Gitaly::CommitService::Stub)
.to receive(:commits_by_message)
.with(request, kind_of(Hash))
.and_return([Gitaly::CommitsByMessageResponse.new(commits: commits)])
end
it 'sends an RPC request with the correct payload' do
expect(client.commits_by_message(query, options)).to match_array(wrap_commits(commits))
end
end
let(:query) { 'Add a feature' }
let(:options) { {} }
context 'when only the query is provided' do
include_examples 'a CommitsByMessageRequest'
end
context 'when all arguments are provided' do
let(:options) { { revision: 'feature-branch', path: 'foo.txt', limit: 10, offset: 20 } }
include_examples 'a CommitsByMessageRequest'
end
context 'when limit and offset are not integers' do
let(:options) { { limit: '10', offset: '60' } }
include_examples 'a CommitsByMessageRequest'
end
context 'when revision and path contain non-ASCII characters' do
let(:options) { { revision: "branch\u011F", path: "foo/\u011F.txt" } }
include_examples 'a CommitsByMessageRequest'
end
def wrap_commits(commits)
commits.map { |commit| Gitlab::Git::Commit.new(repository, commit) }
end
end
end

View File

@ -532,7 +532,7 @@ describe Gitlab::ProjectSearchResults do
context 'when repository_ref is provided' do
let(:message) { 'Feature added' }
let(:repository_ref) { +'feature' }
let(:repository_ref) { 'feature' }
it 'searches in the specified ref' do
commits = described_class.new(user, project, message, repository_ref).objects('commits')

View File

@ -96,6 +96,38 @@ describe Gitlab::UrlBuilder do
end
end
context 'when passing a Wiki' do
let(:wiki) { build_stubbed(:project_wiki) }
describe '#wiki_url' do
it 'uses the default collection action' do
url = subject.wiki_url(wiki)
expect(url).to eq "#{Gitlab.config.gitlab.url}/#{wiki.project.full_path}/-/wikis/home"
end
it 'supports a custom collection action' do
url = subject.wiki_url(wiki, action: :pages)
expect(url).to eq "#{Gitlab.config.gitlab.url}/#{wiki.project.full_path}/-/wikis/pages"
end
end
describe '#wiki_page_url' do
it 'uses the default member action' do
url = subject.wiki_page_url(wiki, 'foo')
expect(url).to eq "#{Gitlab.config.gitlab.url}/#{wiki.project.full_path}/-/wikis/foo"
end
it 'supports a custom member action' do
url = subject.wiki_page_url(wiki, 'foo', action: :edit)
expect(url).to eq "#{Gitlab.config.gitlab.url}/#{wiki.project.full_path}/-/wikis/foo/edit"
end
end
end
context 'when passing a DesignManagement::Design' do
let(:design) { build_stubbed(:design) }

View File

@ -40,7 +40,7 @@ RSpec.describe WikiDirectory do
it 'returns the relative path to the partial to be used' do
directory = build(:wiki_directory)
expect(directory.to_partial_path).to eq('projects/wikis/wiki_directory')
expect(directory.to_partial_path).to eq('../shared/wikis/wiki_directory')
end
end
end

View File

@ -781,7 +781,7 @@ describe WikiPage do
describe '#to_partial_path' do
it 'returns the relative path to the partial to be used' do
expect(subject.to_partial_path).to eq('projects/wikis/wiki_page')
expect(subject.to_partial_path).to eq('../shared/wikis/wiki_page')
end
end

View File

@ -45,7 +45,7 @@ describe AlertManagement::Alerts::UpdateService do
end
end
context 'when a model attribute is included' do
context 'when a model attribute is included without assignees' do
let(:params) { { title: 'This is an updated alert.' } }
it 'updates the attribute' do
@ -54,6 +54,10 @@ describe AlertManagement::Alerts::UpdateService do
expect { response }.to change { alert.title }.from(original_title).to(params[:title])
expect(response).to be_success
end
it 'skips adding a todo' do
expect { response }.not_to change(Todo, :count)
end
end
context 'when assignees are included' do
@ -76,6 +80,10 @@ describe AlertManagement::Alerts::UpdateService do
expect(response).to be_success
end
end
it 'adds a todo' do
expect { response }.to change { Todo.where(user: user_with_permissions).count }.by(1)
end
end
end
end

View File

@ -254,7 +254,7 @@ describe Projects::UpdateService do
it 'logs an error and creates a metric when wiki can not be created' do
project.project_feature.update(wiki_access_level: ProjectFeature::DISABLED)
expect_any_instance_of(ProjectWiki).to receive(:wiki).and_raise(ProjectWiki::CouldNotCreateWikiError)
expect_any_instance_of(ProjectWiki).to receive(:wiki).and_raise(Wiki::CouldNotCreateWikiError)
expect_any_instance_of(described_class).to receive(:log_error).with("Could not create wiki for #{project.full_name}")
counter = double(:counter)

View File

@ -66,7 +66,7 @@ describe 'layouts/nav/sidebar/_project' do
it 'shows the wiki tab with the wiki internal link' do
render
expect(rendered).to have_link('Wiki', href: project_wiki_path(project, :home))
expect(rendered).to have_link('Wiki', href: wiki_path(project.wiki))
end
end
@ -76,7 +76,7 @@ describe 'layouts/nav/sidebar/_project' do
it 'does not show the wiki tab' do
render
expect(rendered).not_to have_link('Wiki', href: project_wiki_path(project, :home))
expect(rendered).not_to have_link('Wiki', href: wiki_path(project.wiki))
end
end
end
@ -104,7 +104,7 @@ describe 'layouts/nav/sidebar/_project' do
it 'does not show the external wiki tab' do
render
expect(rendered).not_to have_link('External Wiki', href: project_wiki_path(project, :home))
expect(rendered).not_to have_link('External Wiki')
end
end
end

View File

@ -782,15 +782,15 @@
eslint-plugin-vue "^6.2.1"
vue-eslint-parser "^7.0.0"
"@gitlab/svgs@1.138.0":
version "1.138.0"
resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-1.138.0.tgz#440c304d1d4b4a6cfd80b26cfac0d0b95dae0cf6"
integrity sha512-qLukIpaJHF8uHRNIPGhhO5Bq1056e4cV3I51wI4PsxJLi5bkX1bXLbBlKXhQJgIknK39+1/MYpYOg2A19xbBdw==
"@gitlab/svgs@1.139.0":
version "1.139.0"
resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-1.139.0.tgz#8a4874e76000e2dd7d3ed3a8967d62bed47d7ea7"
integrity sha512-o1KAmQLYL727HodlPHkmj+d+Kdw8OIgHzlKmmPYMzeE+As2l1oz6CTilca56KqXGklOgrouC9P2puMwyX8e/6g==
"@gitlab/ui@16.6.0":
version "16.6.0"
resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-16.6.0.tgz#7b4acf683106936f04482dc404b54eae86ea6158"
integrity sha512-kOZD5INDHthZ2qT8xAHCR7IkXxKfwOT2fYaQ4epYrho4W7t7HR+IUeO0hlxKeEAIKq+RcavrTUbBtsegyhYUwQ==
"@gitlab/ui@16.8.1":
version "16.8.1"
resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-16.8.1.tgz#c1c4e61288175d956607386a54196d1596d49cf7"
integrity sha512-cFY5PCqoLgO+TQfAsq7WfJYsf3exbxp6aXMKaavTDxOIwUtafOe8Yc65OxBGhzpZBXVhH9aBWVicfOMHCEot9g==
dependencies:
"@babel/standalone" "^7.0.0"
"@gitlab/vue-toasted" "^1.3.0"