debian-mirror-gitlab/app/assets/javascripts/repository/components/blob_edit.vue

48 lines
1 KiB
Vue
Raw Normal View History

2021-06-08 01:23:25 +05:30
<script>
import { GlButton } from '@gitlab/ui';
import { __ } from '~/locale';
2021-09-04 01:27:46 +05:30
import WebIdeLink from '~/vue_shared/components/web_ide_link.vue';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
2021-06-08 01:23:25 +05:30
export default {
i18n: {
edit: __('Edit'),
2021-09-04 01:27:46 +05:30
webIde: __('Web IDE'),
2021-06-08 01:23:25 +05:30
},
components: {
GlButton,
2021-09-04 01:27:46 +05:30
WebIdeLink,
2021-06-08 01:23:25 +05:30
},
2021-09-04 01:27:46 +05:30
mixins: [glFeatureFlagsMixin()],
2021-06-08 01:23:25 +05:30
props: {
editPath: {
type: String,
required: true,
},
2021-09-04 01:27:46 +05:30
webIdePath: {
type: String,
required: true,
},
2021-06-08 01:23:25 +05:30
},
};
</script>
<template>
2021-09-04 01:27:46 +05:30
<web-ide-link
v-if="glFeatures.consolidatedEditButton"
class="gl-mr-3"
:edit-url="editPath"
:web-ide-url="webIdePath"
:is-blob="true"
/>
<div v-else>
<gl-button class="gl-mr-2" category="primary" variant="confirm" :href="editPath">
{{ $options.i18n.edit }}
</gl-button>
<gl-button class="gl-mr-3" category="primary" variant="confirm" :href="webIdePath">
{{ $options.i18n.webIde }}
</gl-button>
</div>
2021-06-08 01:23:25 +05:30
</template>