@@ -34,6 +34,8 @@ import bootstrapTableMixin from '../../../mixins/bootstrapTableMixin';
3434import common from ' ../../../shared/common' ;
3535import EventBus from ' ../../../shared/eventbus' ;
3636import RepositoryCreateRepositoryModal from ' ./RepositoryCreateRepositoryModal' ;
37+ import { parseAdvisoryMirroringEnabled } from ' @/shared/utils' ;
38+ import { parseAdvisoryAliasSyncEnabled } from ' @/shared/utils' ;
3739
3840export default {
3941 props: {
@@ -123,6 +125,30 @@ export default {
123125 return value === true ? ' <i class="fa fa-check-square-o" />' : ' ' ;
124126 },
125127 },
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+ },
126152 ],
127153 data: [],
128154 options: {
@@ -170,10 +196,10 @@ export default {
170196 <c-switch color="primary" v-model="internal" label v-bind="labelIcon" />{{$t('admin.internal')}}
171197 </div>
172198 <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 ')}}
174200 </div>
175201 <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 ')}}
177203 </div>
178204
179205 <div>
@@ -222,22 +248,15 @@ export default {
222248 username: row .username ,
223249 password: row .password || ' HiddenDecryptedPropertyPlaceholder' ,
224250 enabled: row .enabled ,
225- advisoryMirroringEnabled:
226- this .parseAdvisoryMirroringEnabled (row),
227- advisoryAliasSyncEnabled:
228- this .parseAdvisoryAliasSyncEnabled (row),
251+ advisoryMirroringEnabled: parseAdvisoryMirroringEnabled (row),
252+ advisoryAliasSyncEnabled: parseAdvisoryAliasSyncEnabled (row),
229253 uuid: row .uuid ,
230254 labelIcon: {
231255 dataOn: ' \u2713 ' ,
232256 dataOff: ' \u2715 ' ,
233257 },
234258 };
235259 },
236- // TODO remove this dead code
237- // created() {
238- // this.parseAdvisoryMirroringEnabled(this.repository);
239- // this.parseAdvisoryAliasSyncEnabled(this.repository);
240- // },
241260 watch: {
242261 internal () {
243262 this .updateRepository ();
@@ -256,24 +275,6 @@ export default {
256275 },
257276 },
258277 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- },
277278 deleteRepository : function () {
278279 let url = ` ${ this .$api .BASE_URL } /${ this .$api .URL_REPOSITORY } /${ this .uuid } ` ;
279280 this .axios
0 commit comments