Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
synergy-components
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
synergy-components
Commits
c26e0ba3
Commit
c26e0ba3
authored
Aug 19, 2026
by
Samir Sadyhov
🤔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix DocumentAttachments.js
parent
709345c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
constructor/scripts/documentAttachments/documentAttachments.css
...uctor/scripts/documentAttachments/documentAttachments.css
+4
-0
constructor/scripts/documentAttachments/documentAttachments.js
...ructor/scripts/documentAttachments/documentAttachments.js
+26
-0
No files found.
constructor/scripts/documentAttachments/documentAttachments.css
View file @
c26e0ba3
...
...
@@ -14,6 +14,10 @@
align-items
:
center
;
}
#workflow_add_file_button
.uk-disabled
{
opacity
:
0.4
;
}
.workflow-context-menu
{
position
:
absolute
;
display
:
none
;
...
...
constructor/scripts/documentAttachments/documentAttachments.js
View file @
c26e0ba3
...
...
@@ -14,6 +14,23 @@ const getMenuCoordinates = (menu, pageX, pageY) => {
return
coordinates
;
}
const
canEditFile
=
async
(
documentID
)
=>
{
return
new
Promise
(
async
resolve
=>
{
try
{
const
{
login
,
password
}
=
Cons
.
creds
;
const
auth
=
"
Basic
"
+
btoa
(
unescape
(
encodeURIComponent
(
`
${
login
}
:
${
password
}
`
)));
const
url
=
`../Synergy/rest/api/storage/canEditFile?documentId=
${
documentID
}
`
;
const
response
=
await
fetch
(
url
,
{
method
:
'
GET
'
,
headers
:
{
"
Authorization
"
:
auth
}});
if
(
!
response
.
ok
)
throw
new
Error
(
await
response
.
text
());
resolve
(
response
.
text
());
}
catch
(
err
)
{
console
.
log
(
`ERROR [ canEditFile ]:
${
err
.
message
}
`
);
resolve
(
false
);
}
});
}
this
.
DocumentAttachments
=
class
{
constructor
(
documentID
,
container
,
notEditable
=
false
){
this
.
documentID
=
documentID
;
...
...
@@ -227,6 +244,8 @@ this.DocumentAttachments = class {
this
.
tabContainer
.
append
(
this
.
addFileButton
,
this
.
workflowTabs
);
}
if
(
this
.
canEdit
==
"
false
"
)
this
.
addFileButton
.
addClass
(
'
uk-disabled
'
);
this
.
rootContainer
.
append
(
this
.
tabContainer
,
this
.
filesContainer
);
this
.
container
.
append
(
this
.
rootContainer
);
...
...
@@ -249,6 +268,11 @@ this.DocumentAttachments = class {
this
.
filesWorkContainer
.
removeClass
(
'
active
'
);
this
.
tabWorkContainer
.
removeClass
(
'
active
'
);
this
.
path
=
"
ase:attachmentContainer
"
;
if
(
this
.
canEdit
==
"
false
"
)
{
this
.
addFileButton
.
addClass
(
'
uk-disabled
'
);
}
else
{
this
.
addFileButton
.
removeClass
(
'
uk-disabled
'
);
}
});
this
.
tabWorkContainer
.
find
(
'
a
'
).
on
(
'
click
'
,
e
=>
{
...
...
@@ -259,6 +283,7 @@ this.DocumentAttachments = class {
this
.
filesWorkContainer
.
addClass
(
'
active
'
);
this
.
tabWorkContainer
.
addClass
(
'
active
'
);
this
.
path
=
"
ase:workContainer
"
;
this
.
addFileButton
.
removeClass
(
'
uk-disabled
'
);
});
}
...
...
@@ -318,6 +343,7 @@ this.DocumentAttachments = class {
async
init
(){
const
res
=
await
appAPI
.
getDocumentAttachments
(
this
.
documentID
);
this
.
canEdit
=
await
canEditFile
(
this
.
documentID
);
this
.
renderApp
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment