1
1
<script >
2
- import { GlAlert , GlSprintf , GlLink , GlCard , GlButton , GlSkeletonLoader } from ' @gitlab/ui' ;
2
+ import { GlAlert , GlSprintf , GlLink , GlButton } from ' @gitlab/ui' ;
3
3
import {
4
4
CONTAINER_CLEANUP_POLICY_TITLE ,
5
5
CONTAINER_CLEANUP_POLICY_DESCRIPTION ,
@@ -13,16 +13,16 @@ import {
13
13
} from ' ~/packages_and_registries/settings/project/constants' ;
14
14
import expirationPolicyEnabledQuery from ' ~/packages_and_registries/settings/project/graphql/queries/get_expiration_policy_enabled.query.graphql' ;
15
15
import ContainerExpirationPolicyEnabledText from ' ~/packages_and_registries/settings/project/components/container_expiration_policy_enabled_text.vue' ;
16
+ import CrudComponent from ' ~/vue_shared/components/crud_component.vue' ;
16
17
17
18
export default {
18
19
components: {
19
20
ContainerExpirationPolicyEnabledText,
20
21
GlAlert,
21
22
GlSprintf,
22
23
GlLink,
23
- GlCard,
24
24
GlButton,
25
- GlSkeletonLoader ,
25
+ CrudComponent ,
26
26
},
27
27
inject: [
28
28
' projectPath' ,
@@ -90,70 +90,63 @@ export default {
90
90
< / script>
91
91
92
92
< template>
93
- < gl- card data- testid= " container-expiration-policy-project-settings" >
94
- < template #header>
95
- < header class = " gl-flex gl-flex-wrap gl-justify-between" >
96
- < h2
97
- class = " gl-m-0 gl-inline-flex gl-items-center gl-text-base gl-font-bold gl-leading-normal"
98
- >
99
- {{ $options .i18n .CONTAINER_CLEANUP_POLICY_TITLE }}
100
- < / h2>
101
- < gl- button
102
- v- if = " isEnabled"
103
- data- testid= " rules-button"
104
- : href= " cleanupSettingsPath"
105
- : loading= " isLoading"
106
- category= " secondary"
107
- size= " small"
108
- variant= " confirm"
109
- >
110
- {{ cleanupRulesButtonText }}
111
- < / gl- button>
112
- < / header>
93
+ < crud- component
94
+ : title= " $options.i18n.CONTAINER_CLEANUP_POLICY_TITLE"
95
+ : is- loading= " isLoading"
96
+ data- testid= " container-expiration-policy-project-settings"
97
+ >
98
+ < template #actions>
99
+ < gl- button
100
+ v- if = " isEnabled"
101
+ data- testid= " rules-button"
102
+ : href= " cleanupSettingsPath"
103
+ : loading= " isLoading"
104
+ category= " secondary"
105
+ size= " small"
106
+ class = " gl-self-start"
107
+ >
108
+ {{ cleanupRulesButtonText }}
109
+ < / gl- button>
113
110
< / template>
114
- < template #default>
115
- < p class = " gl-text-subtle" data- testid= " description" >
116
- < gl- sprintf : message= " $options.i18n.CONTAINER_CLEANUP_POLICY_DESCRIPTION" >
111
+ < template #description>
112
+ < gl- sprintf : message= " $options.i18n.CONTAINER_CLEANUP_POLICY_DESCRIPTION" >
113
+ < template #link= " { content }" >
114
+ < gl- link : href= " helpPagePath" > {{ content }}< / gl- link>
115
+ < / template>
116
+ < / gl- sprintf>
117
+ < / template>
118
+
119
+ < template v- if = " isEnabled" >
120
+ < container- expiration- policy- enabled- text
121
+ v- if = " isCleanupEnabled"
122
+ : next- run- at= " containerTagsExpirationPolicy.nextRunAt"
123
+ / >
124
+ < p v- else data- testid= " empty-cleanup-policy" class = " gl-mb-0 gl-text-subtle" >
125
+ {{
126
+ s__ (
127
+ ' ContainerRegistry|Registry cleanup disabled. Either no cleanup policies are enabled, or this project has no container images.' ,
128
+ )
129
+ }}
130
+ < / p>
131
+ < / template>
132
+ < template v- else >
133
+ < gl- alert
134
+ v- if = " showDisabledFormMessage"
135
+ : dismissible= " false"
136
+ : title= " $options.i18n.UNAVAILABLE_FEATURE_TITLE"
137
+ variant= " tip"
138
+ >
139
+ {{ $options .i18n .UNAVAILABLE_FEATURE_INTRO_TEXT }}
140
+
141
+ < gl- sprintf : message= " unavailableFeatureMessage" >
117
142
< template #link= " { content }" >
118
- < gl- link : href= " helpPagePath " > {{ content }}< / gl- link>
143
+ < gl- link : href= " adminSettingsPath " > {{ content }}< / gl- link>
119
144
< / template>
120
145
< / gl- sprintf>
121
- < / p>
122
- < div v- if = " isLoading" class = " gl-my-3" >
123
- < gl- skeleton- loader : lines= " 1" / >
124
- < / div>
125
- < template v- else - if = " isEnabled" >
126
- < container- expiration- policy- enabled- text
127
- v- if = " isCleanupEnabled"
128
- : next- run- at= " containerTagsExpirationPolicy.nextRunAt"
129
- / >
130
- < p v- else data- testid= " empty-cleanup-policy" class = " gl-mb-0 gl-text-subtle" >
131
- {{
132
- s__ (
133
- ' ContainerRegistry|Registry cleanup disabled. Either no cleanup policies are enabled, or this project has no container images.' ,
134
- )
135
- }}
136
- < / p>
137
- < / template>
138
- < template v- else >
139
- < gl- alert
140
- v- if = " showDisabledFormMessage"
141
- : dismissible= " false"
142
- : title= " $options.i18n.UNAVAILABLE_FEATURE_TITLE"
143
- variant= " tip"
144
- >
145
- {{ $options .i18n .UNAVAILABLE_FEATURE_INTRO_TEXT }}
146
-
147
- < gl- sprintf : message= " unavailableFeatureMessage" >
148
- < template #link= " { content }" >
149
- < gl- link : href= " adminSettingsPath" > {{ content }}< / gl- link>
150
- < / template>
151
- < / gl- sprintf>
152
- < / gl- alert>
153
- < gl- alert v- else - if = " fetchSettingsError" variant= " warning" : dismissible= " false" >
154
- < gl- sprintf : message= " $options.i18n.FETCH_SETTINGS_ERROR_MESSAGE" / >
155
- < / gl- alert>
156
- < / template>
146
+ < / gl- alert>
147
+ < gl- alert v- else - if = " fetchSettingsError" variant= " warning" : dismissible= " false" >
148
+ < gl- sprintf : message= " $options.i18n.FETCH_SETTINGS_ERROR_MESSAGE" / >
149
+ < / gl- alert>
157
150
< / template>
158
- < / gl - card >
151
+ < / crud - component >
159
152
< / template>
0 commit comments