Skip to content

[SDMEXT-815]/attachmentCreationOnUpload#91

Merged
yashmeet29 merged 8 commits intodevelopfrom
SDMEXT-815/attachmentCreationOnUpload
Feb 6, 2025
Merged

[SDMEXT-815]/attachmentCreationOnUpload#91
yashmeet29 merged 8 commits intodevelopfrom
SDMEXT-815/attachmentCreationOnUpload

Conversation

@yashmeet29
Copy link
Copy Markdown
Member

Jira: https://jira.tools.sap/browse/SDMEXT-815

This PR implements attachments creation on upload of attachments similar to Java plugin. Rename operation is triggered on save of the entity.
In this PR i am also adding a check for SDM roles for creation of attachments.

Scenarios Tested on Cloud:

  • Upload a valid attachment => Success.
  • Upload multiple valid attachment => Success.
  • Upload a duplicate attachment => Duplicate error message on UI.
  • Upload multiple attachments, Rename few of them & Click on create => Success
  • Upload multiple attachments, Rename few of them to same name as existing & Click on create => Duplicate warning
  • Upload multiple attachments, Click on Create, Click on Edit, Rename few of the attachments to valid names => Success
  • Upload multiple attachments, Click on Create, Click on Edit, Rename few of the attachments to duplicate names => Duplicate Warning.
  • Upload multiple attachments of different extensions, Read them => Success. Behaviour is as expected.
  • Upload multiple attachments of different extensions, Create, Read them => Success. Behaviour is as expected.
  • Upload multiple attachments, Click on Create, Click on Edit, Delete few attachments, Click on Create => Success
  • Create an entity, Upload multiple attachments, Click on Create, Delete Entity. => Success Entity & all it's attachements are deleted.
  • Remove SDM roles for user from BTP. Create an attachment. => Error stating roles are not present.

try {
return await axios.get(getAttachmentURL, config);
} catch (error) {
let statusText = "An Error Occurred";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we place this on constants

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

lib/sdm.js Outdated
);
if (response.status == 201) {
d.folderId = parentId;
d.url = response.data.succinctProperties["cmis:objectId"];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

response.data? check for undefined and null

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@yashmeet29 yashmeet29 merged commit f5e6d24 into develop Feb 6, 2025
7 checks passed
@yashmeet29 yashmeet29 deleted the SDMEXT-815/attachmentCreationOnUpload branch February 6, 2025 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants