@@ -34,6 +34,8 @@ import bootstrapTableMixin from '../../../mixins/bootstrapTableMixin';
34
34
import common from ' ../../../shared/common' ;
35
35
import EventBus from ' ../../../shared/eventbus' ;
36
36
import RepositoryCreateRepositoryModal from ' ./RepositoryCreateRepositoryModal' ;
37
+ import { parseAdvisoryMirroringEnabled } from ' @/shared/utils' ;
38
+ import { parseAdvisoryAliasSyncEnabled } from ' @/shared/utils' ;
37
39
38
40
export default {
39
41
props: {
@@ -123,6 +125,30 @@ export default {
123
125
return value === true ? ' <i class="fa fa-check-square-o" />' : ' ' ;
124
126
},
125
127
},
128
+ {
129
+ title: this .$t (' admin.repository_advisory_mirroring_enabled' ),
130
+ field: ' advisoryMirroringEnabled' ,
131
+ class: ' tight' ,
132
+ sortable: true ,
133
+ visible: this .type === ' COMPOSER' ,
134
+ formatter (value , row , index ) {
135
+ return parseAdvisoryMirroringEnabled (row) === true
136
+ ? ' <i class="fa fa-check-square-o" />'
137
+ : ' ' ;
138
+ },
139
+ },
140
+ {
141
+ title: this .$t (' admin.repository_advisory_alias_sync_enabled' ),
142
+ field: ' advisoryAliasSyncEnabled' ,
143
+ class: ' tight' ,
144
+ sortable: true ,
145
+ visible: this .type === ' COMPOSER' ,
146
+ formatter (value , row , index ) {
147
+ return parseAdvisoryAliasSyncEnabled (row) === true
148
+ ? ' <i class="fa fa-check-square-o" />'
149
+ : ' ' ;
150
+ },
151
+ },
126
152
],
127
153
data: [],
128
154
options: {
@@ -170,10 +196,10 @@ export default {
170
196
<c-switch color="primary" v-model="internal" label v-bind="labelIcon" />{{$t('admin.internal')}}
171
197
</div>
172
198
<div v-if="this.type === 'COMPOSER'">
173
- <c-switch color="primary" v-model="advisoryMirroringEnabled" label v-bind="labelIcon" />{{$t('admin.repository_advisory_mirroring_enabled ')}}
199
+ <c-switch color="primary" v-model="advisoryMirroringEnabled" label v-bind="labelIcon" />{{$t('admin.repository_advisory_mirroring_toggle ')}}
174
200
</div>
175
201
<div v-show="advisoryMirroringEnabled" v-if="this.type === 'COMPOSER'">
176
- <c-switch color="primary" v-model="advisoryAliasSyncEnabled" label v-bind="labelIcon" />{{$t('admin.repository_advisory_alias_sync_enabled ')}}
202
+ <c-switch color="primary" v-model="advisoryAliasSyncEnabled" label v-bind="labelIcon" />{{$t('admin.repository_advisory_alias_sync_toggle ')}}
177
203
</div>
178
204
179
205
<div>
@@ -222,22 +248,15 @@ export default {
222
248
username: row .username ,
223
249
password: row .password || ' HiddenDecryptedPropertyPlaceholder' ,
224
250
enabled: row .enabled ,
225
- advisoryMirroringEnabled:
226
- this .parseAdvisoryMirroringEnabled (row),
227
- advisoryAliasSyncEnabled:
228
- this .parseAdvisoryAliasSyncEnabled (row),
251
+ advisoryMirroringEnabled: parseAdvisoryMirroringEnabled (row),
252
+ advisoryAliasSyncEnabled: parseAdvisoryAliasSyncEnabled (row),
229
253
uuid: row .uuid ,
230
254
labelIcon: {
231
255
dataOn: ' \u2713 ' ,
232
256
dataOff: ' \u2715 ' ,
233
257
},
234
258
};
235
259
},
236
- // TODO remove this dead code
237
- // created() {
238
- // this.parseAdvisoryMirroringEnabled(this.repository);
239
- // this.parseAdvisoryAliasSyncEnabled(this.repository);
240
- // },
241
260
watch: {
242
261
internal () {
243
262
this .updateRepository ();
@@ -256,24 +275,6 @@ export default {
256
275
},
257
276
},
258
277
methods: {
259
- parseAdvisoryMirroringEnabled : function (repo ) {
260
- if (repo .config ) {
261
- let value = JSON .parse (repo .config );
262
- if (value) {
263
- return value .advisoryMirroringEnabled ;
264
- }
265
- return null ;
266
- }
267
- },
268
- parseAdvisoryAliasSyncEnabled : function (repo ) {
269
- if (repo .config ) {
270
- let value = JSON .parse (repo .config );
271
- if (value) {
272
- return value .advisoryAliasSyncEnabled ;
273
- }
274
- return null ;
275
- }
276
- },
277
278
deleteRepository : function () {
278
279
let url = ` ${ this .$api .BASE_URL } /${ this .$api .URL_REPOSITORY } /${ this .uuid } ` ;
279
280
this .axios
0 commit comments