Skip to content

Commit

Permalink
Merge branch 'PB-34297_WP41---Create-password-resource-from-quickacce…
Browse files Browse the repository at this point in the history
…ss-in-v5-format' into 'develop'

PB-34297 WP4.1 - Create password resource from quickaccess in v5 format

See merge request passbolt/passbolt-styleguide!1702
  • Loading branch information
Benj1er committed Aug 13, 2024
2 parents aa9887d + 796b5d4 commit f5aec81
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -310,11 +310,16 @@ class ResourceCreatePage extends React.Component {
* @returns {Promise<void>}
*/
async save() {
// @TODO E2EE resource_type_id duplicate for resource
const resourceTypeId = this.resourceTypesSettings.findResourceTypeIdBySlug(this.resourceTypesSettings.DEFAULT_RESOURCE_TYPES_SLUGS.PASSWORD_AND_DESCRIPTION);
const resourceDto = {
name: this.state.name,
username: this.state.username,
uri: this.state.uri,
resource_type_id: this.resourceTypesSettings.findResourceTypeIdBySlug(this.resourceTypesSettings.DEFAULT_RESOURCE_TYPES_SLUGS.PASSWORD_AND_DESCRIPTION),
metadata: {
name: this.state.name,
username: this.state.username,
uris: [this.state.uri],
resource_type_id: resourceTypeId,
},
resource_type_id: resourceTypeId,
expired: this.props.passwordExpiryContext.getDefaultExpirationDate(),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,15 @@ describe("ResourceCreatePage", () => {
await waitFor(() => {});

// Assert the request to create a password has been called and contain the expected parameters.
const resourceTypeId = context.resourceTypesSettings.findResourceTypeIdBySlug(context.resourceTypesSettings.DEFAULT_RESOURCE_TYPES_SLUGS.PASSWORD_AND_DESCRIPTION);
const resourceMeta = {
name: "Passbolt Browser Extension Test",
uri: "https://passbolt-browser-extension/test",
username: "test@passbolt.com",
resource_type_id: context.resourceTypesSettings.findResourceTypeIdBySlug(context.resourceTypesSettings.DEFAULT_RESOURCE_TYPES_SLUGS.PASSWORD_AND_DESCRIPTION),
metadata: {
name: "Passbolt Browser Extension Test",
uris: ["https://passbolt-browser-extension/test"],
username: "test@passbolt.com",
resource_type_id: resourceTypeId,
},
resource_type_id: resourceTypeId,
expired: "2023-12-24T00:00:00.000Z",
};

Expand Down

0 comments on commit f5aec81

Please sign in to comment.