Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 09346f44 authored by Joao Diogo NUNES CARTAXO's avatar Joao Diogo NUNES CARTAXO :sunglasses:
Browse files

Merge branch 'main-release' into 'main'

Revert "Merge branch '2095-toc-edition-warning-in-case-of-mistakes' into 'development'"

See merge request leos/core!2337
parents 9dfb0d07 3d9eeaa2
Branches
Tags LEOS_5.2.2
No related merge requests found
Showing
with 290 additions and 119 deletions
# **SUMMARY**
_\<Bug summaries should identify what the problem is, the area it occurs and what it’s impacting on.\>_
# **RELEASE AND BUILD VERSION**
_\<The version where the issue has been identified \>_
# **STEPS TO REPRODUCE**
_\<List of exact steps needed to reproduce the issue - add screenshots if needed to help contextualize\>_
# **SUMMARY** ## **SUMMARY**
_\<Story summaries should be structured as follows: As \[**the actor**\], I want \[**the something**\] so I can \[**the goal**\].\ \<Story summaries should be structured as follows: As \[**the actor**\], I want \[**the something**\] so I can \[**the goal**\].\
Example: As a user, I want a button to open the milestone explorer so I can consult the containing documents of a milestone\>_ Example: As a user, I want a button to open the milestone explorer so I can consult the containing documents of a milestone\>
# **ACCEPTANCE CRITERIAS / GOALS** ## **ACCEPTANCE CRITERIAS / GOALS**
_\<Checklist to confirm the work done on a ticket meets the intended purpose and maps the deliverable into smaller outcomes. Also helps Q&A to better structure the validation tests._\ \<Checklist to confirm the work done on a ticket meets the intended purpose and maps the deliverable into smaller outcomes. Also helps Q&A to better structure the validation tests.\
Example: Example:
- _A "Open Milestone" button is present on the UI_ - A "Open Milestone" button is present on the UI
- _Clicking on the button opens the milestone explorer_ - Clicking on the button opens the milestone explorer
- _Milestone explorer contains a tab for each document_ - Milestone explorer contains a tab for each document
- _Each tab presents the HTML rendition for the selected document_ - Each tab presents the HTML rendition for the selected document
- _Each tab presents the annotations client on read mode for the selected document\>_ - Each tab presents the annotations client on read mode for the selected document\>
# **OTHER DESCRIPTIONS / DOCUMENTATION** ## **OTHER DESCRIPTIONS / DOCUMENTATION**
\<Mockups, images and or documentation pages, if available\>
## **RELEASE AND BUILD VERSION**
**_OPTIONAL delete if not a bug_**
\<The version where the issue has been identified \>
## BROWSER USED
**_OPTIONAL delete if not a bug_**
\<The web browser where the issue has been identified \>
## **STEPS TO REPRODUCE**
**_OPTIONAL delete if not a bug_**
_\<List of exact steps needed to reproduce the issue - add screenshots if needed to help contextualize\>_
_\<Mockups, images and or documentation pages, if available\>_
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<parent> <parent>
<groupId>eu.europa.ec.leos.pilot</groupId> <groupId>eu.europa.ec.leos.pilot</groupId>
<artifactId>leos-modules</artifactId> <artifactId>leos-modules</artifactId>
<version>5.2.1.2</version> <version>5.2.2</version>
</parent> </parent>
<artifactId>leos-config</artifactId> <artifactId>leos-config</artifactId>
......
...@@ -57,6 +57,8 @@ leos.rest.repository.config.notifications.fetch=/config/notifications/fetch ...@@ -57,6 +57,8 @@ leos.rest.repository.config.notifications.fetch=/config/notifications/fetch
leos.rest.repository.config.workflow-collaborator-config=/workflow-collaborator-config leos.rest.repository.config.workflow-collaborator-config=/workflow-collaborator-config
leos.rest.repository.config.leos-client=/leos-client leos.rest.repository.config.leos-client=/leos-client
leos.rest.repository.package.collaborators=/package/package-collaborators/{packageId}
leos.rest.cache.enable=${leos.rest.cache.enable} leos.rest.cache.enable=${leos.rest.cache.enable}
# LEOS CMIS content repository # LEOS CMIS content repository
......
...@@ -53,6 +53,15 @@ ...@@ -53,6 +53,15 @@
<default-doc-creation-role>false</default-doc-creation-role> <default-doc-creation-role>false</default-doc-creation-role>
<message-key>leos.doc.collaborator.type3</message-key> <message-key>leos.doc.collaborator.type3</message-key>
</role> </role>
<role name="VIEWER">
<permissions>
<permission>CAN_READ</permission>
</permissions>
<application-role>false</application-role>
<collaborator>true</collaborator>
<default-doc-creation-role>false</default-doc-creation-role>
<message-key>leos.doc.collaborator.type5</message-key>
</role>
<role name="SUPPORT"> <role name="SUPPORT">
<permissions> <permissions>
<permission>CAN_READ</permission> <permission>CAN_READ</permission>
......
...@@ -51,6 +51,15 @@ ...@@ -51,6 +51,15 @@
<default-doc-creation-role>false</default-doc-creation-role> <default-doc-creation-role>false</default-doc-creation-role>
<message-key>leos.doc.collaborator.type3</message-key> <message-key>leos.doc.collaborator.type3</message-key>
</role> </role>
<role name="VIEWER">
<permissions>
<permission>CAN_READ</permission>
</permissions>
<application-role>false</application-role>
<collaborator>true</collaborator>
<default-doc-creation-role>false</default-doc-creation-role>
<message-key>leos.doc.collaborator.type5</message-key>
</role>
<role name="SUPPORT"> <role name="SUPPORT">
<permissions> <permissions>
<permission>CAN_READ</permission> <permission>CAN_READ</permission>
...@@ -73,6 +82,7 @@ ...@@ -73,6 +82,7 @@
<permission>CAN_ACCEPT_CHANGES</permission> <permission>CAN_ACCEPT_CHANGES</permission>
<permission>CAN_REJECT_CHANGES</permission> <permission>CAN_REJECT_CHANGES</permission>
<permission>CAN_VALIDATE</permission> <permission>CAN_VALIDATE</permission>
<permission>CAN_UPLOAD_XML_DOC</permission>
</permissions> </permissions>
<application-role>true</application-role> <application-role>true</application-role>
<collaborator>false</collaborator> <collaborator>false</collaborator>
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<parent> <parent>
<groupId>eu.europa.ec.leos.pilot</groupId> <groupId>eu.europa.ec.leos.pilot</groupId>
<artifactId>leos-modules</artifactId> <artifactId>leos-modules</artifactId>
<version>5.2.1.2</version> <version>5.2.2</version>
</parent> </parent>
<artifactId>leos-domain</artifactId> <artifactId>leos-domain</artifactId>
......
package eu.europa.ec.leos.domain.repository;
public enum DocumentRuleType {
STRUCTURE_VALIDATION("structureValidation"),
NOT_EMPTY("notEmpty"),
HIERARCHY("hierarchy");
private String ruleType;
DocumentRuleType(String ruleTYpe) {
this.ruleType = ruleTYpe;
}
public String getRuleType() {return ruleType;}
}
package eu.europa.ec.leos.domain.vo;
import lombok.Data;
@Data
public class CollaboratorVO {
private String login;
private String entity;
private String role;
private String leosClientId;
}
package eu.europa.ec.leos.model.notification.milestone;
import eu.europa.ec.leos.model.notification.EmailNotification;
import eu.europa.ec.leos.model.user.User;
import java.util.ArrayList;
import java.util.List;
public class MilestoneReadyEmailNotification implements EmailNotification {
private User recipient;
private List<String> recipients = new ArrayList<>();
private String emailBody;
private String emailSubject;
private String title;
private byte[] attachmentContent;
private String legFileName;
private String packageId;
public MilestoneReadyEmailNotification(User recipient, String title, byte[] attachmentContent, String legFileName, String packageId) {
this.recipient = recipient;
this.title = title;
this.attachmentContent = attachmentContent;
this.legFileName = legFileName;
this.packageId = packageId;
}
public void setAttachmentContent(byte[] attachmentContent) {
this.attachmentContent = attachmentContent;
}
public String getLegFileName() {
return legFileName;
}
public void setLegFileName(String legFileName) {
this.legFileName = legFileName;
}
public String getEmailSubjectKey() {
return "notification.milestone.ready.subject";
}
public void setRecipients(List<String> recipients) {
this.recipients = new ArrayList<>();
this.recipients.addAll(recipients);
}
public User getRecipient() {
return recipient;
}
public void setRecipient(User recipient) { this.recipient = recipient; }
public void setEmailBody(String emailBody) {
this.emailBody = emailBody;
}
public void setEmailSubject(String emailSubject) {
this.emailSubject = emailSubject;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public byte[] getAttachmentContent() {
return attachmentContent;
}
public String getPackageId() { return packageId; }
@Override
public String getNotificationName() {
return this.getClass().getSimpleName();
}
@Override
public String getEmailSubject() {
return emailSubject;
}
@Override
public String getEmailBody() {
return emailBody;
}
@Override
public String getAttachmentName() {
return legFileName;
}
@Override
public String getMimeType() {
return "application/zip";
}
@Override
public boolean withAttachment() {
return true;
}
@Override
public List<String> getRecipients() {
return recipients;
}
}
package eu.europa.ec.leos.vo.toc; package eu.europa.ec.leos.vo.toc;
public class CheckDocumentRulesVO { import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
public class CheckDocumentRulesVO {
private boolean firstElementFound; private boolean firstElementFound;
private boolean notAllowedElementFound; private boolean notAllowedElementFound;
private boolean validStructure; private boolean validStructure;
private String messageKey; private boolean warning;
private TableOfContentItemVO realSourceItemVO; private List<String> messageKey;
private TableOfContentItemVO actualSourceItemVO;
public CheckDocumentRulesVO() { public CheckDocumentRulesVO() {
this.firstElementFound = false; this.firstElementFound = false;
this.notAllowedElementFound = false; this.notAllowedElementFound = false;
this.validStructure = true; this.validStructure = true;
this.messageKey = ""; this.messageKey = new ArrayList();
} this.warning = false;
public boolean isFirstElementFound() {
return firstElementFound;
}
public void setFirstElementFound(boolean firstElementFound) {
this.firstElementFound = firstElementFound;
}
public boolean isNotAllowedElementFound() {
return notAllowedElementFound;
}
public void setNotAllowedElementFound(boolean notAllowedElementFound) {
this.notAllowedElementFound = notAllowedElementFound;
}
public boolean isValidStructure() {
return validStructure;
}
public void setValidStructure(boolean validStructure) {
this.validStructure = validStructure;
}
public String getMessageKey() {
return messageKey;
}
public void setMessageKey(String messageKey) {
this.messageKey = messageKey;
}
public TableOfContentItemVO getRealSourceItemVO() {
return realSourceItemVO;
} }
public void setRealSourceItemVO(TableOfContentItemVO realSourceItemVO) {
this.realSourceItemVO = realSourceItemVO;
}
} }
...@@ -14,48 +14,19 @@ ...@@ -14,48 +14,19 @@
package eu.europa.ec.leos.vo.toc; package eu.europa.ec.leos.vo.toc;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
@AllArgsConstructor
public class TocDropResult { public class TocDropResult {
private boolean success; private boolean success;
private boolean warning;
private String messageKey; private String messageKey;
private List<String> warningMessageKeys;
private TableOfContentItemVO sourceItem; private TableOfContentItemVO sourceItem;
private TableOfContentItemVO targetItem; private TableOfContentItemVO targetItem;
public TocDropResult(boolean success, String messageKey, TableOfContentItemVO sourceItem, TableOfContentItemVO targetItem) {
this.success = success;
this.messageKey = messageKey;
this.sourceItem = sourceItem;
this.targetItem = targetItem;
}
public boolean isSuccess() {
return success;
}
public void setSuccess(boolean success) {
this.success = success;
}
public String getMessageKey() {
return messageKey;
}
public void setMessageKey(String messageKey) {
this.messageKey = messageKey;
}
public TableOfContentItemVO getSourceItem() {
return sourceItem;
}
public void setSourceItem(TableOfContentItemVO sourceItem) {
this.sourceItem = sourceItem;
}
public TableOfContentItemVO getTargetItem() {
return targetItem;
}
public void setTargetItem(TableOfContentItemVO targetItem) {
this.targetItem = targetItem;
}
} }
...@@ -240,6 +240,41 @@ ...@@ -240,6 +240,41 @@
</xs:restriction> </xs:restriction>
</xs:simpleType> </xs:simpleType>
<xs:complexType name="higherDivisions">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="type" type="higherDivisionType"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="higherDivisionType">
<xs:restriction base="xs:string">
<xs:enumeration value="part"/>
<xs:enumeration value="title"/>
<xs:enumeration value="chapter"/>
<xs:enumeration value="section"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="lowerDivisions">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="type" type="lowerDivisionType"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="lowerDivisionType">
<xs:restriction base="xs:string">
<xs:enumeration value="division"/>
<xs:enumeration value="article"/>
<xs:enumeration value="paragraph"/>
<xs:enumeration value="subparagraph"/>
<xs:enumeration value="list"/>
<xs:enumeration value="point"/>
<xs:enumeration value="indent"/>
<xs:enumeration value="subpoint"/>
<xs:enumeration value="alinea"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="aknTag" final="restriction"> <xs:simpleType name="aknTag" final="restriction">
<xs:annotation> <xs:annotation>
<xs:documentation>All toc tags</xs:documentation> <xs:documentation>All toc tags</xs:documentation>
...@@ -249,7 +284,6 @@ ...@@ -249,7 +284,6 @@
<xs:enumeration value="docstage"/> <xs:enumeration value="docstage"/>
<xs:enumeration value="doctype"/> <xs:enumeration value="doctype"/>
<xs:enumeration value="docpurpose"/> <xs:enumeration value="docpurpose"/>
<xs:enumeration value="body"/>
<xs:enumeration value="preamble"/> <xs:enumeration value="preamble"/>
<xs:enumeration value="citations"/> <xs:enumeration value="citations"/>
<xs:enumeration value="citation"/> <xs:enumeration value="citation"/>
...@@ -312,7 +346,9 @@ ...@@ -312,7 +346,9 @@
<xs:sequence> <xs:sequence>
<xs:element name="description" type="xs:string"/> <xs:element name="description" type="xs:string"/>
<xs:element name="type" type="xs:string"/> <xs:element name="type" type="xs:string"/>
<xs:element name="tocItem" type="aknTag"/> <xs:element name="tocItem" type="aknTag" minOccurs="0"/>
<xs:element name="higherDivisions" type="higherDivisions" minOccurs="0"/>
<xs:element name="lowerDivisions" type="lowerDivisions" minOccurs="0"/>
<xs:element name="scope" type="xs:string"/> <xs:element name="scope" type="xs:string"/>
<xs:element name="exception" minOccurs="0" type="tocIdList"/> <xs:element name="exception" minOccurs="0" type="tocIdList"/>
<xs:element name="errorMessage" type="xs:string"/> <xs:element name="errorMessage" type="xs:string"/>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<parent> <parent>
<groupId>eu.europa.ec.leos.pilot</groupId> <groupId>eu.europa.ec.leos.pilot</groupId>
<artifactId>leos-modules</artifactId> <artifactId>leos-modules</artifactId>
<version>5.2.1.2</version> <version>5.2.2</version>
</parent> </parent>
<artifactId>leos-i18n</artifactId> <artifactId>leos-i18n</artifactId>
......
...@@ -259,6 +259,7 @@ leos.doc.collaborator.type1=Author ...@@ -259,6 +259,7 @@ leos.doc.collaborator.type1=Author
leos.doc.collaborator.type2=Contributor leos.doc.collaborator.type2=Contributor
leos.doc.collaborator.type3=Reviewer leos.doc.collaborator.type3=Reviewer
leos.doc.collaborator.type4=User leos.doc.collaborator.type4=User
leos.doc.collaborator.type5=Viewer
leos.doc.application.role.type1=Support leos.doc.application.role.type1=Support
leos.doc.application.role.type2=Admin leos.doc.application.role.type2=Admin
...@@ -955,6 +956,7 @@ notification.external.validation.document.subject=EdiT - For Info - Validation r ...@@ -955,6 +956,7 @@ notification.external.validation.document.subject=EdiT - For Info - Validation r
notification.collaborator.leosAuthority.OWNER=Author notification.collaborator.leosAuthority.OWNER=Author
notification.collaborator.leosAuthority.CONTRIBUTOR=Contributor notification.collaborator.leosAuthority.CONTRIBUTOR=Contributor
notification.collaborator.leosAuthority.REVIEWER=Reviewer notification.collaborator.leosAuthority.REVIEWER=Reviewer
notification.collaborator.leosAuthority.VIEWER=Viewer
notification.collaborator.leosAuthority.SUPPORT=Support notification.collaborator.leosAuthority.SUPPORT=Support
notification.collaborator.leosAuthority.ADMIN=Admin notification.collaborator.leosAuthority.ADMIN=Admin
notification.collaborator.doc.owner.note=(to be contacted in case of questions) notification.collaborator.doc.owner.note=(to be contacted in case of questions)
...@@ -964,6 +966,9 @@ notification.collaborator.send.feedback=EdiT - For Info - Feedback provided by L ...@@ -964,6 +966,9 @@ notification.collaborator.send.feedback=EdiT - For Info - Feedback provided by L
notification.pdf.generation.subject=EdiT - Consultation - Pdf generated for the requested act notification.pdf.generation.subject=EdiT - Consultation - Pdf generated for the requested act
export.pdf.unavailable=Export to pdf is not available in this instance export.pdf.unavailable=Export to pdf is not available in this instance
#milestone ready notification
notification.milestone.ready.subject=Milestone created at {0} is ready
#clone proposal #clone proposal
notification.clone.proposal.subject=EdiT - Consultation - {0} - Cloned act is ready notification.clone.proposal.subject=EdiT - Consultation - {0} - Cloned act is ready
clone.proposal.notification.title.originRef={0} clone.proposal.notification.title.originRef={0}
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<parent> <parent>
<groupId>eu.europa.ec.leos.pilot</groupId> <groupId>eu.europa.ec.leos.pilot</groupId>
<artifactId>leos-modules</artifactId> <artifactId>leos-modules</artifactId>
<version>5.2.1.2</version> <version>5.2.2</version>
</parent> </parent>
<artifactId>leos-integration</artifactId> <artifactId>leos-integration</artifactId>
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<parent> <parent>
<groupId>eu.europa.ec.leos.pilot</groupId> <groupId>eu.europa.ec.leos.pilot</groupId>
<artifactId>leos-modules</artifactId> <artifactId>leos-modules</artifactId>
<version>5.2.1.2</version> <version>5.2.2</version>
</parent> </parent>
<artifactId>leos-js</artifactId> <artifactId>leos-js</artifactId>
......
...@@ -24,18 +24,30 @@ define(function actionHandlerModule(require) { ...@@ -24,18 +24,30 @@ define(function actionHandlerModule(require) {
if (connector.editorChannel) { if (connector.editorChannel) {
let channel = connector.editorChannel; let channel = connector.editorChannel;
if(channel.bus?.subscriptions) { if(channel.bus?.subscriptions) {
channel.bus.unsubscribeFor({"topic": "actions.insert.group.*.element"});
channel.bus.unsubscribeFor({"topic": "actions.insert.*.element"}); channel.bus.unsubscribeFor({"topic": "actions.insert.*.element"});
channel.bus.unsubscribeFor({"topic": "actions.edit.element"}); channel.bus.unsubscribeFor({"topic": "actions.edit.element"});
channel.bus.unsubscribeFor({"topic": "actions.delete.element"}); channel.bus.unsubscribeFor({"topic": "actions.delete.element"});
} }
connector.actionSubscriptions = []; connector.actionSubscriptions = [];
// subscribe to editor channel action topics // subscribe to editor channel action topics
connector.actionSubscriptions.push(channel.subscribe("actions.insert.group.*.element", _insertGroupAction.bind(undefined, connector)));
connector.actionSubscriptions.push(channel.subscribe("actions.insert.*.element", _insertElementAction.bind(undefined, connector))); connector.actionSubscriptions.push(channel.subscribe("actions.insert.*.element", _insertElementAction.bind(undefined, connector)));
connector.actionSubscriptions.push(channel.subscribe("actions.edit.element", _editElementAction.bind(undefined, connector))); connector.actionSubscriptions.push(channel.subscribe("actions.edit.element", _editElementAction.bind(undefined, connector)));
connector.actionSubscriptions.push(channel.subscribe("actions.delete.element", _deleteElementAction.bind(undefined, connector))); connector.actionSubscriptions.push(channel.subscribe("actions.delete.element", _deleteElementAction.bind(undefined, connector)));
} }
} }
function _insertGroupAction(connector, data) {
log.debug("Insert element action...");
let regExp = /(?:^insert.group)\.(\w+).*$/i;
let matches = regExp.exec(data.action);
if (matches) {
data.position = matches[1];
connector.insertGroupAction(data);
}
}
function _insertElementAction(connector, data) { function _insertElementAction(connector, data) {
log.debug("Insert element action..."); log.debug("Insert element action...");
let regExp = /(?:^insert)\.(\w+).*$/i; let regExp = /(?:^insert)\.(\w+).*$/i;
......
...@@ -80,7 +80,14 @@ define(function aknAuthorialNotePluginModule(require) { ...@@ -80,7 +80,14 @@ define(function aknAuthorialNotePluginModule(require) {
function _getLowestMarkerValue(authorialNotes) { function _getLowestMarkerValue(authorialNotes) {
var markerArray = authorialNotes.map(function() { var markerArray = authorialNotes.map(function() {
return this.getAttribute("marker"); let localMarker = this.getAttribute("marker");
if(localMarker && localMarker.startsWith("(")){
localMarker = localMarker.substring(1);
}
if(localMarker && localMarker.endsWith(")")){
localMarker = localMarker.substring(0, localMarker.length-1);
}
return localMarker;
}).get(); }).get();
return markerArray.length > 0 ? Math.min.apply(Math, markerArray) : 1; return markerArray.length > 0 ? Math.min.apply(Math, markerArray) : 1;
} }
......
...@@ -57,8 +57,9 @@ define(function authorialNoteWidgetModule(require) { ...@@ -57,8 +57,9 @@ define(function authorialNoteWidgetModule(require) {
var $editable = $(editor.editable().$); var $editable = $(editor.editable().$);
var authorialNotes = $editable.find('*[data-akn-name="aknAuthorialNote"]'); var authorialNotes = $editable.find('*[data-akn-name="aknAuthorialNote"]');
authorialNotes.each(function() { authorialNotes.each(function() {
this.innerHTML = markerValue; let displayMarker = "(".concat(markerValue, ")");
this.setAttribute("marker", markerValue); this.innerHTML = displayMarker;
this.setAttribute("marker", displayMarker);
markerValue = markerValue + 1; markerValue = markerValue + 1;
}); });
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment