Skip to content

Commit 01a8b31

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent 127e6d9 commit 01a8b31

File tree

66 files changed

+1697
-67
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1697
-67
lines changed

.eslintrc.yml

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ extends:
33
- plugin:@gitlab/i18n
44
- plugin:no-jquery/slim
55
- plugin:no-jquery/deprecated-3.4
6+
- ./tooling/eslint-config/conditionally_ignore_ee.js
67
globals:
78
__webpack_public_path__: true
89
gl: false

.scss-lint.yml

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ scss_files:
88
exclude:
99
- 'app/assets/stylesheets/pages/emojis.scss'
1010
- 'app/assets/stylesheets/startup/startup-*.scss'
11+
- 'app/assets/stylesheets/lazy_bundles/select2.scss'
1112

1213
linters:
1314
# Reports when you use improper spacing around ! (the "bang") in !default,

GITALY_SERVER_VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
506c44cc07dcb804ce970ec1c02bb6e0d52320d8
1+
40d58655a42f71b6180a3cbaf369cc20b60e695a

app/assets/javascripts/clusters/components/applications.vue

+11
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,17 @@ export default {
467467
notebooks to a class of students, a corporate data science group,
468468
or a scientific research group.`)
469469
}}
470+
<gl-sprintf
471+
:message="
472+
s__(
473+
'ClusterIntegration|%{boldStart}Note:%{boldEnd} Requires Ingress to be installed.',
474+
)
475+
"
476+
>
477+
<template #bold="{ content }">
478+
<b>{{ content }}</b>
479+
</template>
480+
</gl-sprintf>
470481
</p>
471482
472483
<template v-if="ingressExternalEndpoint">

app/assets/javascripts/helpers/startup_css_helper.js

+1-11
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,7 @@ const handleStartupEvents = () => {
2020
}
2121
};
2222

23-
/* Wait for.... The methods can be used:
24-
- with a callback (preferred),
25-
waitFor(action)
26-
27-
- with then (discouraged),
28-
await waitFor().then(action);
29-
30-
- with await,
31-
await waitFor;
32-
action();
33-
-*/
23+
/* For `waitForCSSLoaded` methods, see docs.gitlab.com/ee/development/fe_guide/performance.html#important-considerations */
3424
export const waitForCSSLoaded = (action = () => {}) => {
3525
if (!gon?.features?.startupCss || allLinksLoaded()) {
3626
return new Promise(resolve => {

app/assets/javascripts/integrations/edit/components/confirmation_modal.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ export default {
88
GlModal,
99
},
1010
computed: {
11-
...mapGetters(['isSavingOrTesting']),
11+
...mapGetters(['isDisabled']),
1212
primaryProps() {
1313
return {
1414
text: __('Save'),
1515
attributes: [
1616
{ variant: 'success' },
1717
{ category: 'primary' },
18-
{ disabled: this.isSavingOrTesting },
18+
{ disabled: this.isDisabled },
1919
],
2020
};
2121
},

app/assets/javascripts/integrations/edit/components/integration_form.vue

+26-6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import JiraIssuesFields from './jira_issues_fields.vue';
1212
import TriggerFields from './trigger_fields.vue';
1313
import DynamicField from './dynamic_field.vue';
1414
import ConfirmationModal from './confirmation_modal.vue';
15+
import ResetConfirmationModal from './reset_confirmation_modal.vue';
1516
1617
export default {
1718
name: 'IntegrationForm',
@@ -23,15 +24,16 @@ export default {
2324
TriggerFields,
2425
DynamicField,
2526
ConfirmationModal,
27+
ResetConfirmationModal,
2628
GlButton,
2729
},
2830
directives: {
2931
'gl-modal': GlModalDirective,
3032
},
3133
mixins: [glFeatureFlagsMixin()],
3234
computed: {
33-
...mapGetters(['currentKey', 'propsSource', 'isSavingOrTesting']),
34-
...mapState(['defaultState', 'override', 'isSaving', 'isTesting']),
35+
...mapGetters(['currentKey', 'propsSource', 'isDisabled']),
36+
...mapState(['defaultState', 'override', 'isSaving', 'isTesting', 'isResetting']),
3537
isEditable() {
3638
return this.propsSource.editable;
3739
},
@@ -47,9 +49,12 @@ export default {
4749
showJiraIssuesFields() {
4850
return this.isJira && this.glFeatures.jiraIssuesIntegration;
4951
},
52+
showReset() {
53+
return this.isInstanceOrGroupLevel && this.propsSource.resetPath;
54+
},
5055
},
5156
methods: {
52-
...mapActions(['setOverride', 'setIsSaving', 'setIsTesting']),
57+
...mapActions(['setOverride', 'setIsSaving', 'setIsTesting', 'setIsResetting']),
5358
onSaveClick() {
5459
this.setIsSaving(true);
5560
eventHub.$emit('saveIntegration');
@@ -58,6 +63,7 @@ export default {
5863
this.setIsTesting(true);
5964
eventHub.$emit('testIntegration');
6065
},
66+
onResetClick() {},
6167
},
6268
};
6369
</script>
@@ -100,7 +106,7 @@ export default {
100106
category="primary"
101107
variant="success"
102108
:loading="isSaving"
103-
:disabled="isSavingOrTesting"
109+
:disabled="isDisabled"
104110
data-qa-selector="save_changes_button"
105111
>
106112
{{ __('Save changes') }}
@@ -113,7 +119,7 @@ export default {
113119
variant="success"
114120
type="submit"
115121
:loading="isSaving"
116-
:disabled="isSavingOrTesting"
122+
:disabled="isDisabled"
117123
data-qa-selector="save_changes_button"
118124
@click.prevent="onSaveClick"
119125
>
@@ -123,13 +129,27 @@ export default {
123129
<gl-button
124130
v-if="propsSource.canTest"
125131
:loading="isTesting"
126-
:disabled="isSavingOrTesting"
132+
:disabled="isDisabled"
127133
:href="propsSource.testPath"
128134
@click.prevent="onTestClick"
129135
>
130136
{{ __('Test settings') }}
131137
</gl-button>
132138

139+
<template v-if="showReset">
140+
<gl-button
141+
v-gl-modal.confirmResetIntegration
142+
category="secondary"
143+
variant="default"
144+
:loading="isResetting"
145+
:disabled="isDisabled"
146+
data-testid="reset-button"
147+
>
148+
{{ __('Reset') }}
149+
</gl-button>
150+
<reset-confirmation-modal @reset="onResetClick" />
151+
</template>
152+
133153
<gl-button class="btn-cancel" :href="propsSource.cancelPath">{{ __('Cancel') }}</gl-button>
134154
</div>
135155
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<script>
2+
import { mapGetters } from 'vuex';
3+
import { GlModal } from '@gitlab/ui';
4+
5+
import { __ } from '~/locale';
6+
7+
export default {
8+
components: {
9+
GlModal,
10+
},
11+
computed: {
12+
...mapGetters(['isDisabled']),
13+
primaryProps() {
14+
return {
15+
text: __('Reset'),
16+
attributes: [
17+
{ variant: 'warning' },
18+
{ category: 'primary' },
19+
{ disabled: this.isDisabled },
20+
],
21+
};
22+
},
23+
cancelProps() {
24+
return {
25+
text: __('Cancel'),
26+
};
27+
},
28+
},
29+
methods: {
30+
onReset() {
31+
this.$emit('reset');
32+
},
33+
},
34+
};
35+
</script>
36+
37+
<template>
38+
<gl-modal
39+
modal-id="confirmResetIntegration"
40+
size="sm"
41+
:title="s__('Integrations|Reset integration?')"
42+
:action-primary="primaryProps"
43+
:action-cancel="cancelProps"
44+
@primary="onReset"
45+
>
46+
<p>
47+
{{
48+
s__(
49+
'Integrations|Resetting this integration will clear the settings and deactivate this integration.',
50+
)
51+
}}
52+
</p>
53+
<p>
54+
{{ s__('Integrations|All projects inheriting these settings will also be reset.') }}
55+
</p>
56+
57+
<p class="gl-mb-0">
58+
{{ s__('Integrations|Projects using custom settings will not be affected.') }}
59+
</p>
60+
</gl-modal>
61+
</template>

app/assets/javascripts/integrations/edit/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ function parseDatasetToProps(data) {
2626
integrationLevel,
2727
cancelPath,
2828
testPath,
29+
resetPath,
2930
...booleanAttributes
3031
} = data;
3132
const {
@@ -49,6 +50,7 @@ function parseDatasetToProps(data) {
4950
editable,
5051
canTest,
5152
testPath,
53+
resetPath,
5254
triggerFieldsProps: {
5355
initialTriggerCommit: commitEvents,
5456
initialTriggerMergeRequest: mergeRequestEvents,

app/assets/javascripts/integrations/edit/store/actions.js

+2
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ import * as types from './mutation_types';
33
export const setOverride = ({ commit }, override) => commit(types.SET_OVERRIDE, override);
44
export const setIsSaving = ({ commit }, isSaving) => commit(types.SET_IS_SAVING, isSaving);
55
export const setIsTesting = ({ commit }, isTesting) => commit(types.SET_IS_TESTING, isTesting);
6+
export const setIsResetting = ({ commit }, isResetting) =>
7+
commit(types.SET_IS_RESETTING, isResetting);

app/assets/javascripts/integrations/edit/store/getters.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const isInheriting = state => (state.defaultState === null ? false : !state.override);
22

3-
export const isSavingOrTesting = state => state.isSaving || state.isTesting;
3+
export const isDisabled = state => state.isSaving || state.isTesting || state.isResetting;
44

55
export const propsSource = (state, getters) =>
66
getters.isInheriting ? state.defaultState : state.customState;
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export const SET_OVERRIDE = 'SET_OVERRIDE';
22
export const SET_IS_SAVING = 'SET_IS_SAVING';
33
export const SET_IS_TESTING = 'SET_IS_TESTING';
4+
export const SET_IS_RESETTING = 'SET_IS_RESETTING';

app/assets/javascripts/integrations/edit/store/mutations.js

+3
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@ export default {
1010
[types.SET_IS_TESTING](state, isTesting) {
1111
state.isTesting = isTesting;
1212
},
13+
[types.SET_IS_RESETTING](state, isResetting) {
14+
state.isResetting = isResetting;
15+
},
1316
};

app/assets/javascripts/integrations/edit/store/state.js

+1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ export default ({ defaultState = null, customState = {} } = {}) => {
77
customState,
88
isSaving: false,
99
isTesting: false,
10+
isResetting: false,
1011
};
1112
};

app/assets/javascripts/lib/utils/css_utils.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
export function loadCSSFile(path) {
22
return new Promise(resolve => {
3+
if (!path) resolve();
4+
35
if (document.querySelector(`link[href="${path}"]`)) {
46
resolve();
57
} else {

app/assets/javascripts/lib/utils/text_utility.js

+12
Original file line numberDiff line numberDiff line change
@@ -399,3 +399,15 @@ export const truncateNamespace = (string = '') => {
399399
* @returns {Boolean}
400400
*/
401401
export const hasContent = obj => isString(obj) && obj.trim() !== '';
402+
403+
/**
404+
* A utility function that validates if a
405+
* string is valid SHA1 hash format.
406+
*
407+
* @param {String} hash to validate
408+
*
409+
* @return {Boolean} true if valid
410+
*/
411+
export const isValidSha1Hash = str => {
412+
return /^[0-9a-f]{5,40}$/.test(str);
413+
};

0 commit comments

Comments
 (0)