Update viewer and technician interaction on shareable link modal [SCI-9047] (#6568)

This commit is contained in:
wandji 2023-11-15 15:55:48 +01:00 committed by GitHub
parent 64669dee4d
commit 0987ebf637
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 5 deletions

View file

@ -62,6 +62,10 @@ input[type="checkbox"].sci-toggle-checkbox {
display: none;
}
&:disabled {
cursor: not-allowed;
}
&:checked + .sci-toggle-checkbox-label {
border-color: var(--sn-blue);

View file

@ -8,6 +8,7 @@ class MyModuleShareableLinksController < ApplicationController
results_show)
before_action :check_view_permissions, only: :show
before_action :check_manage_permissions, except: %i(protocol_show
show
repository_index_dt
repository_snapshot_index_dt
download_asset

View file

@ -32,6 +32,7 @@
v-model="sharedEnabled"
id="checkbox"
class="sci-toggle-checkbox"
:disabled="!canShare"
tabindex="0"
@change="checkboxChange"
@keyup.enter="handleCheckboxEnter"/>
@ -46,7 +47,7 @@
:class="{ 'error': error }"
v-model="description"
:placeholder="i18n.t('shareable_links.modal.description_placeholder')"
:disabled="!sharedEnabled"
:disabled="!sharedEnabled || !canShare"
@focus="editing = true">
</textarea>
</div>
@ -110,6 +111,10 @@
characterLimit: {
type: Number,
default: null
},
canShare: {
type: Boolean,
default: false
}
},
data() {

View file

@ -5,7 +5,6 @@
type="button"
:class="shareClass"
:title="shareValue"
:disabled="disabled"
@click="openModal">
<span class="sn-icon sn-icon-shared"></span>
<span class="text-sm">
@ -19,6 +18,7 @@
:characterLimit="255"
@enable="enableShare"
@disable="disableShare"
:canShare="canShare"
@close="closeModal"/>
</div>
</div>
@ -38,7 +38,7 @@
type: String,
required: true
},
disabled: {
canShare: {
type: Boolean,
default: false
}

View file

@ -1,12 +1,12 @@
<div class="task-sharing-and-flows flex items-center gap-2 pl-3">
<%= render partial: 'my_modules/status_flow/task_flow_button', locals: { my_module: @my_module } if @my_module.my_module_status_flow %>
<%= javascript_include_tag("my_modules/status_flow") %>
<% if current_team.shareable_links_enabled? && can_share_my_module?(@my_module) %>
<% if current_team.shareable_links_enabled? %>
<div class="share-task-container" data-behaviour="vue">
<share-task-container
shareable-link-url="<%= my_module_shareable_link_path(@my_module) %>"
:shared="<%= @my_module.shared? %>"
:disabled="<%= !can_share_my_module?(@my_module) %>" />
:can-share="<%= can_share_my_module?(@my_module) %>" />
</div>
<%= javascript_include_tag 'vue_share_task_container' %>