mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-04 19:53:19 +08:00
Merge branch 'develop' into features/file-versioning
This commit is contained in:
commit
7804b46937
8 changed files with 24 additions and 12 deletions
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
1.36.2.2
|
||||
1.37.0
|
||||
|
|
|
@ -62,7 +62,7 @@ class MyModuleShareableLinksController < ApplicationController
|
|||
@draw = params[:draw].to_i
|
||||
per_page = params[:length].to_i < 1 ? Constants::REPOSITORY_DEFAULT_PAGE_SIZE : params[:length].to_i
|
||||
page = (params[:start].to_i / per_page) + 1
|
||||
datatable_service = RepositoryDatatableService.new(@repository, params, nil, @my_module, preload_cells: false)
|
||||
datatable_service = RepositoryDatatableService.new(@repository, params, nil, @my_module, preload_cells: false, disable_reminders: true)
|
||||
|
||||
@datatable_params = {
|
||||
view_mode: params[:view_mode],
|
||||
|
|
|
@ -57,7 +57,7 @@ class TeamSharedObjectsController < ApplicationController
|
|||
end
|
||||
|
||||
def shareable_teams
|
||||
teams = current_user.teams.order(:name) - [@model.team]
|
||||
teams = (Team.order(:name).all - [@model.team]).filter { |t| can_read_team?(t) || @model.private_shared_with?(t) }
|
||||
render json: teams, each_serializer: ShareableTeamSerializer, model: @model
|
||||
end
|
||||
|
||||
|
|
|
@ -37,14 +37,14 @@
|
|||
<template v-for="team in shareableTeams">
|
||||
<div class="col-span-2 flex items-center h-9 gap-1">
|
||||
<span class="sci-checkbox-container" :class="{'opacity-0 pointer-events-none': sharedWithAllRead}">
|
||||
<input type="checkbox" class="sci-checkbox" v-model="team.attributes.private_shared_with" />
|
||||
<input :disabled="!team.attributes.readable" type="checkbox" class="sci-checkbox" v-model="team.attributes.private_shared_with" />
|
||||
<span class="sci-checkbox-label"></span>
|
||||
</span>
|
||||
{{ team.attributes.name }}
|
||||
{{ team.attributes.name || `(${i18n.t('teams.private_team')})` }}
|
||||
</div>
|
||||
<div class="flex justify-center items-center">
|
||||
<span v-if="team.attributes.private_shared_with"
|
||||
:class="{'opacity-0 pointer-events-none': sharedWithAllRead}"
|
||||
:class="{'opacity-0 pointer-events-none': sharedWithAllRead || !team.attributes.readable}"
|
||||
class="sci-toggle-checkbox-container">
|
||||
<input type="checkbox"
|
||||
class="sci-toggle-checkbox"
|
||||
|
|
|
@ -192,12 +192,13 @@ export default {
|
|||
}
|
||||
|
||||
this.savingLocaiton = true;
|
||||
|
||||
|
||||
const params = {
|
||||
name: this.object.name,
|
||||
description: this.object.description,
|
||||
signed_blob_id: this.object.signed_blob_id,
|
||||
container: this.object.container
|
||||
container: this.object.container,
|
||||
file_name: this.object.file_name || this.attachedImage?.name
|
||||
};
|
||||
|
||||
if (this.object.container) {
|
||||
|
|
|
@ -2,8 +2,17 @@
|
|||
|
||||
class ShareableTeamSerializer < ActiveModel::Serializer
|
||||
include Rails.application.routes.url_helpers
|
||||
include Canaid::Helpers::PermissionsHelper
|
||||
|
||||
attributes :id, :name, :private_shared_with, :private_shared_with_write
|
||||
attributes :id, :name, :readable, :private_shared_with, :private_shared_with_write
|
||||
|
||||
def name
|
||||
readable && object.name
|
||||
end
|
||||
|
||||
def readable
|
||||
can_read_team?(object)
|
||||
end
|
||||
|
||||
def private_shared_with
|
||||
model.private_shared_with?(object)
|
||||
|
|
|
@ -13,11 +13,12 @@ class RepositoryDatatableService
|
|||
PREDEFINED_COLUMNS = %w(row_id row_name added_on added_by archived_on archived_by
|
||||
assigned relationships updated_on updated_by).freeze
|
||||
|
||||
def initialize(repository, params, user, my_module = nil, preload_cells: true)
|
||||
def initialize(repository, params, user, my_module = nil, preload_cells: true, disable_reminders: false)
|
||||
@repository = repository
|
||||
@user = user
|
||||
@my_module = my_module
|
||||
@preload_cells = preload_cells
|
||||
@disable_reminders = disable_reminders
|
||||
@params = params
|
||||
@assigned_view = @params[:assigned].in?(%w(assigned assigned_simple))
|
||||
@sortable_columns = build_sortable_columns
|
||||
|
@ -79,7 +80,7 @@ class RepositoryDatatableService
|
|||
end
|
||||
end
|
||||
|
||||
if Repository.reminders_enabled?
|
||||
if Repository.reminders_enabled? && !@disable_reminders
|
||||
repository_rows =
|
||||
if @repository.archived? || @repository.is_a?(RepositorySnapshot)
|
||||
# don't load reminders for archived repositories or snapshots
|
||||
|
|
|
@ -1028,7 +1028,8 @@ en:
|
|||
guest: "Guest"
|
||||
normal_user: "Normal user"
|
||||
admin: "Administrator"
|
||||
|
||||
teams:
|
||||
private_team: "Private team"
|
||||
user_projects:
|
||||
view_users:
|
||||
modal_title: "Members of %{name}"
|
||||
|
|
Loading…
Reference in a new issue