passbolt-styleguide 3.8.3 → 3.9.0-alpha1

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.
Files changed (314) hide show
  1. package/build/css/help.min.css +3 -3
  2. package/build/css/public.min.css +3 -3
  3. package/build/css/themes/default/api_authentication.min.css +3 -3
  4. package/build/css/themes/default/api_cloud.min.css +3 -3
  5. package/build/css/themes/default/api_main.min.css +3 -3
  6. package/build/css/themes/default/api_reports.min.css +3 -3
  7. package/build/css/themes/default/api_webinstaller.min.css +3 -3
  8. package/build/css/themes/default/ext_app.min.css +3 -3
  9. package/build/css/themes/default/ext_authentication.min.css +3 -3
  10. package/build/css/themes/default/ext_external.min.css +2 -2
  11. package/build/css/themes/default/ext_in_form_cta.min.css +3 -3
  12. package/build/css/themes/default/ext_in_form_menu.min.css +3 -3
  13. package/build/css/themes/default/ext_quickaccess.min.css +3 -3
  14. package/build/css/themes/midgar/api_authentication.min.css +3 -3
  15. package/build/css/themes/midgar/api_main.min.css +3 -3
  16. package/build/css/themes/midgar/api_reports.min.css +3 -3
  17. package/build/css/themes/midgar/ext_app.min.css +3 -3
  18. package/build/css/themes/midgar/ext_authentication.min.css +3 -3
  19. package/build/css/themes/midgar/ext_in_form_cta.min.css +3 -3
  20. package/build/css/themes/midgar/ext_in_form_menu.min.css +3 -3
  21. package/build/css/themes/midgar/ext_quickaccess.min.css +3 -3
  22. package/build/css/themes/solarized_dark/api_authentication.min.css +1 -1
  23. package/build/css/themes/solarized_dark/api_main.min.css +1 -1
  24. package/build/css/themes/solarized_dark/api_reports.min.css +1 -1
  25. package/build/css/themes/solarized_dark/ext_app.min.css +1 -1
  26. package/build/css/themes/solarized_dark/ext_authentication.min.css +1 -1
  27. package/build/css/themes/solarized_dark/ext_in_form_cta.min.css +1 -1
  28. package/build/css/themes/solarized_dark/ext_in_form_menu.min.css +1 -1
  29. package/build/css/themes/solarized_dark/ext_quickaccess.min.css +1 -1
  30. package/build/css/themes/solarized_light/api_authentication.min.css +1 -1
  31. package/build/css/themes/solarized_light/api_main.min.css +1 -1
  32. package/build/css/themes/solarized_light/api_reports.min.css +1 -1
  33. package/build/css/themes/solarized_light/ext_app.min.css +1 -1
  34. package/build/css/themes/solarized_light/ext_authentication.min.css +1 -1
  35. package/build/css/themes/solarized_light/ext_in_form_cta.min.css +1 -1
  36. package/build/css/themes/solarized_light/ext_in_form_menu.min.css +1 -1
  37. package/build/css/themes/solarized_light/ext_quickaccess.min.css +1 -1
  38. package/build/js/dist/api-app.js +1 -1
  39. package/build/js/dist/api-app.js.LICENSE.txt +75 -5
  40. package/build/js/dist/api-feedback.js +2 -0
  41. package/build/js/dist/api-feedback.js.LICENSE.txt +45 -0
  42. package/build/js/dist/api-vendors.js +1 -1
  43. package/build/js/dist/api-vendors.js.LICENSE.txt +11 -9
  44. package/build/js/dist/src/locales/de-DE/common.json +995 -0
  45. package/build/js/dist/src/locales/en-UK/common.json +1061 -0
  46. package/build/js/dist/src/locales/es-ES/common.json +995 -0
  47. package/build/js/dist/src/locales/fr-FR/common.json +995 -0
  48. package/build/js/dist/src/locales/ja-JP/common.json +980 -0
  49. package/build/js/dist/src/locales/lt-LT/common.json +1025 -0
  50. package/build/js/dist/src/locales/nl-NL/common.json +995 -0
  51. package/build/js/dist/src/locales/pl-PL/common.json +1025 -0
  52. package/build/js/dist/src/locales/sv-SE/common.json +995 -0
  53. package/package.json +18 -1
  54. package/src/img/controls/attention.svg +1 -0
  55. package/src/locales/en-UK/common.json +79 -16
  56. package/src/react-api/ApiError/ApiError.js +119 -0
  57. package/src/react-api/ApiError/ApiError.test.js +43 -0
  58. package/src/react-api/ApiError/ApiError.test.page.js +107 -0
  59. package/src/react-api/ApiError/ApiError.test.stories.js +39 -0
  60. package/src/react-extension/ApiApp.js +17 -5
  61. package/src/react-extension/ExtApp.js +12 -5
  62. package/src/react-extension/ExtAuthenticationLogin.js +14 -12
  63. package/src/react-extension/ExtAuthenticationLogin.test.stories.js +59 -0
  64. package/src/react-extension/ExtBootstrapApp.js +1 -0
  65. package/src/react-extension/components/Administration/AdministrationWorkspace.js +24 -0
  66. package/src/react-extension/components/Administration/AdministrationWorkspace.test.data.js +3 -3
  67. package/src/react-extension/components/Administration/AdministrationWorkspace.test.js +13 -1
  68. package/src/react-extension/components/Administration/AdministrationWorkspace.test.page.js +7 -0
  69. package/src/react-extension/components/Administration/ConfirmDeleteSsoSettingsDialog/ConfirmDeleteSsoSettingsDialog.js +101 -0
  70. package/src/react-extension/components/Administration/ConfirmDeleteSsoSettingsDialog/ConfirmDeleteSsoSettingsDialog.test.data.js +23 -0
  71. package/src/react-extension/components/Administration/ConfirmDeleteSsoSettingsDialog/ConfirmDeleteSsoSettingsDialog.test.stories.js +27 -0
  72. package/src/react-extension/components/Administration/ConfirmSaveAccountRecoverySettings/ConfirmSaveAccountRecoverySettings.js +1 -1
  73. package/src/react-extension/components/Administration/DisplayAdministrationMenu/DisplayAdministrationMenu.js +78 -2
  74. package/src/react-extension/components/Administration/DisplayAdministrationMenu/DisplayAdministrationMenu.test.data.js +3 -1
  75. package/src/react-extension/components/Administration/DisplayAdministrationMenu/DisplayAdministrationMenu.test.js +60 -0
  76. package/src/react-extension/components/Administration/DisplayAdministrationMenu/DisplayAdministrationMenu.test.page.js +23 -4
  77. package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceActions/DisplayAdministrationInternationalisationActions/DisplayAdministrationInternationalisationActions.js +125 -0
  78. package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceActions/DisplayAdministrationMfaActions/DisplayAdministrationMfaActions.js +131 -0
  79. package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceActions/DisplayAdministrationSelfRegistrationActions/DisplayAdministrationSelfRegistrationActions.js +103 -0
  80. package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceActions/DisplayAdministrationSsoActions/DisplayAdministrationSsoActions.js +91 -0
  81. package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceActions/DisplayAdministrationSubscriptionActions/DisplayAdministrationSubscriptionActions.js +85 -0
  82. package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceActions/DisplayAdministrationUserDirectoryActions/DisplayAdministrationUserDirectoryActions.js +228 -0
  83. package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceBreadcrumb/DisplayAdministrationWorkspaceBreadcrumb.js +4 -0
  84. package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceBreadcrumb/DisplayAdministrationWorkspaceBreadcrumb.test.js +9 -0
  85. package/src/react-extension/components/Administration/DisplayEmailNotificationsAdministration/DisplayEmailNotificationsAdministration.js +3 -3
  86. package/src/react-extension/components/Administration/DisplayEmailNotificationsAdministration/DisplayEmailNotificationsAdministration.test.data.js +14 -0
  87. package/src/react-extension/components/Administration/DisplayEmailNotificationsAdministration/DisplayEmailNotificationsAdministration.test.page.js +0 -17
  88. package/src/react-extension/components/Administration/DisplayInternationalizationAdministration/DisplayInternationalizationAdministration.js +18 -115
  89. package/src/react-extension/components/Administration/DisplayInternationalizationAdministration/DisplayInternationalizationAdministration.test.data.js +11 -13
  90. package/src/react-extension/components/Administration/DisplayInternationalizationAdministration/DisplayInternationalizationAdministration.test.js +38 -43
  91. package/src/react-extension/components/Administration/DisplayInternationalizationAdministration/DisplayInternationalizationAdministration.test.page.js +47 -10
  92. package/src/react-extension/components/Administration/DisplayInternationalizationAdministration/DisplayInternationalizationAdministration.test.stories.js +10 -43
  93. package/src/react-extension/components/Administration/DisplayMfaAdministration/DisplayMfaAdministration.js +82 -367
  94. package/src/react-extension/components/Administration/DisplayMfaAdministration/DisplayMfaAdministration.test.data.js +128 -42
  95. package/src/react-extension/components/Administration/DisplayMfaAdministration/DisplayMfaAdministration.test.js +75 -121
  96. package/src/react-extension/components/Administration/DisplayMfaAdministration/DisplayMfaAdministration.test.page.js +46 -16
  97. package/src/react-extension/components/Administration/DisplayMfaAdministration/DisplayMfaAdministration.test.stories.js +18 -14
  98. package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/ConfirmDeletionSelfRegistrationSettings/ConfirmDeletionSelfRegistrationSettings.js +103 -0
  99. package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/ConfirmDeletionSelfRegistrationSettings/ConfirmDeletionSelfRegistrationSettings.test.js +53 -0
  100. package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/ConfirmDeletionSelfRegistrationSettings/ConfirmDeletionSelfRegistrationSettings.test.page.js +81 -0
  101. package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/ConfirmDeletionSelfRegistrationSettings/ConfirmDeletionSelfRegistrationSettings.test.stories.js +34 -0
  102. package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/ConfirmSaveSelfRegistrationSettings/ConfirmSaveSelfRegistrationSettings.js +125 -0
  103. package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/ConfirmSaveSelfRegistrationSettings/ConfirmSaveSelfRegistrationSettings.test.data.js +63 -0
  104. package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/ConfirmSaveSelfRegistrationSettings/ConfirmSaveSelfRegistrationSettings.test.js +54 -0
  105. package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/ConfirmSaveSelfRegistrationSettings/ConfirmSaveSelfRegistrationSettings.test.page.js +88 -0
  106. package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/ConfirmSaveSelfRegistrationSettings/ConfirmSaveSelfRegistrationSettings.test.stories.js +35 -0
  107. package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/DisplaySelfRegistrationAdministration.js +381 -0
  108. package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/DisplaySelfRegistrationAdministration.test.data.js +69 -0
  109. package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/DisplaySelfRegistrationAdministration.test.js +332 -0
  110. package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/DisplaySelfRegistrationAdministration.test.page.js +247 -0
  111. package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/DisplaySelfRegistrationAdministration.test.stories.js +72 -0
  112. package/src/react-extension/components/Administration/DisplaySimulateSynchronizeUserDirectoryAdministration/DisplaySimulateSynchronizeUserDirectoryAdministration.js +19 -19
  113. package/src/react-extension/components/Administration/DisplaySimulateSynchronizeUserDirectoryAdministration/DisplaySimulateSynchronizeUserDirectoryAdministration.test.data.js +1717 -1729
  114. package/src/react-extension/components/Administration/DisplaySimulateSynchronizeUserDirectoryAdministration/DisplaySimulateSynchronizeUserDirectoryAdministration.test.js +11 -3
  115. package/src/react-extension/components/Administration/DisplaySimulateSynchronizeUserDirectoryAdministration/DisplaySimulateSynchronizeUserDirectoryAdministration.test.page.js +4 -1
  116. package/src/react-extension/components/Administration/DisplaySimulateSynchronizeUserDirectoryAdministration/DisplaySimulateSynchronizeUserDirectoryAdministration.test.stories.js +11 -1784
  117. package/src/react-extension/components/Administration/DisplaySubscriptionKey/DisplaySubscriptionKey.js +41 -140
  118. package/src/react-extension/components/Administration/DisplaySubscriptionKey/DisplaySubscriptionKey.test.data.js +15 -3
  119. package/src/react-extension/components/Administration/DisplaySubscriptionKey/DisplaySubscriptionKey.test.js +22 -49
  120. package/src/react-extension/components/Administration/DisplaySubscriptionKey/DisplaySubscriptionKey.test.page.js +19 -11
  121. package/src/react-extension/components/Administration/DisplaySubscriptionKey/DisplaySubscriptionKey.test.stories.js +9 -3
  122. package/src/react-extension/components/Administration/DisplaySynchronizeUserDirectoryAdministration/DisplaySynchronizeUserDirectoryAdministration.js +5 -6
  123. package/src/react-extension/components/Administration/DisplaySynchronizeUserDirectoryAdministration/DisplaySynchronizeUserDirectoryAdministration.test.data.js +1717 -1728
  124. package/src/react-extension/components/Administration/DisplaySynchronizeUserDirectoryAdministration/DisplaySynchronizeUserDirectoryAdministration.test.js +11 -3
  125. package/src/react-extension/components/Administration/DisplaySynchronizeUserDirectoryAdministration/DisplaySynchronizeUserDirectoryAdministration.test.page.js +4 -1
  126. package/src/react-extension/components/Administration/DisplaySynchronizeUserDirectoryAdministration/DisplaySynchronizeUserDirectoryAdministration.test.stories.js +11 -1784
  127. package/src/react-extension/components/Administration/DisplayUserDirectoryAdministration/DisplayUserDirectoryAdministration.js +362 -835
  128. package/src/react-extension/components/Administration/DisplayUserDirectoryAdministration/DisplayUserDirectoryAdministration.test.data.js +427 -418
  129. package/src/react-extension/components/Administration/DisplayUserDirectoryAdministration/DisplayUserDirectoryAdministration.test.js +134 -175
  130. package/src/react-extension/components/Administration/DisplayUserDirectoryAdministration/DisplayUserDirectoryAdministration.test.page.js +108 -11
  131. package/src/react-extension/components/Administration/DisplayUserDirectoryAdministration/DisplayUserDirectoryAdministration.test.stories.js +17 -25
  132. package/src/react-extension/components/Administration/EditSubscriptionKey/EditSubscriptionKey.js +4 -2
  133. package/src/react-extension/components/Administration/ManageAccountRecoveryAdministrationSettings/ManageAccountRecoveryAdministrationSettings.js +3 -3
  134. package/src/react-extension/components/Administration/ManageAccountRecoveryAdministrationSettings/ManageAccountRecoveryAdministrationSettings.test.js +1 -1
  135. package/src/react-extension/components/Administration/ManageSmtpAdministrationSettings/ManageSmtpAdministrationSettings.js +32 -7
  136. package/src/react-extension/components/Administration/ManageSmtpAdministrationSettings/ManageSmtpAdministrationSettings.test.data.js +0 -3
  137. package/src/react-extension/components/Administration/ManageSmtpAdministrationSettings/ManageSmtpAdministrationSettings.test.js +145 -1
  138. package/src/react-extension/components/Administration/ManageSmtpAdministrationSettings/ManageSmtpAdministrationSettings.test.page.js +52 -1
  139. package/src/react-extension/components/Administration/ManageSmtpAdministrationSettings/ManageSmtpAdministrationSettings.test.stories.js +15 -0
  140. package/src/react-extension/components/Administration/ManageSsoSettings/ManageSsoSettings.js +340 -0
  141. package/src/react-extension/components/Administration/ManageSsoSettings/ManageSsoSettings.test.data.js +56 -0
  142. package/src/react-extension/components/Administration/ManageSsoSettings/ManageSsoSettings.test.js +223 -0
  143. package/src/react-extension/components/Administration/ManageSsoSettings/ManageSsoSettings.test.page.js +235 -0
  144. package/src/react-extension/components/Administration/ManageSsoSettings/ManageSsoSettings.test.stories.js +55 -0
  145. package/src/react-extension/components/Administration/ManageSsoSettings/SsoProviders.data.js +34 -0
  146. package/src/react-extension/components/Administration/SelectAccountRecoveryOrganizationKey/GenerateOrganizationKey.js +12 -3
  147. package/src/react-extension/components/Administration/SelectAccountRecoveryOrganizationKey/GenerateOrganizationKey.test.js +27 -0
  148. package/src/react-extension/components/Administration/SelectAccountRecoveryOrganizationKey/SelectAccountRecoveryOrganizationKey.test.page.js +8 -0
  149. package/src/react-extension/components/Administration/TestSsoSettingsDialog/TestSsoSettingsDialog.js +197 -0
  150. package/src/react-extension/components/Administration/TestSsoSettingsDialog/TestSsoSettingsDialog.test.data.js +37 -0
  151. package/src/react-extension/components/Administration/TestSsoSettingsDialog/TestSsoSettingsDialog.test.js +187 -0
  152. package/src/react-extension/components/Administration/TestSsoSettingsDialog/TestSsoSettingsDialog.test.page.js +120 -0
  153. package/src/react-extension/components/Administration/TestSsoSettingsDialog/TestSsoSettingsDialog.test.stories.js +31 -0
  154. package/src/react-extension/components/Authentication/CheckPassphrase/CheckPassphrase.js +9 -5
  155. package/src/react-extension/components/Authentication/CheckPassphrase/CheckPassphrase.test.data.js +4 -0
  156. package/src/react-extension/components/Authentication/CheckPassphrase/CheckPassphrase.test.js +11 -42
  157. package/src/react-extension/components/Authentication/CheckPassphrase/CheckPassphrase.test.page.js +1 -0
  158. package/src/react-extension/components/Authentication/CreateGpgKey/CreateGpgKey.js +9 -5
  159. package/src/react-extension/components/Authentication/CreateGpgKey/CreateGpgKey.test.data.js +4 -0
  160. package/src/react-extension/components/Authentication/CreateGpgKey/CreateGpgKey.test.js +16 -2
  161. package/src/react-extension/components/Authentication/CreateGpgKey/CreateGpgKey.test.page.js +17 -1
  162. package/src/react-extension/components/AuthenticationLogin/Login/Login.js +177 -63
  163. package/src/react-extension/components/AuthenticationLogin/Login/Login.test.data.js +19 -11
  164. package/src/react-extension/components/AuthenticationLogin/Login/Login.test.js +93 -0
  165. package/src/react-extension/components/AuthenticationLogin/Login/Login.test.page.js +16 -0
  166. package/src/react-extension/components/AuthenticationLogin/OrchestrateLogin/OrchestrateLoginBoxMain.js +1 -0
  167. package/src/react-extension/components/AuthenticationSetup/SetupAuthentication/SetupAuthentication.js +4 -0
  168. package/src/react-extension/components/Common/Error/ApiError/ApiError.js +119 -0
  169. package/src/react-extension/components/Common/Error/ApiError/ApiError.test.js +43 -0
  170. package/src/react-extension/components/Common/Error/ApiError/ApiError.test.page.js +108 -0
  171. package/src/react-extension/components/Common/Error/ApiError/ApiError.test.stories.js +39 -0
  172. package/src/react-extension/components/Common/Inputs/Autocomplete/Autocomplete.test.js +12 -0
  173. package/src/react-extension/components/Common/Inputs/Autocomplete/AutocompleteItem.js +2 -2
  174. package/src/react-extension/components/Common/Legacy/HandleLegacyAppjs.js +1 -1
  175. package/src/react-extension/components/Common/Navigation/Header/Logo.js +13 -1
  176. package/src/react-extension/components/Resource/CreateResource/CreateResource.js +103 -30
  177. package/src/react-extension/components/Resource/CreateResource/CreateResource.test.js +44 -10
  178. package/src/react-extension/components/Resource/CreateResource/CreateResource.test.page.js +35 -7
  179. package/src/react-extension/components/Resource/DisplayResourcesList/DisplayResourcesList.js +3 -3
  180. package/src/react-extension/components/Resource/DisplayResourcesList/DisplayResourcesListContextualMenu.js +6 -5
  181. package/src/react-extension/components/Resource/DisplayResourcesWorkspace/DisplayResourcesWorkspaceMenu.js +5 -4
  182. package/src/react-extension/components/Resource/EditResource/EditResource.js +95 -23
  183. package/src/react-extension/components/Resource/EditResource/EditResource.test.js +45 -13
  184. package/src/react-extension/components/Resource/EditResource/EditResource.test.page.js +35 -2
  185. package/src/react-extension/components/ResourceDetails/DisplayResourceDetails/DisplayResourceDetails.js +2 -1
  186. package/src/react-extension/components/ResourceDetails/DisplayResourceDetails/DisplayResourceDetailsInformation.js +3 -2
  187. package/src/react-extension/components/ResourceFolder/CreateResourceFolder/CreateResourceFolder.js +23 -2
  188. package/src/react-extension/components/ResourceFolder/CreateResourceFolder/CreateResourceFolder.test.js +8 -0
  189. package/src/react-extension/components/ResourceFolder/CreateResourceFolder/CreateResourceFolder.test.page.js +26 -2
  190. package/src/react-extension/components/ResourceFolder/RenameResourceFolder/RenameResourceFolder.js +22 -1
  191. package/src/react-extension/components/ResourceFolder/RenameResourceFolder/RenameResourceFolder.test.js +8 -0
  192. package/src/react-extension/components/ResourceFolder/RenameResourceFolder/RenameResourceFolder.test.page.js +25 -2
  193. package/src/react-extension/components/ResourceFolderDetails/DisplayResourceFolderDetails/DisplayResourceFolderDetails.js +2 -1
  194. package/src/react-extension/components/ResourcePassword/GenerateResourcePassword/GenerateResourcePassword.js +2 -1
  195. package/src/react-extension/components/ResourceTag/EditResourceTag/EditResourceTag.js +14 -1
  196. package/src/react-extension/components/ResourceTag/EditResourceTag/EditResourceTag.test.js +8 -0
  197. package/src/react-extension/components/ResourceTag/EditResourceTag/EditResourceTag.test.page.js +12 -0
  198. package/src/react-extension/components/User/CreateUser/CreateUser.js +42 -3
  199. package/src/react-extension/components/User/CreateUser/CreateUser.test.js +16 -0
  200. package/src/react-extension/components/User/CreateUser/CreateUser.test.page.js +26 -0
  201. package/src/react-extension/components/User/DisplayUserWorkspaceActions/DisplayUserWorkspaceActions.js +2 -1
  202. package/src/react-extension/components/User/DisplayUsersContextualMenu/DisplayUsersContextualMenu.js +5 -5
  203. package/src/react-extension/components/User/EditUser/EditUser.js +29 -2
  204. package/src/react-extension/components/User/EditUser/EditUser.test.js +12 -0
  205. package/src/react-extension/components/User/EditUser/EditUser.test.page.js +26 -0
  206. package/src/react-extension/components/UserDetails/DisplayUserDetails/DisplayUserDetails.js +2 -1
  207. package/src/react-extension/components/UserDetails/DisplayUserDetails/DisplayUserDetails.test.data.js +1332 -1331
  208. package/src/react-extension/components/UserDetails/DisplayUserDetailsPublicKey/DisplayUserDetailsPublicKey.js +2 -1
  209. package/src/react-extension/components/UserGroup/CreateUserGroup/CreateUserGroup.js +19 -1
  210. package/src/react-extension/components/UserGroup/CreateUserGroup/CreateUserGroup.test.js +9 -0
  211. package/src/react-extension/components/UserGroup/CreateUserGroup/CreateUserGroup.test.page.js +12 -0
  212. package/src/react-extension/components/UserGroup/DisplayUserGroupDetails/DisplayUserGroupDetails.js +2 -1
  213. package/src/react-extension/components/UserGroup/EditUserGroup/EditUserGroup.js +16 -1
  214. package/src/react-extension/components/UserGroup/EditUserGroup/EditUserGroup.test.js +8 -0
  215. package/src/react-extension/components/UserGroup/EditUserGroup/EditUserGroup.test.page.js +26 -1
  216. package/src/react-extension/components/UserSetting/ChangeUserPassphrase/ConfirmPassphrase.js +1 -1
  217. package/src/react-extension/components/UserSetting/ChangeUserPassphrase/EnterNewPassphrase.js +6 -4
  218. package/src/react-extension/components/UserSetting/ChangeUserPassphrase/EnterNewPassphrase.test.data.js +4 -1
  219. package/src/react-extension/components/UserSetting/ChangeUserPassphrase/EnterNewPassphrase.test.js +21 -11
  220. package/src/react-extension/components/UserSetting/ChangeUserPassphrase/EnterNewPassphrase.test.page.js +10 -1
  221. package/src/react-extension/contexts/AdminSmtpSettingsContext.js +2 -0
  222. package/src/react-extension/contexts/AdminSmtpSettingsContext.test.data.js +13 -0
  223. package/src/react-extension/contexts/AdminSmtpSettingsContext.test.js +3 -1
  224. package/src/react-extension/contexts/AdminSsoContext.js +558 -0
  225. package/src/react-extension/contexts/AdminSsoContext.test.data.js +51 -0
  226. package/src/react-extension/contexts/Administration/AdministrationInternationalizationContext/AdministrationInternationalizationContext.js +194 -0
  227. package/src/react-extension/contexts/Administration/AdministrationInternationalizationContext/AdministrationInternationalizationContext.test.js +111 -0
  228. package/src/react-extension/contexts/Administration/AdministrationMfa/AdministrationMfaContext.js +265 -0
  229. package/src/react-extension/contexts/Administration/AdministrationMfa/AdministrationMfaContext.test.js +178 -0
  230. package/src/react-extension/contexts/Administration/AdministrationSelfRegistration/AdministrationSelfRegistrationContext.js +453 -0
  231. package/src/react-extension/contexts/Administration/AdministrationSelfRegistration/AdministrationSelfRegistrationContext.test.js +218 -0
  232. package/src/react-extension/contexts/Administration/AdministrationSubscription/AdministrationSubscription.js +168 -0
  233. package/src/react-extension/contexts/Administration/AdministrationSubscription/AdministrationSubscription.test.js +73 -0
  234. package/src/react-extension/contexts/Administration/AdministrationUserDirectory/AdministrationUserDirectoryContext.js +353 -0
  235. package/src/react-extension/contexts/Administration/AdministrationUserDirectory/AdministrationUserDirectoryContext.test.js +220 -0
  236. package/src/react-extension/contexts/AdministrationWorkspaceContext.js +17 -178
  237. package/src/react-extension/contexts/AdministrationWorkspaceContext.test.js +0 -26
  238. package/src/react-extension/contexts/ApiAppContext.test.data.js +4 -2
  239. package/src/react-extension/contexts/Authentication/AuthenticationLoginContext.js +11 -0
  240. package/src/react-extension/contexts/Authentication/AuthenticationSetupContext.js +1 -0
  241. package/src/react-extension/contexts/NavigationContext.js +34 -0
  242. package/src/react-extension/contexts/SsoContext.js +151 -0
  243. package/src/react-extension/lib/Domain/DomainUtil.js +70 -0
  244. package/src/react-extension/lib/Domain/DomainUtil.test.js +129 -0
  245. package/src/react-extension/lib/Domain/Domains.js +6113 -0
  246. package/src/react-extension/lib/Error/InputValidator.js +24 -0
  247. package/src/react-extension/lib/Map/DynamicRef.js +49 -0
  248. package/src/react-extension/lib/Map/DynamicRef.test.js +56 -0
  249. package/src/react-extension/lib/Map/MapObject.js +48 -0
  250. package/src/react-extension/lib/Map/MapObject.test.js +43 -0
  251. package/src/react-quickaccess/ExtQuickAccess.js +7 -4
  252. package/src/react-quickaccess/components/GeneratePasswordPage/GeneratePasswordPage.js +3 -1
  253. package/src/react-quickaccess/components/GeneratePasswordPage/GeneratePasswordPage.test.data.js +4 -0
  254. package/src/react-quickaccess/components/LoginPage/LoginPage.js +115 -4
  255. package/src/react-quickaccess/components/LoginPage/LoginPage.test.data.js +10 -0
  256. package/src/react-quickaccess/components/LoginPage/LoginPage.test.stories.js +30 -3
  257. package/src/react-quickaccess/components/ResourceAutoSave/SaveResource.js +33 -1
  258. package/src/react-quickaccess/components/ResourceAutoSave/SaveResource.test.data.js +25 -0
  259. package/src/react-quickaccess/components/ResourceAutoSave/SaveResource.test.js +60 -0
  260. package/src/react-quickaccess/components/ResourceAutoSave/SaveResource.test.page.js +60 -0
  261. package/src/react-quickaccess/components/ResourceCreatePage/ResourceCreatePage.js +33 -1
  262. package/src/react-quickaccess/components/ResourceCreatePage/ResourceCreatePage.test.js +36 -7
  263. package/src/react-quickaccess/components/ResourceViewPage/ResourceViewPage.js +3 -2
  264. package/src/react-quickaccess/contexts/SsoContext.js +150 -0
  265. package/src/react-web-integration/lib/InForm/InFormFieldSelector.js +5 -0
  266. package/src/shared/constants/inputs.const.js +30 -0
  267. package/src/shared/lib/Browser/clipBoard.js +45 -0
  268. package/src/shared/lib/Browser/clipBoard.test.js +59 -0
  269. package/src/shared/models/Mfa/Duo.js +36 -0
  270. package/src/shared/models/Mfa/Duo.test.js +59 -0
  271. package/src/shared/models/Mfa/MfaDTO.js +51 -0
  272. package/src/shared/models/Mfa/MfaDTO.test.js +48 -0
  273. package/src/shared/models/Mfa/MfaEnumeration.js +17 -0
  274. package/src/shared/models/Mfa/MfaModel.js +48 -0
  275. package/src/shared/models/Mfa/MfaModel.test.js +37 -0
  276. package/src/shared/models/Mfa/Yubikey.js +35 -0
  277. package/src/shared/models/Mfa/Yubikey.test.js +47 -0
  278. package/src/shared/models/selfRegistration/SelfRegistrationDomainsViewModel.js +55 -0
  279. package/src/shared/models/selfRegistration/SelfRegistrationDomainsViewModel.test.js +37 -0
  280. package/src/shared/models/selfRegistration/SelfRegistrationDto.js +42 -0
  281. package/src/shared/models/selfRegistration/SelfRegistrationDto.test.js +48 -0
  282. package/src/shared/models/selfRegistration/SelfRegistrationEnumeration.js +17 -0
  283. package/src/shared/models/subscription/SubscriptionDto.js +34 -0
  284. package/src/shared/models/subscription/SubscriptionDto.test.js +31 -0
  285. package/src/shared/models/subscription/SubscriptionModel.js +33 -0
  286. package/src/shared/models/subscription/SubscriptionModel.test.js +48 -0
  287. package/src/shared/models/user/UserModel.js +37 -0
  288. package/src/shared/models/userDirectory/UserDirectoryDTO.js +57 -0
  289. package/src/shared/models/userDirectory/UserDirectoryDTO.test.js +40 -0
  290. package/src/shared/models/userDirectory/UserDirectoryEnum.js +22 -0
  291. package/src/shared/models/userDirectory/UserDirectoryModel.js +64 -0
  292. package/src/shared/models/userDirectory/UserDirectoryModel.test.js +37 -0
  293. package/src/shared/services/actions/subscription/SubscriptionActionService.js +69 -0
  294. package/src/shared/services/actions/subscription/SubscriptionActionService.test.js +73 -0
  295. package/src/shared/services/api/Internationalisation/InternationalisationService.js +46 -0
  296. package/src/shared/services/api/Mfa/MfaService.js +54 -0
  297. package/src/shared/services/{accountRecovery → api/accountRecovery}/ApiAppAccountRecoveryUserService.js +2 -2
  298. package/src/shared/services/{accountRecovery → api/accountRecovery}/ExtAppAccountRecoveryUserService.js +0 -0
  299. package/src/shared/services/api/secrets/pownedService.js +64 -0
  300. package/src/shared/services/api/secrets/pownedService.test.js +63 -0
  301. package/src/shared/services/api/selfRegistration/selfRegistrationService.js +64 -0
  302. package/src/shared/services/api/user/UserService.js +45 -0
  303. package/src/shared/services/api/userDirectory/UserDirectoryService.js +108 -0
  304. package/src/shared/services/forms/Mfa/MfaFormService.js +195 -0
  305. package/src/shared/services/forms/Mfa/MfaFormService.test.js +341 -0
  306. package/src/shared/services/forms/selfRegistration/SelfRegistrationFormService.js +92 -0
  307. package/src/shared/services/forms/selfRegistration/SelfRegistrationFormService.test.js +101 -0
  308. package/src/shared/services/forms/userDirectory/UserDirectoryFormService.js +118 -0
  309. package/src/shared/services/forms/userDirectory/UserDirectoryFormService.test.js +128 -0
  310. package/.gitlab-ci-local/.gitignore +0 -2
  311. package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceActions/DisplayAdministrationWorkspaceActions.js +0 -205
  312. package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceActions/DisplayAdministrationWorkspaceActions.test.data.js +0 -37
  313. package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceActions/DisplayAdministrationWorkspaceActions.test.js +0 -197
  314. package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceActions/DisplayAdministrationWorkspaceActions.test.page.js +0 -133
@@ -13,11 +13,12 @@
13
13
  */
14
14
  import React from "react";
15
15
  import PropTypes from "prop-types";
16
- import {withActionFeedback} from "../../../contexts/ActionFeedbackContext";
17
- import XRegExp from "xregexp";
18
16
  import Icon from "../../../../shared/components/Icons/Icon";
19
17
  import {withAdministrationWorkspace} from "../../../contexts/AdministrationWorkspaceContext";
20
18
  import {Trans, withTranslation} from "react-i18next";
19
+ import DisplayAdministrationMfaActions from "../DisplayAdministrationWorkspaceActions/DisplayAdministrationMfaActions/DisplayAdministrationMfaActions";
20
+ import {withAdminMfa} from "../../../contexts/Administration/AdministrationMfa/AdministrationMfaContext";
21
+ import MfaFormService from '../../../../shared/services/forms/Mfa/MfaFormService';
21
22
  import Password from "../../../../shared/components/Password/Password";
22
23
 
23
24
  /**
@@ -30,52 +31,30 @@ class DisplayMfaAdministration extends React.Component {
30
31
  */
31
32
  constructor(props) {
32
33
  super(props);
33
- this.state = this.defaultState;
34
+ this.mfaFormService = MfaFormService.getInstance(this.props.adminMfaContext, this.props.t);
34
35
  this.bindCallbacks();
35
36
  }
36
37
 
37
38
  /**
38
- * Get default state
39
- * @returns {*}
39
+ * ComponentDidMount
40
+ * Invoked immediately after component is inserted into the tree
41
+ * @return {void}
40
42
  */
41
- get defaultState() {
42
- return {
43
- loading: true, // component is loading or not
44
- processing: false, // component is processing or not
45
-
46
- // ONE TIME PASSWORD
47
- totpProviderToggle: true, // One Time Password toggle value
48
-
49
- // YUBIKEY
50
- yubikeyToggle: false, // yubikey toggle value
51
- yubikeyClientIdentifier: "", // yubikey client identifier
52
- yubikeyClientIdentifierError: null, // yubikey client identifier error
53
- yubikeySecretKey: "", // yubikey secret key
54
- yubikeySecretKeyError: null, // yubikey secret key error
55
-
56
- // DUO
57
- duoToggle: false, // duo toggle value
58
- duoHostname: "", // duo hostname
59
- duoHostnameError: null, // duo hostname error
60
- duoIntegrationKey: "", // duo integration key
61
- duoIntegrationKeyError: null, // duo integration key error
62
- duoSalt: "", // duo salt
63
- duoSaltError: null, // duo salt error
64
- duoSecretKey: "", // duo secret key
65
- duoSecretKeyError: null, // duo secret key error
66
- };
67
- }
68
43
 
69
44
  async componentDidMount() {
70
- this.findAllMfaSettings();
45
+ this.props.administrationWorkspaceContext.setDisplayAdministrationWorkspaceAction(DisplayAdministrationMfaActions);
46
+ this.props.adminMfaContext.findMfaSettings();
71
47
  }
72
48
 
73
49
  /**
74
- * Whenever the component has updated in terms of props or state
75
- * @param prevProps
50
+ * componentWillUnmount
51
+ * Use to clear the data from the form in case the user put something that needs to be cleared.
76
52
  */
77
- async componentDidUpdate(prevProps) {
78
- await this.handleMustSave(prevProps.administrationWorkspaceContext.must.save);
53
+ componentWillUnmount() {
54
+ this.props.administrationWorkspaceContext.resetDisplayAdministrationWorkspaceAction();
55
+ this.props.adminMfaContext.clearContext();
56
+ MfaFormService.killInstance();
57
+ this.mfaFormService = null;
79
58
  }
80
59
 
81
60
  /**
@@ -85,63 +64,6 @@ class DisplayMfaAdministration extends React.Component {
85
64
  this.handleInputChange = this.handleInputChange.bind(this);
86
65
  }
87
66
 
88
- /**
89
- * Handle the must save change
90
- * @param previousMustSaveSettings Previous must save settings
91
- */
92
- async handleMustSave(previousMustSaveSettings) {
93
- const hasMustSaveChanged = this.props.administrationWorkspaceContext.must.save !== previousMustSaveSettings;
94
- if (hasMustSaveChanged && this.props.administrationWorkspaceContext.must.save) {
95
- await this.handleFormSubmit();
96
- this.props.administrationWorkspaceContext.onResetActionsSettings();
97
- }
98
- }
99
-
100
- /**
101
- * fetch the mfa settings
102
- */
103
- async findAllMfaSettings() {
104
- const result = await this.props.administrationWorkspaceContext.onGetMfaRequested();
105
- const body = result.body;
106
- const providers = body.providers;
107
- // OTP
108
- const totpProviderToggle = providers.includes("totp");
109
- // YUBIKEY
110
- const yubikeyToggle = providers.includes("yubikey");
111
- let yubikeyClientIdentifier = "";
112
- let yubikeySecretKey = "";
113
-
114
- if (yubikeyToggle) {
115
- yubikeyClientIdentifier = body.yubikey.clientId;
116
- yubikeySecretKey = body.yubikey.secretKey;
117
- }
118
- // DUO
119
- const duoToggle = providers.includes("duo");
120
- let duoHostname = "";
121
- let duoIntegrationKey = "";
122
- let duoSalt = "";
123
- let duoSecretKey = "";
124
- if (duoToggle) {
125
- duoHostname = body.duo.hostName;
126
- duoIntegrationKey = body.duo.integrationKey;
127
- duoSalt = body.duo.salt;
128
- duoSecretKey = body.duo.secretKey;
129
- }
130
-
131
- this.setState({
132
- loading: false,
133
- totpProviderToggle,
134
- yubikeyToggle,
135
- yubikeyClientIdentifier,
136
- yubikeySecretKey,
137
- duoToggle,
138
- duoHostname,
139
- duoIntegrationKey,
140
- duoSalt,
141
- duoSecretKey
142
- });
143
- }
144
-
145
67
  /**
146
68
  * Handle form input changes.
147
69
  * @params {ReactEvent} The react event
@@ -151,16 +73,36 @@ class DisplayMfaAdministration extends React.Component {
151
73
  const target = event.target;
152
74
  const value = target.type === "checkbox" ? target.checked : target.value;
153
75
  const name = target.name;
154
- this.setState({[name]: value});
155
- this.handleEnabledSaveButton();
76
+ this.props.adminMfaContext.setSettings(name, value);
77
+ this.validateInput(name, value);
156
78
  }
157
79
 
158
80
  /**
159
- * Handle enabled the save button
81
+ * validate the input
82
+ * @params {string} The input name
83
+ * @params {string} The input valude
84
+ * @returns {void}
160
85
  */
161
- handleEnabledSaveButton() {
162
- if (!this.props.administrationWorkspaceContext.can.save) {
163
- this.props.administrationWorkspaceContext.onSaveEnabled();
86
+ validateInput(name, value) {
87
+ switch (name) {
88
+ case 'yubikeyClientIdentifier':
89
+ this.mfaFormService.validateYubikeyClientIdentifier(value);
90
+ break;
91
+ case 'yubikeySecretKey':
92
+ this.mfaFormService.validateYubikeySecretKey(value);
93
+ break;
94
+ case 'duoHostname':
95
+ this.mfaFormService.validateDuoHostname(value);
96
+ break;
97
+ case 'duoIntegrationKey':
98
+ this.mfaFormService.validateDuoIntegrationKey(value);
99
+ break;
100
+ case 'duoSalt':
101
+ this.mfaFormService.validateDuoSalt(value);
102
+ break;
103
+ case 'duoSecretKey':
104
+ this.mfaFormService.validateDuoSecretKey(value);
105
+ break;
164
106
  }
165
107
  }
166
108
 
@@ -169,238 +111,7 @@ class DisplayMfaAdministration extends React.Component {
169
111
  * @returns {boolean}
170
112
  */
171
113
  hasAllInputDisabled() {
172
- return this.state.processing || this.state.loading;
173
- }
174
-
175
- /**
176
- * If otp provider is checked
177
- * @returns {boolean}
178
- */
179
- isOtpProviderChecked() {
180
- return this.state.totpProviderToggle;
181
- }
182
-
183
- /**
184
- * If yubikey provider is checked
185
- * @returns {boolean}
186
- */
187
- isYubikeyChecked() {
188
- return this.state.yubikeyToggle;
189
- }
190
-
191
- /**
192
- * If duo provider is checked
193
- * @returns {boolean}
194
- */
195
- isDuoChecked() {
196
- return this.state.duoToggle;
197
- }
198
-
199
- /**
200
- * Validate the form.
201
- * @returns {Promise<boolean>}
202
- */
203
- async validate() {
204
- // Validate the form inputs.
205
- await Promise.all([
206
- this.validateYubikeyInput(),
207
- this.validateDuoInput(),
208
- ]);
209
- }
210
-
211
- /**
212
- * Validate the yubikey input.
213
- * @returns {Promise<void>}
214
- */
215
- async validateYubikeyInput() {
216
- let yubikeyClientIdentifierError = null;
217
- let yubikeySecretKeyError = null;
218
- if (this.isYubikeyChecked()) {
219
- const yubikeyClientIdentifier = this.state.yubikeyClientIdentifier.trim();
220
- if (!yubikeyClientIdentifier.length) {
221
- yubikeyClientIdentifierError = this.translate("A client identifier is required.");
222
- } else if (!XRegExp("^[0-9]{1,64}$").test(yubikeyClientIdentifier)) {
223
- yubikeyClientIdentifierError = this.translate("The client identifier should be an integer.");
224
- }
225
- const yubikeySecretKey = this.state.yubikeySecretKey.trim();
226
- if (!yubikeySecretKey.length) {
227
- yubikeySecretKeyError = this.translate("A secret key is required.");
228
- } else if (!XRegExp("^[a-zA-Z0-9\\/=+]{10,128}$").test(yubikeySecretKey)) {
229
- yubikeySecretKeyError = this.translate("This secret key is not valid.");
230
- }
231
- }
232
- return this.setState({yubikeyClientIdentifierError, yubikeySecretKeyError});
233
- }
234
-
235
- /**
236
- * Validate the duo input.
237
- * @returns {Promise<void>}
238
- */
239
- async validateDuoInput() {
240
- let duoHostnameError = null;
241
- let duoIntegrationKeyError = null;
242
- let duoSaltError = null;
243
- let duoSecretKeyError = null;
244
-
245
- if (this.isDuoChecked()) {
246
- const duoHostname = this.state.duoHostname.trim();
247
- if (!duoHostname.length) {
248
- duoHostnameError = this.translate("A hostname is required.");
249
- } else if (!XRegExp("^api-[a-fA-F0-9]{8,16}\\.duosecurity\\.com$").test(duoHostname)) {
250
- duoHostnameError = this.translate("This is not a valid hostname.");
251
- }
252
-
253
- const duoIntegrationKey = this.state.duoIntegrationKey.trim();
254
- if (!duoIntegrationKey.length) {
255
- duoIntegrationKeyError = this.translate("An integration key is required.");
256
- } else if (!XRegExp("^[a-zA-Z0-9]{16,32}$").test(duoIntegrationKey)) {
257
- duoIntegrationKeyError = this.translate("This is not a valid integration key.");
258
- }
259
-
260
- const duoSalt = this.state.duoSalt.trim();
261
- if (!duoSalt.length) {
262
- duoSaltError = this.translate("A salt is required.");
263
- } else if (!XRegExp("^.{40,128}$").test(duoSalt)) {
264
- duoSaltError = this.translate("The salt should be between 40 and 128 characters in length.");
265
- }
266
-
267
- const duoSecretKey = this.state.duoSecretKey.trim();
268
- if (!duoSecretKey.length) {
269
- duoSecretKeyError = this.translate("A secret key is required.");
270
- } else if (!XRegExp("^[a-zA-Z0-9]{32,128}$").test(duoSecretKey)) {
271
- duoSecretKeyError = this.translate("This is not a valid secret key.");
272
- }
273
- }
274
- return this.setState({duoHostnameError, duoIntegrationKeyError, duoSaltError, duoSecretKeyError});
275
- }
276
-
277
- /**
278
- * Return true if the form has some validation error
279
- * @returns {boolean}
280
- */
281
- hasValidationError() {
282
- return this.hasYubikeyError() || this.hasDuoError();
283
- }
284
-
285
- /**
286
- * If yubukey form has an error
287
- * @returns {boolean}
288
- */
289
- hasYubikeyError() {
290
- return this.state.yubikeyClientIdentifierError !== null || this.state.yubikeySecretKeyError !== null;
291
- }
292
-
293
- /**
294
- * If duo form has an error
295
- * @returns {boolean}
296
- */
297
- hasDuoError() {
298
- return this.state.duoHostnameError !== null || this.state.duoIntegrationKeyError !== null || this.state.duoSaltError !== null || this.state.duoSecretKeyError !== null;
299
- }
300
-
301
- /**
302
- * Handle form submit event.
303
- * @params {ReactEvent} The react event
304
- * @returns {void}
305
- */
306
- async handleFormSubmit() {
307
- // Do not re-submit an already processing form
308
- if (!this.state.processing) {
309
- await this.toggleProcessing();
310
- await this.validate();
311
- if (this.hasValidationError()) {
312
- await this.toggleProcessing();
313
- return;
314
- }
315
- try {
316
- await this.saveMfa();
317
- await this.handleSaveSuccess();
318
- } catch (error) {
319
- await this.handleSaveError(error);
320
- }
321
- }
322
- }
323
-
324
- /**
325
- * save MFA settings
326
- * @returns {Promise<*>}
327
- */
328
- async saveMfa() {
329
- const providers = [];
330
- if (this.state.totpProviderToggle) {
331
- providers.push("totp");
332
- }
333
-
334
- let yubikey = null;
335
- if (this.state.yubikeyToggle) {
336
- providers.push("yubikey");
337
- yubikey = {
338
- clientId: this.state.yubikeyClientIdentifier,
339
- secretKey: this.state.yubikeySecretKey
340
- };
341
- }
342
-
343
- let duo = null;
344
- if (this.state.duoToggle) {
345
- providers.push("duo");
346
- duo = {
347
- hostName: this.state.duoHostname,
348
- integrationKey: this.state.duoIntegrationKey,
349
- salt: this.state.duoSalt,
350
- secretKey: this.state.duoSecretKey
351
- };
352
- }
353
-
354
- await this.props.administrationWorkspaceContext.onSaveMfaRequested({providers, yubikey, duo});
355
- }
356
-
357
- /**
358
- * Handle save operation success.
359
- */
360
- async handleSaveSuccess() {
361
- await this.props.actionFeedbackContext.displaySuccess(this.translate("The multi factor authentication settings for the organization were updated."));
362
- this.setState({processing: false});
363
- }
364
-
365
- /**
366
- * Handle save operation error.
367
- * @param {object} error The returned error
368
- */
369
- async handleSaveError(error) {
370
- // It can happen when the user has closed the passphrase entry dialog by instance.
371
- if (error.name === "UserAbortsOperationError") {
372
- this.setState({processing: false});
373
- } else {
374
- // Unexpected error occurred.
375
- console.error(error);
376
- await this.handleError(error);
377
- this.setState({processing: false});
378
- }
379
- }
380
-
381
- /**
382
- * handle error to display the error dialog
383
- * @param error
384
- */
385
- async handleError(error) {
386
- await this.props.actionFeedbackContext.displayError(error.message);
387
- }
388
-
389
- /**
390
- * Toggle processing state
391
- * @returns {Promise<void>}
392
- */
393
- async toggleProcessing() {
394
- const prev = this.state.processing;
395
- return this.setState({processing: !prev});
396
- }
397
-
398
- /**
399
- * Get the translate function
400
- * @returns {function(...[*]=)}
401
- */
402
- get translate() {
403
- return this.props.t;
114
+ return this.props.adminMfaContext.isProcessing();
404
115
  }
405
116
 
406
117
  /**
@@ -408,6 +119,10 @@ class DisplayMfaAdministration extends React.Component {
408
119
  * @returns {JSX}
409
120
  */
410
121
  render() {
122
+ const isSubmitted = this.props.adminMfaContext.isSubmitted();
123
+ const settings = this.props.adminMfaContext.getSettings();
124
+ const errors = this.props.adminMfaContext.getErrors();
125
+
411
126
  return (
412
127
  <div className="row">
413
128
  <div className="mfa-settings col7 main-column">
@@ -416,16 +131,16 @@ class DisplayMfaAdministration extends React.Component {
416
131
  <h4 className="no-border">
417
132
  <span className="input toggle-switch form-element ready">
418
133
  <input id="totp-provider-toggle-button" type="checkbox" className="toggle-switch-checkbox checkbox" name="totpProviderToggle"
419
- onChange={this.handleInputChange} checked={this.state.totpProviderToggle} disabled={this.hasAllInputDisabled()}/>
134
+ onChange={this.handleInputChange} checked={settings.totpProviderToggle} disabled={this.hasAllInputDisabled()}/>
420
135
  <label htmlFor="totp-provider-toggle-button"><Trans>Time-based One Time Password</Trans></label>
421
136
  </span>
422
137
  </h4>
423
- {!this.isOtpProviderChecked() &&
138
+ {!settings.totpProviderToggle &&
424
139
  <p className="description">
425
140
  <Trans>The Time-based One Time Password provider is disabled for all users.</Trans>
426
141
  </p>
427
142
  }
428
- {this.isOtpProviderChecked() &&
143
+ {settings.totpProviderToggle &&
429
144
  <p className="description">
430
145
  <Trans>The Time-based One Time Password provider is enabled for all users. They can setup this provider in their profile and use it as second factor authentication.</Trans>
431
146
  </p>
@@ -433,29 +148,29 @@ class DisplayMfaAdministration extends React.Component {
433
148
  <h4>
434
149
  <span className="input toggle-switch form-element">
435
150
  <input id="yubikey-provider-toggle-button" type="checkbox" className="toggle-switch-checkbox checkbox" name="yubikeyToggle"
436
- onChange={this.handleInputChange} checked={this.state.yubikeyToggle} disabled={this.hasAllInputDisabled()}/>
151
+ onChange={this.handleInputChange} checked={settings.yubikeyToggle} disabled={this.hasAllInputDisabled()}/>
437
152
  <label htmlFor="yubikey-provider-toggle-button">Yubikey</label>
438
153
  </span>
439
154
  </h4>
440
- {!this.isYubikeyChecked() &&
155
+ {!settings.yubikeyToggle &&
441
156
  <p className="description">
442
157
  <Trans>The Yubikey provider is disabled for all users.</Trans>
443
158
  </p>
444
159
  }
445
- {this.isYubikeyChecked() &&
160
+ {settings.yubikeyToggle &&
446
161
  <>
447
162
  <p className="description">
448
163
  <Trans>The Yubikey provider is enabled for all users. They can setup this provider in their profile and use it as second factor authentication.</Trans>
449
164
  </p>
450
- <div className={`input text required ${this.state.yubikeyClientIdentifierError ? "error" : ""} ${this.hasAllInputDisabled() ? 'disabled' : ''}`}>
165
+ <div className={`input text required ${errors.yubikeyClientIdentifierError && isSubmitted ? "error" : ""} ${this.hasAllInputDisabled() ? 'disabled' : ''}`}>
451
166
  <label><Trans>Client identifier</Trans></label>
452
167
  <input id="yubikeyClientIdentifier" type="text" name="yubikeyClientIdentifier" required="required" className="required fluid form-element ready" placeholder="123456789"
453
- onChange={this.handleInputChange} value={this.state.yubikeyClientIdentifier} disabled={this.hasAllInputDisabled()}/>
454
- {this.state.yubikeyClientIdentifierError &&
455
- <div className="yubikey_client_identifier error-message">{this.state.yubikeyClientIdentifierError}</div>
168
+ onChange={this.handleInputChange} value={settings.yubikeyClientIdentifier} disabled={this.hasAllInputDisabled()}/>
169
+ {(errors.yubikeyClientIdentifierError && isSubmitted) &&
170
+ <div className="yubikey_client_identifier error-message">{errors.yubikeyClientIdentifierError}</div>
456
171
  }
457
172
  </div>
458
- <div className={`input required input-secret ${this.state.yubikeySecretKeyError ? "error" : ""} ${this.hasAllInputDisabled() ? 'disabled' : ''}`}>
173
+ <div className={`input required input-secret ${errors.yubikeySecretKeyError && isSubmitted ? "error" : ""} ${this.hasAllInputDisabled() ? 'disabled' : ''}`}>
459
174
  <label><Trans>Secret key</Trans></label>
460
175
  <Password
461
176
  id="yubikeySecretKey"
@@ -464,10 +179,10 @@ class DisplayMfaAdministration extends React.Component {
464
179
  name="yubikeySecretKey"
465
180
  placeholder="**********"
466
181
  disabled={this.hasAllInputDisabled()}
467
- value={this.state.yubikeySecretKey}
182
+ value={settings.yubikeySecretKey}
468
183
  preview={true}></Password>
469
- {this.state.yubikeySecretKeyError &&
470
- <div className="yubikey_secret_key error-message">{this.state.yubikeySecretKeyError}</div>
184
+ {(errors.yubikeySecretKeyError && isSubmitted) &&
185
+ <div className="yubikey_secret_key error-message">{errors.yubikeySecretKeyError}</div>
471
186
  }
472
187
  </div>
473
188
  </>
@@ -475,39 +190,39 @@ class DisplayMfaAdministration extends React.Component {
475
190
  <h4>
476
191
  <span className="input toggle-switch form-element ready">
477
192
  <input id="duo-provider-toggle-button" type="checkbox" className="toggle-switch-checkbox checkbox" name="duoToggle"
478
- onChange={this.handleInputChange} checked={this.state.duoToggle} disabled={this.hasAllInputDisabled()}/>
193
+ onChange={this.handleInputChange} checked={settings.duoToggle} disabled={this.hasAllInputDisabled()}/>
479
194
  <label htmlFor="duo-provider-toggle-button">Duo</label>
480
195
  </span>
481
196
  </h4>
482
- {!this.isDuoChecked() &&
197
+ {!settings.duoToggle &&
483
198
  <p className="description">
484
199
  <Trans>The Duo provider is disabled for all users.</Trans>
485
200
  </p>
486
201
  }
487
- {this.isDuoChecked() &&
202
+ {settings.duoToggle &&
488
203
  <>
489
204
  <p className="description enabled">
490
205
  <Trans>The Duo provider is enabled for all users. They can setup this provider in their profile and use it as second factor authentication.</Trans>
491
206
  </p>
492
- <div className={`input text required ${this.state.duoHostnameError ? "error" : ""} ${this.hasAllInputDisabled() ? 'disabled' : ''}`}>
207
+ <div className={`input text required ${errors.duoHostnameError && isSubmitted ? "error" : ""} ${this.hasAllInputDisabled() ? 'disabled' : ''}`}>
493
208
  <label><Trans>Hostname</Trans></label>
494
209
  <input id="duoHostname" type="text" name="duoHostname" required="required" className="required fluid form-element ready"
495
- placeholder="api-24zlkn4.duosecurity.com" value={this.state.duoHostname}
210
+ placeholder="api-24zlkn4.duosecurity.com" value={settings.duoHostname}
496
211
  onChange={this.handleInputChange} disabled={this.hasAllInputDisabled()}/>
497
- {this.state.duoHostnameError &&
498
- <div className="duo_hostname error-message">{this.state.duoHostnameError}</div>
212
+ {(errors.duoHostnameError && isSubmitted) &&
213
+ <div className="duo_hostname error-message">{errors.duoHostnameError}</div>
499
214
  }
500
215
  </div>
501
- <div className={`input text required ${this.state.duoIntegrationKeyError ? "error" : ""} ${this.hasAllInputDisabled() ? 'disabled' : ''}`}>
216
+ <div className={`input text required ${errors.duoIntegrationKeyError && isSubmitted ? "error" : ""} ${this.hasAllInputDisabled() ? 'disabled' : ''}`}>
502
217
  <label><Trans>Integration key</Trans></label>
503
218
  <input id="duoIntegrationKey" type="text" name="duoIntegrationKey" required="required" className="required fluid form-element ready"
504
- placeholder="HASJKDSQJO213123KQSLDF" value={this.state.duoIntegrationKey}
219
+ placeholder="HASJKDSQJO213123KQSLDF" value={settings.duoIntegrationKey}
505
220
  onChange={this.handleInputChange} disabled={this.hasAllInputDisabled()}/>
506
- {this.state.duoIntegrationKeyError &&
507
- <div className="duo_integration_key error-message">{this.state.duoIntegrationKeyError}</div>
221
+ {(errors.duoIntegrationKeyError && isSubmitted) &&
222
+ <div className="duo_integration_key error-message">{errors.duoIntegrationKeyError}</div>
508
223
  }
509
224
  </div>
510
- <div className={`input text required ${this.state.duoSaltError ? "error" : ""} ${this.hasAllInputDisabled() ? 'disabled' : ''}`}>
225
+ <div className={`input text required ${errors.duoSaltError && isSubmitted ? "error" : ""} ${this.hasAllInputDisabled() ? 'disabled' : ''}`}>
511
226
  <label><Trans>Salt</Trans></label>
512
227
  <Password
513
228
  id="duoSalt"
@@ -516,13 +231,13 @@ class DisplayMfaAdministration extends React.Component {
516
231
  name="duoSalt"
517
232
  placeholder="**********"
518
233
  disabled={this.hasAllInputDisabled()}
519
- value={this.state.duoSalt}
234
+ value={settings.duoSalt}
520
235
  preview={true}></Password>
521
- {this.state.duoSaltError &&
522
- <div className="duo_salt error-message">{this.state.duoSaltError}</div>
236
+ {(errors.duoSaltError && isSubmitted) &&
237
+ <div className="duo_salt error-message">{errors.duoSaltError}</div>
523
238
  }
524
239
  </div>
525
- <div className={`input text required ${this.state.duoSecretKeyError ? "error" : ""} ${this.hasAllInputDisabled() ? 'disabled' : ''}`}>
240
+ <div className={`input text required ${errors.duoSecretKeyError && isSubmitted ? "error" : ""} ${this.hasAllInputDisabled() ? 'disabled' : ''}`}>
526
241
  <label><Trans>Secret key</Trans></label>
527
242
  <Password
528
243
  id="duoSecretKey"
@@ -531,10 +246,10 @@ class DisplayMfaAdministration extends React.Component {
531
246
  name="duoSecretKey"
532
247
  placeholder="**********"
533
248
  disabled={this.hasAllInputDisabled()}
534
- value={this.state.duoSecretKey}
249
+ value={settings.duoSecretKey}
535
250
  preview={true}></Password>
536
- {this.state.duoSecretKeyError &&
537
- <div className="duo_secret_key error-message">{this.state.duoSecretKeyError}</div>
251
+ {(errors.duoSecretKeyError && isSubmitted) &&
252
+ <div className="duo_secret_key error-message">{errors.duoSecretKeyError}</div>
538
253
  }
539
254
  </div>
540
255
  </>
@@ -556,9 +271,9 @@ class DisplayMfaAdministration extends React.Component {
556
271
  }
557
272
 
558
273
  DisplayMfaAdministration.propTypes = {
274
+ adminMfaContext: PropTypes.object, // The administration workspace context
559
275
  administrationWorkspaceContext: PropTypes.object, // The administration workspace context
560
- actionFeedbackContext: PropTypes.any, // The action feedback context
561
276
  t: PropTypes.func, // The translation function
562
277
  };
563
278
 
564
- export default withActionFeedback(withAdministrationWorkspace(withTranslation('common')(DisplayMfaAdministration)));
279
+ export default withAdminMfa(withAdministrationWorkspace(withTranslation('common')(DisplayMfaAdministration)));