user can lock a dashboard to prevent changing a dashboard or deleting a dashboard by mistake

This commit is contained in:
Alexander Meindl 2023-03-05 19:09:16 +01:00
parent aacee17b69
commit 4a850ea2e8
23 changed files with 147 additions and 64 deletions

View File

@ -169,10 +169,16 @@ module DashboardsHelper
end
end
def delete_dashboard_link(url)
options = { method: :delete,
data: { confirm: l(:text_are_you_sure) },
class: 'icon icon-del' }
def delete_dashboard_link(url, dashboard)
options = { class: +'icon icon-del' }
if dashboard.locked?
options[:title] = l :label_dashboard_lock_is_active
options[:class] << ' disabled'
url = '#'
else
options[:method] = :delete
options[:data] = { confirm: l(:text_are_you_sure) }
end
link_to l(:button_dashboard_delete), url, options
end
@ -214,7 +220,7 @@ module DashboardsHelper
content = render_dashboard_block_content block, block_definition, dashboard, **overwritten_settings
return if content.blank?
if dashboard.editable?
if dashboard.editable? && !dashboard.locked?
icons = []
if block_definition[:no_settings].blank? &&
(!block_definition.key?(:with_settings_if) || block_definition[:with_settings_if].call(@project))

View File

@ -30,7 +30,7 @@ class Dashboard < ActiveRecord::Base
scope :project_only, (-> { where dashboard_type: DashboardContentProject::TYPE_NAME })
safe_attributes 'name', 'description', 'enable_sidebar',
'always_expose', 'project_id', 'author_id',
'locked', 'always_expose', 'project_id', 'author_id',
if: (lambda do |dashboard, user|
dashboard.new_record? ||
user.allowed_to?(:save_dashboards, dashboard.project, global: true)
@ -56,6 +56,7 @@ class Dashboard < ActiveRecord::Base
before_save :dashboard_type_check, :visibility_check, :set_options_hash, :clear_unused_block_settings
before_destroy :check_locked
before_destroy :check_destroy_system_default
after_save :update_system_defaults
after_save :remove_unused_role_relations
@ -384,6 +385,10 @@ class Dashboard < ActiveRecord::Base
raise ProjectSystemDefaultChangeException if project_id.present?
end
def check_locked
raise 'It is not allowed to delete dashboard, because it is locked' if locked?
end
def check_destroy_system_default
raise 'It is not allowed to delete dashboard, which is system default' unless deletable?
end

View File

@ -49,6 +49,8 @@
= hidden_field_tag 'dashboard[role_ids][]', ''
.splitcontentright
p
= f.check_box :locked, label: :field_dashboard_locked
p
= f.check_box :enable_sidebar

View File

@ -5,8 +5,11 @@
= call_hook :view_project_contextual_links, project: @project
- if @dashboard&.editable?
= form_tag _add_block_dashboard_path(@project, @dashboard), remote: true, id: 'block-form', authenticity_token: true do
= dashboard_block_select_tag @dashboard
- if @dashboard.locked?
= font_awesome_icon 'dashboard-locked fas_lock', title: l(:label_dashboard_lock_is_active)
- else
= form_tag _add_block_dashboard_path(@project, @dashboard), remote: true, id: 'block-form', authenticity_token: true do
= dashboard_block_select_tag @dashboard
= actions_dropdown do
- if User.current.allowed_to? :add_subprojects, @project
@ -45,7 +48,7 @@
class: 'icon icon-edit'
- if @dashboard&.deletable?
= delete_dashboard_link project_dashboard_path(@project, @dashboard)
= delete_dashboard_link project_dashboard_path(@project, @dashboard), @dashboard
= sidebar_action_toggle @dashboard_sidebar, @dashboard, @project
= render_dashboard_actionlist @dashboard, @project unless @dashboard_sidebar

View File

@ -4,8 +4,11 @@
= call_hook :view_welcome_contextual_links
- if @dashboard&.editable?
= form_tag add_block_dashboard_path(@dashboard), remote: true, id: 'block-form', authenticity_token: true do
= dashboard_block_select_tag @dashboard
- if @dashboard.locked?
= font_awesome_icon 'dashboard-locked fas_lock', title: l(:label_dashboard_lock_is_active)
- else
= form_tag add_block_dashboard_path(@dashboard), remote: true, id: 'block-form', authenticity_token: true do
= dashboard_block_select_tag @dashboard
= actions_dropdown do
- if User.current.allowed_to? :save_dashboards, nil, global: true
@ -17,7 +20,7 @@
edit_dashboard_path(@dashboard),
class: 'icon icon-edit'
- if @dashboard&.deletable?
= delete_dashboard_link dashboard_path(@dashboard)
= delete_dashboard_link dashboard_path(@dashboard), @dashboard
= sidebar_action_toggle @dashboard_sidebar, @dashboard
= render_dashboard_actionlist @dashboard unless @dashboard_sidebar

View File

@ -21,6 +21,10 @@
font-size: 95%;
}
span.dashboard-locked {
color: #666;
}
#my-page.dashboard .settings input[type='text'],
#my-page.dashboard .settings input[type='password'],
#my-page.dashboard .settings input[type='url'] {

View File

@ -43,6 +43,7 @@ cs:
errors_no_or_invalid_arguments: "Žádné nebo neplatné argumenty"
field_always_expose: "Vždy zobrazit název palubní desky"
field_color: Barva
field_dashboard_locked: Locked
field_enable_new_ticket_message: "Aktivace zprávy o vydání"
field_enable_sidebar: "Aktivace postranního panelu"
field_hide: "Skrýt"
@ -86,6 +87,7 @@ cs:
label_dashboard_block_info_async: "Tento blok se načítá asynchronně a ukládá se do mezipaměti po dobu %{time}."
label_dashboard_legacy_left: "Zbývá standardní obsah"
label_dashboard_legacy_right: "Standardní obsahové právo"
label_dashboard_lock_is_active: Dashboard lock is active
label_dashboard_plural: Dashboards
label_day: den
label_disable_sidebar: "Zakázat sidebar"
@ -111,7 +113,10 @@ cs:
label_issue_change_status: "Změnit stav"
label_issue_change_status_in_sidebar: "Stav vydání na postranním panelu"
label_issue_current_user_status: "Current issue status x is only allowed if \"Assignee\" is the current user."
label_issue_fast_description_edit: "Rychlá úprava popisu"
label_issue_freezed_with_close: "Zakázat úpravy uzavřených čísel (Freeze)"
label_issue_genitive: "Úkol"
label_issue_note_with_author: "Zobrazit autora úlohy s poznámkou"
label_issue_status_change: "If \"Assignee\" is unchanged and the issue status changed from x to y, than the author is assigned to the issue"
label_issue_timelog_required: "Časový záznam potřebných problémů"
label_issues_summary: "Přehled úkolů"
@ -167,6 +172,7 @@ cs:
label_twitter_account: Twitter account
label_twitter_hashtag: Twitter hashtag
label_uptime: Uptime
label_user_is_author_of: "Tento uživatel je autorem tohoto %{entity}."
label_user_list: "Seznam uživatelů"
label_web_apis: Web APIs
label_weekly: "týdně"
@ -201,7 +207,3 @@ cs:
top_wiki_help: "Zde můžete definovat obsah a nastavení vaší Wiki."
wiki_pdf_remove_attachments_info: "Pokud je aktivní, připojené soubory Wiki se nebudou zobrazovat v zobrazení PDF."
wiki_pdf_remove_title_info: "Pokud je aktivní, informace o názvu Wiki se nebudou zobrazovat v zobrazení PDF."
label_user_is_author_of: "Tento uživatel je autorem tohoto %{entity}."
label_issue_genitive: "Úkol"
label_issue_note_with_author: "Zobrazit autora úlohy s poznámkou"
label_issue_fast_description_edit: "Rychlá úprava popisu"

View File

@ -43,6 +43,7 @@ de:
errors_no_or_invalid_arguments: Kein oder ungültiger Parameter
field_always_expose: Dashboard Name immer anzeigen
field_color: Farbe
field_dashboard_locked: Schutz aktivieren
field_enable_new_ticket_message: Aktiviere Hinweistext
field_enable_sidebar: Sidebar aktivieren
field_hide: Verstecken
@ -86,6 +87,7 @@ de:
label_dashboard_block_info_async: Dieser Block wird asynchron geladen und %{time} gecached.
label_dashboard_legacy_left: Standard-Inhalt links
label_dashboard_legacy_right: Standard-Inhalt rechts
label_dashboard_lock_is_active: Dashboard Schutz ist aktiv
label_dashboard_plural: Dashboards
label_day: Tag
label_disable_sidebar: Sidebar deaktivieren
@ -111,7 +113,10 @@ de:
label_issue_change_status: Status ändern
label_issue_change_status_in_sidebar: Ticketstatus über Sidebar
label_issue_current_user_status: "Der Ticketstatus x ist nur erlaubt, wenn \"Zugewiesen an\" der aktuelle Benutzer zugewiesen wird."
label_issue_fast_description_edit: Schnellbearbeitung Beschreibung
label_issue_freezed_with_close: Bearbeitung geschlossener Tickets verbieten (Freeze)
label_issue_genitive: Tickets
label_issue_note_with_author: Ticket-Autor zu Kommentar anzeigen
label_issue_status_change: "Wird \"Zugewiesen an\" nicht verändert und der Ticketstatus von x auf y geändert, dann wird das Ticket automatisch dem Ersteller zugewiesen"
label_issue_timelog_required: Zeiterfassung für Ticket erforderlich
label_issues_summary: Ticket Übersicht
@ -167,6 +172,7 @@ de:
label_twitter_account: Twitter Benutzer
label_twitter_hashtag: Twitter Hashtag
label_uptime: Betriebszeit
label_user_is_author_of: Dieser Benutzer ist der Autor dieses %{entity}.
label_user_list: Benutzerliste
label_web_apis: Web APIs
label_weekly: wöchentlich
@ -201,7 +207,3 @@ de:
top_wiki_help: Hier kannst Du Inhalte und Einstellungen bzg. der Wiki festlegen.
wiki_pdf_remove_attachments_info: Wenn aktiv, werden die an der Wiki Seite angehängten Dateien nicht in der PDF Ansicht angezeigt.
wiki_pdf_remove_title_info: Wenn aktiv, wird der Wiki Titel nicht in der PDF Ansicht angezeigt.
label_user_is_author_of: Dieser Benutzer ist der Autor dieses %{entity}.
label_issue_genitive: Tickets
label_issue_note_with_author: Ticket-Autor zu Kommentar anzeigen
label_issue_fast_description_edit: Schnellbearbeitung Beschreibung

View File

@ -43,6 +43,7 @@ en:
errors_no_or_invalid_arguments: No or invalid arguments
field_always_expose: Always show dashboard name
field_color: Color
field_dashboard_locked: Locked
field_enable_new_ticket_message: Activate issue message
field_enable_sidebar: Enable sidebar
field_hide: Hide
@ -86,6 +87,7 @@ en:
label_dashboard_block_info_async: This block is loaded asynchronous and cached for %{time}.
label_dashboard_legacy_left: "Standard content left"
label_dashboard_legacy_right: "Standard content right"
label_dashboard_lock_is_active: Dashboard lock is active
label_dashboard_plural: Dashboards
label_day: day
label_disable_sidebar: Disable sidebar
@ -111,7 +113,10 @@ en:
label_issue_change_status: Change status
label_issue_change_status_in_sidebar: Issue status on sidebar
label_issue_current_user_status: "Current issue status x is only allowed if \"Assignee\" is the current user."
label_issue_fast_description_edit: Fast edit for description
label_issue_freezed_with_close: Disallow editing of closed issues (Freeze)
label_issue_genitive: issue
label_issue_note_with_author: Show issue author with note
label_issue_status_change: "If \"Assignee\" is unchanged and the issue status changed from x to y, than the author is assigned to the issue"
label_issue_timelog_required: Time log for issues required
label_issues_summary: "Issue summary"
@ -167,6 +172,7 @@ en:
label_twitter_account: Twitter account
label_twitter_hashtag: Twitter hashtag
label_uptime: Uptime
label_user_is_author_of: This user is the author of this %{entity}.
label_user_list: "User list"
label_web_apis: Web APIs
label_weekly: weekly
@ -201,7 +207,3 @@ en:
top_wiki_help: "Here you can define contents and settings for your Wiki."
wiki_pdf_remove_attachments_info: "When active the attached Wiki files will not be displayed in PDF view."
wiki_pdf_remove_title_info: "When active the Wiki title info will not be displayed in PDF view."
label_user_is_author_of: This user is the author of this %{entity}.
label_issue_genitive: issue
label_issue_note_with_author: Show issue author with note
label_issue_fast_description_edit: Fast edit for description

View File

@ -43,6 +43,7 @@ es:
errors_no_or_invalid_arguments: Parámetros inválidos
field_always_expose: "Mostrar siempre el nombre del salpicadero"
field_color: Color
field_dashboard_locked: Locked
field_enable_new_ticket_message: "Activar el mensaje de la empresa"
field_enable_sidebar: "Activar la barra lateral"
field_hide: "Ocultar"
@ -86,6 +87,7 @@ es:
label_dashboard_block_info_async: "Este bloque se carga de forma asíncrona y se almacena en caché durante %{time}."
label_dashboard_legacy_left: "Contenido estándar a la izquierda"
label_dashboard_legacy_right: "Contenido estándar correcto"
label_dashboard_lock_is_active: Dashboard lock is active
label_dashboard_plural: Dashboards
label_day: día
label_disable_sidebar: "Deshabilitar la barra lateral"
@ -111,7 +113,10 @@ es:
label_issue_change_status: Cambiar estado
label_issue_change_status_in_sidebar: Estado de las peticiones en la barra lateral
label_issue_current_user_status: "Estado de la petición actual x solo está permitido si la petición está asignada al usuario actual."
label_issue_fast_description_edit: "Edición rápida para la descripción"
label_issue_freezed_with_close: No permitir editar peticiones cerradas (Congelar)
label_issue_genitive: "problema"
label_issue_note_with_author: "Mostrar autor de tarea con nota"
label_issue_status_change: "Si no se modifica el usuario \"Asignado\" y la el estado de la petición es modificado de x a y, entonces la petición es asignada al autor de la petición"
label_issue_timelog_required: Se requiere Registro de tiempo para las peticiones
label_issues_summary: "Resumen de tareas"
@ -167,6 +172,7 @@ es:
label_twitter_account: Cuenta de Twitter
label_twitter_hashtag: Hashtag de Twitter
label_uptime: Tiempo encendido
label_user_is_author_of: "Este usuario es el autor de esta %{entity}."
label_user_list: "Lista de usuarios"
label_web_apis: Web APIs
label_weekly: semanalmente
@ -201,7 +207,3 @@ es:
top_wiki_help: "Aquí puede definir contenidos y configuracioens para su Wiki."
wiki_pdf_remove_attachments_info: "Cuando está activa, los adjuntos no serán mostrados en los PDF."
wiki_pdf_remove_title_info: "Cuando está activa, el título de la Wiki no será mostrado en los PDF."
label_user_is_author_of: "Este usuario es el autor de esta %{entity}."
label_issue_genitive: "problema"
label_issue_note_with_author: "Mostrar autor de tarea con nota"
label_issue_fast_description_edit: "Edición rápida para la descripción"

View File

@ -43,6 +43,7 @@ fr:
errors_no_or_invalid_arguments: "Pas d'arguments ou arguments invalides"
field_always_expose: "Toujours afficher le nom du tableau de bord"
field_color: Couleur
field_dashboard_locked: Locked
field_enable_new_ticket_message: "Activer le message d'émission"
field_enable_sidebar: Activer le menu latéral
field_hide: "Cacher"
@ -86,6 +87,7 @@ fr:
label_dashboard_block_info_async: "Ce bloc est chargé de manière asynchrone et mis en cache pendant %{time}."
label_dashboard_legacy_left: "Contenu standard à gauche"
label_dashboard_legacy_right: "Droit au contenu standard"
label_dashboard_lock_is_active: Dashboard lock is active
label_dashboard_plural: Tableaux de bord
label_day: Jour
label_disable_sidebar: "Désactiver la sidebar"
@ -111,7 +113,10 @@ fr:
label_issue_change_status: Modifier le statut
label_issue_change_status_in_sidebar: Statuts des tâches dans la bare latérale
label_issue_current_user_status: "L'état actuel du problème x n'est autorisé que si \"Assignee\" est l'utilisateur actuel."
label_issue_fast_description_edit: "Édition rapide pour la description"
label_issue_freezed_with_close: "Interdire l'édition des tâches fermées (freeze)"
label_issue_genitive: "problème"
label_issue_note_with_author: "Afficher l'auteur de la tâche avec une note"
label_issue_status_change: "Si \"Assignee\" est inchangé et que le statut de la question est passé de x à y, l'auteur est assigné à la question."
label_issue_timelog_required: Saisie de temps obligatoire pour une tâche
label_issues_summary: "Aperçu des tâches"
@ -167,6 +172,7 @@ fr:
label_twitter_account: Compte Twitter
label_twitter_hashtag: Hashtag Twitter
label_uptime: Uptime
label_user_is_author_of: "Cet utilisateur est l'auteur de cette %{entity}."
label_user_list: "Liste des utilisateurs"
label_web_apis: APIs Web
label_weekly: hebdomadaire
@ -201,7 +207,3 @@ fr:
top_wiki_help: "Ici vous pouvez définir le contenu et les paramètres de votre Wiki."
wiki_pdf_remove_attachments_info: "Lorsqu'ils sont actifs, les fichiers Wiki joints ne seront pas affichés en vue PDF."
wiki_pdf_remove_title_info: "Lorsqu'elle est active, l'information sur le titre du wiki ne sera pas affichée dans la vue PDF."
label_user_is_author_of: "Cet utilisateur est l'auteur de cette %{entity}."
label_issue_genitive: "problème"
label_issue_note_with_author: "Afficher l'auteur de la tâche avec une note"
label_issue_fast_description_edit: "Édition rapide pour la description"

View File

@ -43,6 +43,7 @@ it:
errors_no_or_invalid_arguments: No o non valido argomenti
field_always_expose: "Mostra sempre il nome del portale"
field_color: Colore
field_dashboard_locked: Locked
field_enable_new_ticket_message: "Attivare il messaggio del task"
field_enable_sidebar: Enable sidebar
field_hide: "Nascondi"
@ -86,6 +87,7 @@ it:
label_dashboard_block_info_async: "Questo blocco viene caricato in modo asincrono e memorizzato nella cache per %{time}."
label_dashboard_legacy_left: "Contenuto standard a sinistra"
label_dashboard_legacy_right: "Contenuto standard a destra"
label_dashboard_lock_is_active: Dashboard lock is active
label_dashboard_plural: Dashboards
label_day: giorno
label_disable_sidebar: "Disattivare la barra laterale"
@ -111,7 +113,10 @@ it:
label_issue_change_status: Modifica issue stato
label_issue_change_status_in_sidebar: Stato della questione sulla barra laterale
label_issue_current_user_status: "Lo stato attuale della questione x è permesso solo se \"Assignee\" è l'utente corrente."
label_issue_fast_description_edit: "Modifica rapida della descrizione"
label_issue_freezed_with_close: "Impedire la modifica dei problemi chiusi (Freeze)"
label_issue_genitive: tema
label_issue_note_with_author: "Mostra l'autore dell'attività con una nota"
label_issue_status_change: "Se \"Assignee\" è invariato e lo stato della questione è cambiato da x a y, allora l'autore è assegnato alla questione"
label_issue_timelog_required: "Time log per i problemi richiesti"
label_issues_summary: "Panoramica delle task"
@ -167,6 +172,7 @@ it:
label_twitter_account: Twitter account
label_twitter_hashtag: Twitter hashtag
label_uptime: Uptime
label_user_is_author_of: "Questo utente è l'autore di questo %{entity}."
label_user_list: "Lista utenti"
label_web_apis: Web APIs
label_weekly: settimanalmente
@ -201,7 +207,3 @@ it:
top_wiki_help: "Qui puoi definire contenuti e impostazioni per il tuo Wiki."
wiki_pdf_remove_attachments_info: "Quando è attivo, il Wiki file allegati non verranno visualizzati nella vista PDF."
wiki_pdf_remove_title_info: "Quando è attivo, le informazioni sul titolo del Wiki non verranno visualizzate nella vista PDF."
label_user_is_author_of: "Questo utente è l'autore di questo %{entity}."
label_issue_genitive: tema
label_issue_note_with_author: "Mostra l'autore dell'attività con una nota"
label_issue_fast_description_edit: "Modifica rapida della descrizione"

View File

@ -43,6 +43,7 @@ ja:
errors_no_or_invalid_arguments: "引数がない、または無効な引数"
field_always_expose: "ダッシュボード名を常に表示する"
field_color: "カラー"
field_dashboard_locked: Locked
field_enable_new_ticket_message: "タスク起動メッセージ"
field_enable_sidebar: "サイドバーを有効にする"
field_hide: Hide
@ -86,6 +87,7 @@ ja:
label_dashboard_block_info_async: のために非同期でブロックがロードされ、キャッシュされます %{time}.
label_dashboard_legacy_left: "標準インハルト左"
label_dashboard_legacy_right: "標準コンテンツの権利"
label_dashboard_lock_is_active: Dashboard lock is active
label_dashboard_plural: Dashboards
label_day: "日"
label_disable_sidebar: "サイドバーを無効にする"
@ -111,7 +113,10 @@ ja:
label_issue_change_status: Change status
label_issue_change_status_in_sidebar: Issue status on sidebar
label_issue_current_user_status: "Current issue status x is only allowed if \"Assignee\" is the current user."
label_issue_fast_description_edit: "描写のための高速編集"
label_issue_freezed_with_close: Disallow editing of closed issues (Freeze)
label_issue_genitive: "タスク"
label_issue_note_with_author: "タスクの作者とメモを表示する"
label_issue_status_change: "If \"Assignee\" is unchanged and the issue status changed from x to y, than the author is assigned to the issue"
label_issue_timelog_required: "タスクに必要な時間予約"
label_issues_summary: "タスクの概要"
@ -167,6 +172,7 @@ ja:
label_twitter_account: Twitter アカウント
label_twitter_hashtag: Twitter ハッシュタグ
label_uptime: Uptime
label_user_is_author_of: "このユーザーは、この %{entity}."
label_user_list: "ユーザ一覧"
label_web_apis: Web APIs
label_weekly: "毎週"
@ -201,7 +207,3 @@ ja:
top_wiki_help: "ここでは、Wikiの内容や設定を定義することができます。"
wiki_pdf_remove_attachments_info: "アクティブな場合、添付されたWikiファイルはPDFビューに表示されません。"
wiki_pdf_remove_title_info: "アクティブな場合、Wikiのタイトル情報はPDFビューに表示されません。"
label_user_is_author_of: "このユーザーは、この %{entity}."
label_issue_genitive: "タスク"
label_issue_note_with_author: "タスクの作者とメモを表示する"
label_issue_fast_description_edit: "描写のための高速編集"

View File

@ -43,6 +43,7 @@ ko:
errors_no_or_invalid_arguments: "인수가 없거나 유효하지 않습니다"
field_always_expose: "항상 대시보드 이름 표시"
field_color: 색깔
field_dashboard_locked: Locked
field_enable_new_ticket_message: "작업 메시지 활성화"
field_enable_sidebar: 사이드바 표시
field_hide: 숨는 장소
@ -86,6 +87,7 @@ ko:
label_dashboard_block_info_async: "이 블록은 비동기식으로 로드되며 %{time}에 대해 캐시됩니다."
label_dashboard_legacy_left: "표준 콘텐츠 왼쪽"
label_dashboard_legacy_right: "표준 콘텐츠 권리"
label_dashboard_lock_is_active: Dashboard lock is active
label_dashboard_plural: Dashboards
label_day:
label_disable_sidebar: "사이드바 비활성화"
@ -111,7 +113,10 @@ ko:
label_issue_change_status: 상태 변경
label_issue_change_status_in_sidebar: 사이드 바의 발행 상태
label_issue_current_user_status: "Current issue status x is only allowed if \"Assignee\" is the current user."
label_issue_fast_description_edit: "빠른 설명 편집"
label_issue_freezed_with_close: 닫힌 이슈 편집 금지 (고정)
label_issue_genitive: "일"
label_issue_note_with_author: "메모와 함께 작업 작성자 표시"
label_issue_status_change: "If \"Assignee\" is unchanged and the issue status changed from x to y, than the author is assigned to the issue"
label_issue_timelog_required: 필요한 문제에 대한 시간 로그
label_issues_summary: "작업 개요 "
@ -167,6 +172,7 @@ ko:
label_twitter_account: Twitter account
label_twitter_hashtag: Twitter hashtag
label_uptime: 가동 시간
label_user_is_author_of: "이 사용자는 이 글의 작성자입니다 %{entity}."
label_user_list: "사용자 목록"
label_web_apis: Web APIs
label_weekly: 주간
@ -201,7 +207,3 @@ ko:
top_wiki_help: 여기에서 위키의 내용과 설정을 정의 할 수 있습니다.
wiki_pdf_remove_attachments_info: 활성화 된 경우 첨부 된 Wiki 파일은 PDF보기에 표시되지 않습니다.
wiki_pdf_remove_title_info: 활성화되면 위키 제목 정보가 PDF보기에 표시되지 않습니다.
label_user_is_author_of: "이 사용자는 이 글의 작성자입니다 %{entity}."
label_issue_genitive: "일"
label_issue_note_with_author: "메모와 함께 작업 작성자 표시"
label_issue_fast_description_edit: "빠른 설명 편집"

View File

@ -43,6 +43,7 @@ pl:
errors_no_or_invalid_arguments: "Brak lub nieważne argumenty"
field_always_expose: "Zawsze pokazuj nazwę pulpitu"
field_color: Kolor
field_dashboard_locked: Locked
field_enable_new_ticket_message: "Aktywuj komunikat o zleceniu"
field_enable_sidebar: "Aktywuj pasek boczny"
field_hide: "Ukryć się"
@ -86,6 +87,7 @@ pl:
label_dashboard_block_info_async: "Ten blok jest ładowany asynchronicznie i buforowany przez %{time}."
label_dashboard_legacy_left: "Zawartość standardowa lewy"
label_dashboard_legacy_right: "Zawartość standardowa prawa"
label_dashboard_lock_is_active: Dashboard lock is active
label_dashboard_plural: Dashboards
label_day: "dzień"
label_disable_sidebar: "Wyłączyć pasek boczny"
@ -111,7 +113,10 @@ pl:
label_issue_change_status: "Zmiana statusu"
label_issue_change_status_in_sidebar: "Status Issue na pasku bocznym"
label_issue_current_user_status: "Bieżący status sprawy x jest dozwolony tylko wtedy, gdy \"Assignee\" jest bieżącym użytkownikiem."
label_issue_fast_description_edit: "Szybka edycja do opisu"
label_issue_freezed_with_close: "Uniemożliwienie edycji zamkniętych issues (Freeze)"
label_issue_genitive: issue
label_issue_note_with_author: "Pokaż autora zadania z notatką"
label_issue_status_change: "Jeśli status \"Assignee\" jest niezmieniony, a status sprawy zmienił się z x na y, to autor jest przypisany do sprawy"
label_issue_timelog_required: "Wymagany jest dziennik czasowy dla issues"
label_issues_summary: "Przegląd zadań"
@ -167,6 +172,7 @@ pl:
label_twitter_account: Twitter konto
label_twitter_hashtag: Twitter hashtag
label_uptime: Uptime
label_user_is_author_of: "Ten użytkownik jest autorem tego %{entity}."
label_user_list: "Lista użytkowników"
label_web_apis: Web APIs
label_weekly: tygodnik
@ -201,7 +207,3 @@ pl:
top_wiki_help: "Tutaj możesz zdefiniować zawartość i ustawienia dla swojej Wiki."
wiki_pdf_remove_attachments_info: "Gdy jest aktywny, załączone pliki Wiki nie będą wyświetlane w widoku PDF."
wiki_pdf_remove_title_info: "Gdy jest aktywny, informacja o tytule Wiki nie będzie wyświetlana w widoku PDF."
label_user_is_author_of: "Ten użytkownik jest autorem tego %{entity}."
label_issue_genitive: issue
label_issue_note_with_author: "Pokaż autora zadania z notatką"
label_issue_fast_description_edit: "Szybka edycja do opisu"

View File

@ -43,6 +43,7 @@ pt-BR:
errors_no_or_invalid_arguments: "Nenhum argumento ou argumentos inválidos"
field_always_expose: "Mostrar sempre o nome do painel de bordo"
field_color: "Cor"
field_dashboard_locked: Locked
field_enable_new_ticket_message: "Ativar mensagem de tarefa"
field_enable_sidebar: "Habilitar barra lateral"
field_hide: "Esconder"
@ -86,6 +87,7 @@ pt-BR:
label_dashboard_block_info_async: "Este bloco é carregado assíncrono e colocado em cache por %{time}."
label_dashboard_legacy_left: "Conteúdo padrão restante"
label_dashboard_legacy_right: "Direito de conteúdo padrão"
label_dashboard_lock_is_active: Dashboard lock is active
label_dashboard_plural: Dashboards
label_day: dia
label_disable_sidebar: "Desativar sidebar"
@ -111,7 +113,10 @@ pt-BR:
label_issue_change_status: "Mudança de status"
label_issue_change_status_in_sidebar: "Status da tarefa na barra lateral"
label_issue_current_user_status: "O status atual de tarifa x só é permitido se \"Assignee\" for o usuário atual."
label_issue_fast_description_edit: "Edição rápida para descrição"
label_issue_freezed_with_close: "Proibir a edição de tarefas fechadas (Congelamento)"
label_issue_genitive: "Tarefa"
label_issue_note_with_author: "Mostrar autor da tarefa com nota"
label_issue_status_change: "Se \"Assignee\" é inalterado e o status da tarefa mudou de x para y, do que o autor é designado para a tarefa"
label_issue_timelog_required: "Registro de tempo para as tarefas necessárias"
label_issues_summary: "Resumo das tarefas"
@ -167,6 +172,7 @@ pt-BR:
label_twitter_account: Twitter account
label_twitter_hashtag: Twitter hashtag
label_uptime: "Horário de funcionamento"
label_user_is_author_of: "Este usuário é o autor deste %{entity}."
label_user_list: "Lista de usuários"
label_web_apis: Web APIs
label_weekly: "semanalmente"
@ -201,7 +207,3 @@ pt-BR:
top_wiki_help: "Aqui você pode definir conteúdos e configurações para seu Wiki."
wiki_pdf_remove_attachments_info: "Quando ativo, os arquivos Wiki anexos não serão exibidos na visualização em PDF."
wiki_pdf_remove_title_info: "Quando ativo, o título do Wiki não será exibido na visualização em PDF."
label_user_is_author_of: "Este usuário é o autor deste %{entity}."
label_issue_genitive: "Tarefa"
label_issue_note_with_author: "Mostrar autor da tarefa com nota"
label_issue_fast_description_edit: "Edição rápida para descrição"

View File

@ -43,6 +43,7 @@ ru:
errors_no_or_invalid_arguments: "Нет или недействительные аргументы"
field_always_expose: "Всегда показать название приборной панели"
field_color: Color
field_dashboard_locked: Locked
field_enable_new_ticket_message: "Активировать сообщение о задании"
field_enable_sidebar: "Активировать боковую панель"
field_hide: "Спрятать"
@ -86,6 +87,7 @@ ru:
label_dashboard_block_info_async: "Этот блок загружается асинхронно и кэшируется на %{time}."
label_dashboard_legacy_left: "Стандарт-Инхальт налево"
label_dashboard_legacy_right: "Стандартное право на контент"
label_dashboard_lock_is_active: Dashboard lock is active
label_dashboard_plural: Dashboards
label_day: "день"
label_disable_sidebar: "отключить боковую панель"
@ -111,7 +113,10 @@ ru:
label_issue_change_status: "Изменить статус"
label_issue_change_status_in_sidebar: "Состояние вопроса на боковой панели"
label_issue_current_user_status: "Current issue status x is only allowed if \"Assignee\" is the current user."
label_issue_fast_description_edit: "Быстрая правка для описания"
label_issue_freezed_with_close: "Запрет редактирования закрытых заданий (Freeze)"
label_issue_genitive: "Задание"
label_issue_note_with_author: "Показать автора задачи с примечанием"
label_issue_status_change: "If \"Assignee\" is unchanged and the issue status changed from x to y, than the author is assigned to the issue"
label_issue_timelog_required: "Бронирование времени, необходимого для выполнения задания"
label_issues_summary: "Обзор задач"
@ -167,6 +172,7 @@ ru:
label_twitter_account: Twitter account
label_twitter_hashtag: Twitter hashtag
label_uptime: Uptime
label_user_is_author_of: "Этот пользователь является автором этого %{entity}."
label_user_list: "Список пользователей"
label_web_apis: Web APIs
label_weekly: "еженедельно"
@ -201,7 +207,3 @@ ru:
top_wiki_help: "Здесь вы можете определить содержимое и настройки для вашей Вики."
wiki_pdf_remove_attachments_info: "Если флажок установлен, вложенные Вики-файлы не будут отображаться в PDF-формате."
wiki_pdf_remove_title_info: "При активации этого параметра информация о названии Вики не будет отображаться в PDF-формате."
label_user_is_author_of: "Этот пользователь является автором этого %{entity}."
label_issue_genitive: "Задание"
label_issue_note_with_author: "Показать автора задачи с примечанием"
label_issue_fast_description_edit: "Быстрая правка для описания"

View File

@ -43,6 +43,7 @@
errors_no_or_invalid_arguments: "參數無效或不存在。"
field_always_expose: "始终显示仪表盘名称"
field_color: 顏色
field_dashboard_locked: Locked
field_enable_new_ticket_message: "激活任务信息"
field_enable_sidebar: "激活侧边栏"
field_hide: Hide
@ -86,6 +87,7 @@
label_dashboard_block_info_async: This block is loaded asynchronous and cached for %{time}.
label_dashboard_legacy_left: "Standard-Inhalt left"
label_dashboard_legacy_right: "Standard content right"
label_dashboard_lock_is_active: Dashboard lock is active
label_dashboard_plural: Dashboards
label_day:
label_disable_sidebar: Disable sidebar
@ -111,7 +113,10 @@
label_issue_change_status: Change status
label_issue_change_status_in_sidebar: Issue status on sidebar
label_issue_current_user_status: " \"被分派者\"為目前用戶時,議題狀態只能被設定為 X 。"
label_issue_fast_description_edit: "快速编辑描述"
label_issue_freezed_with_close: Disallow editing of closed issues (Freeze)
label_issue_genitive: "问题"
label_issue_note_with_author: "显示任务的作者与注释"
label_issue_status_change: "若未修改 \"被分派者\" ,且議題狀態要從 X 變更為 Y ,則該議題必須被分派給議題作者。"
label_issue_timelog_required: "所需问题的时间记录"
label_issues_summary: "任务概述"
@ -167,6 +172,7 @@
label_twitter_account: "Twitter 帳號"
label_twitter_hashtag: "Twitter #標籤"
label_uptime: "上線時間"
label_user_is_author_of: "这个用户是这个的作者 %{entity}."
label_user_list: "用戶列表"
label_web_apis: Web APIs
label_weekly: "每周"
@ -201,7 +207,3 @@
top_wiki_help: "您可以在此自訂Wiki的內容和設定。"
wiki_pdf_remove_attachments_info: "當啟用時Wiki附件將不會顯示在PDF中。"
wiki_pdf_remove_title_info: "當啟用時Wiki標題訊息不會顯示在PDF中"
label_user_is_author_of: "这个用户是这个的作者 %{entity}."
label_issue_genitive: "问题"
label_issue_note_with_author: "显示任务的作者与注释"
label_issue_fast_description_edit: "快速编辑描述"

View File

@ -43,6 +43,7 @@ zh:
errors_no_or_invalid_arguments: 参数无效或不存在。
field_always_expose: 始终显示仪表盘名称
field_color: 颜色
field_dashboard_locked: Locked
field_enable_new_ticket_message: "激活任务信息"
field_enable_sidebar: 启用侧边栏
field_hide: 隐藏
@ -86,6 +87,7 @@ zh:
label_dashboard_block_info_async: This block is loaded asynchronous and cached for %{time}.
label_dashboard_legacy_left: "标准左侧内容"
label_dashboard_legacy_right: "标准右侧内容"
label_dashboard_lock_is_active: Dashboard lock is active
label_dashboard_plural: 仪表盘
label_day:
label_disable_sidebar: 禁用侧边栏
@ -111,7 +113,10 @@ zh:
label_issue_change_status: 更新问题状态
label_issue_change_status_in_sidebar: 在侧边栏显示更新问题状态
label_issue_current_user_status: "当前问题状态 X 仅在 \"指派给\" 的值设置为当前用户时生效。"
label_issue_fast_description_edit: "快速编辑描述"
label_issue_freezed_with_close: 禁止修改已关闭的问题 (冻结)
label_issue_genitive: "问题"
label_issue_note_with_author: "显示任务的作者与注释"
label_issue_status_change: "若 \"指派给\" 的值未修改,且问题状态要从 X 变更为 Y那么该问题必须指派给问题作者自己。"
label_issue_timelog_required: 问题需要登记工时
label_issues_summary: "任务概述"
@ -167,6 +172,7 @@ zh:
label_twitter_account: Twitter 账号
label_twitter_hashtag: Twitter 哈希标签
label_uptime: 上线时间
label_user_is_author_of: "这个用户是这个的作者 %{entity}."
label_user_list: "用户列表"
label_web_apis: Web APIs
label_weekly: 每周
@ -201,7 +207,3 @@ zh:
top_wiki_help: 您可以在此定义 Wiki 的内容及设置。
wiki_pdf_remove_attachments_info: 当启用时Wiki 附件将不会显示在 PDF 视图中。
wiki_pdf_remove_title_info: 当启用时Wiki 标题信息将不会显示在 PDF 视图中。
label_user_is_author_of: "这个用户是这个的作者 %{entity}."
label_issue_genitive: "问题"
label_issue_note_with_author: "显示任务的作者与注释"
label_issue_fast_description_edit: "快速编辑描述"

View File

@ -0,0 +1,7 @@
# frozen_string_literal: true
class AddLockedToDashboards < ActiveRecord::Migration[6.1]
def change
add_column :dashboards, :locked, :boolean, default: false, null: false
end
end

View File

@ -0,0 +1,8 @@
# frozen_string_literal: true
class ActivateLockedForSystemDefaultDashboards < ActiveRecord::Migration[6.1]
def up
Dashboard.where(system_default: true, project_id: nil)
.update_all locked: true
end
end

View File

@ -2,6 +2,7 @@ system_default_welcome:
name: Global default dashboard
dashboard_type: <%= DashboardContentWelcome::TYPE_NAME %>
system_default: true
locked: true
enable_sidebar: false
author_id: 1
visibility: 2
@ -35,6 +36,7 @@ system_default_project:
name: Project default dashboard
dashboard_type: <%= DashboardContentProject::TYPE_NAME %>
system_default: true
locked: true
enable_sidebar: true
project_id:
author_id: 1
@ -64,6 +66,7 @@ system_default_defined_project:
name: Project default dashboard only for Project 2
dashboard_type: <%= DashboardContentProject::TYPE_NAME %>
system_default: true
locked: false
enable_sidebar: true
project_id: 2
author_id: 1
@ -83,6 +86,7 @@ system_default_defined_project:
private_welcome:
name: Only for user 1
dashboard_type: <%= DashboardContentWelcome::TYPE_NAME %>
locked: false
enable_sidebar: true
author_id: 1
visibility: 0
@ -98,6 +102,7 @@ private_welcome:
private_welcome2:
name: Only for user 2
dashboard_type: <%= DashboardContentWelcome::TYPE_NAME %>
locked: false
author_id: 2
visibility: 0
options: |
@ -112,6 +117,7 @@ private_welcome2:
private_project_default:
name: Private project default
dashboard_type: <%= DashboardContentProject::TYPE_NAME %>
locked: false
project_id:
author_id: 1
visibility: 0
@ -119,6 +125,7 @@ private_project_default:
public_project:
name: Public project for all project, but no system default
dashboard_type: <%= DashboardContentProject::TYPE_NAME %>
locked: false
project_id:
author_id: 1
visibility: 2
@ -126,6 +133,7 @@ public_project:
private_project:
name: Private project for user 1
dashboard_type: <%= DashboardContentProject::TYPE_NAME %>
locked: false
project_id: 1
author_id: 1
visibility: 0
@ -133,6 +141,7 @@ private_project:
private_project2:
name: Private project for user 2
dashboard_type: <%= DashboardContentProject::TYPE_NAME %>
locked: false
project_id: 1
author_id: 2
visibility: 0
@ -140,11 +149,13 @@ private_project2:
public_welcome:
name: Public welcome
dashboard_type: <%= DashboardContentWelcome::TYPE_NAME %>
locked: false
author_id: 1
visibility: 2
welcome_for_roles:
name: Welcome for roles
dashboard_type: <%= DashboardContentWelcome::TYPE_NAME %>
locked: false
author_id: 1
visibility: 1

View File

@ -176,6 +176,14 @@ class DashboardTest < Additionals::TestCase
end
end
def test_locked_dashboard_should_not_be_deletable
dashboard = dashboards :system_default_defined_project
assert_raise Exception do
dashboard.destroy
end
end
def test_dashboard_with_unique_name_scope
dashboard = Dashboard.new(dashboard_type: DashboardContentProject::TYPE_NAME,
author_id: 2,