2023-02-13 16:50:39 +08:00
|
|
|
<template>
|
|
|
|
<div ref="modal" @keydown.esc="cancel" class="modal publish-modal" tabindex="-1" role="dialog">
|
|
|
|
<div class="modal-dialog" role="document">
|
2024-08-02 20:03:21 +08:00
|
|
|
<div class="modal-content" data-e2e="e2e-MD-publishProtocol">
|
2023-02-13 16:50:39 +08:00
|
|
|
<div class="modal-header">
|
2024-08-02 20:03:21 +08:00
|
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close" data-e2e="e2e-BT-publishProtocol-close"><i class="sn-icon sn-icon-close"></i></button>
|
|
|
|
<h4 class="modal-title" data-e2e="e2e-TX-publishProtocol-title">
|
2023-04-14 15:56:35 +08:00
|
|
|
{{ i18n.t('protocols.publish_modal.title', { nr: protocol.attributes.version })}}
|
2023-02-13 16:50:39 +08:00
|
|
|
</h4>
|
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
|
|
|
<div class="sci-input-container">
|
2024-08-02 20:03:21 +08:00
|
|
|
<label data-e2e="e2e-TX-publishProtocol-templateNameLabel">{{ i18n.t('protocols.publish_modal.name')}}</label>
|
|
|
|
<div data-e2e="e2e-TX-publishProtocol-templateName">{{ protocol.attributes.name }}</div>
|
2023-02-13 16:50:39 +08:00
|
|
|
</div>
|
|
|
|
<div class="sci-input-container">
|
2024-08-02 20:03:21 +08:00
|
|
|
<label data-e2e="e2e-TX-publishProtocol-revisionNotesLabel">{{ i18n.t('protocols.publish_modal.comment')}}</label>
|
2023-03-14 21:20:03 +08:00
|
|
|
<textarea ref="textarea"
|
|
|
|
v-model="protocol.attributes.version_comment"
|
|
|
|
class="sci-input-field"
|
2024-08-02 20:03:21 +08:00
|
|
|
:placeholder="i18n.t('protocols.publish_modal.comment_placeholder')"
|
|
|
|
data-e2e="e2e-IF-publishProtocol-revisionNotes">
|
2023-03-14 21:20:03 +08:00
|
|
|
</textarea>
|
2023-02-13 16:50:39 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
2024-08-02 20:03:21 +08:00
|
|
|
<button class="btn btn-secondary" @click="cancel" data-e2e="e2e-BT-publishProtocol-cancel">{{ i18n.t('general.cancel') }}</button>
|
|
|
|
<button class="btn btn-primary" @click="confirm" data-e2e="e2e-BT-publishProtocol-publish">{{ i18n.t('protocols.publish_modal.publish')}}</button>
|
2023-02-13 16:50:39 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
2024-01-04 23:34:36 +08:00
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
name: 'publishProtocol',
|
|
|
|
props: {
|
|
|
|
protocol: {
|
|
|
|
type: Object,
|
|
|
|
required: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
$(this.$refs.modal).modal('show');
|
|
|
|
$(this.$refs.modal).on('hidden.bs.modal', () => {
|
|
|
|
this.$emit('cancel');
|
|
|
|
});
|
|
|
|
$(this.$refs.textarea).focus();
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
confirm() {
|
|
|
|
$(this.$refs.modal).modal('hide');
|
|
|
|
this.$emit('publish', this.protocol.attributes.version_comment);
|
2023-02-13 16:50:39 +08:00
|
|
|
},
|
2024-01-04 23:34:36 +08:00
|
|
|
cancel() {
|
|
|
|
$(this.$refs.modal).modal('hide');
|
2023-02-13 16:50:39 +08:00
|
|
|
}
|
|
|
|
}
|
2024-01-04 23:34:36 +08:00
|
|
|
};
|
2023-02-13 16:50:39 +08:00
|
|
|
</script>
|