passbolt-styleguide 3.3.3 → 3.4.0-alpha2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/css/help.min.css +4 -4
- package/build/css/public.min.css +5 -6
- package/build/css/themes/default/api_authentication.min.css +3 -3
- package/build/css/themes/default/api_cloud.min.css +3 -7
- package/build/css/themes/default/api_main.min.css +4 -9
- package/build/css/themes/default/api_reports.min.css +4 -9
- package/build/css/themes/default/api_webinstaller.min.css +4 -9
- package/build/css/themes/default/ext_app.min.css +4 -9
- package/build/css/themes/default/ext_authentication.min.css +3 -3
- package/build/css/themes/default/ext_external.min.css +3 -3
- package/build/css/themes/default/ext_in_form_cta.min.css +9 -0
- package/build/css/themes/default/ext_in_form_menu.min.css +9 -0
- package/build/css/themes/default/ext_quickaccess.min.css +3 -3
- package/build/css/themes/midgar/api_authentication.min.css +9 -0
- package/build/css/themes/midgar/api_main.min.css +4 -9
- package/build/css/themes/midgar/api_reports.min.css +4 -9
- package/build/css/themes/midgar/ext_app.min.css +4 -9
- package/build/css/themes/midgar/ext_authentication.min.css +3 -3
- package/build/css/themes/midgar/ext_in_form_cta.min.css +9 -0
- package/build/css/themes/midgar/ext_in_form_menu.min.css +9 -0
- package/build/css/themes/midgar/ext_quickaccess.min.css +3 -3
- package/build/js/dist/api-app.js +1 -1
- package/build/js/dist/api-app.js.LICENSE.txt +5 -5
- package/build/js/dist/api-recover.js +1 -1
- package/build/js/dist/api-recover.js.LICENSE.txt +0 -28
- package/build/js/dist/api-setup.js +1 -1
- package/build/js/dist/api-setup.js.LICENSE.txt +0 -15
- package/build/js/dist/api-triage.js +1 -1
- package/build/js/dist/api-triage.js.LICENSE.txt +0 -14
- package/build/js/dist/api-vendors.js +1 -1
- package/build/js/dist/api-vendors.js.LICENSE.txt +146 -84
- package/package.json +31 -26
- package/src/img/controls/chevron-down_blue.svg +3 -0
- package/src/img/diagrams/functional_overview.png +0 -0
- package/src/img/diagrams/functional_overview.svg +4 -0
- package/src/img/diagrams/howitworks.svg +2797 -0
- package/src/img/diagrams/mobile-transfer.svg +296 -0
- package/src/img/diagrams/sequence_diagram_form_authenticate.png +0 -0
- package/src/img/diagrams/sequence_diagram_gpg_authenticate.png +0 -0
- package/src/img/diagrams/totp.svg +251 -0
- package/src/img/illustrations/pin_passbolt.gif +0 -0
- package/src/img/illustrations/wave-pin_my_extension.svg +1 -0
- package/src/img/logo/icon-32-badge-1.png +0 -0
- package/src/img/logo/icon-32-badge-2.png +0 -0
- package/src/img/logo/icon-32-badge-3.png +0 -0
- package/src/img/logo/icon-32-badge-4.png +0 -0
- package/src/img/logo/icon-32-badge-5+.png +0 -0
- package/src/img/logo/icon-32-badge-5.png +0 -0
- package/src/img/logo/icon-32-signout.png +0 -0
- package/src/img/logo/icon-badge-1.svg +1 -0
- package/src/img/logo/icon-badge-2.svg +1 -0
- package/src/img/logo/icon-badge-3.svg +1 -0
- package/src/img/logo/icon-badge-4.svg +1 -0
- package/src/img/logo/icon-badge-5+.svg +1 -0
- package/src/img/logo/icon-badge-5.svg +1 -0
- package/src/img/logo/icon-inactive.svg +1 -0
- package/src/img/logo/icon-without-badge.svg +1 -0
- package/src/img/third_party/ChromeWebStore_black.svg +1 -0
- package/src/img/third_party/ChromeWebStore_white.svg +1 -0
- package/src/img/third_party/edge-addon-black.svg +1 -0
- package/src/img/third_party/edge-addon-white.svg +1 -0
- package/src/locales/de-DE/common.json +820 -0
- package/src/locales/en-UK/common.json +86 -20
- package/src/locales/fr/common.json +750 -0
- package/src/locales/fr-FR/common.json +92 -22
- package/src/locales/sv-SE/common.json +820 -0
- package/src/react-extension/ExtApp.js +16 -10
- package/src/react-extension/ExtBootstrapApp.js +1 -0
- package/src/react-extension/components/Administration/DisplayAdministrationMenu/DisplayAdministrationMenu.js +2 -2
- package/src/react-extension/components/Administration/DisplayAdministrationMenu/DisplayAdministrationMenu.test.js +2 -2
- package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceBreadcrumb/DisplayAdministrationWorkspaceBreadcrumb.js +1 -1
- package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceBreadcrumb/DisplayAdministrationWorkspaceBreadcrumb.test.js +1 -1
- package/src/react-extension/components/Administration/DisplayEmailNotificationsAdministration/DisplayEmailNotificationsAdministration.js +22 -8
- package/src/react-extension/components/Administration/DisplayEmailNotificationsAdministration/DisplayEmailNotificationsAdministration.test.data.js +3 -0
- package/src/react-extension/components/Administration/DisplayInternationalizationAdministration/DisplayInternationalizationAdministration.js +10 -8
- package/src/react-extension/components/Administration/DisplayMfaAdministration/DisplayMfaAdministration.js +21 -19
- package/src/react-extension/components/Administration/DisplayMfaAdministration/DisplayMfaAdministration.test.page.js +6 -6
- package/src/react-extension/components/Administration/DisplayMfaAdministration/DisplayMfaAdministration.test.stories.js +0 -1
- package/src/react-extension/components/Administration/DisplaySimulateSynchronizeUserDirectoryAdministration/DisplaySimulateSynchronizeUserDirectoryAdministration.js +1 -1
- package/src/react-extension/components/Administration/DisplaySimulateSynchronizeUserDirectoryAdministration/DisplaySimulateSynchronizeUserDirectoryAdministration.test.js +1 -1
- package/src/react-extension/components/Administration/DisplaySimulateSynchronizeUserDirectoryAdministration/DisplaySimulateSynchronizeUserDirectoryAdministration.test.stories.js +5 -8
- package/src/react-extension/components/Administration/DisplaySubscriptionKey/DisplaySubscriptionKey.js +20 -38
- package/src/react-extension/components/Administration/DisplaySubscriptionKey/DisplaySubscriptionKey.test.data.js +4 -1
- package/src/react-extension/components/Administration/DisplaySubscriptionKey/DisplaySubscriptionKey.test.js +4 -4
- package/src/react-extension/components/Administration/DisplaySynchronizeUserDirectoryAdministration/DisplaySynchronizeUserDirectoryAdministration.js +1 -1
- package/src/react-extension/components/Administration/DisplaySynchronizeUserDirectoryAdministration/DisplaySynchronizeUserDirectoryAdministration.test.js +1 -1
- package/src/react-extension/components/Administration/DisplayTestUserDirectoryAdministration/DisplayTestUserDirectoryAdministration.test.js +2 -3
- package/src/react-extension/components/Administration/DisplayTestUserDirectoryAdministration/DisplayTestUserDirectoryAdministration.test.stories.js +5 -9
- package/src/react-extension/components/Administration/DisplayUserDirectoryAdministration/DisplayUserDirectoryAdministration.js +34 -32
- package/src/react-extension/components/Administration/DisplayUserDirectoryAdministration/DisplayUserDirectoryAdministration.test.js +1 -1
- package/src/react-extension/components/Administration/DisplayUserDirectoryAdministration/DisplayUserDirectoryAdministration.test.stories.js +0 -3
- package/src/react-extension/components/Administration/EditSubscriptionKey/EditSubscriptionKey.js +1 -1
- package/src/react-extension/components/Administration/EditSubscriptionKey/EditSubscriptionKey.test.page.js +2 -2
- package/src/react-extension/components/Authentication/AskForAuthenticationHelp/AskForAuthenticationHelp.js +1 -1
- package/src/react-extension/components/Authentication/AskForAuthenticationHelp/AskForAuthenticationHelp.test.stories.js +12 -15
- package/src/react-extension/components/Authentication/CheckMailBox/CheckMailBox.js +2 -2
- package/src/react-extension/components/Authentication/CheckMailBox/CheckMailBox.test.js +1 -1
- package/src/react-extension/components/Authentication/CheckMailBox/CheckMailbox.test.stories.js +12 -14
- package/src/react-extension/components/Authentication/CheckPassphrase/CheckPassphrase.js +2 -1
- package/src/react-extension/components/Authentication/CheckPassphrase/CheckPassphrase.test.stories.js +12 -15
- package/src/react-extension/components/Authentication/ChooseSecurityToken/ChooseSecurityToken.js +1 -2
- package/src/react-extension/components/Authentication/ChooseSecurityToken/ChooseSecurityToken.test.stories.js +12 -15
- package/src/react-extension/components/Authentication/CreateGpgKey/CreateGpgKey.js +9 -19
- package/src/react-extension/components/Authentication/CreateGpgKey/CreateGpgKey.test.stories.js +12 -15
- package/src/react-extension/components/Authentication/DisplayBrowserNotSupported/DisplayBrowserNotSupported.test.stories.js +12 -15
- package/src/react-extension/components/Authentication/DisplayExpiredTokenError/DisplayExpiredTokenError.test.stories.js +12 -15
- package/src/react-extension/components/Authentication/DisplayRequireInvitationError/DisplayRequireInvitationError.test.stories.js +12 -15
- package/src/react-extension/components/Authentication/DisplayUnexpectedError/DisplayUnexpectedError.test.stories.js +12 -15
- package/src/react-extension/components/Authentication/DownloadRecoveryKit/DownloadRecoveryKit.js +1 -1
- package/src/react-extension/components/Authentication/DownloadRecoveryKit/DownloadRecoveryKit.test.stories.js +12 -15
- package/src/react-extension/components/Authentication/EnterNameForm/EnterNameForm.test.stories.js +12 -15
- package/src/react-extension/components/Authentication/EnterUsernameForm/EnterUsernameForm.test.stories.js +12 -15
- package/src/react-extension/components/Authentication/HandleSessionExpired/HandleSessionExpired.test.data.js +14 -0
- package/src/react-extension/components/Authentication/HandleSessionExpired/HandleSessionExpired.test.js +65 -0
- package/src/react-extension/components/Authentication/HandleSessionExpired/HandleSessionExpired.test.page.js +38 -0
- package/src/react-extension/components/Authentication/ImportGpgKey/ImportGpgKey.test.stories.js +12 -15
- package/src/react-extension/components/Authentication/InstallExtension/InstallExtension.js +15 -6
- package/src/react-extension/components/Authentication/InstallExtension/InstallExtension.test.js +27 -0
- package/src/react-extension/components/Authentication/InstallExtension/InstallExtension.test.stories.js +12 -15
- package/src/react-extension/components/Authentication/IntroduceSetupExtension/IntroduceSetupExtension.js +107 -0
- package/src/react-extension/components/Authentication/IntroduceSetupExtension/IntroduceSetupExtension.test.data.js +11 -0
- package/src/react-extension/components/Authentication/IntroduceSetupExtension/IntroduceSetupExtension.test.js +65 -0
- package/src/react-extension/components/Authentication/IntroduceSetupExtension/IntroduceSetupExtension.test.page.js +73 -0
- package/src/react-extension/components/Authentication/IntroduceSetupExtension/IntroduceSetupExtension.test.stories.js +34 -0
- package/src/react-extension/components/Authentication/NotifyExpiredSession/NotifyExpiredSession.test.stories.js +8 -11
- package/src/react-extension/components/AuthenticationLogin/AcceptLoginServerKeyChange/AcceptLoginServerKeyChange.js +1 -1
- package/src/react-extension/components/AuthenticationLogin/AcceptLoginServerKeyChange/AcceptLoginServerKeyChange.test.stories.js +12 -15
- package/src/react-extension/components/AuthenticationLogin/DisplayLoginError/DisplayLoginError.test.stories.js +12 -15
- package/src/react-extension/components/AuthenticationLogin/DisplayLoginInProgress/DisplayLoginProgress.test.stories.js +12 -15
- package/src/react-extension/components/AuthenticationLogin/Login/Login.js +3 -1
- package/src/react-extension/components/AuthenticationLogin/Login/Login.test.stories.js +12 -15
- package/src/react-extension/components/AuthenticationPassphrase/InputPassphrase/InputPassphrase.js +2 -1
- package/src/react-extension/components/AuthenticationPassphrase/InputPassphrase/InputPassphrase.test.js +1 -1
- package/src/react-extension/components/AuthenticationPassphrase/InputPassphrase/InputPassphrase.test.stories.js +5 -11
- package/src/react-extension/components/AuthenticationRecover/RecoverAuthentication/RecoverAuthentication.js +5 -1
- package/src/react-extension/components/AuthenticationSetup/SetupAuthentication/SetupAuthentication.js +4 -0
- package/src/react-extension/components/Common/ActionFeedback/DisplayActionFeedbacks.test.data.js +0 -2
- package/src/react-extension/components/Common/ActionFeedback/DisplayActionFeedbacks.test.js +4 -5
- package/src/react-extension/components/Common/ActionFeedback/DisplayActionFeedbacks.test.page.js +0 -1
- package/src/react-extension/components/Common/Avatar/UserAvatar.js +2 -1
- package/src/react-extension/components/Common/Error/ShowErrorDetails/ShowErrorDetails.js +126 -0
- package/src/react-extension/components/Common/Icons/AnimatedFeedback.js +58 -0
- package/src/react-extension/components/Common/Icons/Icon.js +16 -0
- package/src/react-extension/components/Common/Icons/Icon.test.stories.js +78 -0
- package/src/react-extension/components/Common/Inputs/FormSubmitButton/FormSubmitButton.js +4 -0
- package/src/react-extension/components/Common/Loading/LoadingSpinner/LoadingSpinner.js +2 -1
- package/src/react-extension/components/Common/Menu/DisplayMainMenu.js +2 -4
- package/src/react-extension/components/Common/Navigation/Search/SearchBar.js +1 -1
- package/src/react-extension/components/Common/Progress/DisplayProgress/DisplayProgress.js +1 -1
- package/src/react-extension/components/Common/Progress/DisplayProgress/DisplayProgress.test.js +1 -1
- package/src/react-extension/components/Common/Progress/DisplayProgress/DisplayProgress.test.stories.js +34 -0
- package/src/react-extension/components/Common/Tab/Tab.js +65 -0
- package/src/react-extension/components/Common/Tab/Tabs.js +87 -0
- package/src/react-extension/components/Resource/CreateResource/CreateResource.js +85 -66
- package/src/react-extension/components/Resource/CreateResource/CreateResource.test.data.js +80 -1
- package/src/react-extension/components/Resource/CreateResource/CreateResource.test.js +18 -39
- package/src/react-extension/components/Resource/CreateResource/CreateResource.test.page.js +27 -8
- package/src/react-extension/components/Resource/CreateResource/CreateResource.test.stories.js +70 -4
- package/src/react-extension/components/Resource/DeleteResource/DeleteResource.js +1 -1
- package/src/react-extension/components/Resource/DisplayResourcesList/DisplayDragResource.js +68 -0
- package/src/react-extension/components/Resource/DisplayResourcesList/DisplayResourcesList.js +20 -47
- package/src/react-extension/components/Resource/DisplayResourcesList/DisplayResourcesList.test.page.js +4 -1
- package/src/react-extension/components/Resource/DisplayResourcesWorkspace/DisplayResourcesWorkspaceMenu.js +2 -2
- package/src/react-extension/components/Resource/DisplayResourcesWorkspace/DisplayResourcesWorkspaceMenu.test.data.js +1 -7
- package/src/react-extension/components/Resource/EditResource/EditResource.js +93 -68
- package/src/react-extension/components/Resource/EditResource/EditResource.test.data.js +80 -1
- package/src/react-extension/components/Resource/EditResource/EditResource.test.js +10 -39
- package/src/react-extension/components/Resource/EditResource/EditResource.test.page.js +26 -11
- package/src/react-extension/components/Resource/ExportResources/ExportResources.js +1 -1
- package/src/react-extension/components/Resource/ExportResources/ExportResources.test.stories.js +5 -11
- package/src/react-extension/components/Resource/ExportResources/ExportResourcesCredentials.js +10 -12
- package/src/react-extension/components/Resource/ExportResources/ExportResourcesCredentials.test.stories.js +5 -11
- package/src/react-extension/components/Resource/FilterResourcesByBreadcrumb/FilterResourcesByBreadcrumb.js +4 -4
- package/src/react-extension/components/Resource/FilterResourcesByBreadcrumb/FilterResourcesByBreadcrumb.test.stories.js +0 -1
- package/src/react-extension/components/Resource/FilterResourcesByFolders/DisplayDragFolderItem.js +109 -0
- package/src/react-extension/components/Resource/FilterResourcesByFolders/FilterResourcesByFolders.js +41 -193
- package/src/react-extension/components/Resource/FilterResourcesByFolders/FilterResourcesByFolders.test.data.js +10 -5
- package/src/react-extension/components/Resource/FilterResourcesByFolders/FilterResourcesByFolders.test.js +9 -12
- package/src/react-extension/components/Resource/FilterResourcesByFolders/FilterResourcesByFolders.test.page.js +6 -2
- package/src/react-extension/components/Resource/FilterResourcesByFolders/FilterResourcesByFolders.test.stories.js +0 -1
- package/src/react-extension/components/Resource/FilterResourcesByFolders/FilterResourcesByFoldersItem.js +83 -58
- package/src/react-extension/components/Resource/FilterResourcesByFolders/FilterResourcesByFoldersItem.test.data.js +52 -59
- package/src/react-extension/components/Resource/FilterResourcesByFolders/FilterResourcesByFoldersItem.test.js +25 -20
- package/src/react-extension/components/Resource/FilterResourcesByFolders/FilterResourcesByFoldersItem.test.page.js +11 -5
- package/src/react-extension/components/Resource/FilterResourcesByFolders/FilterResourcesByFoldersItemContextualMenu.js +1 -1
- package/src/react-extension/components/Resource/FilterResourcesByFolders/FilterResourcesByRootFolderContextualMenu.js +7 -2
- package/src/react-extension/components/Resource/FilterResourcesByFolders/FilterResourcesByRootFolderContextualMenu.test.js +3 -7
- package/src/react-extension/components/Resource/FilterResourcesByGroups/FilterResourcesByGroups.js +1 -1
- package/src/react-extension/components/Resource/FilterResourcesByShortcuts/FilterResourcesByShortcuts.js +1 -1
- package/src/react-extension/components/Resource/FilterResourcesByShortcuts/FilterResourcesByShortcuts.test.page.js +1 -1
- package/src/react-extension/components/Resource/FilterResourcesByShortcuts/FilterResourcesByShortcuts.test.stories.js +0 -1
- package/src/react-extension/components/Resource/FilterResourcesByTags/FilterResourcesByTags.js +1 -1
- package/src/react-extension/components/Resource/FilterResourcesByTags/FilterResourcesByTags.test.data.js +47 -0
- package/src/react-extension/components/Resource/FilterResourcesByTags/FilterResourcesByTags.test.js +34 -3
- package/src/react-extension/components/Resource/FilterResourcesByTags/FilterResourcesByTags.test.page.js +46 -9
- package/src/react-extension/components/Resource/FilterResourcesByTags/FilterResourcesByTags.test.stories.js +0 -1
- package/src/react-extension/components/Resource/FilterResourcesByTags/FilterResourcesByTagsList.js +124 -4
- package/src/react-extension/components/Resource/FilterResourcesByText/FilterResourcesByText.test.stories.js +0 -2
- package/src/react-extension/components/Resource/ImportResources/ImportResources.js +6 -5
- package/src/react-extension/components/Resource/ImportResources/ImportResourcesKeyUnlock.js +10 -12
- package/src/react-extension/components/Resource/ImportResources/ImportResourcesKeyUnlock.test.stories.js +5 -11
- package/src/react-extension/components/Resource/ImportResources/ImportResourcesResult.js +3 -3
- package/src/react-extension/components/Resource/ImportResources/ImportResourcesResult.test.js +3 -3
- package/src/react-extension/components/Resource/ImportResources/ImportResourcesResult.test.stories.js +5 -11
- package/src/react-extension/components/ResourceComment/AddResourceComment/AddResourceComment.js +1 -1
- package/src/react-extension/components/ResourceComment/AddResourceComment/AddResourceComment.test.page.object.js +1 -1
- package/src/react-extension/components/ResourceComment/AddResourceComment/AddResourceComment.test.stories.js +8 -14
- package/src/react-extension/components/ResourceComment/ConfirmResourceCommentDeletion/ConfirmResourceCommentDeletion.test.stories.js +5 -11
- package/src/react-extension/components/ResourceComment/DisplayResourceCommentList/DisplayResourceCommentList.test.stories.js +8 -14
- package/src/react-extension/components/ResourceDescription/EditResourceDescription/EditResourceDescription.js +9 -8
- package/src/react-extension/components/ResourceDescription/EditResourceDescription/EditResourceDescription.test.page.js +1 -1
- package/src/react-extension/components/ResourceDescription/EditResourceDescription/EditResourceDescription.test.stories.js +8 -15
- package/src/react-extension/components/ResourceDetails/DisplayResourceDetails/DisplayResourceDetailsActivity.test.stories.js +0 -1
- package/src/react-extension/components/ResourceDetails/DisplayResourceDetails/DisplayResourceDetailsDescription.js +1 -1
- package/src/react-extension/components/ResourceDetails/DisplayResourceDetails/DisplayResourceDetailsDescription.test.stories.js +0 -1
- package/src/react-extension/components/ResourceDetails/DisplayResourceDetails/DisplayResourceDetailsTag.test.js +1 -1
- package/src/react-extension/components/ResourceDetails/DisplayResourceDetails/DisplayResourceDetailsTag.test.stories.js +0 -1
- package/src/react-extension/components/ResourceFolder/CreateResourceFolder/CreateResourceFolder.js +2 -2
- package/src/react-extension/components/ResourceFolder/CreateResourceFolder/CreateResourceFolder.test.page.js +1 -1
- package/src/react-extension/components/ResourceFolder/CreateResourceFolder/CreateResourceFolder.test.stories.js +0 -3
- package/src/react-extension/components/ResourceFolder/DefineResourceFolderMoveStrategy/DefineResourceFolderMoveStrategy.test.stories.js +0 -6
- package/src/react-extension/components/ResourceFolder/DeleteResourceFolder/DeleteResourceFolder.test.stories.js +0 -5
- package/src/react-extension/components/ResourceFolder/RenameResourceFolder/RenameResourceFolder.js +1 -1
- package/src/react-extension/components/ResourceFolder/RenameResourceFolder/RenameResourceFolder.test.page.js +1 -1
- package/src/react-extension/components/ResourceFolder/RenameResourceFolder/RenameResourceFolder.test.stories.js +0 -7
- package/src/react-extension/components/ResourceFolderDetails/DisplayResourceFolderDetails/DisplayResourceFolderDetailsActivity.test.stories.js +0 -2
- package/src/react-extension/components/ResourceFolderDetails/DisplayResourceFolderDetails/DisplayResourceFolderDetailsInformation.test.stories.js +0 -2
- package/src/react-extension/components/ResourceFolderDetails/DisplayResourceFolderDetails/DisplayResourceFolderDetailsPermissions.test.stories.js +0 -2
- package/src/react-extension/components/ResourcePassword/GenerateResourcePassword/ConfigurePassphraseGenerator.js +150 -0
- package/src/react-extension/components/ResourcePassword/GenerateResourcePassword/ConfigurePassphraseGenerator.test.stories.js +30 -0
- package/src/react-extension/components/ResourcePassword/GenerateResourcePassword/ConfigurePasswordGenerator.js +191 -0
- package/src/react-extension/components/ResourcePassword/GenerateResourcePassword/ConfigurePasswordGenerator.test.stories.js +73 -0
- package/src/react-extension/components/ResourcePassword/GenerateResourcePassword/GenerateResourcePassword.js +296 -0
- package/src/react-extension/components/ResourcePassword/GenerateResourcePassword/GenerateResourcePassword.test.stories.js +112 -0
- package/src/react-extension/components/ResourceTag/DeleteResourceTag/DeleteResourceTag.test.stories.js +0 -2
- package/src/react-extension/components/ResourceTag/EditResourceTag/EditResourceTag.js +1 -1
- package/src/react-extension/components/ResourceTag/EditResourceTag/EditResourceTag.test.page.js +1 -1
- package/src/react-extension/components/ResourceTag/EditResourceTag/EditResourceTag.test.stories.js +0 -4
- package/src/react-extension/components/ResourceTag/EditResourceTags/EditResourceTags.js +2 -2
- package/src/react-extension/components/ResourceTag/EditResourceTags/EditResourceTags.test.page.js +1 -1
- package/src/react-extension/components/ResourceTag/EditResourceTags/EditResourceTagsItemViewer.js +5 -1
- package/src/react-extension/components/Share/ShareDialog.test.page.js +1 -1
- package/src/react-extension/components/Share/ShareDialog.test.stories.js +12 -10
- package/src/react-extension/components/User/ConfirmDisableUserMFA/ConfirmDisableUserMFA.test.stories.js +5 -9
- package/src/react-extension/components/User/CreateUser/CreateUser.js +4 -4
- package/src/react-extension/components/User/CreateUser/CreateUser.test.page.js +3 -3
- package/src/react-extension/components/User/CreateUser/CreateUser.test.stories.js +3 -1
- package/src/react-extension/components/User/DeleteUser/DeleteUser.test.stories.js +5 -8
- package/src/react-extension/components/User/DeleteUser/DeleteUserWithConflicts.test.stories.js +5 -8
- package/src/react-extension/components/User/DisplayUserWorkspaceActions/DisplayUserWorkspaceActions.js +2 -2
- package/src/react-extension/components/User/DisplayUserWorkspaceActions/DisplayUserWorkspaceActions.test.page.js +1 -1
- package/src/react-extension/components/User/DisplayUsers/DisplayUsers.js +35 -2
- package/src/react-extension/components/User/DisplayUsers/DisplayUsers.test.data.js +2 -1
- package/src/react-extension/components/User/DisplayUsers/DisplayUsers.test.js +6 -0
- package/src/react-extension/components/User/DisplayUsers/DisplayUsers.test.page.js +19 -6
- package/src/react-extension/components/User/EditUser/EditUser.js +3 -3
- package/src/react-extension/components/User/EditUser/EditUser.test.page.js +2 -2
- package/src/react-extension/components/User/EditUser/EditUser.test.stories.js +3 -1
- package/src/react-extension/components/User/FilterUsersByBreadcrumb/FilterUsersByBreadcrumb.js +2 -2
- package/src/react-extension/components/User/FilterUsersByBreadcrumb/FilterUsersByBreadcrumb.test.js +1 -1
- package/src/react-extension/components/User/FilterUsersByBreadcrumb/FilterUsersByBreadcrumb.test.stories.js +5 -8
- package/src/react-extension/components/User/FilterUsersByGroups/FilterUsersByGroup.js +1 -1
- package/src/react-extension/components/User/FilterUsersByShortcut/FilterUsersByShortcut.js +1 -1
- package/src/react-extension/components/User/FilterUsersByShortcut/FilterUsersByShortcut.test.stories.js +0 -1
- package/src/react-extension/components/User/FilterUsersByText/FilterUsersByText.test.stories.js +0 -2
- package/src/react-extension/components/UserDetails/DisplayUserDetailsGroups/DisplayUserDetailsGroups.test.stories.js +8 -11
- package/src/react-extension/components/UserDetails/DisplayUserDetailsInformation/DisplayUserDetailsInformation.test.stories.js +8 -11
- package/src/react-extension/components/UserDetails/DisplayUserDetailsPublicKey/DisplayUserDetailsPublicKey.test.stories.js +8 -12
- package/src/react-extension/components/UserGroup/CreateUserGroup/CreateUserGroup.js +1 -1
- package/src/react-extension/components/UserGroup/CreateUserGroup/CreateUserGroup.test.page.js +2 -2
- package/src/react-extension/components/UserGroup/CreateUserGroup/CreateUserGroup.test.stories.js +5 -8
- package/src/react-extension/components/UserGroup/DeleteUserGroup/DeleteUserGroup.test.stories.js +5 -8
- package/src/react-extension/components/UserGroup/DeleteUserGroup/DeleteUserGroupWithConflicts.test.stories.js +5 -8
- package/src/react-extension/components/UserGroup/DisplayUserGroupDetailsInformation/DisplayUserGroupDetailsInformation.test.stories.js +8 -11
- package/src/react-extension/components/UserGroup/DisplayUserGroupDetailsMembers/DisplayUserGroupDetailsMembers.test.stories.js +8 -11
- package/src/react-extension/components/UserGroup/EditUserGroup/EditUserGroup.js +11 -3
- package/src/react-extension/components/UserGroup/EditUserGroup/EditUserGroup.test.data.js +7 -0
- package/src/react-extension/components/UserGroup/EditUserGroup/EditUserGroup.test.page.js +1 -1
- package/src/react-extension/components/UserGroup/EditUserGroup/EditUserGroup.test.stories.js +12 -8
- package/src/react-extension/components/UserSetting/ChangeUserPassphrase/ConfirmPassphrase.js +92 -21
- package/src/react-extension/components/UserSetting/ChangeUserPassphrase/ConfirmPassphrase.test.data.js +6 -0
- package/src/react-extension/components/UserSetting/ChangeUserPassphrase/ConfirmPassphrase.test.js +2 -2
- package/src/react-extension/components/UserSetting/ChangeUserPassphrase/ConfirmPassphrase.test.page.js +1 -1
- package/src/react-extension/components/UserSetting/ChangeUserPassphrase/DisplayChangePassphraseIntroduction.js +12 -10
- package/src/react-extension/components/UserSetting/ChangeUserPassphrase/DownloadRecoveryKit.js +4 -10
- package/src/react-extension/components/UserSetting/ChangeUserPassphrase/EnterNewPassphrase.js +65 -25
- package/src/react-extension/components/UserSetting/ChangeUserPassphrase/EnterNewPassphrase.test.data.js +6 -0
- package/src/react-extension/components/UserSetting/ChangeUserPassphrase/EnterNewPassphrase.test.js +1 -1
- package/src/react-extension/components/UserSetting/ChangeUserPassphrase/EnterNewPassphrase.test.page.js +1 -1
- package/src/react-extension/components/UserSetting/ChangeUserSecurityToken/ChangeUserSecurityToken.js +14 -13
- package/src/react-extension/components/UserSetting/ChangeUserSecurityToken/ChangeUserSecurityToken.test.stories.js +5 -8
- package/src/react-extension/components/UserSetting/DisplayUserGpgInformation/DisplayUserGpgInformation.js +21 -6
- package/src/react-extension/components/UserSetting/DisplayUserGpgInformation/DisplayUserGpgInformation.test.stories.js +5 -8
- package/src/react-extension/components/UserSetting/DisplayUserProfile/DisplayUserProfile.js +1 -1
- package/src/react-extension/components/UserSetting/DisplayUserProfile/DisplayUserProfile.test.stories.js +5 -8
- package/src/react-extension/components/UserSetting/DisplayUserSettingsWorkspace/DisplayUserSettingsWorkspace.js +13 -1
- package/src/react-extension/components/UserSetting/DisplayUserSettingsWorkspaceBreadcrumb/DisplayUserSettingsWorkspaceBreadcrumb.js +2 -1
- package/src/react-extension/components/UserSetting/DisplayUserSettingsWorkspaceBreadcrumb/DisplayUserSettingsWorkspaceBreadcrumb.test.stories.js +5 -8
- package/src/react-extension/components/UserSetting/DisplayUserTheme/DisplayUserTheme.test.stories.js +5 -8
- package/src/react-extension/components/UserSetting/EditUserProfile/EditUserProfile.js +3 -3
- package/src/react-extension/components/UserSetting/EditUserProfile/EditUserProfile.test.stories.js +5 -8
- package/src/react-extension/components/UserSetting/NavigateIntoUserSettingsWorkspace/NavigateIntoUserSettingsWorkspace.js +26 -4
- package/src/react-extension/components/UserSetting/NavigateIntoUserSettingsWorkspace/NavigateIntoUserSettingsWorkspace.test.stories.js +7 -10
- package/src/react-extension/components/UserSetting/TransferToMobile/TransferToMobile.js +749 -0
- package/src/react-extension/components/UserSetting/TransferToMobile/TransferToMobile.test.data.js +32 -0
- package/src/react-extension/components/UserSetting/TransferToMobile/TransferToMobile.test.js +60 -0
- package/src/react-extension/components/UserSetting/TransferToMobile/TransferToMobile.test.page.js +110 -0
- package/src/react-extension/components/UserSetting/UploadUserProfileAvatar/UploadUserProfileAvatar.js +3 -2
- package/src/react-extension/components/UserSetting/UploadUserProfileAvatar/UploadUserProfileAvatar.test.stories.js +5 -8
- package/src/react-extension/contexts/AdministrationWorkspaceContext.js +2 -2
- package/src/react-extension/contexts/ApiAppContext.js +1 -1
- package/src/react-extension/contexts/ApiRecoverContext.js +1 -1
- package/src/react-extension/contexts/ApiSetupContext.js +1 -1
- package/src/react-extension/contexts/AuthenticationContext.js +21 -2
- package/src/react-extension/contexts/AuthenticationContext.test.js +40 -0
- package/src/react-extension/contexts/DragContext.js +122 -0
- package/src/react-extension/contexts/DragContext.test.js +53 -0
- package/src/react-extension/contexts/NavigationContext.js +11 -0
- package/src/react-extension/contexts/ResourcePasswordGeneratorContext.js +144 -0
- package/src/react-extension/contexts/ResourceWorkspaceContext.js +5 -4
- package/src/react-extension/contexts/ResourceWorkspaceContext.test.data.js +0 -1
- package/src/react-extension/contexts/ResourceWorkspaceContext.test.page.js +0 -1
- package/src/react-extension/contexts/UserWorkspaceContext.js +31 -4
- package/src/react-extension/contexts/UserWorkspaceContext.test.data.js +17 -287
- package/src/react-extension/lib/Crypto/sha512.js +17 -0
- package/src/react-extension/test/fixture/Settings/siteSettings.js +6 -0
- package/src/react-extension/test/mock/components/Internationalisation/MockTranslationProvider.js +42 -7
- package/src/react-quickaccess/ExtQuickAccess.js +75 -28
- package/src/react-quickaccess/components/AnimatedSwitch/AnimatedSwitch.js +22 -5
- package/src/react-quickaccess/components/ExtensionSetup/SetupExtensionInProgress/SetupExtensionInProgress.js +41 -0
- package/src/react-quickaccess/components/ExtensionSetup/SetupExtensionInProgress/SetupExtensionInProgressPage.test.stories.js +23 -0
- package/src/react-quickaccess/components/FilterResourcesByFavoritePage/FilterResourcesByFavoritePage.js +8 -4
- package/src/react-quickaccess/components/FilterResourcesByFavoritePage/FilterResourcesByFavoritePage.test.stories.js +7 -7
- package/src/react-quickaccess/components/FilterResourcesByGroupPage/FilterResourcesByGroupPage.js +10 -6
- package/src/react-quickaccess/components/FilterResourcesByGroupPage/FilterResourcesByGroupPage.test.stories.js +9 -5
- package/src/react-quickaccess/components/FilterResourcesByItemsIOwnPage/FilterResourcesByItemsIOwnPage.js +10 -7
- package/src/react-quickaccess/components/FilterResourcesByItemsIOwnPage/FilterResourcesByItemsIOwnPage.test.stories.js +7 -7
- package/src/react-quickaccess/components/FilterResourcesByRecentlyModifiedPage/FilterResourcesByRecentlyModifiedPage.js +10 -7
- package/src/react-quickaccess/components/FilterResourcesByRecentlyModifiedPage/FilterResourcesByRecentlyModifiedPage.test.stories.js +7 -7
- package/src/react-quickaccess/components/FilterResourcesBySharedWithMePage/FilterResourcesBySharedWithMePage.js +10 -7
- package/src/react-quickaccess/components/FilterResourcesBySharedWithMePage/FilterResourcesBySharedWithMePage.test.stories.js +7 -7
- package/src/react-quickaccess/components/FilterResourcesByTagPage/FilterResourcesByTagPage.js +10 -7
- package/src/react-quickaccess/components/FilterResourcesByTagPage/FilterResourcesByTagPage.test.stories.js +9 -5
- package/src/react-quickaccess/components/GeneratePasswordPage/ConfigurePassphraseGenerator.js +150 -0
- package/src/react-quickaccess/components/GeneratePasswordPage/ConfigurePassphraseGenerator.test.data.js +20 -0
- package/src/react-quickaccess/components/GeneratePasswordPage/ConfigurePassphraseGenerator.test.js +67 -0
- package/src/react-quickaccess/components/GeneratePasswordPage/ConfigurePassphraseGenerator.test.page.js +109 -0
- package/src/react-quickaccess/components/GeneratePasswordPage/ConfigurePasswordGenerator.js +189 -0
- package/src/react-quickaccess/components/GeneratePasswordPage/ConfigurePasswordGenerator.test.data.js +40 -0
- package/src/react-quickaccess/components/GeneratePasswordPage/ConfigurePasswordGenerator.test.js +67 -0
- package/src/react-quickaccess/components/GeneratePasswordPage/ConfigurePasswordGenerator.test.page.js +121 -0
- package/src/react-quickaccess/components/GeneratePasswordPage/GeneratePasswordPage.js +304 -0
- package/src/react-quickaccess/components/GeneratePasswordPage/GeneratePasswordPage.test.data.js +102 -0
- package/src/react-quickaccess/components/GeneratePasswordPage/GeneratePasswordPage.test.js +76 -0
- package/src/react-quickaccess/components/GeneratePasswordPage/GeneratePasswordPage.test.page.js +158 -0
- package/src/react-quickaccess/components/Header/Header.js +10 -8
- package/src/react-quickaccess/components/Header/Header.test.stories.js +4 -7
- package/src/react-quickaccess/components/HomePage/HomePage.js +40 -11
- package/src/react-quickaccess/components/HomePage/HomePage.test.stories.js +14 -10
- package/src/react-quickaccess/components/HomePage/canSuggestUrl.js +8 -3
- package/src/react-quickaccess/components/HomePage/canSuggestUrl.test.js +6 -0
- package/src/react-quickaccess/components/LoginPage/LoginPage.js +58 -18
- package/src/react-quickaccess/components/LoginPage/LoginPage.test.stories.js +4 -6
- package/src/react-quickaccess/components/ManageQuickAccessMode/ManageQuickAccessMode.js +103 -0
- package/src/react-quickaccess/components/MoreFiltersPage/MoreFiltersPage.js +2 -2
- package/src/react-quickaccess/components/MoreFiltersPage/MoreFiltersPage.test.stories.js +4 -6
- package/src/react-quickaccess/components/PassphraseDialog/PassphraseDialog.js +5 -3
- package/src/react-quickaccess/components/PassphraseDialog/PassphraseDialog.test.stories.js +6 -6
- package/src/react-quickaccess/components/PrivateRoute/PrivateRoute.js +1 -0
- package/src/react-quickaccess/components/ResourceAutoSave/SaveResource.js +234 -0
- package/src/react-quickaccess/components/ResourceAutoSave/SaveResource.test.data.js +28 -0
- package/src/react-quickaccess/components/ResourceAutoSave/SaveResource.test.stories.js +44 -0
- package/src/react-quickaccess/components/ResourceCreatePage/ResourceCreatePage.js +166 -39
- package/src/react-quickaccess/components/ResourceCreatePage/ResourceCreatePage.test.data.js +108 -2
- package/src/react-quickaccess/components/ResourceCreatePage/ResourceCreatePage.test.js +28 -25
- package/src/react-quickaccess/components/ResourceCreatePage/ResourceCreatePage.test.stories.js +6 -6
- package/src/react-quickaccess/components/ResourceViewPage/ResourceViewPage.js +6 -3
- package/src/react-quickaccess/components/ResourceViewPage/ResourceViewPage.test.stories.js +5 -3
- package/src/react-quickaccess/components/Search/Search.js +13 -1
- package/src/react-quickaccess/components/Search/Search.test.stories.js +4 -6
- package/src/react-quickaccess/contexts/PrepareResourceContext.js +221 -0
- package/src/react-web-integration/AuthLogin/AuthLogin.js +72 -0
- package/src/react-web-integration/Autofill/Autofill.js +331 -0
- package/src/react-web-integration/BrowserIntegrationBootstrap.js +64 -0
- package/src/react-web-integration/Events/Quickaccess/QuickAccessEvent.js +24 -0
- package/src/react-web-integration/ExtInFormCallToAction.js +56 -0
- package/src/react-web-integration/ExtInFormMenu.js +70 -0
- package/src/react-web-integration/components/AskInFormMenuDisplay/AskInFormMenuDisplay.js +161 -0
- package/src/react-web-integration/components/AskInFormMenuDisplay/AskInFormMenuDisplay.test.data.js +39 -0
- package/src/react-web-integration/components/AskInFormMenuDisplay/AskInFormMenuDisplay.test.js +48 -0
- package/src/react-web-integration/components/AskInFormMenuDisplay/AskInFormMenuDisplay.test.page.js +42 -0
- package/src/react-web-integration/components/AskInFormMenuDisplay/AskInFormMenuDisplay.test.stories.js +91 -0
- package/src/react-web-integration/components/DisplayInFormMenu/DisplayInFormMenu.js +360 -0
- package/src/react-web-integration/components/DisplayInFormMenu/DisplayInFormMenu.test.stories.js +198 -0
- package/src/react-web-integration/components/DisplayInFormMenu/DisplayInFormMenuItem.js +103 -0
- package/src/react-web-integration/contexts/AppContext.js +39 -0
- package/src/react-web-integration/lib/Dom/DomUtils.js +94 -0
- package/src/react-web-integration/lib/InForm/InFormCallToActionField.js +263 -0
- package/src/react-web-integration/lib/InForm/InFormCredentialsFormField.js +118 -0
- package/src/react-web-integration/lib/InForm/InFormFieldSelector.js +77 -0
- package/src/react-web-integration/lib/InForm/InFormManager.js +253 -0
- package/src/react-web-integration/lib/InForm/InformManager.test.data.js +46 -0
- package/src/react-web-integration/lib/InForm/InformManager.test.js +82 -0
- package/src/react-web-integration/lib/InForm/InformManager.test.page.js +116 -0
- package/src/react-web-integration/lib/InForm/InformMenuField.js +182 -0
- package/src/shared/components/Internationalisation/TranslationProvider.js +145 -0
- package/src/shared/lib/Browser/detectBrowserName.js +2 -1
- package/src/shared/lib/Secret/SecretComplexity.js +2 -2
- package/src/shared/lib/SecretGenerator/PassphraseGenerator.js +112 -0
- package/src/shared/lib/SecretGenerator/PassphraseGenerator.test.js +48 -0
- package/src/shared/lib/SecretGenerator/PassphraseGeneratorWords.js +7789 -0
- package/src/shared/lib/SecretGenerator/PasswordGenerator.js +103 -0
- package/src/shared/lib/SecretGenerator/SecretGenerator.js +45 -0
- package/src/shared/lib/SecretGenerator/SecretGeneratorComplexity.js +190 -0
- package/src/shared/lib/SecretGenerator/SecretGeneratorComplexity.test.js +95 -0
- package/src/shared/lib/Settings/SiteSettings.js +8 -0
- package/src/shared/lib/apiClient/apiClient.test.js +1 -1
- package/.babelrc +0 -11
- package/.editorconfig +0 -13
- package/.eslintrc.json +0 -197
- package/.gitlab-ci.yml +0 -28
- package/.jest.config.json +0 -6
- package/.jest.setup.js +0 -8
- package/.jest.transform.js +0 -7
- package/.storybook/main.js +0 -15
- package/.storybook/preview-body.html +0 -5
- package/.storybook/preview.js +0 -6
- package/Gruntfile.js +0 -199
- package/build/css/themes/default/ext_config_debug.min.css +0 -13
- package/build/css/themes/default/ext_legacy.min.css +0 -13
- package/build/css/themes/midgar/ext_legacy.min.css +0 -13
- package/crowdin.yml +0 -4
- package/docker-compose-dev.yml +0 -10
- package/jest.config.json +0 -6
- package/src/img/controls/colorpicker/marker.png +0 -0
- package/src/img/controls/colorpicker/mask.png +0 -0
- package/src/img/controls/colorpicker/wheel.png +0 -0
- package/src/img/controls/overlay-opacity-50.png +0 -0
- package/src/img/third_party/ChromeWebStore_black.png +0 -0
- package/src/img/third_party/ChromeWebStore_white.png +0 -0
- package/src/js/accordion.js +0 -10
- package/src/js/autocomplete.js +0 -241
- package/src/js/autocomplete.min.js +0 -3
- package/src/js/bootstrap-scrollspy.js +0 -172
- package/src/js/chosen.jquery.js +0 -1356
- package/src/js/colorpicker.js +0 -32
- package/src/js/download.js +0 -128
- package/src/js/farbtastic.js +0 -345
- package/src/js/swiper.min.js +0 -18
- package/src/react-quickaccess/components/Internationalisation/TranslationProvider.js +0 -151
- package/storybook-static/favicon.ico +0 -0
- package/storybook-static/iframe.html +0 -133
- package/storybook-static/index.html +0 -47
- package/storybook-static/main.2d01924b12554c6c15af.bundle.js +0 -1
- package/storybook-static/main.b0c44c8759149ccf4f67.bundle.js +0 -3
- package/storybook-static/main.b0c44c8759149ccf4f67.bundle.js.LICENSE.txt +0 -153
- package/storybook-static/main.b0c44c8759149ccf4f67.bundle.js.map +0 -1
- package/storybook-static/runtime~main.6a9b04192e3176eff72a.bundle.js +0 -1
- package/storybook-static/runtime~main.b0c44c8759149ccf4f67.bundle.js +0 -2
- package/storybook-static/runtime~main.b0c44c8759149ccf4f67.bundle.js.map +0 -1
- package/storybook-static/static/media/chosen-sprite.6768c197.png +0 -0
- package/storybook-static/static/media/chosen-sprite@2x.a0b7f3f1.png +0 -0
- package/storybook-static/static/media/dot_black.a2c44078.svg +0 -6
- package/storybook-static/static/media/dot_red.7b34541d.svg +0 -6
- package/storybook-static/static/media/dot_white.f60f7331.svg +0 -6
- package/storybook-static/static/media/fontawesome-webfont.1e59d233.ttf +0 -0
- package/storybook-static/static/media/fontawesome-webfont.20fd1704.woff2 +0 -0
- package/storybook-static/static/media/fontawesome-webfont.8b43027f.eot +0 -0
- package/storybook-static/static/media/fontawesome-webfont.c1e38fd9.svg +0 -2671
- package/storybook-static/static/media/fontawesome-webfont.f691f37e.woff +0 -0
- package/storybook-static/static/media/infinite-bar.f5327dc3.gif +0 -0
- package/storybook-static/static/media/loading_dark.ea474c7f.svg +0 -21
- package/storybook-static/static/media/loading_light.061977b5.svg +0 -15
- package/storybook-static/static/media/logo.e2b062a5.svg +0 -1
- package/storybook-static/static/media/logo_white.cb32e694.svg +0 -1
- package/storybook-static/static/media/opensans-bold.a6b4768c.woff +0 -0
- package/storybook-static/static/media/opensans-regular.7812bd0b.woff +0 -0
- package/storybook-static/static/media/passphrase_intro.37a1ba4e.png +0 -0
- package/storybook-static/vendors~main.4abf29e4f956d5befb41.bundle.js +0 -2
- package/storybook-static/vendors~main.4abf29e4f956d5befb41.bundle.js.LICENSE.txt +0 -105
- package/storybook-static/vendors~main.b0c44c8759149ccf4f67.bundle.js +0 -3
- package/storybook-static/vendors~main.b0c44c8759149ccf4f67.bundle.js.LICENSE.txt +0 -145
- package/storybook-static/vendors~main.b0c44c8759149ccf4f67.bundle.js.map +0 -1
- package/webpack-api.config.js +0 -83
- package/webpack-ext.config.js +0 -84
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Passbolt ~ Open source password manager for teams
|
|
3
|
+
* Copyright (c) 2021 Passbolt SA (https://www.passbolt.com)
|
|
4
|
+
*
|
|
5
|
+
* Licensed under GNU Affero General Public License version 3 of the or any later version.
|
|
6
|
+
* For full copyright and license information, please see the LICENSE.txt
|
|
7
|
+
* Redistributions of files must retain the above copyright notice.
|
|
8
|
+
*
|
|
9
|
+
* @copyright Copyright (c) 2021 Passbolt SA (https://www.passbolt.com)
|
|
10
|
+
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License
|
|
11
|
+
* @link https://www.passbolt.com Passbolt(tm)
|
|
12
|
+
* @since 3.3.0
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import React from "react";
|
|
16
|
+
import PropTypes from "prop-types";
|
|
17
|
+
import {withTranslation} from "react-i18next";
|
|
18
|
+
import DisplayInFormMenuItem from "./DisplayInFormMenuItem";
|
|
19
|
+
import {withAppContext} from "../../contexts/AppContext";
|
|
20
|
+
import {SecretGenerator} from "../../../shared/lib/SecretGenerator/SecretGenerator";
|
|
21
|
+
|
|
22
|
+
/** The maximum length of visibility of a generated password */
|
|
23
|
+
const TRUNCATED_GENERATED_PASSWORD_MAX_LENGTH = 15;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* This component is a menu integrated into a target web page which includes
|
|
27
|
+
* an identified authentication form. After the call-to-action performed,
|
|
28
|
+
* the menu proposes different available actions given the situation
|
|
29
|
+
*/
|
|
30
|
+
class DisplayInFormMenu extends React.Component {
|
|
31
|
+
/**
|
|
32
|
+
* Default constructor
|
|
33
|
+
* @param props Component props
|
|
34
|
+
*/
|
|
35
|
+
constructor(props) {
|
|
36
|
+
super(props);
|
|
37
|
+
this.state = this.defaultState;
|
|
38
|
+
this.createRefs();
|
|
39
|
+
this.bindCallbacks();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Create DOM nodes or React elements references in order to be able to access them programmatically.
|
|
44
|
+
*/
|
|
45
|
+
createRefs() {
|
|
46
|
+
this.inFormMenuRef = React.createRef();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Whenever the component is mounted
|
|
51
|
+
*/
|
|
52
|
+
componentDidMount() {
|
|
53
|
+
this.handleDisplayConfigurationReceivedEvent();
|
|
54
|
+
document.addEventListener('click', this.handleInFormMenuClickEvent);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
componentWillUnmount() {
|
|
58
|
+
document.removeEventListener('click', this.handleInFormMenuClickEvent);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Handle click events on in form menu. close the component if the click occurred outside of the component.
|
|
63
|
+
* @param {ReactEvent} event The event
|
|
64
|
+
*/
|
|
65
|
+
handleInFormMenuClickEvent(event) {
|
|
66
|
+
// Prevent close when the user click on an element of the in form menu
|
|
67
|
+
if (this.inFormMenuRef.current.contains(event.target)) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
this.props.context.port.request('passbolt.in-form-menu.close');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Binds methods callbacks
|
|
75
|
+
*/
|
|
76
|
+
bindCallbacks() {
|
|
77
|
+
this.handleInFormMenuClickEvent = this.handleInFormMenuClickEvent.bind(this);
|
|
78
|
+
|
|
79
|
+
this.handleCreateNewCredentialsRequestedEvent = this.handleCreateNewCredentialsRequestedEvent.bind(this);
|
|
80
|
+
this.handleSaveCredentialsRequestedEvent = this.handleSaveCredentialsRequestedEvent.bind(this);
|
|
81
|
+
this.handleBrowseCredentialsRequestedEvent = this.handleBrowseCredentialsRequestedEvent.bind(this);
|
|
82
|
+
this.handleUseSuggestedResourceRequestedEvent = this.handleUseSuggestedResourceRequestedEvent.bind(this);
|
|
83
|
+
this.handleGeneratePasswordRequestedEvent = this.handleGeneratePasswordRequestedEvent.bind(this);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* The component default state
|
|
88
|
+
*/
|
|
89
|
+
get defaultState() {
|
|
90
|
+
return {
|
|
91
|
+
configuration: {
|
|
92
|
+
inputType: null, // Input inputType attached to the menu
|
|
93
|
+
inputValue: null, // Input inputValue attached to the menu
|
|
94
|
+
suggestedResources: null, // Suggested resources to display
|
|
95
|
+
secretGeneratorConfiguration: null, // A secret generator configuration
|
|
96
|
+
}, // The display configuration of the menu
|
|
97
|
+
generatedPassword: null, // Generated password
|
|
98
|
+
resourceIdProcessing: null // The resource id processing
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Returns true if the component has a display configuration
|
|
104
|
+
*/
|
|
105
|
+
get hasConfiguration() {
|
|
106
|
+
return Boolean(this.state.configuration) && Boolean(this.state.configuration.inputType);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Returns true if the component has a "username" display configuration
|
|
111
|
+
*/
|
|
112
|
+
get isUsernameConfiguration() {
|
|
113
|
+
return this.state.configuration.inputType === 'username';
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Returns true if the username field has been (
|
|
118
|
+
*/
|
|
119
|
+
get isUsernameFilled() {
|
|
120
|
+
return this.state.configuration.inputValue && this.state.configuration.inputValue !== '';
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Returns true if the component has a "password" display configuration
|
|
125
|
+
*/
|
|
126
|
+
get isPasswordConfiguration() {
|
|
127
|
+
return this.state.configuration.inputType === 'password';
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Returns true if the password field has been (
|
|
132
|
+
*/
|
|
133
|
+
get isPasswordFilled() {
|
|
134
|
+
return this.state.configuration.inputValue && this.state.configuration.inputValue !== '';
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Returns the list of the menu items to display
|
|
139
|
+
*/
|
|
140
|
+
get items() {
|
|
141
|
+
if (this.hasConfiguration) {
|
|
142
|
+
if (this.isUsernameConfiguration) {
|
|
143
|
+
return this.isUsernameFilled ? this.filledUsernameMenuItems: this.emptyUsernameMenuItems;
|
|
144
|
+
} else if(this.isPasswordConfiguration) {
|
|
145
|
+
return this.isPasswordFilled ? this.filledPasswordMenuItems: this.emptyPasswordMenuItems;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return [];
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Returns the truncated version of generated password
|
|
153
|
+
*/
|
|
154
|
+
get truncatedGeneratedPassword() {
|
|
155
|
+
if (this.state.generatedPassword) {
|
|
156
|
+
const uplimitIndex = Math.min(TRUNCATED_GENERATED_PASSWORD_MAX_LENGTH, Math.floor(this.state.generatedPassword.length/2));
|
|
157
|
+
return this.state.generatedPassword.substring(0,uplimitIndex);
|
|
158
|
+
}
|
|
159
|
+
return this.state.generatedPassword;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Returns the list of menu items in case of filled username configuration
|
|
164
|
+
* @return {JSX.Element[]}
|
|
165
|
+
*/
|
|
166
|
+
get filledUsernameMenuItems() {
|
|
167
|
+
return [
|
|
168
|
+
...this.suggestedResourcesItems,
|
|
169
|
+
this.saveAsNewCredentialItem,
|
|
170
|
+
this.browseCredentialsItem
|
|
171
|
+
];
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Returns the list of menu items in case of empty username configuration
|
|
176
|
+
* @return {JSX.Element[]}
|
|
177
|
+
*/
|
|
178
|
+
get emptyUsernameMenuItems() {
|
|
179
|
+
return [
|
|
180
|
+
...this.suggestedResourcesItems,
|
|
181
|
+
this.createNewCredentialItem,
|
|
182
|
+
this.browseCredentialsItem
|
|
183
|
+
];
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Returns the list of menu items in case of filled password configuration
|
|
188
|
+
* @return {JSX.Element[]}
|
|
189
|
+
*/
|
|
190
|
+
get filledPasswordMenuItems() {
|
|
191
|
+
return [
|
|
192
|
+
...this.suggestedResourcesItems,
|
|
193
|
+
this.saveAsNewCredentialItem,
|
|
194
|
+
this.browseCredentialsItem
|
|
195
|
+
];
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Returns the list of menu items in case of empty password configuration
|
|
200
|
+
* @return {JSX.Element[]}
|
|
201
|
+
*/
|
|
202
|
+
get emptyPasswordMenuItems() {
|
|
203
|
+
return [
|
|
204
|
+
...this.suggestedResourcesItems,
|
|
205
|
+
this.generateNewPasswordItem,
|
|
206
|
+
this.createNewCredentialItem,
|
|
207
|
+
this.browseCredentialsItem
|
|
208
|
+
];
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Return the generate a new credential menu item.
|
|
213
|
+
* @returns {JSX.Element}
|
|
214
|
+
*/
|
|
215
|
+
get generateNewPasswordItem() {
|
|
216
|
+
return <DisplayInFormMenuItem
|
|
217
|
+
key="generate-password"
|
|
218
|
+
onClick={this.handleGeneratePasswordRequestedEvent}
|
|
219
|
+
title={this.props.t("Generate a new password securely")}
|
|
220
|
+
subtitle={<span className="in-form-menu-item-content-subheader-password">{this.truncatedGeneratedPassword}"</span>}
|
|
221
|
+
description={this.props.t("You will be able to save it after submitting")}
|
|
222
|
+
icon="magic-wand"/>;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Return the save as new credential menu item.
|
|
227
|
+
* @returns {JSX.Element}
|
|
228
|
+
*/
|
|
229
|
+
get saveAsNewCredentialItem() {
|
|
230
|
+
return <DisplayInFormMenuItem
|
|
231
|
+
key="save-credentials"
|
|
232
|
+
onClick={this.handleSaveCredentialsRequestedEvent}
|
|
233
|
+
title={this.props.t("Save as new credential")}
|
|
234
|
+
description={this.props.t("Save the data entered as a new credential")}
|
|
235
|
+
icon="add"/>;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Return the create a new credential menu item.
|
|
240
|
+
* @returns {JSX.Element}
|
|
241
|
+
*/
|
|
242
|
+
get createNewCredentialItem() {
|
|
243
|
+
return <DisplayInFormMenuItem
|
|
244
|
+
key="create-new-credentials"
|
|
245
|
+
onClick={this.handleCreateNewCredentialsRequestedEvent}
|
|
246
|
+
title={this.props.t("Create a new credential")}
|
|
247
|
+
description={this.props.t("Create and customize it yourself")}
|
|
248
|
+
icon="add"/>;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Return the browse credentials menu item.
|
|
253
|
+
* @returns {JSX.Element}
|
|
254
|
+
*/
|
|
255
|
+
get browseCredentialsItem() {
|
|
256
|
+
return <DisplayInFormMenuItem
|
|
257
|
+
key="browse-credentials"
|
|
258
|
+
onClick={this.handleBrowseCredentialsRequestedEvent}
|
|
259
|
+
title={this.props.t("Browse credentials")}
|
|
260
|
+
description={this.props.t("Search among available credentials")}
|
|
261
|
+
icon="search"/>;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Returns the list of suggested resources menu items
|
|
266
|
+
*/
|
|
267
|
+
get suggestedResourcesItems() {
|
|
268
|
+
const suggestedResources = (this.state.configuration && this.state.configuration.suggestedResources) || [];
|
|
269
|
+
return suggestedResources.reduce((menuItems, resource) => {
|
|
270
|
+
return menuItems.concat([
|
|
271
|
+
<DisplayInFormMenuItem
|
|
272
|
+
key={resource.id}
|
|
273
|
+
onClick={() => this.handleUseSuggestedResourceRequestedEvent(resource.id)}
|
|
274
|
+
processing={this.state.resourceIdProcessing === resource.id}
|
|
275
|
+
disabled={this.state.resourceIdProcessing === resource.id}
|
|
276
|
+
title={resource.name}
|
|
277
|
+
description={resource.username}
|
|
278
|
+
icon="key"/>
|
|
279
|
+
]);
|
|
280
|
+
}, []);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Whenever the display configuration of the menu is received
|
|
285
|
+
*/
|
|
286
|
+
async handleDisplayConfigurationReceivedEvent() {
|
|
287
|
+
const configuration = await this.props.context.port.request('passbolt.in-form-menu.init');
|
|
288
|
+
this.setState({configuration});
|
|
289
|
+
if (!this.isPasswordFilled) {
|
|
290
|
+
// Pre-generate the password
|
|
291
|
+
this.setState({generatedPassword: SecretGenerator.generate(configuration.secretGeneratorConfiguration)});
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Whenever the user requests to create a new credential
|
|
297
|
+
*/
|
|
298
|
+
handleCreateNewCredentialsRequestedEvent() {
|
|
299
|
+
this.props.context.port.request('passbolt.in-form-menu.create-new-credentials');
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Whenever the user requests to browse credentials
|
|
304
|
+
*/
|
|
305
|
+
handleBrowseCredentialsRequestedEvent() {
|
|
306
|
+
this.props.context.port.request('passbolt.in-form-menu.browse-credentials');
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Whenever the user requests to save the credentials
|
|
311
|
+
*/
|
|
312
|
+
handleSaveCredentialsRequestedEvent() {
|
|
313
|
+
this.props.context.port.request('passbolt.in-form-menu.save-credentials');
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Whenever the user requests to use the suggested resource as credentials in the current page
|
|
318
|
+
* @param resourceId
|
|
319
|
+
*/
|
|
320
|
+
async handleUseSuggestedResourceRequestedEvent(resourceId) {
|
|
321
|
+
await this.setState({resourceIdProcessing: resourceId});
|
|
322
|
+
try {
|
|
323
|
+
await this.props.context.port.request('passbolt.in-form-menu.use-suggested-resource', resourceId);
|
|
324
|
+
} catch (error) {
|
|
325
|
+
console.log(error)
|
|
326
|
+
}
|
|
327
|
+
await this.setState({resourceIdProcessing: null});
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Whenever the user request to generate a password for the current page
|
|
332
|
+
*/
|
|
333
|
+
handleGeneratePasswordRequestedEvent() {
|
|
334
|
+
this.props.context.port.request('passbolt.in-form-menu.fill-password', this.state.generatedPassword);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Render the component
|
|
340
|
+
*/
|
|
341
|
+
render() {
|
|
342
|
+
const items = this.items;
|
|
343
|
+
return (
|
|
344
|
+
<>
|
|
345
|
+
{this.hasConfiguration &&
|
|
346
|
+
<div className={`in-form-menu ${items.length > 3 ? 'in-form-menu--scrollable' : ''}`} ref={this.inFormMenuRef}>
|
|
347
|
+
{items}
|
|
348
|
+
</div>
|
|
349
|
+
}
|
|
350
|
+
</>
|
|
351
|
+
);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
DisplayInFormMenu.propTypes = {
|
|
356
|
+
context: PropTypes.any, // The application context
|
|
357
|
+
t: PropTypes.func, // The translation function
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
export default withAppContext(withTranslation('common')(DisplayInFormMenu));
|
package/src/react-web-integration/components/DisplayInFormMenu/DisplayInFormMenu.test.stories.js
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Passbolt ~ Open source password manager for teams
|
|
3
|
+
* Copyright (c) 2021 Passbolt SA (https://www.passbolt.com)
|
|
4
|
+
*
|
|
5
|
+
* Licensed under GNU Affero General Public License version 3 of the or any later version.
|
|
6
|
+
* For full copyright and license information, please see the LICENSE.txt
|
|
7
|
+
* Redistributions of files must retain the above copyright notice.
|
|
8
|
+
*
|
|
9
|
+
* @copyright Copyright (c) 2021 Passbolt SA (https://www.passbolt.com)
|
|
10
|
+
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License
|
|
11
|
+
* @link https://www.passbolt.com Passbolt(tm)
|
|
12
|
+
* @since 3.3.0
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import React from "react";
|
|
16
|
+
import DisplayInFormMenu from "./DisplayInFormMenu";
|
|
17
|
+
import DisplayInFormMenuItem from "./DisplayInFormMenuItem";
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
title: 'Passbolt/WebIntegration/InFormMenu',
|
|
21
|
+
component: DisplayInFormMenu
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
const TemplateAllItemsMenu = () => {
|
|
26
|
+
const searchIcon = (
|
|
27
|
+
<span className="fa icon">
|
|
28
|
+
<svg xmlns="http://www.w3.org/2000/svg" aria-label="magnifying glass icon"><path id="search-icon" d="M15.781 13.844a.723.723 0 0 1 .219.531.723.723 0 0 1-.219.531l-.875.875a.723.723 0 0 1-.531.219.723.723 0 0 1-.531-.219l-3.125-3.125a.723.723 0 0 1-.219-.531v-.5C9.333 12.542 8 13 6.5 13a6.313 6.313 0 0 1-3.266-.875 6.567 6.567 0 0 1-2.359-2.36A6.313 6.313 0 0 1 0 6.5c0-1.187.292-2.276.875-3.266A6.567 6.567 0 0 1 3.235.875 6.313 6.313 0 0 1 6.5 0c1.187 0 2.276.292 3.266.875a6.567 6.567 0 0 1 2.359 2.36c.583.989.875 2.078.875 3.265 0 1.5-.458 2.833-1.375 4h.5c.208 0 .385.073.531.219l3.125 3.125zM6.5 10.5c.73 0 1.401-.177 2.016-.531a3.891 3.891 0 0 0 1.453-1.453A3.966 3.966 0 0 0 10.5 6.5c0-.73-.177-1.401-.531-2.016a3.891 3.891 0 0 0-1.453-1.453A3.966 3.966 0 0 0 6.5 2.5c-.73 0-1.401.177-2.016.531a3.891 3.891 0 0 0-1.453 1.453A3.966 3.966 0 0 0 2.5 6.5c0 .73.177 1.401.531 2.016a3.891 3.891 0 0 0 1.453 1.453A3.966 3.966 0 0 0 6.5 10.5z" fillRule="evenodd" /></svg>
|
|
29
|
+
</span>
|
|
30
|
+
);
|
|
31
|
+
const magicWandIcon = (
|
|
32
|
+
<span className="fa icon">
|
|
33
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M224 96l16-32 32-16-32-16-16-32-16 32-32 16 32 16 16 32zM80 160l26.66-53.33L160 80l-53.34-26.67L80 0 53.34 53.33 0 80l53.34 26.67L80 160zm352 128l-26.66 53.33L352 368l53.34 26.67L432 448l26.66-53.33L512 368l-53.34-26.67L432 288zm70.62-193.77L417.77 9.38C411.53 3.12 403.34 0 395.15 0c-8.19 0-16.38 3.12-22.63 9.38L9.38 372.52c-12.5 12.5-12.5 32.76 0 45.25l84.85 84.85c6.25 6.25 14.44 9.37 22.62 9.37 8.19 0 16.38-3.12 22.63-9.37l363.14-363.15c12.5-12.48 12.5-32.75 0-45.24zM359.45 203.46l-50.91-50.91 86.6-86.6 50.91 50.91-86.6 86.6z" /></svg>
|
|
34
|
+
</span>
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
const addIcon = (
|
|
38
|
+
<span className="fa icon">
|
|
39
|
+
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" data-prefix="fas"
|
|
40
|
+
data-icon="plus-circle" role="img" viewBox="0 0 512 512">
|
|
41
|
+
<path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm144 276c0 6.6-5.4 12-12 12h-92v92c0 6.6-5.4 12-12 12h-56c-6.6 0-12-5.4-12-12v-92h-92c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h92v-92c0-6.6 5.4-12 12-12h56c6.6 0 12 5.4 12 12v92h92c6.6 0 12 5.4 12 12v56z"/>
|
|
42
|
+
</svg>
|
|
43
|
+
</span>
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
const keyIcon = (
|
|
47
|
+
<span className="fa icon">
|
|
48
|
+
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="key"
|
|
49
|
+
className="svg-inline--fa fa-key fa-w-16" role="img" viewBox="0 0 512 512">
|
|
50
|
+
<path d="M512 176.001C512 273.203 433.202 352 336 352c-11.22 0-22.19-1.062-32.827-3.069l-24.012 27.014A23.999 23.999 0 0 1 261.223 384H224v40c0 13.255-10.745 24-24 24h-40v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24v-78.059c0-6.365 2.529-12.47 7.029-16.971l161.802-161.802C163.108 213.814 160 195.271 160 176 160 78.798 238.797.001 335.999 0 433.488-.001 512 78.511 512 176.001zM336 128c0 26.51 21.49 48 48 48s48-21.49 48-48-21.49-48-48-48-48 21.49-48 48z"/>
|
|
51
|
+
</svg>
|
|
52
|
+
</span>
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
const reloadIcon = (
|
|
56
|
+
<span className="fa icon">
|
|
57
|
+
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="reload"
|
|
58
|
+
className="svg-inline--fa fa-key fa-w-16" role="img" viewBox="0 0 512 512">
|
|
59
|
+
<path xmlns="http://www.w3.org/2000/svg" d="M500.33 0h-47.41a12 12 0 0 0-12 12.57l4 82.76A247.42 247.42 0 0 0 256 8C119.34 8 7.9 119.53 8 256.19 8.1 393.07 119.1 504 256 504a247.1 247.1 0 0 0 166.18-63.91 12 12 0 0 0 .48-17.43l-34-34a12 12 0 0 0-16.38-.55A176 176 0 1 1 402.1 157.8l-101.53-4.87a12 12 0 0 0-12.57 12v47.41a12 12 0 0 0 12 12h200.33a12 12 0 0 0 12-12V12a12 12 0 0 0-12-12z"/>
|
|
60
|
+
</svg>
|
|
61
|
+
</span>
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<div className="web-integration">
|
|
66
|
+
<DisplayInFormMenu>
|
|
67
|
+
<DisplayInFormMenuItem
|
|
68
|
+
title="Twitter (company account)"
|
|
69
|
+
description="companyaccount@pasbolt.com"
|
|
70
|
+
icon={keyIcon}/>
|
|
71
|
+
<DisplayInFormMenuItem
|
|
72
|
+
title="Create a new credential"
|
|
73
|
+
description="Create and customize it yourself"
|
|
74
|
+
icon={addIcon}/>
|
|
75
|
+
<DisplayInFormMenuItem
|
|
76
|
+
title="Save as new credential"
|
|
77
|
+
description="Save the data entered as a new credential"
|
|
78
|
+
icon={addIcon}/>
|
|
79
|
+
<DisplayInFormMenuItem
|
|
80
|
+
title="Save as a new password securely"
|
|
81
|
+
subtitle={<span>Strength: <span style={{color: 'green'}}>strong</span></span>}
|
|
82
|
+
description="Save the data entered as a new credential"
|
|
83
|
+
icon={magicWandIcon}/>
|
|
84
|
+
<DisplayInFormMenuItem
|
|
85
|
+
title="Browse credentials"
|
|
86
|
+
description="Search among available credentials"
|
|
87
|
+
icon={searchIcon}/>
|
|
88
|
+
<DisplayInFormMenuItem
|
|
89
|
+
title="Generate a new password securely"
|
|
90
|
+
subtitle={<span className="in-form-menu-item-content-subheader-password">Yfdfdlkrefkd,kfndjn"</span>}
|
|
91
|
+
description="You will be able to save it after submitting"
|
|
92
|
+
icon={magicWandIcon}/>
|
|
93
|
+
<DisplayInFormMenuItem
|
|
94
|
+
title="User previously generated password"
|
|
95
|
+
subtitle={<span className="in-form-menu-item-content-subheader-password">Yfdfdlkrefkd,kfndjn"</span>}
|
|
96
|
+
icon={reloadIcon}/>
|
|
97
|
+
</DisplayInFormMenu>
|
|
98
|
+
</div>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const TemplateNoScroll = () => {
|
|
103
|
+
const searchIcon = (
|
|
104
|
+
<span className="fa icon">
|
|
105
|
+
<svg xmlns="http://www.w3.org/2000/svg" aria-label="magnifying glass icon"><path id="search-icon" d="M15.781 13.844a.723.723 0 0 1 .219.531.723.723 0 0 1-.219.531l-.875.875a.723.723 0 0 1-.531.219.723.723 0 0 1-.531-.219l-3.125-3.125a.723.723 0 0 1-.219-.531v-.5C9.333 12.542 8 13 6.5 13a6.313 6.313 0 0 1-3.266-.875 6.567 6.567 0 0 1-2.359-2.36A6.313 6.313 0 0 1 0 6.5c0-1.187.292-2.276.875-3.266A6.567 6.567 0 0 1 3.235.875 6.313 6.313 0 0 1 6.5 0c1.187 0 2.276.292 3.266.875a6.567 6.567 0 0 1 2.359 2.36c.583.989.875 2.078.875 3.265 0 1.5-.458 2.833-1.375 4h.5c.208 0 .385.073.531.219l3.125 3.125zM6.5 10.5c.73 0 1.401-.177 2.016-.531a3.891 3.891 0 0 0 1.453-1.453A3.966 3.966 0 0 0 10.5 6.5c0-.73-.177-1.401-.531-2.016a3.891 3.891 0 0 0-1.453-1.453A3.966 3.966 0 0 0 6.5 2.5c-.73 0-1.401.177-2.016.531a3.891 3.891 0 0 0-1.453 1.453A3.966 3.966 0 0 0 2.5 6.5c0 .73.177 1.401.531 2.016a3.891 3.891 0 0 0 1.453 1.453A3.966 3.966 0 0 0 6.5 10.5z" fillRule="evenodd" /></svg>
|
|
106
|
+
</span>
|
|
107
|
+
);
|
|
108
|
+
const magicWandIcon = (
|
|
109
|
+
<span className="fa icon">
|
|
110
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M224 96l16-32 32-16-32-16-16-32-16 32-32 16 32 16 16 32zM80 160l26.66-53.33L160 80l-53.34-26.67L80 0 53.34 53.33 0 80l53.34 26.67L80 160zm352 128l-26.66 53.33L352 368l53.34 26.67L432 448l26.66-53.33L512 368l-53.34-26.67L432 288zm70.62-193.77L417.77 9.38C411.53 3.12 403.34 0 395.15 0c-8.19 0-16.38 3.12-22.63 9.38L9.38 372.52c-12.5 12.5-12.5 32.76 0 45.25l84.85 84.85c6.25 6.25 14.44 9.37 22.62 9.37 8.19 0 16.38-3.12 22.63-9.37l363.14-363.15c12.5-12.48 12.5-32.75 0-45.24zM359.45 203.46l-50.91-50.91 86.6-86.6 50.91 50.91-86.6 86.6z" /></svg>
|
|
111
|
+
</span>
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
const keyIcon = (
|
|
115
|
+
<span className="fa icon">
|
|
116
|
+
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="key"
|
|
117
|
+
className="svg-inline--fa fa-key fa-w-16" role="img" viewBox="0 0 512 512">
|
|
118
|
+
<path d="M512 176.001C512 273.203 433.202 352 336 352c-11.22 0-22.19-1.062-32.827-3.069l-24.012 27.014A23.999 23.999 0 0 1 261.223 384H224v40c0 13.255-10.745 24-24 24h-40v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24v-78.059c0-6.365 2.529-12.47 7.029-16.971l161.802-161.802C163.108 213.814 160 195.271 160 176 160 78.798 238.797.001 335.999 0 433.488-.001 512 78.511 512 176.001zM336 128c0 26.51 21.49 48 48 48s48-21.49 48-48-21.49-48-48-48-48 21.49-48 48z"/>
|
|
119
|
+
</svg>
|
|
120
|
+
</span>
|
|
121
|
+
)
|
|
122
|
+
return (
|
|
123
|
+
<div className="quickaccess">
|
|
124
|
+
<DisplayInFormMenu>
|
|
125
|
+
<DisplayInFormMenuItem
|
|
126
|
+
title="Matching Credentials"
|
|
127
|
+
description="john@pasbolt.com"
|
|
128
|
+
icon={keyIcon}/>
|
|
129
|
+
<DisplayInFormMenuItem
|
|
130
|
+
title="Save as a new password securely"
|
|
131
|
+
subtitle={<span>Strength: <span style={{color: 'green'}}>strong</span></span>}
|
|
132
|
+
description="Save the data entered as a new credential"
|
|
133
|
+
icon={magicWandIcon}/>
|
|
134
|
+
<DisplayInFormMenuItem
|
|
135
|
+
title="Browse credentials"
|
|
136
|
+
description="Search among available credentials"
|
|
137
|
+
icon={searchIcon}/>
|
|
138
|
+
</DisplayInFormMenu>
|
|
139
|
+
</div>
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const TemplateWithScroll = () => {
|
|
144
|
+
const searchIcon = (
|
|
145
|
+
<span className="fa icon">
|
|
146
|
+
<svg xmlns="http://www.w3.org/2000/svg" aria-label="magnifying glass icon"><path id="search-icon" d="M15.781 13.844a.723.723 0 0 1 .219.531.723.723 0 0 1-.219.531l-.875.875a.723.723 0 0 1-.531.219.723.723 0 0 1-.531-.219l-3.125-3.125a.723.723 0 0 1-.219-.531v-.5C9.333 12.542 8 13 6.5 13a6.313 6.313 0 0 1-3.266-.875 6.567 6.567 0 0 1-2.359-2.36A6.313 6.313 0 0 1 0 6.5c0-1.187.292-2.276.875-3.266A6.567 6.567 0 0 1 3.235.875 6.313 6.313 0 0 1 6.5 0c1.187 0 2.276.292 3.266.875a6.567 6.567 0 0 1 2.359 2.36c.583.989.875 2.078.875 3.265 0 1.5-.458 2.833-1.375 4h.5c.208 0 .385.073.531.219l3.125 3.125zM6.5 10.5c.73 0 1.401-.177 2.016-.531a3.891 3.891 0 0 0 1.453-1.453A3.966 3.966 0 0 0 10.5 6.5c0-.73-.177-1.401-.531-2.016a3.891 3.891 0 0 0-1.453-1.453A3.966 3.966 0 0 0 6.5 2.5c-.73 0-1.401.177-2.016.531a3.891 3.891 0 0 0-1.453 1.453A3.966 3.966 0 0 0 2.5 6.5c0 .73.177 1.401.531 2.016a3.891 3.891 0 0 0 1.453 1.453A3.966 3.966 0 0 0 6.5 10.5z" fillRule="evenodd" /></svg>
|
|
147
|
+
</span>
|
|
148
|
+
);
|
|
149
|
+
const magicWandIcon = (
|
|
150
|
+
<span className="fa icon">
|
|
151
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M224 96l16-32 32-16-32-16-16-32-16 32-32 16 32 16 16 32zM80 160l26.66-53.33L160 80l-53.34-26.67L80 0 53.34 53.33 0 80l53.34 26.67L80 160zm352 128l-26.66 53.33L352 368l53.34 26.67L432 448l26.66-53.33L512 368l-53.34-26.67L432 288zm70.62-193.77L417.77 9.38C411.53 3.12 403.34 0 395.15 0c-8.19 0-16.38 3.12-22.63 9.38L9.38 372.52c-12.5 12.5-12.5 32.76 0 45.25l84.85 84.85c6.25 6.25 14.44 9.37 22.62 9.37 8.19 0 16.38-3.12 22.63-9.37l363.14-363.15c12.5-12.48 12.5-32.75 0-45.24zM359.45 203.46l-50.91-50.91 86.6-86.6 50.91 50.91-86.6 86.6z" /></svg>
|
|
152
|
+
</span>
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
const keyIcon = (
|
|
156
|
+
<span className="fa icon">
|
|
157
|
+
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="key"
|
|
158
|
+
className="svg-inline--fa fa-key fa-w-16" role="img" viewBox="0 0 512 512">
|
|
159
|
+
<path d="M512 176.001C512 273.203 433.202 352 336 352c-11.22 0-22.19-1.062-32.827-3.069l-24.012 27.014A23.999 23.999 0 0 1 261.223 384H224v40c0 13.255-10.745 24-24 24h-40v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24v-78.059c0-6.365 2.529-12.47 7.029-16.971l161.802-161.802C163.108 213.814 160 195.271 160 176 160 78.798 238.797.001 335.999 0 433.488-.001 512 78.511 512 176.001zM336 128c0 26.51 21.49 48 48 48s48-21.49 48-48-21.49-48-48-48-48 21.49-48 48z"/>
|
|
160
|
+
</svg>
|
|
161
|
+
</span>
|
|
162
|
+
)
|
|
163
|
+
return (
|
|
164
|
+
<div className="quickaccess">
|
|
165
|
+
<DisplayInFormMenu>
|
|
166
|
+
<DisplayInFormMenuItem
|
|
167
|
+
title="Matching Credentials"
|
|
168
|
+
description="john@pasbolt.com"
|
|
169
|
+
icon={keyIcon}/>
|
|
170
|
+
<DisplayInFormMenuItem
|
|
171
|
+
title="Matching Credentials 2"
|
|
172
|
+
description="john2@pasbolt.com"
|
|
173
|
+
icon={keyIcon}/>
|
|
174
|
+
<DisplayInFormMenuItem
|
|
175
|
+
title="Save as a new password securely"
|
|
176
|
+
subtitle={<span>Strength: <span style={{color: 'green'}}>strong</span></span>}
|
|
177
|
+
description="Save the data entered as a new credential"
|
|
178
|
+
icon={magicWandIcon}/>
|
|
179
|
+
<DisplayInFormMenuItem
|
|
180
|
+
title="Browse credentials"
|
|
181
|
+
description="Search among available credentials"
|
|
182
|
+
icon={searchIcon}/>
|
|
183
|
+
</DisplayInFormMenu>
|
|
184
|
+
</div>
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
const parameters = {
|
|
189
|
+
css: "ext_in_form_menu"
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
export const AllMenuItems = TemplateAllItemsMenu.bind({});
|
|
193
|
+
export const NoScrollItems = TemplateNoScroll.bind({});
|
|
194
|
+
export const ScrollableMenu = TemplateWithScroll.bind({});
|
|
195
|
+
|
|
196
|
+
AllMenuItems.parameters = parameters;
|
|
197
|
+
NoScrollItems.parameters = parameters;
|
|
198
|
+
ScrollableMenu.parameters = parameters;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Passbolt ~ Open source password manager for teams
|
|
3
|
+
* Copyright (c) 2021 Passbolt SA (https://www.passbolt.com)
|
|
4
|
+
*
|
|
5
|
+
* Licensed under GNU Affero General Public License version 3 of the or any later version.
|
|
6
|
+
* For full copyright and license information, please see the LICENSE.txt
|
|
7
|
+
* Redistributions of files must retain the above copyright notice.
|
|
8
|
+
*
|
|
9
|
+
* @copyright Copyright (c) 2021 Passbolt SA (https://www.passbolt.com)
|
|
10
|
+
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License
|
|
11
|
+
* @link https://www.passbolt.com Passbolt(tm)
|
|
12
|
+
* @since 3.3.0
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import React from "react";
|
|
16
|
+
import PropTypes from "prop-types";
|
|
17
|
+
import Icon from "../../../react-extension/components/Common/Icons/Icon";
|
|
18
|
+
|
|
19
|
+
class DisplayInFormMenuItem extends React.Component {
|
|
20
|
+
/**
|
|
21
|
+
* Default constructor
|
|
22
|
+
* @param props Component props
|
|
23
|
+
*/
|
|
24
|
+
constructor(props) {
|
|
25
|
+
super(props);
|
|
26
|
+
this.bindCallbacks();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Binds methods callbacks
|
|
31
|
+
*/
|
|
32
|
+
bindCallbacks() {
|
|
33
|
+
this.handleClick = this.handleClick.bind(this);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Get the input button classname
|
|
38
|
+
* @returns {string}
|
|
39
|
+
*/
|
|
40
|
+
getClassName() {
|
|
41
|
+
let name = 'in-form-menu-item';
|
|
42
|
+
if (this.props.disabled) {
|
|
43
|
+
name += ' disabled';
|
|
44
|
+
}
|
|
45
|
+
if (this.props.processing) {
|
|
46
|
+
name += ' processing';
|
|
47
|
+
}
|
|
48
|
+
return name;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Handle cancel click
|
|
53
|
+
* @return {void}
|
|
54
|
+
*/
|
|
55
|
+
handleClick() {
|
|
56
|
+
this.props.onClick();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Render the component
|
|
61
|
+
*/
|
|
62
|
+
render() {
|
|
63
|
+
return (
|
|
64
|
+
<a className={this.getClassName()} onClick={this.handleClick}>
|
|
65
|
+
{this.props.processing &&
|
|
66
|
+
<div className="processing-wrapper">
|
|
67
|
+
<div className="processing"></div>
|
|
68
|
+
</div>
|
|
69
|
+
}
|
|
70
|
+
{!this.props.processing &&
|
|
71
|
+
<div className="in-form-menu-item-icon">
|
|
72
|
+
<Icon name={this.props.icon} big={true} dim={true}/>
|
|
73
|
+
</div>
|
|
74
|
+
}
|
|
75
|
+
<div className="in-form-menu-item-content">
|
|
76
|
+
<div className="in-form-menu-item-content-header">
|
|
77
|
+
<strong>
|
|
78
|
+
{this.props.title}
|
|
79
|
+
</strong>
|
|
80
|
+
</div>
|
|
81
|
+
<div className="in-form-menu-item-content-subheader">
|
|
82
|
+
{this.props.subtitle}
|
|
83
|
+
</div>
|
|
84
|
+
<div className="in-form-menu-item-content-description">
|
|
85
|
+
{this.props.description}
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
</a>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
DisplayInFormMenuItem.propTypes = {
|
|
94
|
+
title: PropTypes.string,
|
|
95
|
+
subtitle: PropTypes.any,
|
|
96
|
+
description: PropTypes.string,
|
|
97
|
+
icon: PropTypes.any,
|
|
98
|
+
processing: PropTypes.bool,
|
|
99
|
+
disabled: PropTypes.bool,
|
|
100
|
+
onClick: PropTypes.func
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export default DisplayInFormMenuItem;
|