mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-26 17:51:13 +08:00
Merge pull request #8027 from artoscinote/ma_SCI_11040
Make file versioning disclaimer overridable [SCI-11040]
This commit is contained in:
commit
8912bb44b0
3 changed files with 15 additions and 6 deletions
|
@ -407,7 +407,8 @@ class AssetsController < ApplicationController
|
||||||
user: current_user
|
user: current_user
|
||||||
).as_json.merge(
|
).as_json.merge(
|
||||||
enabled: VersionedAttachments.enabled?,
|
enabled: VersionedAttachments.enabled?,
|
||||||
enable_url: ENV.fetch('SCINOTE_FILE_VERSIONING_ENABLE_URL', nil)
|
enable_url: ENV.fetch('SCINOTE_FILE_VERSIONING_ENABLE_URL', nil),
|
||||||
|
disabled_disclaimer: VersionedAttachments.disabled_disclaimer
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<h3 class="mt-1 mb-2">{{ i18n.t('assets.file_versions_modal.title') }}</h3>
|
<h3 class="mt-1 mb-2">{{ i18n.t('assets.file_versions_modal.title') }}</h3>
|
||||||
{{ i18n.t('assets.file_versions_modal.disabled_disclaimer') }}
|
{{ disabledDisclaimer.text }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -76,7 +76,7 @@
|
||||||
{{ i18n.t('general.cancel') }}
|
{{ i18n.t('general.cancel') }}
|
||||||
</button>
|
</button>
|
||||||
<a v-if="fileVersions && !enabled" :href="enableUrl" class='btn btn-primary' target="_blank">
|
<a v-if="fileVersions && !enabled" :href="enableUrl" class='btn btn-primary' target="_blank">
|
||||||
{{ i18n.t('assets.file_versions_modal.enable_button') }}
|
{{ disabledDisclaimer.button }}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -96,8 +96,7 @@ export default {
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
restoreVersionUrl: {
|
restoreVersionUrl: {
|
||||||
type: String,
|
type: String
|
||||||
required: true
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mixins: [modalMixin],
|
mixins: [modalMixin],
|
||||||
|
@ -105,7 +104,8 @@ export default {
|
||||||
return {
|
return {
|
||||||
fileVersions: null,
|
fileVersions: null,
|
||||||
enabled: null,
|
enabled: null,
|
||||||
enableUrl: null
|
enableUrl: null,
|
||||||
|
disabledDisclaimer: null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -122,6 +122,7 @@ export default {
|
||||||
this.fileVersions = response.data.data;
|
this.fileVersions = response.data.data;
|
||||||
this.enabled = response.data.enabled;
|
this.enabled = response.data.enabled;
|
||||||
this.enableUrl = response.data.enable_url;
|
this.enableUrl = response.data.enable_url;
|
||||||
|
this.disabledDisclaimer = response.data.disabled_disclaimer;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
document.querySelectorAll('[data-render-tooltip]').forEach((e) => {
|
document.querySelectorAll('[data-render-tooltip]').forEach((e) => {
|
||||||
window.initTooltip(e);
|
window.initTooltip(e);
|
||||||
|
|
|
@ -51,4 +51,11 @@ module VersionedAttachments
|
||||||
def enabled?
|
def enabled?
|
||||||
ApplicationSettings.instance.values['versioned_attachments_enabled']
|
ApplicationSettings.instance.values['versioned_attachments_enabled']
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def disabled_disclaimer
|
||||||
|
{
|
||||||
|
text: I18n.t('assets.file_versions_modal.disabled_disclaimer'),
|
||||||
|
button: I18n.t('assets.file_versions_modal.enable_button')
|
||||||
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue