Skip to content

Commit 1185bb8

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent c6dc2c3 commit 1185bb8

File tree

44 files changed

+1319
-102
lines changed

Some content is hidden

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

44 files changed

+1319
-102
lines changed

GITALY_SERVER_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c8d9c76d7f3ab259d0b743b2c79a678e88832a85
1+
9aea54d16acab5377a7e0488411f6fb066788570

GITLAB_KAS_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
40c7b25469a48f2eb811a9f797d412a2b9923433
1+
c4214a8f59358bcca78e06f5e4d5bbb8e19cc03b

app/assets/javascripts/packages_and_registries/settings/project/components/package_registry_section.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ export default {
3838
</gl-sprintf>
3939
</template>
4040
<template #default>
41-
<packages-protection-rules />
42-
<dependency-proxy-packages-settings v-if="showDependencyProxySettings" />
43-
<packages-cleanup-policy />
41+
<div class="gl-flex gl-flex-col gl-gap-5">
42+
<packages-protection-rules />
43+
<dependency-proxy-packages-settings v-if="showDependencyProxySettings" />
44+
<packages-cleanup-policy />
45+
</div>
4446
</template>
4547
</settings-block>
4648
</template>

app/assets/javascripts/packages_and_registries/settings/project/components/packages_cleanup_policy.vue

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
<script>
2-
import { GlAlert, GlSprintf } from '@gitlab/ui';
2+
import { GlAlert, GlCard } from '@gitlab/ui';
33
import {
44
FETCH_SETTINGS_ERROR_MESSAGE,
55
PACKAGES_CLEANUP_POLICY_TITLE,
66
PACKAGES_CLEANUP_POLICY_DESCRIPTION,
77
} from '~/packages_and_registries/settings/project/constants';
88
import packagesCleanupPolicyQuery from '~/packages_and_registries/settings/project/graphql/queries/get_packages_cleanup_policy.query.graphql';
99
import SettingsSection from '~/vue_shared/components/settings/settings_section.vue';
10-
10+
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
1111
import PackagesCleanupPolicyForm from './packages_cleanup_policy_form.vue';
1212
1313
export default {
1414
components: {
1515
SettingsSection,
1616
GlAlert,
17-
GlSprintf,
17+
GlCard,
1818
PackagesCleanupPolicyForm,
1919
},
20+
mixins: [glFeatureFlagsMixin()],
2021
inject: ['projectPath'],
2122
i18n: {
2223
FETCH_SETTINGS_ERROR_MESSAGE,
@@ -46,19 +47,44 @@ export default {
4647
packagesCleanupPolicy: {},
4748
};
4849
},
50+
computed: {
51+
featureFlagEnabled() {
52+
return this.glFeatures.reorganizeProjectLevelRegistrySettings;
53+
},
54+
},
4955
};
5056
</script>
5157
5258
<template>
53-
<settings-section :heading="$options.i18n.PACKAGES_CLEANUP_POLICY_TITLE">
59+
<gl-card v-if="featureFlagEnabled">
60+
<template #header>
61+
<h2 class="gl-m-0 gl-inline-flex gl-items-center gl-text-base gl-font-bold gl-leading-normal">
62+
{{ $options.i18n.PACKAGES_CLEANUP_POLICY_TITLE }}
63+
</h2>
64+
</template>
65+
<template #default>
66+
<p class="gl-text-subtle" data-testid="description">
67+
{{ $options.i18n.PACKAGES_CLEANUP_POLICY_DESCRIPTION }}
68+
</p>
69+
<gl-alert v-if="fetchSettingsError" variant="warning" :dismissible="false">
70+
{{ $options.i18n.FETCH_SETTINGS_ERROR_MESSAGE }}
71+
</gl-alert>
72+
<packages-cleanup-policy-form
73+
v-else
74+
v-model="packagesCleanupPolicy"
75+
:is-loading="$apollo.queries.packagesCleanupPolicy.loading"
76+
/>
77+
</template>
78+
</gl-card>
79+
<settings-section v-else :heading="$options.i18n.PACKAGES_CLEANUP_POLICY_TITLE">
5480
<template #description>
5581
<span data-testid="description">
56-
<gl-sprintf :message="$options.i18n.PACKAGES_CLEANUP_POLICY_DESCRIPTION" />
82+
{{ $options.i18n.PACKAGES_CLEANUP_POLICY_DESCRIPTION }}
5783
</span>
5884
</template>
5985
6086
<gl-alert v-if="fetchSettingsError" variant="warning" :dismissible="false">
61-
<gl-sprintf :message="$options.i18n.FETCH_SETTINGS_ERROR_MESSAGE" />
87+
{{ $options.i18n.FETCH_SETTINGS_ERROR_MESSAGE }}
6288
</gl-alert>
6389
<packages-cleanup-policy-form
6490
v-else

app/assets/javascripts/packages_and_registries/settings/project/components/packages_protection_rules.vue

Lines changed: 137 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import deletePackagesProtectionRuleMutation from '~/packages_and_registries/sett
1818
import updatePackagesProtectionRuleMutation from '~/packages_and_registries/settings/project/graphql/mutations/update_packages_protection_rule.mutation.graphql';
1919
import SettingsSection from '~/vue_shared/components/settings/settings_section.vue';
2020
import PackagesProtectionRuleForm from '~/packages_and_registries/settings/project/components/packages_protection_rule_form.vue';
21+
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
2122
import { s__, __ } from '~/locale';
2223
2324
const PAGINATION_DEFAULT_PER_PAGE = 10;
@@ -42,12 +43,15 @@ export default {
4243
GlModal: GlModalDirective,
4344
GlTooltip: GlTooltipDirective,
4445
},
46+
mixins: [glFeatureFlagsMixin()],
4547
inject: ['projectPath'],
4648
i18n: {
49+
delete: __('Delete'),
4750
settingBlockTitle: s__('PackageRegistry|Protected packages'),
4851
settingBlockDescription: s__(
4952
'PackageRegistry|When a package is protected, only certain user roles can push, update, and delete the protected package, which helps to avoid tampering with the package.',
5053
),
54+
createProtectionRuleText: s__('PackageRegistry|Add protection rule'),
5155
protectionRuleDeletionConfirmModal: {
5256
title: s__('PackageRegistry|Delete package protection rule?'),
5357
descriptionWarning: s__(
@@ -70,6 +74,9 @@ export default {
7074
};
7175
},
7276
computed: {
77+
containsTableItems() {
78+
return this.packageProtectionRulesQueryResult.length > 0;
79+
},
7380
tableItems() {
7481
return this.packageProtectionRulesQueryResult.map((packagesProtectionRule) => {
7582
return {
@@ -89,25 +96,11 @@ export default {
8996
isLoadingPackageProtectionRules() {
9097
return this.$apollo.queries.packageProtectionRulesQueryPayload.loading;
9198
},
92-
modalActionPrimary() {
93-
return {
94-
text: s__('PackageRegistry|Delete package protection rule'),
95-
attributes: {
96-
variant: 'danger',
97-
},
98-
};
99+
showTopLevelLoadingIcon() {
100+
return this.isLoadingPackageProtectionRules && !this.containsTableItems;
99101
},
100-
modalActionCancel() {
101-
return {
102-
text: __('Cancel'),
103-
};
104-
},
105-
minimumAccessLevelOptions() {
106-
return [
107-
{ value: 'MAINTAINER', text: __('Maintainer') },
108-
{ value: 'OWNER', text: __('Owner') },
109-
{ value: 'ADMIN', text: s__('AdminUsers|Administrator') },
110-
];
102+
featureFlagEnabled() {
103+
return this.glFeatures.reorganizeProjectLevelRegistrySettings;
111104
},
112105
},
113106
apollo: {
@@ -253,20 +246,140 @@ export default {
253246
tdClass: '!gl-align-middle gl-text-right',
254247
},
255248
],
249+
minimumAccessLevelOptions: [
250+
{ value: 'MAINTAINER', text: __('Maintainer') },
251+
{ value: 'OWNER', text: __('Owner') },
252+
{ value: 'ADMIN', text: s__('AdminUsers|Administrator') },
253+
],
256254
modal: { id: 'delete-package-protection-rule-confirmation-modal' },
255+
modalActionPrimary: {
256+
text: s__('PackageRegistry|Delete package protection rule'),
257+
attributes: {
258+
variant: 'danger',
259+
},
260+
},
261+
modalActionCancel: {
262+
text: __('Cancel'),
263+
},
257264
};
258265
</script>
259266
260267
<template>
268+
<div v-if="featureFlagEnabled" data-testid="project-packages-protection-rules-settings">
269+
<crud-component
270+
ref="packagesCrud"
271+
:title="$options.i18n.settingBlockTitle"
272+
:toggle-text="$options.i18n.createProtectionRuleText"
273+
>
274+
<template #form>
275+
<packages-protection-rule-form
276+
@cancel="hideProtectionRuleForm"
277+
@submit="refetchProtectionRules"
278+
/>
279+
</template>
280+
281+
<template #default>
282+
<p
283+
class="gl-pb-0 gl-text-subtle"
284+
:class="{ 'gl-px-5 gl-pt-4': containsTableItems }"
285+
data-testid="description"
286+
>
287+
{{ $options.i18n.settingBlockDescription }}
288+
</p>
289+
290+
<gl-alert
291+
v-if="alertErrorMessage"
292+
class="gl-mb-5"
293+
variant="danger"
294+
@dismiss="clearAlertMessage"
295+
>
296+
{{ alertErrorMessage }}
297+
</gl-alert>
298+
299+
<gl-loading-icon v-if="showTopLevelLoadingIcon" size="sm" class="gl-my-5" />
300+
<gl-table
301+
v-else-if="containsTableItems"
302+
:items="tableItems"
303+
:fields="$options.fields"
304+
stacked="md"
305+
:aria-label="$options.i18n.settingBlockTitle"
306+
:busy="isLoadingPackageProtectionRules"
307+
>
308+
<template #table-busy>
309+
<gl-loading-icon size="sm" class="gl-my-5" />
310+
</template>
311+
312+
<template #cell(col_3_minimum_access_level_for_push)="{ item }">
313+
<gl-form-select
314+
v-model="item.minimumAccessLevelForPush"
315+
class="gl-max-w-34"
316+
required
317+
:aria-label="$options.i18n.minimumAccessLevelForPush"
318+
:options="$options.minimumAccessLevelOptions"
319+
:disabled="isProtectionRuleMinimumAccessLevelFormSelectDisabled(item)"
320+
data-testid="push-access-select"
321+
@change="updatePackageProtectionRule(item)"
322+
/>
323+
</template>
324+
325+
<template #cell(col_4_actions)="{ item }">
326+
<gl-button
327+
v-gl-tooltip
328+
v-gl-modal="$options.modal.id"
329+
category="tertiary"
330+
icon="remove"
331+
:title="$options.i18n.delete"
332+
:aria-label="$options.i18n.delete"
333+
data-testid="delete-rule-btn"
334+
:disabled="isProtectionRuleDeleteButtonDisabled(item)"
335+
@click="showProtectionRuleDeletionConfirmModal(item)"
336+
/>
337+
</template>
338+
</gl-table>
339+
<p v-else class="gl-text-subtle">
340+
{{ s__('PackageRegistry|No packages are protected yet.') }}
341+
</p>
342+
</template>
343+
344+
<template #pagination>
345+
<gl-keyset-pagination
346+
v-bind="packageProtectionRulesQueryPageInfo"
347+
@prev="onPrevPage"
348+
@next="onNextPage"
349+
/>
350+
</template>
351+
</crud-component>
352+
353+
<gl-modal
354+
v-if="protectionRuleMutationItem"
355+
:modal-id="$options.modal.id"
356+
size="sm"
357+
:title="$options.i18n.protectionRuleDeletionConfirmModal.title"
358+
:action-primary="$options.modalActionPrimary"
359+
:action-cancel="$options.modalActionCancel"
360+
@primary="deleteProtectionRule(protectionRuleMutationItem)"
361+
>
362+
<p>
363+
<gl-sprintf :message="$options.i18n.protectionRuleDeletionConfirmModal.descriptionWarning">
364+
<template #packageNamePattern>
365+
<strong>{{ protectionRuleMutationItem.col_1_package_name_pattern }}</strong>
366+
</template>
367+
</gl-sprintf>
368+
</p>
369+
<p>{{ $options.i18n.protectionRuleDeletionConfirmModal.descriptionConsequence }}</p>
370+
</gl-modal>
371+
</div>
261372
<settings-section
373+
v-else
262374
:heading="$options.i18n.settingBlockTitle"
263375
:description="$options.i18n.settingBlockDescription"
376+
data-testid="project-packages-protection-rules-settings"
264377
>
265378
<template #default>
266379
<crud-component
267380
ref="packagesCrud"
268381
:title="$options.i18n.settingBlockTitle"
269-
:toggle-text="s__('PackageRegistry|Add protection rule')"
382+
:toggle-text="$options.i18n.createProtectionRuleText"
270383
>
271384
<template #form>
272385
<packages-protection-rule-form
@@ -303,7 +416,7 @@ export default {
303416
class="gl-max-w-34"
304417
required
305418
:aria-label="$options.i18n.minimumAccessLevelForPush"
306-
:options="minimumAccessLevelOptions"
419+
:options="$options.minimumAccessLevelOptions"
307420
:disabled="isProtectionRuleMinimumAccessLevelFormSelectDisabled(item)"
308421
data-testid="push-access-select"
309422
@change="updatePackageProtectionRule(item)"
@@ -316,8 +429,8 @@ export default {
316429
v-gl-modal="$options.modal.id"
317430
category="tertiary"
318431
icon="remove"
319-
:title="__('Delete')"
320-
:aria-label="__('Delete')"
432+
:title="$options.i18n.delete"
433+
:aria-label="$options.i18n.delete"
321434
data-testid="delete-rule-btn"
322435
:disabled="isProtectionRuleDeleteButtonDisabled(item)"
323436
@click="showProtectionRuleDeletionConfirmModal(item)"
@@ -340,8 +453,8 @@ export default {
340453
:modal-id="$options.modal.id"
341454
size="sm"
342455
:title="$options.i18n.protectionRuleDeletionConfirmModal.title"
343-
:action-primary="modalActionPrimary"
344-
:action-cancel="modalActionCancel"
456+
:action-primary="$options.modalActionPrimary"
457+
:action-cancel="$options.modalActionCancel"
345458
@primary="deleteProtectionRule(protectionRuleMutationItem)"
346459
>
347460
<p>

app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,9 @@ export default {
288288
<template v-if="isLoading">{{ $options.FETCH_LOADING }}</template>
289289
<template v-else>
290290
<div class="gl-flex gl-flex-col">
291-
<div class="gl-flex gl-flex-col gl-flex-wrap gl-items-baseline gl-gap-3 sm:gl-flex-row">
291+
<div
292+
class="gl-flex gl-flex-col gl-flex-wrap gl-items-baseline gl-gap-3 sm:gl-flex-row sm:gl-items-center"
293+
>
292294
<div v-if="requireSamlAuthToApprove && showApprove">
293295
<gl-form
294296
ref="form"

app/assets/stylesheets/framework/icons.scss

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77

88
.ci-status-icon-success,
99
.ci-status-icon-passed {
10-
@include icon-styles($green-500);
10+
svg,
11+
.gl-icon {
12+
@apply gl-fill-icon-success;
13+
}
1114
}
1215

1316
.ci-status-icon-error,
@@ -186,7 +189,7 @@ a.ci-icon:focus {
186189
.password-status-icon-success {
187190
svg {
188191
vertical-align: middle;
189-
fill: $green-500;
192+
@apply gl-fill-icon-success;
190193
}
191194
}
192195

app/assets/stylesheets/page_bundles/projects.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@
9595
}
9696

9797
.vs-private {
98-
color: var(--green-500, $green-500);
98+
@apply gl-text-success;
9999
}
100100

101101
.lfs-enabled {
102-
color: var(--green-500, $green-500);
102+
@apply gl-text-success;
103103
}
104104

105105
.lfs-disabled {

app/assets/stylesheets/pages/groups.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
.card {
3232
.shared_runners_limit_under_quota {
33-
color: $green-500;
33+
@apply gl-text-success;
3434
}
3535

3636
.shared_runners_limit_over_quota {

app/assets/stylesheets/pages/issues.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ ul.related-merge-requests > li gl-emoji {
6969
}
7070

7171
&.open {
72-
color: $green-500;
72+
@apply gl-text-success;
7373
}
7474
}
7575

0 commit comments

Comments
 (0)