From f9d21b57809417b07a511a0b017ae6db5dc0cd19 Mon Sep 17 00:00:00 2001
From: antoine37120 <ant.dupre@gmail.com>
Date: Tue, 16 Jan 2024 15:44:20 +0100
Subject: [PATCH] fix: disabled files author field on edit

---
 src/styles/index.scss    |  4 ++++
 src/views-terrytories.js | 20 +++++++++++---------
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/src/styles/index.scss b/src/styles/index.scss
index 9de63ac..2c73203 100644
--- a/src/styles/index.scss
+++ b/src/styles/index.scss
@@ -342,6 +342,10 @@ solid-form {
     -webkit-tap-highlight-color: var(--color-secondary);
   }
 }
+.form input[type=text][disabled] {
+  color: #a9a7a7;
+  cursor: not-allowed;
+}
 .white-space-normal {
   white-space: normal!important;
 }
diff --git a/src/views-terrytories.js b/src/views-terrytories.js
index 7314cb9..e1c6ac3 100644
--- a/src/views-terrytories.js
+++ b/src/views-terrytories.js
@@ -223,7 +223,13 @@ import("./utils.js").then((utils) => {
                             >
                           </solid-conversation>
                           </template>
-                  </solid-widget>
+                </solid-widget>
+                <solid-widget name="tzcld-shared-files-author-input">
+                  <template>
+                  <label>Auteur *</label>
+                  <input type="text" value="\${value}" disabled>
+                  </template>
+          </solid-widget>
                 `;
                 return render;
               }
@@ -1297,7 +1303,7 @@ import("./utils.js").then((utils) => {
                         </div>
                         <solid-form 
                           onsubmit="javascript:history.back();"
-                          fields="segment1(segment2(title(title_prefix), segment3(name, document), segment4(author)))" 
+                          fields="segment1(segment2(title(title_prefix), segment3(name, document), segment4(author.name)))" 
                           class="segment block whitespace-normal form" 
                           class-visible="hidden"
                           value-visible="admins"
@@ -1308,7 +1314,7 @@ import("./utils.js").then((utils) => {
 
                           class-date="segment margin-bottom-medium half sm-full padding-right-small sm-padding-none text-small text-semibold text-color-heading whitespace-normal text-xlarge"
                           class-document="segment margin-bottom-medium half sm-full padding-right-small sm-padding-none text-xlarge text-semibold text-color-heading text-top"
-                          class-author="segment margin-bottom-medium half sm-full padding-right-small sm-padding-none text-xlarge text-semibold text-color-heading text-top"
+                          class-author.name="segment margin-bottom-medium half sm-full padding-right-small sm-padding-none text-xlarge text-semibold text-color-heading text-top"
                           class-name="segment margin-bottom-medium half sm-full padding-right-small sm-padding-none text-small text-semibold text-color-heading whitespace-normal text-xlarge text-top"
 
                           widget-title="h2"
@@ -1320,14 +1326,11 @@ import("./utils.js").then((utils) => {
 
 
                           label-name="Titre *"
-                          label-document="Docmuent *"
-                          label-author="Autheur *"
+                          label-document="Document *"
 
                           widget-date="solid-form-date-label"
                           widget-subject="solid-form-textarea-label"
-                          widget-author="solid-form-dropdown-autocompletion-label"
-                          order-asc-author="username"
-                          range-author="${this.rangeUser}"
+                          widget-author.name="tzcld-shared-files-author-input"
                           loader-id="loader-${this.route}-${utils.TZCLD_URLS.my_territory_shared_files_edit}-${nested}"
                           bind-resources="" 
                           solid-resource=""
@@ -1338,7 +1341,6 @@ import("./utils.js").then((utils) => {
                                                     
                           required-document
                           required-name
-                          required-author
                         >
                         </solid-form>
                       </div>
-- 
GitLab