Skip to content

Commit ef3d81b

Browse files
ClementBouvierNfreddidierRTE
authored andcommitted
Card edit button should not be visible in Archives screen (#7803)
Signed-off-by: ClementBouvierN <[email protected]>
1 parent ea6bfc6 commit ef3d81b

File tree

1 file changed

+12
-19
lines changed

1 file changed

+12
-19
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- Copyright (c) 2023-2024, RTE (http://www.rte-france.com) -->
1+
<!-- Copyright (c) 2023-2025, RTE (http://www.rte-france.com) -->
22
<!-- See AUTHORS.txt -->
33
<!-- This Source Code Form is subject to the terms of the Mozilla Public -->
44
<!-- License, v. 2.0. If a copy of the MPL was not distributed with this -->
@@ -8,33 +8,26 @@
88

99
<h4> Hello {{userContext.login}}, you received the following message </h4>
1010

11-
<br/>
11+
<br />
1212

13-
<div class="template-style">
14-
<span id="richMessage">{{card.data.richMessage}}</span>
13+
<div class='template-style'>
14+
<span id='richMessage'>{{card.data.richMessage}}</span>
1515
</div>
1616

17-
18-
<br/>
19-
<br/>
20-
<br/>
17+
<br />
18+
<br />
19+
<br />
2120

2221
<div>
23-
<button id="editButton" class="opfab-btn" onClick="editCard()">Edit</button>
22+
<button id='editButton' class='opfab-btn' onClick='editCard()'>Edit</button>
2423
</div>
2524

26-
2725
<script>
2826
opfab.richTextEditor.showRichMessage(document.getElementById("richMessage"));
29-
30-
if (!opfab.currentCard.isUserAllowedToEdit()) {
31-
console.log(new Date().toISOString(),"Hide edit button");
27+
28+
if (!opfab.currentCard.isUserAllowedToEdit() || opfab.currentCard.getDisplayContext() == 'archive') {
3229
document.getElementById("editButton").setAttribute('hidden', true);
3330
}
34-
else console.log(new Date().toISOString(),"Do not hide edit button");
35-
36-
function editCard() {
37-
opfab.currentCard.editCard();
38-
}
31+
function editCard() { opfab.currentCard.editCard(); }
3932
40-
</script>
33+
</script>

0 commit comments

Comments
 (0)