@keycloakify/keycloak-account-ui 26.0.0-rc.3 → 260007.0.0
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/KcAccountUiLoader.d.ts +2 -4
- package/KcAccountUiLoader.js +34 -41
- package/KcAccountUiLoader.js.map +1 -1
- package/README.md +1 -50
- package/index.js.map +1 -1
- package/{KcAccountUi.js → keycloak-theme/account/KcAccountUi.tsx} +15 -7
- package/keycloak-theme/account/KcContext.ts +8 -0
- package/keycloak-theme/account/KcPage.tsx +11 -0
- package/{src → keycloak-theme/account}/account-security/AccountRow.tsx +8 -4
- package/{src → keycloak-theme/account}/account-security/DeviceActivity.tsx +11 -7
- package/{src → keycloak-theme/account}/account-security/LinkedAccounts.tsx +12 -8
- package/{src → keycloak-theme/account}/account-security/LinkedAccountsToolbar.tsx +4 -0
- package/{src → keycloak-theme/account}/account-security/SigningIn.tsx +12 -8
- package/{src → keycloak-theme/account}/api/constants.ts +4 -0
- package/{src → keycloak-theme/account}/api/methods.ts +9 -5
- package/{src → keycloak-theme/account}/api/parse-links.ts +4 -0
- package/{src → keycloak-theme/account}/api/parse-response.ts +6 -2
- package/{src → keycloak-theme/account}/api/representations.ts +4 -0
- package/{src → keycloak-theme/account}/api/request.ts +7 -3
- package/{src → keycloak-theme/account}/api.ts +11 -7
- package/{src → keycloak-theme/account}/applications/Applications.tsx +12 -8
- package/{src/public → keycloak-theme/account/assets}/content.ts +14 -20
- package/keycloak-theme/account/assets/favicon.svg +63 -0
- package/{src → keycloak-theme/account}/components/datalist/EmptyRow.tsx +4 -0
- package/{src → keycloak-theme/account}/components/page/Page.tsx +4 -0
- package/{src → keycloak-theme/account}/content/ContentComponent.tsx +10 -6
- package/keycloak-theme/account/content/fetchContent.ts +13 -0
- package/{src → keycloak-theme/account}/environment.ts +5 -1
- package/{src → keycloak-theme/account}/groups/Groups.tsx +9 -5
- package/{src → keycloak-theme/account/i18n}/i18n.ts +7 -5
- package/keycloak-theme/account/i18n/index.ts +5 -0
- package/{messages → keycloak-theme/account/i18n}/messages_ar.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_ca.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_cs.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_da.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_de.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_el.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_en.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_es.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_fa.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_fi.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_fr.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_hu.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_it.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_ja.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_ka.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_lt.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_lv.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_nl.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_no.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_pl.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_pt.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_pt_BR.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_ru.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_sk.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_sv.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_th.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_tr.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_uk.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_zh_CN.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_zh_TW.properties +8 -0
- package/{src → keycloak-theme/account}/i18next.d.ts +4 -0
- package/{src → keycloak-theme/account}/oid4vci/Oid4Vci.tsx +9 -5
- package/{src → keycloak-theme/account}/organizations/Organizations.tsx +9 -5
- package/{src → keycloak-theme/account}/personal-info/PersonalInfo.tsx +13 -10
- package/{src → keycloak-theme/account}/resources/EditTheResource.tsx +8 -4
- package/{src → keycloak-theme/account}/resources/PermissionRequest.tsx +8 -4
- package/{src → keycloak-theme/account}/resources/ResourceToolbar.tsx +4 -0
- package/{src → keycloak-theme/account}/resources/Resources.tsx +6 -2
- package/{src → keycloak-theme/account}/resources/ResourcesTab.tsx +16 -12
- package/{src → keycloak-theme/account}/resources/ShareTheResource.tsx +9 -5
- package/{src → keycloak-theme/account}/resources/SharedWith.tsx +5 -1
- package/{src → keycloak-theme/account}/root/ErrorPage.tsx +4 -0
- package/{src → keycloak-theme/account}/root/Header.tsx +11 -6
- package/{src → keycloak-theme/account}/root/PageNav.tsx +9 -5
- package/{src → keycloak-theme/account}/root/Root.tsx +8 -4
- package/{src → keycloak-theme/account}/routes.tsx +18 -14
- package/{src → keycloak-theme/account}/utils/formatDate.ts +6 -3
- package/{src → keycloak-theme/account}/utils/joinPath.ts +4 -0
- package/{src → keycloak-theme/account}/utils/useAccountAlerts.ts +6 -2
- package/{src → keycloak-theme/account}/utils/usePromise.ts +4 -0
- package/package.json +18 -525
- package/src/KcAccountUiLoader.tsx +391 -370
- package/src/zKcContextLike.ts +31 -74
- package/tsconfig.tsbuildinfo +1 -0
- package/zKcContextLike.js +7 -7
- package/zKcContextLike.js.map +1 -1
- package/KcAccountUi.d.ts +0 -3
- package/KcAccountUi.js.map +0 -1
- package/account-security/AccountRow.d.ts +0 -8
- package/account-security/AccountRow.js +0 -37
- package/account-security/AccountRow.js.map +0 -1
- package/account-security/DeviceActivity.d.ts +0 -2
- package/account-security/DeviceActivity.js +0 -71
- package/account-security/DeviceActivity.js.map +0 -1
- package/account-security/LinkedAccounts.d.ts +0 -2
- package/account-security/LinkedAccounts.js +0 -40
- package/account-security/LinkedAccounts.js.map +0 -1
- package/account-security/LinkedAccountsToolbar.d.ts +0 -12
- package/account-security/LinkedAccountsToolbar.js +0 -24
- package/account-security/LinkedAccountsToolbar.js.map +0 -1
- package/account-security/SigningIn.d.ts +0 -2
- package/account-security/SigningIn.js +0 -65
- package/account-security/SigningIn.js.map +0 -1
- package/api/constants.d.ts +0 -2
- package/api/constants.js +0 -3
- package/api/constants.js.map +0 -1
- package/api/methods.d.ts +0 -31
- package/api/methods.js +0 -80
- package/api/methods.js.map +0 -1
- package/api/parse-links.d.ts +0 -5
- package/api/parse-links.js +0 -23
- package/api/parse-links.js.map +0 -1
- package/api/parse-response.d.ts +0 -5
- package/api/parse-response.js +0 -36
- package/api/parse-response.js.map +0 -1
- package/api/representations.d.ts +0 -202
- package/api/representations.js +0 -3
- package/api/representations.js.map +0 -1
- package/api/request.d.ts +0 -12
- package/api/request.js +0 -33
- package/api/request.js.map +0 -1
- package/api.d.ts +0 -13
- package/api.js +0 -46
- package/api.js.map +0 -1
- package/applications/Applications.d.ts +0 -2
- package/applications/Applications.js +0 -53
- package/applications/Applications.js.map +0 -1
- package/components/datalist/EmptyRow.d.ts +0 -5
- package/components/datalist/EmptyRow.js +0 -20
- package/components/datalist/EmptyRow.js.map +0 -1
- package/components/page/Page.d.ts +0 -7
- package/components/page/Page.js +0 -6
- package/components/page/Page.js.map +0 -1
- package/content/ContentComponent.d.ts +0 -2
- package/content/ContentComponent.js +0 -36
- package/content/ContentComponent.js.map +0 -1
- package/content/fetchContent.d.ts +0 -3
- package/content/fetchContent.js +0 -6
- package/content/fetchContent.js.map +0 -1
- package/environment.d.ts +0 -26
- package/environment.js +0 -3
- package/environment.js.map +0 -1
- package/groups/Groups.d.ts +0 -2
- package/groups/Groups.js +0 -45
- package/groups/Groups.js.map +0 -1
- package/i18n.d.ts +0 -4
- package/i18n.js +0 -32
- package/i18n.js.map +0 -1
- package/oid4vci/Oid4Vci.d.ts +0 -2
- package/oid4vci/Oid4Vci.js +0 -54
- package/oid4vci/Oid4Vci.js.map +0 -1
- package/organizations/Organizations.d.ts +0 -2
- package/organizations/Organizations.js +0 -19
- package/organizations/Organizations.js.map +0 -1
- package/personal-info/PersonalInfo.d.ts +0 -2
- package/personal-info/PersonalInfo.js +0 -69
- package/personal-info/PersonalInfo.js.map +0 -1
- package/public/content.d.ts +0 -37
- package/public/content.js +0 -50
- package/public/content.js.map +0 -1
- package/resources/EditTheResource.d.ts +0 -8
- package/resources/EditTheResource.js +0 -37
- package/resources/EditTheResource.js.map +0 -1
- package/resources/PermissionRequest.d.ts +0 -7
- package/resources/PermissionRequest.js +0 -40
- package/resources/PermissionRequest.js.map +0 -1
- package/resources/ResourceToolbar.d.ts +0 -12
- package/resources/ResourceToolbar.js +0 -24
- package/resources/ResourceToolbar.js.map +0 -1
- package/resources/Resources.d.ts +0 -2
- package/resources/Resources.js +0 -13
- package/resources/Resources.js.map +0 -1
- package/resources/ResourcesTab.d.ts +0 -5
- package/resources/ResourcesTab.js +0 -104
- package/resources/ResourcesTab.js.map +0 -1
- package/resources/ShareTheResource.d.ts +0 -9
- package/resources/ShareTheResource.js +0 -71
- package/resources/ShareTheResource.js.map +0 -1
- package/resources/SharedWith.d.ts +0 -6
- package/resources/SharedWith.js +0 -8
- package/resources/SharedWith.js.map +0 -1
- package/root/ErrorPage.d.ts +0 -5
- package/root/ErrorPage.js +0 -29
- package/root/ErrorPage.js.map +0 -1
- package/root/Header.d.ts +0 -1
- package/root/Header.js +0 -31
- package/root/Header.js.map +0 -1
- package/root/PageNav.d.ts +0 -22
- package/root/PageNav.js +0 -47
- package/root/PageNav.js.map +0 -1
- package/root/Root.d.ts +0 -1
- package/root/Root.js +0 -12
- package/root/Root.js.map +0 -1
- package/routes.d.ts +0 -16
- package/routes.js +0 -75
- package/routes.js.map +0 -1
- package/src/KcAccountUi.tsx +0 -25
- package/src/content/fetchContent.ts +0 -13
- package/src/global.d.ts +0 -9
- package/src/public/logo.svg +0 -1
- package/src/root/header.module.css +0 -3
- package/src/ui-shared/alerts/AlertPanel.tsx +0 -43
- package/src/ui-shared/alerts/Alerts.tsx +0 -82
- package/src/ui-shared/buttons/FormSubmitButton.tsx +0 -47
- package/src/ui-shared/context/ErrorPage.tsx +0 -60
- package/src/ui-shared/context/HelpContext.tsx +0 -30
- package/src/ui-shared/context/KeycloakContext.tsx +0 -97
- package/src/ui-shared/context/environment.ts +0 -50
- package/src/ui-shared/continue-cancel/ContinueCancelModal.tsx +0 -75
- package/src/ui-shared/controls/FormErrorText.tsx +0 -23
- package/src/ui-shared/controls/FormLabel.tsx +0 -40
- package/src/ui-shared/controls/HelpItem.tsx +0 -43
- package/src/ui-shared/controls/KeycloakSpinner.tsx +0 -12
- package/src/ui-shared/controls/NumberControl.tsx +0 -93
- package/src/ui-shared/controls/OrganizationTable.tsx +0 -122
- package/src/ui-shared/controls/PasswordControl.tsx +0 -71
- package/src/ui-shared/controls/PasswordInput.tsx +0 -50
- package/src/ui-shared/controls/SwitchControl.tsx +0 -67
- package/src/ui-shared/controls/TextAreaControl.tsx +0 -60
- package/src/ui-shared/controls/TextControl.tsx +0 -75
- package/src/ui-shared/controls/keycloak-text-area/KeycloakTextArea.tsx +0 -23
- package/src/ui-shared/controls/select-control/SelectControl.tsx +0 -75
- package/src/ui-shared/controls/select-control/SingleSelectControl.tsx +0 -109
- package/src/ui-shared/controls/select-control/TypeaheadSelectControl.tsx +0 -285
- package/src/ui-shared/controls/table/KeycloakDataTable.tsx +0 -597
- package/src/ui-shared/controls/table/ListEmptyState.tsx +0 -86
- package/src/ui-shared/controls/table/PaginatingTableToolbar.tsx +0 -106
- package/src/ui-shared/controls/table/TableToolbar.tsx +0 -92
- package/src/ui-shared/icons/IconMapper.tsx +0 -63
- package/src/ui-shared/index.ts +0 -1
- package/src/ui-shared/main.ts +0 -96
- package/src/ui-shared/masthead/DefaultAvatar.tsx +0 -109
- package/src/ui-shared/masthead/KeycloakDropdown.tsx +0 -48
- package/src/ui-shared/masthead/Masthead.tsx +0 -161
- package/src/ui-shared/scroll-form/FormPanel.tsx +0 -29
- package/src/ui-shared/scroll-form/FormTitle.tsx +0 -28
- package/src/ui-shared/scroll-form/ScrollForm.tsx +0 -98
- package/src/ui-shared/scroll-form/ScrollPanel.tsx +0 -21
- package/src/ui-shared/scroll-form/form-title.module.css +0 -4
- package/src/ui-shared/scroll-form/scroll-form.module.css +0 -8
- package/src/ui-shared/select/KeycloakSelect.tsx +0 -49
- package/src/ui-shared/select/SingleSelect.tsx +0 -87
- package/src/ui-shared/select/TypeaheadSelect.tsx +0 -198
- package/src/ui-shared/user-profile/LocaleSelector.tsx +0 -51
- package/src/ui-shared/user-profile/MultiInputComponent.tsx +0 -146
- package/src/ui-shared/user-profile/OptionsComponent.tsx +0 -63
- package/src/ui-shared/user-profile/SelectComponent.tsx +0 -109
- package/src/ui-shared/user-profile/TextAreaComponent.tsx +0 -23
- package/src/ui-shared/user-profile/TextComponent.tsx +0 -32
- package/src/ui-shared/user-profile/UserProfileFields.tsx +0 -243
- package/src/ui-shared/user-profile/UserProfileGroup.tsx +0 -71
- package/src/ui-shared/user-profile/utils.ts +0 -170
- package/src/ui-shared/utils/ErrorBoundary.tsx +0 -77
- package/src/ui-shared/utils/createNamedContext.ts +0 -11
- package/src/ui-shared/utils/darkMode.ts +0 -19
- package/src/ui-shared/utils/errors.ts +0 -55
- package/src/ui-shared/utils/generateId.ts +0 -1
- package/src/ui-shared/utils/getRuleValue.ts +0 -17
- package/src/ui-shared/utils/isDefined.ts +0 -3
- package/src/ui-shared/utils/useFetch.ts +0 -44
- package/src/ui-shared/utils/useRequiredContext.ts +0 -24
- package/src/ui-shared/utils/useSetTimeout.ts +0 -40
- package/src/ui-shared/utils/useStorageItem.ts +0 -51
- package/src/ui-shared/utils/useStoredState.ts +0 -38
- package/ui-shared/alerts/AlertPanel.d.ts +0 -6
- package/ui-shared/alerts/AlertPanel.js +0 -6
- package/ui-shared/alerts/AlertPanel.js.map +0 -1
- package/ui-shared/alerts/Alerts.d.ts +0 -16
- package/ui-shared/alerts/Alerts.js +0 -37
- package/ui-shared/alerts/Alerts.js.map +0 -1
- package/ui-shared/buttons/FormSubmitButton.d.ts +0 -10
- package/ui-shared/buttons/FormSubmitButton.js +0 -26
- package/ui-shared/buttons/FormSubmitButton.js.map +0 -1
- package/ui-shared/context/ErrorPage.d.ts +0 -5
- package/ui-shared/context/ErrorPage.js +0 -24
- package/ui-shared/context/ErrorPage.js.map +0 -1
- package/ui-shared/context/HelpContext.d.ts +0 -9
- package/ui-shared/context/HelpContext.js +0 -14
- package/ui-shared/context/HelpContext.js.map +0 -1
- package/ui-shared/context/KeycloakContext.d.ts +0 -12
- package/ui-shared/context/KeycloakContext.js +0 -53
- package/ui-shared/context/KeycloakContext.js.map +0 -1
- package/ui-shared/context/environment.d.ts +0 -36
- package/ui-shared/context/environment.js +0 -27
- package/ui-shared/context/environment.js.map +0 -1
- package/ui-shared/continue-cancel/ContinueCancelModal.d.ts +0 -15
- package/ui-shared/continue-cancel/ContinueCancelModal.js +0 -27
- package/ui-shared/continue-cancel/ContinueCancelModal.js.map +0 -1
- package/ui-shared/controls/FormErrorText.d.ts +0 -5
- package/ui-shared/controls/FormErrorText.js +0 -19
- package/ui-shared/controls/FormErrorText.js.map +0 -1
- package/ui-shared/controls/FormLabel.d.ts +0 -13
- package/ui-shared/controls/FormLabel.js +0 -20
- package/ui-shared/controls/FormLabel.js.map +0 -1
- package/ui-shared/controls/HelpItem.d.ts +0 -9
- package/ui-shared/controls/HelpItem.js +0 -9
- package/ui-shared/controls/HelpItem.js.map +0 -1
- package/ui-shared/controls/KeycloakSpinner.d.ts +0 -1
- package/ui-shared/controls/KeycloakSpinner.js +0 -8
- package/ui-shared/controls/KeycloakSpinner.js.map +0 -1
- package/ui-shared/controls/NumberControl.d.ts +0 -13
- package/ui-shared/controls/NumberControl.js +0 -33
- package/ui-shared/controls/NumberControl.js.map +0 -1
- package/ui-shared/controls/OrganizationTable.d.ts +0 -16
- package/ui-shared/controls/OrganizationTable.js +0 -45
- package/ui-shared/controls/OrganizationTable.js.map +0 -1
- package/ui-shared/controls/PasswordControl.d.ts +0 -9
- package/ui-shared/controls/PasswordControl.js +0 -25
- package/ui-shared/controls/PasswordControl.js.map +0 -1
- package/ui-shared/controls/PasswordInput.d.ts +0 -7
- package/ui-shared/controls/PasswordInput.js +0 -25
- package/ui-shared/controls/PasswordInput.js.map +0 -1
- package/ui-shared/controls/SwitchControl.d.ts +0 -11
- package/ui-shared/controls/SwitchControl.js +0 -29
- package/ui-shared/controls/SwitchControl.js.map +0 -1
- package/ui-shared/controls/TextAreaControl.d.ts +0 -8
- package/ui-shared/controls/TextAreaControl.js +0 -12
- package/ui-shared/controls/TextAreaControl.js.map +0 -1
- package/ui-shared/controls/TextControl.d.ts +0 -11
- package/ui-shared/controls/TextControl.js +0 -24
- package/ui-shared/controls/TextControl.js.map +0 -1
- package/ui-shared/controls/keycloak-text-area/KeycloakTextArea.d.ts +0 -4
- package/ui-shared/controls/keycloak-text-area/KeycloakTextArea.js +0 -5
- package/ui-shared/controls/keycloak-text-area/KeycloakTextArea.js.map +0 -1
- package/ui-shared/controls/select-control/SelectControl.d.ts +0 -31
- package/ui-shared/controls/select-control/SelectControl.js +0 -28
- package/ui-shared/controls/select-control/SelectControl.js.map +0 -1
- package/ui-shared/controls/select-control/SingleSelectControl.d.ts +0 -3
- package/ui-shared/controls/select-control/SingleSelectControl.js +0 -43
- package/ui-shared/controls/select-control/SingleSelectControl.js.map +0 -1
- package/ui-shared/controls/select-control/TypeaheadSelectControl.d.ts +0 -3
- package/ui-shared/controls/select-control/TypeaheadSelectControl.js +0 -140
- package/ui-shared/controls/select-control/TypeaheadSelectControl.js.map +0 -1
- package/ui-shared/controls/table/KeycloakDataTable.d.ts +0 -64
- package/ui-shared/controls/table/KeycloakDataTable.js +0 -279
- package/ui-shared/controls/table/KeycloakDataTable.js.map +0 -1
- package/ui-shared/controls/table/ListEmptyState.d.ts +0 -20
- package/ui-shared/controls/table/ListEmptyState.js +0 -11
- package/ui-shared/controls/table/ListEmptyState.js.map +0 -1
- package/ui-shared/controls/table/PaginatingTableToolbar.d.ts +0 -21
- package/ui-shared/controls/table/PaginatingTableToolbar.js +0 -27
- package/ui-shared/controls/table/PaginatingTableToolbar.js.map +0 -1
- package/ui-shared/controls/table/TableToolbar.d.ts +0 -12
- package/ui-shared/controls/table/TableToolbar.js +0 -30
- package/ui-shared/controls/table/TableToolbar.js.map +0 -1
- package/ui-shared/icons/IconMapper.d.ts +0 -5
- package/ui-shared/icons/IconMapper.js +0 -40
- package/ui-shared/icons/IconMapper.js.map +0 -1
- package/ui-shared/index.d.ts +0 -1
- package/ui-shared/index.js +0 -2
- package/ui-shared/index.js.map +0 -1
- package/ui-shared/main.d.ts +0 -45
- package/ui-shared/main.js +0 -41
- package/ui-shared/main.js.map +0 -1
- package/ui-shared/masthead/DefaultAvatar.d.ts +0 -7
- package/ui-shared/masthead/DefaultAvatar.js +0 -26
- package/ui-shared/masthead/DefaultAvatar.js.map +0 -1
- package/ui-shared/masthead/KeycloakDropdown.d.ts +0 -10
- package/ui-shared/masthead/KeycloakDropdown.js +0 -23
- package/ui-shared/masthead/KeycloakDropdown.js.map +0 -1
- package/ui-shared/masthead/Masthead.d.ts +0 -19
- package/ui-shared/masthead/Masthead.js +0 -55
- package/ui-shared/masthead/Masthead.js.map +0 -1
- package/ui-shared/scroll-form/FormPanel.d.ts +0 -8
- package/ui-shared/scroll-form/FormPanel.js +0 -9
- package/ui-shared/scroll-form/FormPanel.js.map +0 -1
- package/ui-shared/scroll-form/FormTitle.d.ts +0 -8
- package/ui-shared/scroll-form/FormTitle.js +0 -19
- package/ui-shared/scroll-form/FormTitle.js.map +0 -1
- package/ui-shared/scroll-form/ScrollForm.d.ts +0 -15
- package/ui-shared/scroll-form/ScrollForm.js +0 -38
- package/ui-shared/scroll-form/ScrollForm.js.map +0 -1
- package/ui-shared/scroll-form/ScrollPanel.d.ts +0 -7
- package/ui-shared/scroll-form/ScrollPanel.js +0 -18
- package/ui-shared/scroll-form/ScrollPanel.js.map +0 -1
- package/ui-shared/scroll-form/form-title.module.css +0 -4
- package/ui-shared/scroll-form/scroll-form.module.css +0 -8
- package/ui-shared/select/KeycloakSelect.d.ts +0 -30
- package/ui-shared/select/KeycloakSelect.js +0 -31
- package/ui-shared/select/KeycloakSelect.js.map +0 -1
- package/ui-shared/select/SingleSelect.d.ts +0 -4
- package/ui-shared/select/SingleSelect.js +0 -46
- package/ui-shared/select/SingleSelect.js.map +0 -1
- package/ui-shared/select/TypeaheadSelect.d.ts +0 -2
- package/ui-shared/select/TypeaheadSelect.js +0 -96
- package/ui-shared/select/TypeaheadSelect.js.map +0 -1
- package/ui-shared/user-profile/LocaleSelector.d.ts +0 -7
- package/ui-shared/user-profile/LocaleSelector.js +0 -28
- package/ui-shared/user-profile/LocaleSelector.js.map +0 -1
- package/ui-shared/user-profile/MultiInputComponent.d.ts +0 -15
- package/ui-shared/user-profile/MultiInputComponent.js +0 -61
- package/ui-shared/user-profile/MultiInputComponent.js.map +0 -1
- package/ui-shared/user-profile/OptionsComponent.d.ts +0 -2
- package/ui-shared/user-profile/OptionsComponent.js +0 -29
- package/ui-shared/user-profile/OptionsComponent.js.map +0 -1
- package/ui-shared/user-profile/SelectComponent.d.ts +0 -2
- package/ui-shared/user-profile/SelectComponent.js +0 -56
- package/ui-shared/user-profile/SelectComponent.js.map +0 -1
- package/ui-shared/user-profile/TextAreaComponent.d.ts +0 -2
- package/ui-shared/user-profile/TextAreaComponent.js +0 -11
- package/ui-shared/user-profile/TextAreaComponent.js.map +0 -1
- package/ui-shared/user-profile/TextComponent.d.ts +0 -2
- package/ui-shared/user-profile/TextComponent.js +0 -14
- package/ui-shared/user-profile/TextComponent.js.map +0 -1
- package/ui-shared/user-profile/UserProfileFields.d.ts +0 -37
- package/ui-shared/user-profile/UserProfileFields.js +0 -94
- package/ui-shared/user-profile/UserProfileFields.js.map +0 -1
- package/ui-shared/user-profile/UserProfileGroup.d.ts +0 -12
- package/ui-shared/user-profile/UserProfileGroup.js +0 -15
- package/ui-shared/user-profile/UserProfileGroup.js.map +0 -1
- package/ui-shared/user-profile/utils.d.ts +0 -32
- package/ui-shared/user-profile/utils.js +0 -84
- package/ui-shared/user-profile/utils.js.map +0 -1
- package/ui-shared/utils/ErrorBoundary.d.ts +0 -26
- package/ui-shared/utils/ErrorBoundary.js +0 -29
- package/ui-shared/utils/ErrorBoundary.js.map +0 -1
- package/ui-shared/utils/createNamedContext.d.ts +0 -3
- package/ui-shared/utils/createNamedContext.js +0 -7
- package/ui-shared/utils/createNamedContext.js.map +0 -1
- package/ui-shared/utils/darkMode.d.ts +0 -1
- package/ui-shared/utils/darkMode.js +0 -16
- package/ui-shared/utils/darkMode.js.map +0 -1
- package/ui-shared/utils/errors.d.ts +0 -4
- package/ui-shared/utils/errors.js +0 -42
- package/ui-shared/utils/errors.js.map +0 -1
- package/ui-shared/utils/generateId.d.ts +0 -1
- package/ui-shared/utils/generateId.js +0 -2
- package/ui-shared/utils/generateId.js.map +0 -1
- package/ui-shared/utils/getRuleValue.d.ts +0 -2
- package/ui-shared/utils/getRuleValue.js +0 -12
- package/ui-shared/utils/getRuleValue.js.map +0 -1
- package/ui-shared/utils/isDefined.d.ts +0 -1
- package/ui-shared/utils/isDefined.js +0 -4
- package/ui-shared/utils/isDefined.js.map +0 -1
- package/ui-shared/utils/useFetch.d.ts +0 -17
- package/ui-shared/utils/useFetch.js +0 -38
- package/ui-shared/utils/useFetch.js.map +0 -1
- package/ui-shared/utils/useRequiredContext.d.ts +0 -9
- package/ui-shared/utils/useRequiredContext.js +0 -17
- package/ui-shared/utils/useRequiredContext.js.map +0 -1
- package/ui-shared/utils/useSetTimeout.d.ts +0 -1
- package/ui-shared/utils/useSetTimeout.js +0 -32
- package/ui-shared/utils/useSetTimeout.js.map +0 -1
- package/ui-shared/utils/useStorageItem.d.ts +0 -10
- package/ui-shared/utils/useStorageItem.js +0 -40
- package/ui-shared/utils/useStorageItem.js.map +0 -1
- package/ui-shared/utils/useStoredState.d.ts +0 -13
- package/ui-shared/utils/useStoredState.js +0 -21
- package/ui-shared/utils/useStoredState.js.map +0 -1
- package/utils/formatDate.d.ts +0 -4
- package/utils/formatDate.js +0 -12
- package/utils/formatDate.js.map +0 -1
- package/utils/joinPath.d.ts +0 -1
- package/utils/joinPath.js +0 -18
- package/utils/joinPath.js.map +0 -1
- package/utils/useAccountAlerts.d.ts +0 -4
- package/utils/useAccountAlerts.js +0 -19
- package/utils/useAccountAlerts.js.map +0 -1
- package/utils/usePromise.d.ts +0 -41
- package/utils/usePromise.js +0 -59
- package/utils/usePromise.js.map +0 -1
- /package/{public → keycloak-theme/account/assets}/logo.svg +0 -0
- /package/{root → keycloak-theme/account/root}/header.module.css +0 -0
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { ContinueCancelModal, useEnvironment, } from "../ui-shared";
|
|
3
|
-
import { Button, Chip, ChipGroup, Dropdown, DropdownItem, DropdownList, MenuToggle, OverflowMenu, OverflowMenuContent, OverflowMenuControl, OverflowMenuDropdownItem, OverflowMenuGroup, OverflowMenuItem, Spinner, } from "@patternfly/react-core";
|
|
4
|
-
import { EditAltIcon, EllipsisVIcon, ExternalLinkAltIcon, Remove2Icon, ShareAltIcon, } from "@patternfly/react-icons";
|
|
5
|
-
import { ExpandableRowContent, Table, Tbody, Td, Th, Thead, Tr, } from "@patternfly/react-table";
|
|
6
|
-
import { useState } from "react";
|
|
7
|
-
import { useTranslation } from "react-i18next";
|
|
8
|
-
import { fetchPermission, fetchResources, updatePermissions } from "../api";
|
|
9
|
-
import { getPermissionRequests } from "../api/methods";
|
|
10
|
-
import { useAccountAlerts } from "../utils/useAccountAlerts";
|
|
11
|
-
import { usePromise } from "../utils/usePromise";
|
|
12
|
-
import { EditTheResource } from "../resources/EditTheResource";
|
|
13
|
-
import { PermissionRequest } from "../resources/PermissionRequest";
|
|
14
|
-
import { ResourceToolbar } from "../resources/ResourceToolbar";
|
|
15
|
-
import { ShareTheResource } from "../resources/ShareTheResource";
|
|
16
|
-
import { SharedWith } from "../resources/SharedWith";
|
|
17
|
-
export const ResourcesTab = ({ isShared = false }) => {
|
|
18
|
-
const { t } = useTranslation();
|
|
19
|
-
const context = useEnvironment();
|
|
20
|
-
const { addAlert, addError } = useAccountAlerts();
|
|
21
|
-
const [params, setParams] = useState({
|
|
22
|
-
first: "0",
|
|
23
|
-
max: "5",
|
|
24
|
-
});
|
|
25
|
-
const [links, setLinks] = useState();
|
|
26
|
-
const [resources, setResources] = useState();
|
|
27
|
-
const [details, setDetails] = useState({});
|
|
28
|
-
const [key, setKey] = useState(1);
|
|
29
|
-
const refresh = () => setKey(key + 1);
|
|
30
|
-
usePromise(async (signal) => {
|
|
31
|
-
const result = await fetchResources({ signal, context }, params, isShared);
|
|
32
|
-
if (!isShared)
|
|
33
|
-
await Promise.all(result.data.map(async (r) => (r.shareRequests = await getPermissionRequests(r._id, {
|
|
34
|
-
signal,
|
|
35
|
-
context,
|
|
36
|
-
}))));
|
|
37
|
-
return result;
|
|
38
|
-
}, ({ data, links }) => {
|
|
39
|
-
setResources(data);
|
|
40
|
-
setLinks(links);
|
|
41
|
-
}, [params, key]);
|
|
42
|
-
if (!resources) {
|
|
43
|
-
return _jsx(Spinner, {});
|
|
44
|
-
}
|
|
45
|
-
const fetchPermissions = async (id) => {
|
|
46
|
-
var _a;
|
|
47
|
-
let permissions = ((_a = details[id]) === null || _a === void 0 ? void 0 : _a.permissions) || [];
|
|
48
|
-
if (!details[id]) {
|
|
49
|
-
permissions = await fetchPermission({ context }, id);
|
|
50
|
-
}
|
|
51
|
-
return permissions;
|
|
52
|
-
};
|
|
53
|
-
const removeShare = async (resource) => {
|
|
54
|
-
try {
|
|
55
|
-
const permissions = (await fetchPermissions(resource._id)).map(({ username }) => ({
|
|
56
|
-
username,
|
|
57
|
-
scopes: [],
|
|
58
|
-
}));
|
|
59
|
-
await updatePermissions(context, resource._id, permissions);
|
|
60
|
-
setDetails({});
|
|
61
|
-
addAlert(t("unShareSuccess"));
|
|
62
|
-
}
|
|
63
|
-
catch (error) {
|
|
64
|
-
addError("unShareError", error);
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
const toggleOpen = async (id, field, open) => {
|
|
68
|
-
const permissions = await fetchPermissions(id);
|
|
69
|
-
setDetails(Object.assign(Object.assign({}, details), { [id]: Object.assign(Object.assign({}, details[id]), { [field]: open, permissions }) }));
|
|
70
|
-
};
|
|
71
|
-
return (_jsxs(_Fragment, { children: [_jsx(ResourceToolbar, { onFilter: (name) => setParams(Object.assign(Object.assign({}, params), { name })), count: resources.length, first: parseInt(params["first"]), max: parseInt(params["max"]), onNextClick: () => setParams((links === null || links === void 0 ? void 0 : links.next) || {}), onPreviousClick: () => setParams((links === null || links === void 0 ? void 0 : links.prev) || {}), onPerPageSelect: (first, max) => setParams({ first: `${first}`, max: `${max}` }), hasNext: !!(links === null || links === void 0 ? void 0 : links.next) }), _jsxs(Table, { "aria-label": t("resources"), children: [_jsx(Thead, { children: _jsxs(Tr, { children: [_jsx(Th, { "aria-hidden": "true" }), _jsx(Th, { children: t("resourceName") }), _jsx(Th, { children: t("application") }), _jsx(Th, { "aria-hidden": isShared, children: !isShared ? t("permissionRequests") : "" })] }) }), resources.map((resource, index) => {
|
|
72
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
73
|
-
return (_jsxs(Tbody, { isExpanded: (_a = details[resource._id]) === null || _a === void 0 ? void 0 : _a.rowOpen, children: [_jsxs(Tr, { children: [_jsx(Td, { "data-testid": `expand-${resource.name}`, expand: !isShared
|
|
74
|
-
? {
|
|
75
|
-
isExpanded: ((_b = details[resource._id]) === null || _b === void 0 ? void 0 : _b.rowOpen) || false,
|
|
76
|
-
rowIndex: index,
|
|
77
|
-
onToggle: () => {
|
|
78
|
-
var _a;
|
|
79
|
-
return toggleOpen(resource._id, "rowOpen", !((_a = details[resource._id]) === null || _a === void 0 ? void 0 : _a.rowOpen));
|
|
80
|
-
},
|
|
81
|
-
}
|
|
82
|
-
: undefined }), _jsx(Td, { dataLabel: t("resourceName"), "data-testid": `row[${index}].name`, children: resource.name }), _jsx(Td, { dataLabel: t("application"), children: _jsxs("a", { href: resource.client.baseUrl, children: [resource.client.name || resource.client.clientId, " ", _jsx(ExternalLinkAltIcon, {})] }) }), _jsxs(Td, { dataLabel: t("permissionRequests"), children: [resource.shareRequests &&
|
|
83
|
-
resource.shareRequests.length > 0 && (_jsx(PermissionRequest, { resource: resource, refresh: () => refresh() })), _jsx(ShareTheResource, { resource: resource, permissions: (_c = details[resource._id]) === null || _c === void 0 ? void 0 : _c.permissions, open: ((_d = details[resource._id]) === null || _d === void 0 ? void 0 : _d.shareDialogOpen) || false, onClose: () => setDetails({}) }), ((_e = details[resource._id]) === null || _e === void 0 ? void 0 : _e.editDialogOpen) && (_jsx(EditTheResource, { resource: resource, permissions: (_f = details[resource._id]) === null || _f === void 0 ? void 0 : _f.permissions, onClose: () => setDetails({}) }))] }), isShared ? (_jsx(Td, { children: resource.scopes.length > 0 && (_jsx(ChipGroup, { categoryName: t("permissions"), children: resource.scopes.map((scope) => (_jsx(Chip, { isReadOnly: true, children: scope.displayName || scope.name }, scope.name))) })) })) : (_jsx(Td, { isActionCell: true, children: _jsxs(OverflowMenu, { breakpoint: "lg", children: [_jsx(OverflowMenuContent, { children: _jsxs(OverflowMenuGroup, { groupType: "button", children: [_jsx(OverflowMenuItem, { children: _jsxs(Button, { "data-testid": `share-${resource.name}`, variant: "link", onClick: () => toggleOpen(resource._id, "shareDialogOpen", true), children: [_jsx(ShareAltIcon, {}), " ", t("share")] }) }), _jsx(OverflowMenuItem, { children: _jsx(Dropdown, { popperProps: {
|
|
84
|
-
position: "right",
|
|
85
|
-
}, onOpenChange: (isOpen) => toggleOpen(resource._id, "contextOpen", isOpen), toggle: (ref) => {
|
|
86
|
-
var _a;
|
|
87
|
-
return (_jsx(MenuToggle, { variant: "plain", ref: ref, onClick: () => {
|
|
88
|
-
var _a;
|
|
89
|
-
return toggleOpen(resource._id, "contextOpen", !((_a = details[resource._id]) === null || _a === void 0 ? void 0 : _a.contextOpen));
|
|
90
|
-
}, isExpanded: (_a = details[resource._id]) === null || _a === void 0 ? void 0 : _a.contextOpen, children: _jsx(EllipsisVIcon, {}) }));
|
|
91
|
-
}, isOpen: !!((_g = details[resource._id]) === null || _g === void 0 ? void 0 : _g.contextOpen), children: _jsxs(DropdownList, { children: [_jsxs(DropdownItem, { isDisabled: ((_j = (_h = details[resource._id]) === null || _h === void 0 ? void 0 : _h.permissions) === null || _j === void 0 ? void 0 : _j.length) ===
|
|
92
|
-
0, onClick: () => toggleOpen(resource._id, "editDialogOpen", true), children: [_jsx(EditAltIcon, {}), " ", t("edit")] }), _jsx(ContinueCancelModal, { buttonTitle: _jsxs(_Fragment, { children: [_jsx(Remove2Icon, {}), " ", t("unShare")] }), modalTitle: t("unShare"), continueLabel: t("confirm"), cancelLabel: t("cancel"), component: DropdownItem, onContinue: () => removeShare(resource), isDisabled: ((_l = (_k = details[resource._id]) === null || _k === void 0 ? void 0 : _k.permissions) === null || _l === void 0 ? void 0 : _l.length) ===
|
|
93
|
-
0, children: t("unShareAllConfirm") })] }) }) })] }) }), _jsx(OverflowMenuControl, { children: _jsx(Dropdown, { popperProps: {
|
|
94
|
-
position: "right",
|
|
95
|
-
}, onOpenChange: (isOpen) => toggleOpen(resource._id, "contextOpen", isOpen), toggle: (ref) => {
|
|
96
|
-
var _a;
|
|
97
|
-
return (_jsx(MenuToggle, { variant: "plain", ref: ref, isExpanded: (_a = details[resource._id]) === null || _a === void 0 ? void 0 : _a.contextOpen, onClick: () => {
|
|
98
|
-
var _a;
|
|
99
|
-
return toggleOpen(resource._id, "contextOpen", !((_a = details[resource._id]) === null || _a === void 0 ? void 0 : _a.contextOpen));
|
|
100
|
-
}, children: _jsx(EllipsisVIcon, {}) }));
|
|
101
|
-
}, isOpen: !!((_m = details[resource._id]) === null || _m === void 0 ? void 0 : _m.contextOpen), children: _jsxs(DropdownList, { children: [_jsxs(OverflowMenuDropdownItem, { isShared: true, onClick: () => toggleOpen(resource._id, "shareDialogOpen", true), children: [_jsx(ShareAltIcon, {}), " ", t("share")] }, "share"), _jsxs(OverflowMenuDropdownItem, { isShared: true, onClick: () => toggleOpen(resource._id, "editDialogOpen", true), isDisabled: ((_p = (_o = details[resource._id]) === null || _o === void 0 ? void 0 : _o.permissions) === null || _p === void 0 ? void 0 : _p.length) === 0, children: [_jsx(EditAltIcon, {}), " ", t("edit")] }, "edit"), _jsx(ContinueCancelModal, { buttonTitle: _jsxs(_Fragment, { children: [_jsx(Remove2Icon, {}), " ", t("unShare")] }), modalTitle: t("unShare"), continueLabel: t("confirm"), cancelLabel: t("cancel"), component: OverflowMenuDropdownItem, onContinue: () => removeShare(resource), isDisabled: ((_r = (_q = details[resource._id]) === null || _q === void 0 ? void 0 : _q.permissions) === null || _r === void 0 ? void 0 : _r.length) === 0, children: t("unShareAllConfirm") }, "unShare")] }) }) })] }) }))] }), _jsx(Tr, { isExpanded: ((_s = details[resource._id]) === null || _s === void 0 ? void 0 : _s.rowOpen) || false, children: _jsx(Td, { colSpan: 4, textCenter: true, children: _jsx(ExpandableRowContent, { children: _jsx(SharedWith, { permissions: (_t = details[resource._id]) === null || _t === void 0 ? void 0 : _t.permissions }) }) }) })] }, resource.name));
|
|
102
|
-
})] })] }));
|
|
103
|
-
};
|
|
104
|
-
//# sourceMappingURL=ResourcesTab.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ResourcesTab.js","sourceRoot":"","sources":["../src/resources/ResourcesTab.tsx"],"names":[],"mappings":";AAAA,OAAO,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QAAQ,CAAC,IAAI,CAsOZ,CACT,CAAA;qBAAA,CAAC,IACI,IACP,CACJ,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Permission, Resource } from "../api/representations";
|
|
2
|
-
type ShareTheResourceProps = {
|
|
3
|
-
resource: Resource;
|
|
4
|
-
permissions?: Permission[];
|
|
5
|
-
open: boolean;
|
|
6
|
-
onClose: () => void;
|
|
7
|
-
};
|
|
8
|
-
export declare const ShareTheResource: ({ resource, permissions, open, onClose, }: ShareTheResourceProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export {};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { FormErrorText, SelectControl, useEnvironment, } from "../ui-shared";
|
|
3
|
-
import { Button, Chip, ChipGroup, Form, FormGroup, InputGroup, InputGroupItem, Modal, TextInput, ValidatedOptions, } from "@patternfly/react-core";
|
|
4
|
-
import { useEffect } from "react";
|
|
5
|
-
import { FormProvider, useFieldArray, useForm, useWatch, } from "react-hook-form";
|
|
6
|
-
import { useTranslation } from "react-i18next";
|
|
7
|
-
import { updateRequest } from "../api";
|
|
8
|
-
import { useAccountAlerts } from "../utils/useAccountAlerts";
|
|
9
|
-
import { SharedWith } from "../resources/SharedWith";
|
|
10
|
-
export const ShareTheResource = ({ resource, permissions, open, onClose, }) => {
|
|
11
|
-
const { t } = useTranslation();
|
|
12
|
-
const context = useEnvironment();
|
|
13
|
-
const { addAlert, addError } = useAccountAlerts();
|
|
14
|
-
const form = useForm();
|
|
15
|
-
const { control, register, reset, formState: { errors, isValid }, setError, clearErrors, handleSubmit, } = form;
|
|
16
|
-
const { fields, append, remove } = useFieldArray({
|
|
17
|
-
control,
|
|
18
|
-
name: "usernames",
|
|
19
|
-
});
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
if (fields.length === 0) {
|
|
22
|
-
append({ value: "" });
|
|
23
|
-
}
|
|
24
|
-
}, [fields]);
|
|
25
|
-
const watchFields = useWatch({
|
|
26
|
-
control,
|
|
27
|
-
name: "usernames",
|
|
28
|
-
defaultValue: [],
|
|
29
|
-
});
|
|
30
|
-
const isDisabled = watchFields.every(({ value }) => value.trim().length === 0);
|
|
31
|
-
const addShare = async ({ usernames, permissions }) => {
|
|
32
|
-
try {
|
|
33
|
-
await Promise.all(usernames
|
|
34
|
-
.filter(({ value }) => value !== "")
|
|
35
|
-
.map(({ value: username }) => updateRequest(context, resource._id, username, permissions)));
|
|
36
|
-
addAlert(t("shareSuccess"));
|
|
37
|
-
onClose();
|
|
38
|
-
}
|
|
39
|
-
catch (error) {
|
|
40
|
-
addError("shareError", error);
|
|
41
|
-
}
|
|
42
|
-
reset({});
|
|
43
|
-
};
|
|
44
|
-
const validateUser = async () => {
|
|
45
|
-
const userOrEmails = fields.map((f) => f.value).filter((f) => f !== "");
|
|
46
|
-
const userPermission = permissions === null || permissions === void 0 ? void 0 : permissions.map((p) => [p.username, p.email]).flat();
|
|
47
|
-
const hasUsers = userOrEmails.length > 0;
|
|
48
|
-
const alreadyShared = userOrEmails.filter((u) => userPermission === null || userPermission === void 0 ? void 0 : userPermission.includes(u)).length !== 0;
|
|
49
|
-
if (!hasUsers || alreadyShared) {
|
|
50
|
-
setError("usernames", {
|
|
51
|
-
message: !hasUsers ? t("required") : t("resourceAlreadyShared"),
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
clearErrors();
|
|
56
|
-
}
|
|
57
|
-
return hasUsers && !alreadyShared;
|
|
58
|
-
};
|
|
59
|
-
return (_jsx(Modal, { title: t("shareTheResource", { name: resource.name }), variant: "medium", isOpen: open, onClose: onClose, actions: [
|
|
60
|
-
_jsx(Button, { variant: "primary", "data-testid": "done", isDisabled: !isValid, type: "submit", form: "share-form", children: t("done") }, "confirm"),
|
|
61
|
-
_jsx(Button, { variant: "link", onClick: onClose, children: t("cancel") }, "cancel"),
|
|
62
|
-
], children: _jsxs(Form, { id: "share-form", onSubmit: handleSubmit(addShare), children: [_jsxs(FormGroup, { label: t("shareUser"), type: "string", fieldId: "users", isRequired: true, children: [_jsxs(InputGroup, { children: [_jsx(InputGroupItem, { children: _jsx(TextInput, Object.assign({ id: "users", "data-testid": "users", placeholder: t("usernamePlaceholder"), validated: errors.usernames
|
|
63
|
-
? ValidatedOptions.error
|
|
64
|
-
: ValidatedOptions.default }, register(`usernames.${fields.length - 1}.value`, {
|
|
65
|
-
validate: validateUser,
|
|
66
|
-
}))) }), _jsx(InputGroupItem, { children: _jsx(Button, { variant: "primary", "data-testid": "add", onClick: () => append({ value: "" }), isDisabled: isDisabled, children: t("add") }, "add-user") })] }), fields.length > 1 && (_jsx(ChipGroup, { categoryName: t("shareWith"), children: fields.map((field, index) => index !== fields.length - 1 && (_jsx(Chip, { onClick: () => remove(index), children: field.value }, field.id))) })), errors.usernames && (_jsx(FormErrorText, { message: errors.usernames.message }))] }), _jsx(FormProvider, Object.assign({}, form, { children: _jsx(FormGroup, { label: "", fieldId: "permissions-selected", "data-testid": "permissions", children: _jsx(SelectControl, { name: "permissions", variant: "typeaheadMulti", controller: { defaultValue: [] }, options: resource.scopes.map(({ name, displayName }) => ({
|
|
67
|
-
key: name,
|
|
68
|
-
value: displayName || name,
|
|
69
|
-
})) }) }) })), _jsx(FormGroup, { children: _jsx(SharedWith, { permissions: permissions }) })] }) }));
|
|
70
|
-
};
|
|
71
|
-
//# sourceMappingURL=ShareTheResource.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ShareTheResource.js","sourceRoot":"","sources":["../src/resources/ShareTheResource.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EACb,aAAa,EACb,cAAc,GACf,MAAM,4CAA4C,CAAC;AACpD,OAAO,EACL,MAAM,EACN,IAAI,EACJ,SAAS,EACT,IAAI,EACJ,SAAS,EACT,UAAU,EACV,cAAc,EACd,KAAK,EACL,SAAS,EAC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AE,EACR,OAAO,EAAC,sBAAsB,iBAClB,aAAa,YAEzB,KAAC,aAAa,IACZ,IAAI,EAAC,aAAa,EAClB,OAAO,EAAC,gBAAgB,EACxB,UAAU,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,EAChC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;gCACvD,GAAG,EAAE,IAAI;gCACT,KAAK,EAAE,WAAW,IAAI,IAAI;6BAC3B,CAAC,CAAC,GACH,GACQ,IACC,EACf,KAAC,SAAS,cACR,KAAC,UAAU,IAAC,WAAW,EAAE,WAAW,GAAI,GAC9B,IACP,GACD,CACT,CAAC;AACJ,CAAC,CAAC"}
|
package/resources/SharedWith.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Trans } from "react-i18next";
|
|
3
|
-
export const SharedWith = ({ permissions: p = [] }) => (_jsx("div", { "data-testid": `shared-with-${p.length ? p.map((e) => e.username) : "none"}`, children: _jsxs(Trans, { i18nKey: "resourceSharedWith", count: p.length, children: [_jsx("strong", { children: {
|
|
4
|
-
username: p[0] ? p[0].username : undefined,
|
|
5
|
-
} }), _jsx("strong", { children: {
|
|
6
|
-
other: p.length - 1,
|
|
7
|
-
} })] }) }));
|
|
8
|
-
//# sourceMappingURL=SharedWith.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SharedWith.js","sourceRoot":"","sources":["../src/resources/SharedWith.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAQtC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAE,WAAW,EAAE,CAAC,GAAG,EAAE,EAAmB,EAAE,EAAE,CAAC,CACtE,6BACe,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,YAE1E,MAAC,KAAK,IAAC,OAAO,EAAC,oBAAoB,EAAC,KAAK,EAAE,CAAC,CAAC,MAAM,aACjD,2BACG;oBACC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;iBAC3C,GACM,EACT,2BACG;oBACC,KAAK,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC;iBACpB,GACM,IACH,GACJ,CACP,CAAC"}
|
package/root/ErrorPage.d.ts
DELETED
package/root/ErrorPage.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Button, Modal, ModalVariant, Page, Text, TextContent, TextVariants, } from "@patternfly/react-core";
|
|
3
|
-
import { useTranslation } from "react-i18next";
|
|
4
|
-
import { isRouteErrorResponse, useRouteError } from "react-router-dom";
|
|
5
|
-
export const ErrorPage = (props) => {
|
|
6
|
-
var _a;
|
|
7
|
-
const { t } = useTranslation();
|
|
8
|
-
const error = (_a = useRouteError()) !== null && _a !== void 0 ? _a : props.error;
|
|
9
|
-
const errorMessage = getErrorMessage(error);
|
|
10
|
-
function onRetry() {
|
|
11
|
-
location.href = location.origin + location.pathname;
|
|
12
|
-
}
|
|
13
|
-
return (_jsx(Page, { children: _jsx(Modal, { variant: ModalVariant.small, title: t("somethingWentWrong"), titleIconVariant: "danger", showClose: false, isOpen: true, actions: [
|
|
14
|
-
_jsx(Button, { variant: "primary", onClick: onRetry, children: t("tryAgain") }, "tryAgain"),
|
|
15
|
-
], children: _jsxs(TextContent, { children: [_jsx(Text, { children: t("somethingWentWrongDescription") }), errorMessage && (_jsx(Text, { component: TextVariants.small, children: errorMessage }))] }) }) }));
|
|
16
|
-
};
|
|
17
|
-
function getErrorMessage(error) {
|
|
18
|
-
if (typeof error === "string") {
|
|
19
|
-
return error;
|
|
20
|
-
}
|
|
21
|
-
if (isRouteErrorResponse(error)) {
|
|
22
|
-
return error.statusText;
|
|
23
|
-
}
|
|
24
|
-
if (error instanceof Error) {
|
|
25
|
-
return error.message;
|
|
26
|
-
}
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=ErrorPage.js.map
|
package/root/ErrorPage.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorPage.js","sourceRoot":"","sources":["../src/root/ErrorPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,MAAM,EACN,KAAK,EACL,YAAY,EACZ,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,YAAY,GACb,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAMvE,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAqB,EAAE,EAAE;;IACjD,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAC;IAC/B,MAAM,KAAK,GAAG,MAAA,aAAa,EAAE,mCAAI,KAAK,CAAC,KAAK,CAAC;IAC7C,MAAM,YAAY,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IAE5C,SAAS,OAAO;QACd,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC;IACtD,CAAC;IAED,OAAO,CACL,KAAC,IAAI,cACH,KAAC,KAAK,IACJ,OAAO,EAAE,YAAY,CAAC,KAAK,EAC3B,KAAK,EAAE,CAAC,CAAC,oBAAoB,CAAC,EAC9B,gBAAgB,EAAC,QAAQ,EACzB,SAAS,EAAE,KAAK,EAChB,MAAM,QACN,OAAO,EAAE;gBACP,KAAC,MAAM,IAAgB,OAAO,EAAC,SAAS,EAAC,OAAO,EAAE,OAAO,YACtD,CAAC,CAAC,UAAU,CAAC,IADJ,UAAU,CAEb;aACV,YAED,MAAC,WAAW,eACV,KAAC,IAAI,cAAE,CAAC,CAAC,+BAA+B,CAAC,GAAQ,EAChD,YAAY,IAAI,CACf,KAAC,IAAI,IAAC,SAAS,EAAE,YAAY,CAAC,KAAK,YAAG,YAAY,GAAQ,CAC3D,IACW,GACR,GACH,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,SAAS,eAAe,CAAC,KAAc;IACrC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,oBAAoB,CAAC,KAAK,CAAC,EAAE,CAAC;QAChC,OAAO,KAAK,CAAC,UAAU,CAAC;IAC1B,CAAC;IAED,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,OAAO,CAAC;IACvB,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/root/Header.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const Header: () => import("react/jsx-runtime").JSX.Element;
|
package/root/Header.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { KeycloakMasthead, label, useEnvironment, } from "../ui-shared";
|
|
3
|
-
import { Button } from "@patternfly/react-core";
|
|
4
|
-
import { ExternalLinkSquareAltIcon } from "@patternfly/react-icons";
|
|
5
|
-
import { useTranslation } from "react-i18next";
|
|
6
|
-
import { useHref } from "react-router-dom";
|
|
7
|
-
import { environment } from "../environment";
|
|
8
|
-
import { joinPath } from "../utils/joinPath";
|
|
9
|
-
import style from "@keycloakify/keycloak-account-ui/root/header.module.css";
|
|
10
|
-
const ReferrerLink = () => {
|
|
11
|
-
const { t } = useTranslation();
|
|
12
|
-
return environment.referrerUrl ? (_jsx(Button, { "data-testid": "referrer-link", component: "a", href: environment.referrerUrl.replace("_hash_", "#"), variant: "link", icon: _jsx(ExternalLinkSquareAltIcon, {}), iconPosition: "right", isInline: true, children: t("backTo", {
|
|
13
|
-
app: label(t, environment.referrerName, environment.referrerUrl),
|
|
14
|
-
}) })) : null;
|
|
15
|
-
};
|
|
16
|
-
export const Header = () => {
|
|
17
|
-
const { environment, keycloak } = useEnvironment();
|
|
18
|
-
const { t } = useTranslation();
|
|
19
|
-
const brandImage = environment.logo || "logo.svg";
|
|
20
|
-
const logoUrl = environment.logoUrl ? environment.logoUrl : "/";
|
|
21
|
-
const internalLogoHref = useHref(logoUrl);
|
|
22
|
-
// User can indicate that he wants an internal URL by starting it with "/"
|
|
23
|
-
const indexHref = logoUrl.startsWith("/") ? internalLogoHref : logoUrl;
|
|
24
|
-
return (_jsx(KeycloakMasthead, { "data-testid": "page-header", keycloak: keycloak, features: { hasManageAccount: false }, brand: {
|
|
25
|
-
href: indexHref,
|
|
26
|
-
src: /https?:/.test(brandImage) || brandImage.startsWith("data:") || brandImage.startsWith("/") ? brandImage : joinPath(environment.resourceUrl, brandImage),
|
|
27
|
-
alt: t("logo"),
|
|
28
|
-
className: style.brand,
|
|
29
|
-
}, toolbarItems: [_jsx(ReferrerLink, {}, "link")] }));
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=Header.js.map
|
package/root/Header.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../src/root/Header.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,gBAAgB,EAChB,KAAK,EACL,cAAc,GACf,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,OA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AAgB,CAAC,CAAC,CAAC,OAAO,CAAC;IAEvE,OAAO,CACL,KAAC,gBAAgB,mBACH,aAAa,EACzB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,EAAE,gBAAgB,EAAE,KAAK,EAAE,EACrC,KAAK,EAAE;YACL,IAAI,EAAE,SAAS;YACf,GAAG,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,WAAW,EAAE,UAAU,CAAC;YAC5J,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC;YACd,SAAS,EAAE,KAAK,CAAC,KAAK;SACvB,EACD,YAAY,EAAE,CAAC,KAAC,YAAY,MAAK,MAAM,CAAG,CAAC,GAC3C,CACH,CAAC;AACJ,CAAC,CAAC"}
|
package/root/PageNav.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren } from "react";
|
|
2
|
-
import { type Feature } from "../environment";
|
|
3
|
-
import { TFuncKey } from "../i18n";
|
|
4
|
-
type RootMenuItem = {
|
|
5
|
-
label: TFuncKey;
|
|
6
|
-
path: string;
|
|
7
|
-
isVisible?: keyof Feature;
|
|
8
|
-
modulePath?: string;
|
|
9
|
-
};
|
|
10
|
-
type MenuItemWithChildren = {
|
|
11
|
-
label: TFuncKey;
|
|
12
|
-
children: MenuItem[];
|
|
13
|
-
isVisible?: keyof Feature;
|
|
14
|
-
};
|
|
15
|
-
export type MenuItem = RootMenuItem | MenuItemWithChildren;
|
|
16
|
-
export declare const PageNav: () => import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
type NavLinkProps = {
|
|
18
|
-
path: string;
|
|
19
|
-
isActive: boolean;
|
|
20
|
-
};
|
|
21
|
-
export declare const NavLink: ({ path, isActive, children, }: PropsWithChildren<NavLinkProps>) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
export {};
|
package/root/PageNav.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useEnvironment } from "../ui-shared";
|
|
3
|
-
import { Nav, NavExpandable, NavItem, NavList, PageSidebar, PageSidebarBody, Spinner, } from "@patternfly/react-core";
|
|
4
|
-
import { Suspense, useMemo, useState, } from "react";
|
|
5
|
-
import { useTranslation } from "react-i18next";
|
|
6
|
-
import { matchPath, useHref, useLinkClickHandler, useLocation, } from "react-router-dom";
|
|
7
|
-
import fetchContentJson from "../content/fetchContent";
|
|
8
|
-
import { environment } from "../environment";
|
|
9
|
-
import { usePromise } from "../utils/usePromise";
|
|
10
|
-
export const PageNav = () => {
|
|
11
|
-
const [menuItems, setMenuItems] = useState();
|
|
12
|
-
const context = useEnvironment();
|
|
13
|
-
usePromise((signal) => fetchContentJson({ signal, context }), setMenuItems);
|
|
14
|
-
return (_jsx(PageSidebar, { children: _jsx(PageSidebarBody, { children: _jsx(Nav, { children: _jsx(NavList, { children: _jsx(Suspense, { fallback: _jsx(Spinner, {}), children: menuItems === null || menuItems === void 0 ? void 0 : menuItems.filter((menuItem) => menuItem.isVisible
|
|
15
|
-
? context.environment.features[menuItem.isVisible]
|
|
16
|
-
: true).map((menuItem) => (_jsx(NavMenuItem, { menuItem: menuItem }, menuItem.label))) }) }) }) }) }));
|
|
17
|
-
};
|
|
18
|
-
function NavMenuItem({ menuItem }) {
|
|
19
|
-
const { t } = useTranslation();
|
|
20
|
-
const { environment: { features }, } = useEnvironment();
|
|
21
|
-
const { pathname } = useLocation();
|
|
22
|
-
const isActive = useMemo(() => matchMenuItem(pathname, menuItem), [pathname, menuItem]);
|
|
23
|
-
if ("path" in menuItem) {
|
|
24
|
-
return (_jsx(NavLink, { path: menuItem.path, isActive: isActive, children: t(menuItem.label) }));
|
|
25
|
-
}
|
|
26
|
-
return (_jsx(NavExpandable, { "data-testid": menuItem.label, title: t(menuItem.label), isActive: isActive, isExpanded: isActive, children: menuItem.children
|
|
27
|
-
.filter((menuItem) => menuItem.isVisible ? features[menuItem.isVisible] : true)
|
|
28
|
-
.map((child) => (_jsx(NavMenuItem, { menuItem: child }, child.label))) }));
|
|
29
|
-
}
|
|
30
|
-
function getFullUrl(path) {
|
|
31
|
-
return `${new URL(environment.baseUrl).pathname}${path}`;
|
|
32
|
-
}
|
|
33
|
-
function matchMenuItem(currentPath, menuItem) {
|
|
34
|
-
if ("path" in menuItem) {
|
|
35
|
-
return !!matchPath(getFullUrl(menuItem.path), currentPath);
|
|
36
|
-
}
|
|
37
|
-
return menuItem.children.some((child) => matchMenuItem(currentPath, child));
|
|
38
|
-
}
|
|
39
|
-
export const NavLink = ({ path, isActive, children, }) => {
|
|
40
|
-
const menuItemPath = getFullUrl(path) + `?${location.search}`;
|
|
41
|
-
const href = useHref(menuItemPath);
|
|
42
|
-
const handleClick = useLinkClickHandler(menuItemPath);
|
|
43
|
-
return (_jsx(NavItem, { "data-testid": path, to: href, isActive: isActive, onClick: (event) =>
|
|
44
|
-
// PatternFly does not have the correct type for this event, so we need to cast it.
|
|
45
|
-
handleClick(event), children: children }));
|
|
46
|
-
};
|
|
47
|
-
//# sourceMappingURL=PageNav.js.map
|
package/root/PageNav.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PageNav.js","sourceRoot":"","sources":["../src/root/PageNav.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EACL,GAAG,EACH,aAAa,EACb,OAAO,EACP,OAAO,EACP,WAAW,EACX,eAAe,EACf,OAAO,GACR,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAGL,QAAQ,EACR,OAAO,EACP,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EACL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D,CAAC;IAED,OAAO,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;AAC9E,CAAC;AAOD,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EACtB,IAAI,EACJ,QAAQ,EACR,QAAQ,GACwB,EAAE,EAAE;IACpC,MAAM,YAAY,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;IAC9D,MAAM,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACnC,MAAM,WAAW,GAAG,mBAAmB,CAAC,YAAY,CAAC,CAAC;IAEtD,OAAO,CACL,KAAC,OAAO,mBACO,IAAI,EACjB,EAAE,EAAE,IAAI,EACR,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;QACjB,mFAAmF;QACnF,WAAW,CAAC,KAAsD,CAAC,YAGpE,QAAQ,GACD,CACX,CAAC;AACJ,CAAC,CAAC"}
|
package/root/Root.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const Root: () => import("react/jsx-runtime").JSX.Element;
|
package/root/Root.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { KeycloakProvider } from "../ui-shared";
|
|
3
|
-
import { Page, Spinner } from "@patternfly/react-core";
|
|
4
|
-
import { Suspense } from "react";
|
|
5
|
-
import { Outlet } from "react-router-dom";
|
|
6
|
-
import { environment } from "../environment";
|
|
7
|
-
import { Header } from "../root/Header";
|
|
8
|
-
import { PageNav } from "../root/PageNav";
|
|
9
|
-
export const Root = () => {
|
|
10
|
-
return (_jsx(KeycloakProvider, { environment: environment, children: _jsx(Page, { header: _jsx(Header, {}), sidebar: _jsx(PageNav, {}), isManagedSidebar: true, children: _jsx(Suspense, { fallback: _jsx(Spinner, {}), children: _jsx(Outlet, {}) }) }) }));
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=Root.js.map
|
package/root/Root.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Root.js","sourceRoot":"","sources":["../src/root/Root.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,8CAA8C,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,8CAA8C,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,+CAA+C,CAAC;AAExE,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,EAAE;IACvB,OAAO,CACL,KAAC,gBAAgB,IAAC,WAAW,EAAE,WAAW,YACxC,KAAC,IAAI,IAAC,MAAM,EAAE,KAAC,MAAM,KAAG,EAAE,OAAO,EAAE,KAAC,OAAO,KAAG,EAAE,gBAAgB,kBAC9D,KAAC,QAAQ,IAAC,QAAQ,EAAE,KAAC,OAAO,KAAG,YAC7B,KAAC,MAAM,KAAG,GACD,GACN,GACU,CACpB,CAAC;AACJ,CAAC,CAAC"}
|
package/routes.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { IndexRouteObject, RouteObject } from "react-router-dom";
|
|
2
|
-
export declare const DeviceActivityRoute: RouteObject;
|
|
3
|
-
export declare const LinkedAccountsRoute: RouteObject;
|
|
4
|
-
export declare const SigningInRoute: RouteObject;
|
|
5
|
-
export declare const ApplicationsRoute: RouteObject;
|
|
6
|
-
export declare const GroupsRoute: RouteObject;
|
|
7
|
-
export declare const ResourcesRoute: RouteObject;
|
|
8
|
-
export type ContentComponentParams = {
|
|
9
|
-
componentId: string;
|
|
10
|
-
};
|
|
11
|
-
export declare const ContentRoute: RouteObject;
|
|
12
|
-
export declare const PersonalInfoRoute: IndexRouteObject;
|
|
13
|
-
export declare const OrganizationsRoute: RouteObject;
|
|
14
|
-
export declare const Oid4VciRoute: RouteObject;
|
|
15
|
-
export declare const RootRoute: RouteObject;
|
|
16
|
-
export declare const routes: RouteObject[];
|
package/routes.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { lazy } from "react";
|
|
3
|
-
import { environment } from "./environment";
|
|
4
|
-
import { Organizations } from "./organizations/Organizations";
|
|
5
|
-
import { ErrorPage } from "./root/ErrorPage";
|
|
6
|
-
import { Root } from "./root/Root";
|
|
7
|
-
const DeviceActivity = lazy(() => import("./account-security/DeviceActivity"));
|
|
8
|
-
const LinkedAccounts = lazy(() => import("./account-security/LinkedAccounts"));
|
|
9
|
-
const SigningIn = lazy(() => import("./account-security/SigningIn"));
|
|
10
|
-
const Applications = lazy(() => import("./applications/Applications"));
|
|
11
|
-
const Groups = lazy(() => import("./groups/Groups"));
|
|
12
|
-
const PersonalInfo = lazy(() => import("./personal-info/PersonalInfo"));
|
|
13
|
-
const Resources = lazy(() => import("./resources/Resources"));
|
|
14
|
-
const ContentComponent = lazy(() => import("./content/ContentComponent"));
|
|
15
|
-
const Oid4Vci = lazy(() => import("./oid4vci/Oid4Vci"));
|
|
16
|
-
export const DeviceActivityRoute = {
|
|
17
|
-
path: "account-security/device-activity",
|
|
18
|
-
element: _jsx(DeviceActivity, {}),
|
|
19
|
-
};
|
|
20
|
-
export const LinkedAccountsRoute = {
|
|
21
|
-
path: "account-security/linked-accounts",
|
|
22
|
-
element: _jsx(LinkedAccounts, {}),
|
|
23
|
-
};
|
|
24
|
-
export const SigningInRoute = {
|
|
25
|
-
path: "account-security/signing-in",
|
|
26
|
-
element: _jsx(SigningIn, {}),
|
|
27
|
-
};
|
|
28
|
-
export const ApplicationsRoute = {
|
|
29
|
-
path: "applications",
|
|
30
|
-
element: _jsx(Applications, {}),
|
|
31
|
-
};
|
|
32
|
-
export const GroupsRoute = {
|
|
33
|
-
path: "groups",
|
|
34
|
-
element: _jsx(Groups, {}),
|
|
35
|
-
};
|
|
36
|
-
export const ResourcesRoute = {
|
|
37
|
-
path: "resources",
|
|
38
|
-
element: _jsx(Resources, {}),
|
|
39
|
-
};
|
|
40
|
-
export const ContentRoute = {
|
|
41
|
-
path: "content/:componentId",
|
|
42
|
-
element: _jsx(ContentComponent, {}),
|
|
43
|
-
};
|
|
44
|
-
export const PersonalInfoRoute = {
|
|
45
|
-
index: true,
|
|
46
|
-
element: _jsx(PersonalInfo, {}),
|
|
47
|
-
};
|
|
48
|
-
export const OrganizationsRoute = {
|
|
49
|
-
path: "organizations",
|
|
50
|
-
element: _jsx(Organizations, {}),
|
|
51
|
-
};
|
|
52
|
-
export const Oid4VciRoute = {
|
|
53
|
-
path: "oid4vci",
|
|
54
|
-
element: _jsx(Oid4Vci, {}),
|
|
55
|
-
};
|
|
56
|
-
export const RootRoute = {
|
|
57
|
-
path: decodeURIComponent(new URL(environment.baseUrl).pathname),
|
|
58
|
-
element: _jsx(Root, {}),
|
|
59
|
-
errorElement: _jsx(ErrorPage, {}),
|
|
60
|
-
children: [
|
|
61
|
-
PersonalInfoRoute,
|
|
62
|
-
DeviceActivityRoute,
|
|
63
|
-
LinkedAccountsRoute,
|
|
64
|
-
SigningInRoute,
|
|
65
|
-
ApplicationsRoute,
|
|
66
|
-
GroupsRoute,
|
|
67
|
-
OrganizationsRoute,
|
|
68
|
-
PersonalInfoRoute,
|
|
69
|
-
ResourcesRoute,
|
|
70
|
-
ContentRoute,
|
|
71
|
-
Oid4VciRoute,
|
|
72
|
-
],
|
|
73
|
-
};
|
|
74
|
-
export const routes = [RootRoute];
|
|
75
|
-
//# sourceMappingURL=routes.js.map
|
package/routes.js.map
DELETED
|
@@ -1 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,IAAI,KAAG;IACjB,YAAY,EAAE,KAAC,SAAS,KAAG;IAC3B,QAAQ,EAAE;QACR,iBAAiB;QACjB,mBAAmB;QACnB,mBAAmB;QACnB,cAAc;QACd,iBAAiB;QACjB,WAAW;QACX,kBAAkB;QAClB,iBAAiB;QACjB,cAAc;QACd,YAAY;QACZ,YAAY;KACb;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAkB,CAAC,SAAS,CAAC,CAAC"}
|
package/src/KcAccountUi.tsx
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { useEffect, useReducer } from "react";
|
|
2
|
-
import "@patternfly/react-core/dist/styles/base.css";
|
|
3
|
-
import "@patternfly/patternfly/patternfly-addons.css";
|
|
4
|
-
|
|
5
|
-
import { createBrowserRouter, RouterProvider } from "react-router-dom";
|
|
6
|
-
|
|
7
|
-
import { initI18n } from "@keycloakify/keycloak-account-ui/i18n";
|
|
8
|
-
import { routes } from "@keycloakify/keycloak-account-ui/routes";
|
|
9
|
-
|
|
10
|
-
const router = createBrowserRouter(routes);
|
|
11
|
-
const prI18nInitialized = initI18n();
|
|
12
|
-
|
|
13
|
-
export default function KeycloakAccountUi() {
|
|
14
|
-
const [isI18nInitialized, setI18nInitialized] = useReducer(() => true, false);
|
|
15
|
-
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
prI18nInitialized.then(() => setI18nInitialized());
|
|
18
|
-
}, []);
|
|
19
|
-
|
|
20
|
-
if (!isI18nInitialized) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return <RouterProvider router={router} />;
|
|
25
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { CallOptions } from "@keycloakify/keycloak-account-ui/api/methods";
|
|
2
|
-
import { MenuItem } from "@keycloakify/keycloak-account-ui/root/PageNav";
|
|
3
|
-
import { joinPath } from "@keycloakify/keycloak-account-ui/utils/joinPath";
|
|
4
|
-
|
|
5
|
-
export default async function fetchContentJson(
|
|
6
|
-
opts: CallOptions,
|
|
7
|
-
): Promise<MenuItem[]> {
|
|
8
|
-
const response = await fetch(
|
|
9
|
-
joinPath(opts.context.environment.resourceUrl, "/content.json"),
|
|
10
|
-
opts,
|
|
11
|
-
);
|
|
12
|
-
return await response.json();
|
|
13
|
-
}
|