@flightctl/ui-components 0.10.0-rc7 → 1.0.0-rc2
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/dist/src/components/AuthProvider/AuthProviderDetails/AuthProviderDetails.d.ts +4 -0
- package/dist/src/components/AuthProvider/AuthProviderDetails/AuthProviderDetails.d.ts.map +1 -0
- package/dist/src/components/AuthProvider/AuthProviderDetails/AuthProviderDetails.js +57 -0
- package/dist/src/components/AuthProvider/AuthProviderDetails/AuthProviderDetails.js.map +1 -0
- package/dist/src/components/AuthProvider/AuthProviderDetails/AuthProviderDetailsTab.d.ts +7 -0
- package/dist/src/components/AuthProvider/AuthProviderDetails/AuthProviderDetailsTab.d.ts.map +1 -0
- package/dist/src/components/AuthProvider/AuthProviderDetails/AuthProviderDetailsTab.js +118 -0
- package/dist/src/components/AuthProvider/AuthProviderDetails/AuthProviderDetailsTab.js.map +1 -0
- package/dist/src/components/AuthProvider/AuthProviderDetails/DeleteAuthProviderModal.d.ts +9 -0
- package/dist/src/components/AuthProvider/AuthProviderDetails/DeleteAuthProviderModal.d.ts.map +1 -0
- package/dist/src/components/AuthProvider/AuthProviderDetails/DeleteAuthProviderModal.js +55 -0
- package/dist/src/components/AuthProvider/AuthProviderDetails/DeleteAuthProviderModal.js.map +1 -0
- package/dist/src/components/AuthProvider/AuthProviderDetails/RoleAssigmentDetails.d.ts +7 -0
- package/dist/src/components/AuthProvider/AuthProviderDetails/RoleAssigmentDetails.d.ts.map +1 -0
- package/dist/src/components/AuthProvider/AuthProviderDetails/RoleAssigmentDetails.js +35 -0
- package/dist/src/components/AuthProvider/AuthProviderDetails/RoleAssigmentDetails.js.map +1 -0
- package/dist/src/components/AuthProvider/AuthProviderRow.d.ts +8 -0
- package/dist/src/components/AuthProvider/AuthProviderRow.d.ts.map +1 -0
- package/dist/src/components/AuthProvider/AuthProviderRow.js +67 -0
- package/dist/src/components/AuthProvider/AuthProviderRow.js.map +1 -0
- package/dist/src/components/AuthProvider/AuthProvidersPage.d.ts +4 -0
- package/dist/src/components/AuthProvider/AuthProvidersPage.d.ts.map +1 -0
- package/dist/src/components/AuthProvider/AuthProvidersPage.js +90 -0
- package/dist/src/components/AuthProvider/AuthProvidersPage.js.map +1 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/AuthOrganizationAssignment.d.ts +4 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/AuthOrganizationAssignment.d.ts.map +1 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/AuthOrganizationAssignment.js +39 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/AuthOrganizationAssignment.js.map +1 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/AuthProviderHelperText.d.ts +6 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/AuthProviderHelperText.d.ts.map +1 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/AuthProviderHelperText.js +87 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/AuthProviderHelperText.js.map +1 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/CreateAuthProvider.d.ts +4 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/CreateAuthProvider.d.ts.map +1 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/CreateAuthProvider.js +94 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/CreateAuthProvider.js.map +1 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/CreateAuthProviderForm.d.ts +13 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/CreateAuthProviderForm.d.ts.map +1 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/CreateAuthProviderForm.js +161 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/CreateAuthProviderForm.js.map +1 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/Oauth2ProviderFields.d.ts +4 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/Oauth2ProviderFields.d.ts.map +1 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/Oauth2ProviderFields.js +19 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/Oauth2ProviderFields.js.map +1 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/RoleAssignmentSection.d.ts +4 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/RoleAssignmentSection.d.ts.map +1 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/RoleAssignmentSection.js +71 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/RoleAssignmentSection.js.map +1 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/types.d.ts +57 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/types.d.ts.map +1 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/types.js +33 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/types.js.map +1 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/utils.d.ts +15 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/utils.d.ts.map +1 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/utils.js +466 -0
- package/dist/src/components/AuthProvider/CreateAuthProvider/utils.js.map +1 -0
- package/dist/src/components/AuthProvider/TestConnectionModal/TestConnectionModal.d.ts +9 -0
- package/dist/src/components/AuthProvider/TestConnectionModal/TestConnectionModal.d.ts.map +1 -0
- package/dist/src/components/AuthProvider/TestConnectionModal/TestConnectionModal.js +67 -0
- package/dist/src/components/AuthProvider/TestConnectionModal/TestConnectionModal.js.map +1 -0
- package/dist/src/components/AuthProvider/useAuthProviders.d.ts +8 -0
- package/dist/src/components/AuthProvider/useAuthProviders.d.ts.map +1 -0
- package/dist/src/components/AuthProvider/useAuthProviders.js +19 -0
- package/dist/src/components/AuthProvider/useAuthProviders.js.map +1 -0
- package/dist/src/components/DetailsPage/DetailsPage.d.ts +1 -1
- package/dist/src/components/DetailsPage/DetailsPage.d.ts.map +1 -1
- package/dist/src/components/DetailsPage/DetailsPageActions.d.ts.map +1 -1
- package/dist/src/components/DetailsPage/DetailsPageActions.js +1 -1
- package/dist/src/components/DetailsPage/DetailsPageActions.js.map +1 -1
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.d.ts +1 -7
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.d.ts.map +1 -1
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.js +26 -81
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.js.map +1 -1
- package/dist/src/components/DetailsPage/Tables/SystemdUnitsTable.d.ts +8 -0
- package/dist/src/components/DetailsPage/Tables/SystemdUnitsTable.d.ts.map +1 -0
- package/dist/src/components/DetailsPage/Tables/SystemdUnitsTable.js +67 -0
- package/dist/src/components/DetailsPage/Tables/SystemdUnitsTable.js.map +1 -0
- package/dist/src/components/Device/DeviceDetails/DeviceApplications.d.ts +1 -3
- package/dist/src/components/Device/DeviceDetails/DeviceApplications.d.ts.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceApplications.js +5 -49
- package/dist/src/components/Device/DeviceDetails/DeviceApplications.js.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.d.ts.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.js +15 -9
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.js.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.d.ts.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.js +5 -2
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.js.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceSystemdUnits.d.ts +8 -0
- package/dist/src/components/Device/DeviceDetails/DeviceSystemdUnits.d.ts.map +1 -0
- package/dist/src/components/Device/DeviceDetails/DeviceSystemdUnits.js +19 -0
- package/dist/src/components/Device/DeviceDetails/DeviceSystemdUnits.js.map +1 -0
- package/dist/src/components/Device/DeviceDetails/TerminalTab.d.ts.map +1 -1
- package/dist/src/components/Device/DeviceDetails/TerminalTab.js +36 -10
- package/dist/src/components/Device/DeviceDetails/TerminalTab.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.js +7 -3
- package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/DevicesEmptyStates.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/DevicesEmptyStates.js +3 -2
- package/dist/src/components/Device/DevicesPage/DevicesEmptyStates.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/DevicesPage.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/DevicesPage.js +9 -15
- package/dist/src/components/Device/DevicesPage/DevicesPage.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.js +8 -4
- package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js +4 -3
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.d.ts +2 -1
- package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.js +235 -56
- package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationContainerForm.css +5 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationContainerForm.d.ts +10 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationContainerForm.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationContainerForm.js +167 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationContainerForm.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.d.ts +2 -2
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.d.ts +2 -2
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.js +100 -38
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationVolumeForm.d.ts +11 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationVolumeForm.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationVolumeForm.js +63 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationVolumeForm.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.js +6 -4
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.js +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewApplications.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewApplications.js +21 -10
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewApplications.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/utils.d.ts +55 -3
- package/dist/src/components/Device/EditDeviceWizard/utils.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/utils.js +5 -2
- package/dist/src/components/Device/EditDeviceWizard/utils.js.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.d.ts.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js +9 -4
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.d.ts +1 -3
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.d.ts.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.js +8 -9
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.js +10 -5
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/utils.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/utils.js +2 -5
- package/dist/src/components/Fleet/CreateFleet/utils.js.map +1 -1
- package/dist/src/components/Fleet/FleetDetails/FleetDetailsPage.d.ts.map +1 -1
- package/dist/src/components/Fleet/FleetDetails/FleetDetailsPage.js +11 -6
- package/dist/src/components/Fleet/FleetDetails/FleetDetailsPage.js.map +1 -1
- package/dist/src/components/Fleet/FleetDetails/FleetYaml.d.ts +9 -0
- package/dist/src/components/Fleet/FleetDetails/FleetYaml.d.ts.map +1 -0
- package/dist/src/components/Fleet/FleetDetails/FleetYaml.js +13 -0
- package/dist/src/components/Fleet/FleetDetails/FleetYaml.js.map +1 -0
- package/dist/src/components/Fleet/FleetResourceSyncs.d.ts.map +1 -1
- package/dist/src/components/Fleet/FleetResourceSyncs.js +3 -2
- package/dist/src/components/Fleet/FleetResourceSyncs.js.map +1 -1
- package/dist/src/components/Fleet/FleetsPage.d.ts.map +1 -1
- package/dist/src/components/Fleet/FleetsPage.js +22 -13
- package/dist/src/components/Fleet/FleetsPage.js.map +1 -1
- package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.d.ts.map +1 -1
- package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.js +9 -2
- package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.js.map +1 -1
- package/dist/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.d.ts.map +1 -1
- package/dist/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.js +3 -2
- package/dist/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.js.map +1 -1
- package/dist/src/components/ListPage/ListPage.d.ts +0 -1
- package/dist/src/components/ListPage/ListPage.d.ts.map +1 -1
- package/dist/src/components/ListPage/ListPage.js +2 -5
- package/dist/src/components/ListPage/ListPage.js.map +1 -1
- package/dist/src/components/Login/ProviderSelector.d.ts +11 -0
- package/dist/src/components/Login/ProviderSelector.d.ts.map +1 -0
- package/dist/src/components/Login/ProviderSelector.js +66 -0
- package/dist/src/components/Login/ProviderSelector.js.map +1 -0
- package/dist/src/components/Login/TokenLoginForm.d.ts +9 -0
- package/dist/src/components/Login/TokenLoginForm.d.ts.map +1 -0
- package/dist/src/components/Login/TokenLoginForm.js +107 -0
- package/dist/src/components/Login/TokenLoginForm.js.map +1 -0
- package/dist/src/components/Masthead/CommandLineToolsPage.d.ts.map +1 -1
- package/dist/src/components/Masthead/CommandLineToolsPage.js +1 -6
- package/dist/src/components/Masthead/CommandLineToolsPage.js.map +1 -1
- package/dist/src/components/OverviewPage/Cards/Alerts/AlertsCard.d.ts.map +1 -1
- package/dist/src/components/OverviewPage/Cards/Alerts/AlertsCard.js +2 -0
- package/dist/src/components/OverviewPage/Cards/Alerts/AlertsCard.js.map +1 -1
- package/dist/src/components/OverviewPage/Overview.d.ts.map +1 -1
- package/dist/src/components/OverviewPage/Overview.js +8 -4
- package/dist/src/components/OverviewPage/Overview.js.map +1 -1
- package/dist/src/components/OverviewPage/OverviewPage.d.ts.map +1 -1
- package/dist/src/components/OverviewPage/OverviewPage.js +3 -8
- package/dist/src/components/OverviewPage/OverviewPage.js.map +1 -1
- package/dist/src/components/Repository/CreateRepository/CreateRepository.d.ts.map +1 -1
- package/dist/src/components/Repository/CreateRepository/CreateRepository.js +3 -2
- package/dist/src/components/Repository/CreateRepository/CreateRepository.js.map +1 -1
- package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.d.ts.map +1 -1
- package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.js +3 -2
- package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.js.map +1 -1
- package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.d.ts.map +1 -1
- package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.js +11 -6
- package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.js.map +1 -1
- package/dist/src/components/Repository/RepositoryList.d.ts.map +1 -1
- package/dist/src/components/Repository/RepositoryList.js +11 -5
- package/dist/src/components/Repository/RepositoryList.js.map +1 -1
- package/dist/src/components/ResourceSync/RepositoryResourceSyncList.d.ts.map +1 -1
- package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js +7 -3
- package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js.map +1 -1
- package/dist/src/components/Terminal/Terminal.css +12 -1
- package/dist/src/components/Terminal/Terminal.js +3 -3
- package/dist/src/components/Terminal/Terminal.js.map +1 -1
- package/dist/src/components/common/CodeEditor/YamlEditor.d.ts +7 -5
- package/dist/src/components/common/CodeEditor/YamlEditor.d.ts.map +1 -1
- package/dist/src/components/common/CodeEditor/YamlEditor.js +142 -10
- package/dist/src/components/common/CodeEditor/YamlEditor.js.map +1 -1
- package/dist/src/components/common/CodeEditor/YamlEditorBase.d.ts +7 -1
- package/dist/src/components/common/CodeEditor/YamlEditorBase.d.ts.map +1 -1
- package/dist/src/components/common/CodeEditor/YamlEditorBase.js +16 -8
- package/dist/src/components/common/CodeEditor/YamlEditorBase.js.map +1 -1
- package/dist/src/components/common/OrganizationGuard.d.ts +1 -1
- package/dist/src/components/common/OrganizationGuard.d.ts.map +1 -1
- package/dist/src/components/common/OrganizationGuard.js +16 -22
- package/dist/src/components/common/OrganizationGuard.js.map +1 -1
- package/dist/src/components/common/OrganizationSelector.d.ts.map +1 -1
- package/dist/src/components/common/OrganizationSelector.js +20 -6
- package/dist/src/components/common/OrganizationSelector.js.map +1 -1
- package/dist/src/components/common/PageNavigation.css +9 -0
- package/dist/src/components/common/PageNavigation.d.ts +4 -1
- package/dist/src/components/common/PageNavigation.d.ts.map +1 -1
- package/dist/src/components/common/PageNavigation.js +25 -10
- package/dist/src/components/common/PageNavigation.js.map +1 -1
- package/dist/src/components/common/PermissionsContext.d.ts +14 -0
- package/dist/src/components/common/PermissionsContext.d.ts.map +1 -0
- package/dist/src/components/common/PermissionsContext.js +84 -0
- package/dist/src/components/common/PermissionsContext.js.map +1 -0
- package/dist/src/components/form/FilterSelect.d.ts.map +1 -1
- package/dist/src/components/form/FilterSelect.js +1 -1
- package/dist/src/components/form/FilterSelect.js.map +1 -1
- package/dist/src/components/form/FormSelect.d.ts.map +1 -1
- package/dist/src/components/form/FormSelect.js +1 -1
- package/dist/src/components/form/FormSelect.js.map +1 -1
- package/dist/src/components/form/FormSelectTypeahead.d.ts.map +1 -1
- package/dist/src/components/form/FormSelectTypeahead.js +84 -4
- package/dist/src/components/form/FormSelectTypeahead.js.map +1 -1
- package/dist/src/components/form/ListItemField.d.ts +12 -0
- package/dist/src/components/form/ListItemField.d.ts.map +1 -0
- package/dist/src/components/form/ListItemField.js +67 -0
- package/dist/src/components/form/ListItemField.js.map +1 -0
- package/dist/src/components/form/NameField.d.ts +1 -1
- package/dist/src/components/form/NameField.d.ts.map +1 -1
- package/dist/src/components/form/NameField.js +4 -2
- package/dist/src/components/form/NameField.js.map +1 -1
- package/dist/src/components/form/SwitchField.d.ts +2 -1
- package/dist/src/components/form/SwitchField.d.ts.map +1 -1
- package/dist/src/components/form/SwitchField.js +2 -2
- package/dist/src/components/form/SwitchField.js.map +1 -1
- package/dist/src/components/form/validations.d.ts +64 -4
- package/dist/src/components/form/validations.d.ts.map +1 -1
- package/dist/src/components/form/validations.js +340 -41
- package/dist/src/components/form/validations.js.map +1 -1
- package/dist/src/constants.d.ts +1 -1
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/constants.js +1 -1
- package/dist/src/constants.js.map +1 -1
- package/dist/src/hooks/useAlertsEnabled.d.ts.map +1 -1
- package/dist/src/hooks/useAlertsEnabled.js +10 -4
- package/dist/src/hooks/useAlertsEnabled.js.map +1 -1
- package/dist/src/hooks/useAppContext.d.ts +4 -2
- package/dist/src/hooks/useAppContext.d.ts.map +1 -1
- package/dist/src/hooks/useAppContext.js +4 -1
- package/dist/src/hooks/useAppContext.js.map +1 -1
- package/dist/src/hooks/useFetch.d.ts +0 -1
- package/dist/src/hooks/useFetch.d.ts.map +1 -1
- package/dist/src/hooks/useNavigate.d.ts +6 -2
- package/dist/src/hooks/useNavigate.d.ts.map +1 -1
- package/dist/src/hooks/useNavigate.js +4 -0
- package/dist/src/hooks/useNavigate.js.map +1 -1
- package/dist/src/hooks/usePendingEnrollmentRequestsCount.d.ts.map +1 -1
- package/dist/src/hooks/usePendingEnrollmentRequestsCount.js +9 -1
- package/dist/src/hooks/usePendingEnrollmentRequestsCount.js.map +1 -1
- package/dist/src/hooks/useSystemRestoreContext.d.ts.map +1 -1
- package/dist/src/hooks/useSystemRestoreContext.js +3 -2
- package/dist/src/hooks/useSystemRestoreContext.js.map +1 -1
- package/dist/src/hooks/useWebSocket.d.ts.map +1 -1
- package/dist/src/hooks/useWebSocket.js +47 -19
- package/dist/src/hooks/useWebSocket.js.map +1 -1
- package/dist/src/types/deviceSpec.d.ts +50 -15
- package/dist/src/types/deviceSpec.d.ts.map +1 -1
- package/dist/src/types/deviceSpec.js +17 -8
- package/dist/src/types/deviceSpec.js.map +1 -1
- package/dist/src/types/extraTypes.d.ts +14 -2
- package/dist/src/types/extraTypes.d.ts.map +1 -1
- package/dist/src/types/extraTypes.js +11 -1
- package/dist/src/types/extraTypes.js.map +1 -1
- package/dist/src/types/rbac.d.ts +2 -1
- package/dist/src/types/rbac.d.ts.map +1 -1
- package/dist/src/types/rbac.js +1 -0
- package/dist/src/types/rbac.js.map +1 -1
- package/dist/src/utils/authProvider.d.ts +4 -0
- package/dist/src/utils/authProvider.d.ts.map +1 -0
- package/dist/src/utils/authProvider.js +22 -0
- package/dist/src/utils/authProvider.js.map +1 -0
- package/dist/src/utils/error.d.ts +1 -0
- package/dist/src/utils/error.d.ts.map +1 -1
- package/dist/src/utils/error.js +6 -1
- package/dist/src/utils/error.js.map +1 -1
- package/dist/src/utils/k8sProvider.d.ts +3 -0
- package/dist/src/utils/k8sProvider.d.ts.map +1 -0
- package/dist/src/utils/k8sProvider.js +18 -0
- package/dist/src/utils/k8sProvider.js.map +1 -0
- package/dist/src/utils/patch.d.ts.map +1 -1
- package/dist/src/utils/patch.js +3 -1
- package/dist/src/utils/patch.js.map +1 -1
- package/dist/src/utils/status/applications.d.ts.map +1 -1
- package/dist/src/utils/status/applications.js +7 -0
- package/dist/src/utils/status/applications.js.map +1 -1
- package/package.json +1 -1
- package/src/components/AuthProvider/AuthProviderDetails/AuthProviderDetails.tsx +111 -0
- package/src/components/AuthProvider/AuthProviderDetails/AuthProviderDetailsTab.tsx +239 -0
- package/src/components/AuthProvider/AuthProviderDetails/DeleteAuthProviderModal.tsx +95 -0
- package/src/components/AuthProvider/AuthProviderDetails/RoleAssigmentDetails.tsx +53 -0
- package/src/components/AuthProvider/AuthProviderRow.tsx +84 -0
- package/src/components/AuthProvider/AuthProvidersPage.tsx +168 -0
- package/src/components/AuthProvider/CreateAuthProvider/AuthOrganizationAssignment.tsx +102 -0
- package/src/components/AuthProvider/CreateAuthProvider/AuthProviderHelperText.tsx +78 -0
- package/src/components/AuthProvider/CreateAuthProvider/CreateAuthProvider.tsx +145 -0
- package/src/components/AuthProvider/CreateAuthProvider/CreateAuthProviderForm.tsx +284 -0
- package/src/components/AuthProvider/CreateAuthProvider/Oauth2ProviderFields.tsx +24 -0
- package/src/components/AuthProvider/CreateAuthProvider/RoleAssignmentSection.tsx +165 -0
- package/src/components/AuthProvider/CreateAuthProvider/types.ts +96 -0
- package/src/components/AuthProvider/CreateAuthProvider/utils.ts +557 -0
- package/src/components/AuthProvider/TestConnectionModal/TestConnectionModal.tsx +136 -0
- package/src/components/AuthProvider/useAuthProviders.ts +18 -0
- package/src/components/DetailsPage/DetailsPage.tsx +1 -1
- package/src/components/DetailsPage/DetailsPageActions.tsx +2 -0
- package/src/components/DetailsPage/Tables/ApplicationsTable.tsx +29 -132
- package/src/components/DetailsPage/Tables/SystemdUnitsTable.tsx +98 -0
- package/src/components/Device/DeviceDetails/DeviceApplications.tsx +3 -73
- package/src/components/Device/DeviceDetails/DeviceDetailsPage.tsx +19 -9
- package/src/components/Device/DeviceDetails/DeviceDetailsTab.tsx +6 -2
- package/src/components/Device/DeviceDetails/DeviceSystemdUnits.tsx +30 -0
- package/src/components/Device/DeviceDetails/TerminalTab.tsx +57 -24
- package/src/components/Device/DevicesPage/DecommissionedDevicesTable.tsx +8 -3
- package/src/components/Device/DevicesPage/DevicesEmptyStates.tsx +3 -2
- package/src/components/Device/DevicesPage/DevicesPage.tsx +9 -15
- package/src/components/Device/DevicesPage/EnrolledDevicesTable.tsx +9 -4
- package/src/components/Device/EditDeviceWizard/EditDeviceWizard.tsx +10 -4
- package/src/components/Device/EditDeviceWizard/deviceSpecUtils.ts +295 -60
- package/src/components/Device/EditDeviceWizard/steps/ApplicationContainerForm.css +5 -0
- package/src/components/Device/EditDeviceWizard/steps/ApplicationContainerForm.tsx +312 -0
- package/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.tsx +2 -2
- package/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.tsx +3 -3
- package/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.tsx +196 -80
- package/src/components/Device/EditDeviceWizard/steps/ApplicationVolumeForm.tsx +149 -0
- package/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.tsx +6 -4
- package/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.tsx +1 -1
- package/src/components/Device/EditDeviceWizard/steps/ReviewApplications.tsx +26 -10
- package/src/components/Device/EditDeviceWizard/utils.ts +15 -1
- package/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.tsx +10 -4
- package/src/components/EnrollmentRequest/EnrollmentRequestList.tsx +9 -13
- package/src/components/Fleet/CreateFleet/CreateFleetWizard.tsx +11 -8
- package/src/components/Fleet/CreateFleet/utils.ts +2 -4
- package/src/components/Fleet/FleetDetails/FleetDetailsPage.tsx +11 -6
- package/src/components/Fleet/FleetDetails/FleetYaml.tsx +13 -0
- package/src/components/Fleet/FleetResourceSyncs.tsx +3 -2
- package/src/components/Fleet/FleetsPage.tsx +34 -27
- package/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.tsx +10 -2
- package/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.tsx +3 -2
- package/src/components/ListPage/ListPage.tsx +1 -8
- package/src/components/Login/ProviderSelector.tsx +114 -0
- package/src/components/Login/TokenLoginForm.tsx +202 -0
- package/src/components/Masthead/CommandLineToolsPage.tsx +1 -11
- package/src/components/OverviewPage/Cards/Alerts/AlertsCard.tsx +2 -0
- package/src/components/OverviewPage/Overview.tsx +9 -4
- package/src/components/OverviewPage/OverviewPage.tsx +6 -13
- package/src/components/Repository/CreateRepository/CreateRepository.tsx +3 -2
- package/src/components/Repository/CreateRepository/CreateRepositoryForm.tsx +3 -2
- package/src/components/Repository/RepositoryDetails/RepositoryDetails.tsx +11 -9
- package/src/components/Repository/RepositoryList.tsx +11 -5
- package/src/components/ResourceSync/RepositoryResourceSyncList.tsx +8 -3
- package/src/components/Terminal/Terminal.css +12 -1
- package/src/components/Terminal/Terminal.tsx +3 -3
- package/src/components/common/CodeEditor/YamlEditor.tsx +195 -15
- package/src/components/common/CodeEditor/YamlEditorBase.tsx +42 -8
- package/src/components/common/OrganizationGuard.tsx +19 -27
- package/src/components/common/OrganizationSelector.tsx +65 -38
- package/src/components/common/PageNavigation.css +9 -0
- package/src/components/common/PageNavigation.tsx +42 -14
- package/src/components/common/PermissionsContext.tsx +108 -0
- package/src/components/form/FilterSelect.tsx +2 -0
- package/src/components/form/FormSelect.tsx +2 -0
- package/src/components/form/FormSelectTypeahead.tsx +97 -4
- package/src/components/form/ListItemField.tsx +123 -0
- package/src/components/form/NameField.tsx +3 -1
- package/src/components/form/SwitchField.tsx +3 -2
- package/src/components/form/validations.ts +430 -65
- package/src/constants.ts +1 -1
- package/src/hooks/useAlertsEnabled.ts +10 -5
- package/src/hooks/useAppContext.tsx +4 -3
- package/src/hooks/useNavigate.tsx +7 -1
- package/src/hooks/usePendingEnrollmentRequestsCount.ts +13 -1
- package/src/hooks/useSystemRestoreContext.tsx +3 -2
- package/src/hooks/useWebSocket.ts +53 -16
- package/src/types/deviceSpec.ts +72 -22
- package/src/types/extraTypes.ts +19 -1
- package/src/types/rbac.ts +1 -0
- package/src/utils/authProvider.ts +20 -0
- package/src/utils/error.ts +5 -0
- package/src/utils/k8sProvider.ts +11 -0
- package/src/utils/patch.ts +3 -1
- package/src/utils/status/applications.ts +7 -0
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.css +0 -7
- package/dist/src/components/common/ButtonWithPermissions.d.ts +0 -8
- package/dist/src/components/common/ButtonWithPermissions.d.ts.map +0 -1
- package/dist/src/components/common/ButtonWithPermissions.js +0 -12
- package/dist/src/components/common/ButtonWithPermissions.js.map +0 -1
- package/dist/src/components/common/TechPreviewBadge.d.ts +0 -4
- package/dist/src/components/common/TechPreviewBadge.d.ts.map +0 -1
- package/dist/src/components/common/TechPreviewBadge.js +0 -24
- package/dist/src/components/common/TechPreviewBadge.js.map +0 -1
- package/dist/src/hooks/useAccessReview.d.ts +0 -4
- package/dist/src/hooks/useAccessReview.d.ts.map +0 -1
- package/dist/src/hooks/useAccessReview.js +0 -46
- package/dist/src/hooks/useAccessReview.js.map +0 -1
- package/dist/src/hooks/useFleetImportAccessReview.d.ts +0 -3
- package/dist/src/hooks/useFleetImportAccessReview.d.ts.map +0 -1
- package/dist/src/hooks/useFleetImportAccessReview.js +0 -12
- package/dist/src/hooks/useFleetImportAccessReview.js.map +0 -1
- package/src/components/DetailsPage/Tables/ApplicationsTable.css +0 -7
- package/src/components/common/ButtonWithPermissions.tsx +0 -14
- package/src/components/common/TechPreviewBadge.tsx +0 -45
- package/src/hooks/useAccessReview.ts +0 -49
- package/src/hooks/useFleetImportAccessReview.ts +0 -8
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import {
|
|
3
|
+
Button,
|
|
3
4
|
Dropdown,
|
|
4
5
|
DropdownItem,
|
|
5
6
|
DropdownList,
|
|
6
|
-
Masthead,
|
|
7
|
-
MastheadContent,
|
|
8
7
|
MenuToggle,
|
|
9
8
|
MenuToggleElement,
|
|
10
|
-
|
|
9
|
+
Panel,
|
|
10
|
+
PanelMain,
|
|
11
|
+
PanelMainBody,
|
|
11
12
|
Toolbar,
|
|
12
13
|
ToolbarContent,
|
|
13
14
|
ToolbarItem,
|
|
15
|
+
Tooltip,
|
|
14
16
|
} from '@patternfly/react-core';
|
|
17
|
+
import CogIcon from '@patternfly/react-icons/dist/js/icons/cog-icon';
|
|
15
18
|
import { useTranslation } from '../../hooks/useTranslation';
|
|
19
|
+
import { ROUTE, useNavigate } from '../../hooks/useNavigate';
|
|
16
20
|
import { useOrganizationGuardContext } from './OrganizationGuard';
|
|
17
21
|
import OrganizationSelector from './OrganizationSelector';
|
|
22
|
+
import { RESOURCE, VERB } from '../../types/rbac';
|
|
23
|
+
import { usePermissionsContext } from './PermissionsContext';
|
|
24
|
+
|
|
25
|
+
import './PageNavigation.css';
|
|
18
26
|
|
|
19
27
|
type OrganizationDropdownProps = {
|
|
20
28
|
organizationName?: string;
|
|
@@ -55,22 +63,28 @@ const OrganizationDropdown = ({ organizationName, onSwitchOrganization }: Organi
|
|
|
55
63
|
);
|
|
56
64
|
};
|
|
57
65
|
|
|
58
|
-
const PageNavigation = () => {
|
|
66
|
+
const PageNavigation = ({ showSettings = true }: { showSettings?: boolean }) => {
|
|
67
|
+
const { t } = useTranslation();
|
|
68
|
+
const navigate = useNavigate();
|
|
59
69
|
const { currentOrganization, availableOrganizations } = useOrganizationGuardContext();
|
|
70
|
+
const { checkPermissions } = usePermissionsContext();
|
|
71
|
+
const [isAdmin] = checkPermissions([{ kind: RESOURCE.AUTH_PROVIDER, verb: VERB.CREATE }]);
|
|
60
72
|
const [showOrganizationModal, setShowOrganizationModal] = React.useState(false);
|
|
61
|
-
|
|
62
73
|
const showOrganizationSelection = availableOrganizations.length > 1;
|
|
63
|
-
|
|
74
|
+
const currentOrgDisplayName = currentOrganization?.spec?.displayName || currentOrganization?.metadata?.name || '';
|
|
75
|
+
|
|
76
|
+
// Show navigation bar if there's either org selection OR admin button to show
|
|
77
|
+
const shouldShowNavigation = showOrganizationSelection || isAdmin;
|
|
78
|
+
|
|
79
|
+
if (!shouldShowNavigation) {
|
|
64
80
|
return null;
|
|
65
81
|
}
|
|
66
82
|
|
|
67
|
-
const currentOrgDisplayName = currentOrganization?.spec?.displayName || currentOrganization?.metadata?.name || '';
|
|
68
|
-
|
|
69
83
|
return (
|
|
70
84
|
<>
|
|
71
|
-
<
|
|
72
|
-
<
|
|
73
|
-
<
|
|
85
|
+
<Panel className="fctl-subnav_panel">
|
|
86
|
+
<PanelMain>
|
|
87
|
+
<PanelMainBody>
|
|
74
88
|
<Toolbar isFullHeight isStatic className="fctl-subnav_toolbar">
|
|
75
89
|
<ToolbarContent>
|
|
76
90
|
{showOrganizationSelection && (
|
|
@@ -83,11 +97,25 @@ const PageNavigation = () => {
|
|
|
83
97
|
/>
|
|
84
98
|
</ToolbarItem>
|
|
85
99
|
)}
|
|
100
|
+
{isAdmin && showSettings && (
|
|
101
|
+
<ToolbarItem>
|
|
102
|
+
<Tooltip content={t('Manage authentication providers')}>
|
|
103
|
+
<Button
|
|
104
|
+
variant="link"
|
|
105
|
+
aria-label={t('Settings')}
|
|
106
|
+
onClick={() => navigate(ROUTE.AUTH_PROVIDERS)}
|
|
107
|
+
icon={<CogIcon />}
|
|
108
|
+
>
|
|
109
|
+
{t('Settings')}
|
|
110
|
+
</Button>
|
|
111
|
+
</Tooltip>
|
|
112
|
+
</ToolbarItem>
|
|
113
|
+
)}
|
|
86
114
|
</ToolbarContent>
|
|
87
115
|
</Toolbar>
|
|
88
|
-
</
|
|
89
|
-
</
|
|
90
|
-
</
|
|
116
|
+
</PanelMainBody>
|
|
117
|
+
</PanelMain>
|
|
118
|
+
</Panel>
|
|
91
119
|
|
|
92
120
|
{showOrganizationModal && (
|
|
93
121
|
<OrganizationSelector
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { Permission, PermissionList } from '@flightctl/types';
|
|
3
|
+
import { RESOURCE, VERB } from '../../types/rbac';
|
|
4
|
+
import { useFetch } from '../../hooks/useFetch';
|
|
5
|
+
import { useOrganizationGuardContext } from './OrganizationGuard';
|
|
6
|
+
|
|
7
|
+
export type PermissionCheck = {
|
|
8
|
+
kind: RESOURCE;
|
|
9
|
+
verb: VERB;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Helper function to check if a permission (resource + verb) is allowed
|
|
14
|
+
* Handles wildcards: "*" in resource means all resources, "*" in operations means all operations
|
|
15
|
+
*/
|
|
16
|
+
const isPermissionAllowed = (userPermissions: Permission[], permissionCheck: PermissionCheck): boolean => {
|
|
17
|
+
for (const permission of userPermissions) {
|
|
18
|
+
// Check if resource matches (exact match or wildcard)
|
|
19
|
+
const resourceMatches = permission.resource === '*' || permission.resource === permissionCheck.kind;
|
|
20
|
+
if (resourceMatches) {
|
|
21
|
+
// Check if operation/verb matches (exact match or wildcard)
|
|
22
|
+
const verbMatches = permission.operations.includes('*') || permission.operations.includes(permissionCheck.verb);
|
|
23
|
+
if (verbMatches) {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return false;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type PermissionsContextType = {
|
|
33
|
+
loading: boolean;
|
|
34
|
+
error: string | undefined;
|
|
35
|
+
checkPermissions: (permissions: PermissionCheck[]) => boolean[];
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const PermissionsContext = React.createContext<PermissionsContextType | undefined>(undefined);
|
|
39
|
+
|
|
40
|
+
export const PermissionsContextProvider = ({ children }: React.PropsWithChildren) => {
|
|
41
|
+
const [userPermissions, setUserPermissions] = React.useState<Permission[]>([]);
|
|
42
|
+
const [loading, setLoading] = React.useState(true);
|
|
43
|
+
const [error, setError] = React.useState<string | undefined>();
|
|
44
|
+
const { currentOrganization } = useOrganizationGuardContext();
|
|
45
|
+
|
|
46
|
+
const orgId = currentOrganization?.metadata?.name;
|
|
47
|
+
|
|
48
|
+
const { get } = useFetch();
|
|
49
|
+
|
|
50
|
+
React.useEffect(() => {
|
|
51
|
+
const abortController = new AbortController();
|
|
52
|
+
|
|
53
|
+
const loadPermissions = async () => {
|
|
54
|
+
setLoading(true);
|
|
55
|
+
setError(undefined);
|
|
56
|
+
try {
|
|
57
|
+
const response = await get<PermissionList>('auth/permissions', abortController.signal);
|
|
58
|
+
if (!abortController.signal.aborted) {
|
|
59
|
+
setUserPermissions(response.permissions);
|
|
60
|
+
}
|
|
61
|
+
} catch (err) {
|
|
62
|
+
// Ignore abort errors - they're expected when organization changes
|
|
63
|
+
if (!abortController.signal.aborted) {
|
|
64
|
+
setError(err instanceof Error ? err.message : 'Failed to fetch permissions');
|
|
65
|
+
setUserPermissions([]);
|
|
66
|
+
}
|
|
67
|
+
} finally {
|
|
68
|
+
if (!abortController.signal.aborted) {
|
|
69
|
+
setLoading(false);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
if (orgId) {
|
|
75
|
+
void loadPermissions();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Cleanup: abort the request if the organization changes or component unmounts
|
|
79
|
+
return () => {
|
|
80
|
+
abortController.abort();
|
|
81
|
+
};
|
|
82
|
+
}, [get, orgId]);
|
|
83
|
+
|
|
84
|
+
const checkPermissions = React.useCallback(
|
|
85
|
+
(permissionChecks: PermissionCheck[]): boolean[] =>
|
|
86
|
+
permissionChecks.map((permissionCheck) => isPermissionAllowed(userPermissions, permissionCheck)),
|
|
87
|
+
[userPermissions],
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
const value = React.useMemo(
|
|
91
|
+
() => ({
|
|
92
|
+
loading,
|
|
93
|
+
error,
|
|
94
|
+
checkPermissions,
|
|
95
|
+
}),
|
|
96
|
+
[loading, error, checkPermissions],
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
return <PermissionsContext.Provider value={value}>{children}</PermissionsContext.Provider>;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const usePermissionsContext = (): PermissionsContextType => {
|
|
103
|
+
const context = React.useContext(PermissionsContext);
|
|
104
|
+
if (context === undefined) {
|
|
105
|
+
throw new Error('usePermissionsContext must be used within a PermissionsContextProvider');
|
|
106
|
+
}
|
|
107
|
+
return context;
|
|
108
|
+
};
|
|
@@ -46,6 +46,9 @@ const FormSelectTypeahead = ({
|
|
|
46
46
|
|
|
47
47
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
48
48
|
const [inputValue, setInputValue] = React.useState<string | undefined>(undefined);
|
|
49
|
+
const [focusedItemIndex, setFocusedItemIndex] = React.useState<number | null>(null);
|
|
50
|
+
const [activeItemId, setActiveItemId] = React.useState<string | null>(null);
|
|
51
|
+
const textInputRef = React.useRef<HTMLInputElement>();
|
|
49
52
|
|
|
50
53
|
const currentValue = field.value;
|
|
51
54
|
|
|
@@ -79,6 +82,79 @@ const FormSelectTypeahead = ({
|
|
|
79
82
|
return getItemLabel(items[key]).toLowerCase().includes(inputValue.toLowerCase());
|
|
80
83
|
});
|
|
81
84
|
|
|
85
|
+
const setActiveAndFocusedItem = (itemIndex: number) => {
|
|
86
|
+
setFocusedItemIndex(itemIndex);
|
|
87
|
+
const focusedItem = itemKeysFiltered[itemIndex];
|
|
88
|
+
setActiveItemId(`${fieldId}-${focusedItem}`);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const resetActiveAndFocusedItem = () => {
|
|
92
|
+
setFocusedItemIndex(null);
|
|
93
|
+
setActiveItemId(null);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const handleMenuArrowKeys = (key: string) => {
|
|
97
|
+
let indexToFocus = 0;
|
|
98
|
+
|
|
99
|
+
if (!isOpen) {
|
|
100
|
+
setIsOpen(true);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (itemKeysFiltered.length === 0) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (key === 'ArrowUp') {
|
|
108
|
+
// When no index is set or at the first index, focus to the last, otherwise decrement focus index
|
|
109
|
+
if (focusedItemIndex === null || focusedItemIndex === 0) {
|
|
110
|
+
indexToFocus = itemKeysFiltered.length - 1;
|
|
111
|
+
} else {
|
|
112
|
+
indexToFocus = focusedItemIndex - 1;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (key === 'ArrowDown') {
|
|
117
|
+
// When no index is set or at the last index, focus to the first, otherwise increment focus index
|
|
118
|
+
if (focusedItemIndex === null || focusedItemIndex === itemKeysFiltered.length - 1) {
|
|
119
|
+
indexToFocus = 0;
|
|
120
|
+
} else {
|
|
121
|
+
indexToFocus = focusedItemIndex + 1;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
setActiveAndFocusedItem(indexToFocus);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const onInputKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {
|
|
129
|
+
const focusedItem = focusedItemIndex !== null ? itemKeysFiltered[focusedItemIndex] : null;
|
|
130
|
+
|
|
131
|
+
switch (event.key) {
|
|
132
|
+
case 'Enter':
|
|
133
|
+
if (isOpen && focusedItem) {
|
|
134
|
+
event.preventDefault();
|
|
135
|
+
setTouched(true);
|
|
136
|
+
setValue(focusedItem, true);
|
|
137
|
+
setInputValue(undefined);
|
|
138
|
+
setIsOpen(false);
|
|
139
|
+
resetActiveAndFocusedItem();
|
|
140
|
+
} else if (!isOpen) {
|
|
141
|
+
setIsOpen(true);
|
|
142
|
+
}
|
|
143
|
+
break;
|
|
144
|
+
case 'ArrowUp':
|
|
145
|
+
case 'ArrowDown':
|
|
146
|
+
event.preventDefault();
|
|
147
|
+
handleMenuArrowKeys(event.key);
|
|
148
|
+
break;
|
|
149
|
+
case 'Escape':
|
|
150
|
+
if (isOpen) {
|
|
151
|
+
setIsOpen(false);
|
|
152
|
+
resetActiveAndFocusedItem();
|
|
153
|
+
}
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
|
|
82
158
|
return (
|
|
83
159
|
<FormGroup id={`form-control__${fieldId}`} fieldId={fieldId}>
|
|
84
160
|
<Select
|
|
@@ -90,6 +166,7 @@ const FormSelectTypeahead = ({
|
|
|
90
166
|
setValue(value as string, true);
|
|
91
167
|
setInputValue(undefined);
|
|
92
168
|
setIsOpen(false);
|
|
169
|
+
resetActiveAndFocusedItem();
|
|
93
170
|
}}
|
|
94
171
|
toggle={(toggleRef) => (
|
|
95
172
|
<MenuToggle
|
|
@@ -99,6 +176,7 @@ const FormSelectTypeahead = ({
|
|
|
99
176
|
setTouched(true);
|
|
100
177
|
}
|
|
101
178
|
setIsOpen(!isOpen);
|
|
179
|
+
textInputRef?.current?.focus();
|
|
102
180
|
}}
|
|
103
181
|
isExpanded={isOpen}
|
|
104
182
|
className="fctl-form-select__toggle"
|
|
@@ -113,9 +191,11 @@ const FormSelectTypeahead = ({
|
|
|
113
191
|
setTouched(true);
|
|
114
192
|
}
|
|
115
193
|
setIsOpen(!isOpen);
|
|
194
|
+
textInputRef?.current?.focus();
|
|
116
195
|
}}
|
|
117
196
|
onChange={(_, value) => {
|
|
118
197
|
setInputValue(value || undefined);
|
|
198
|
+
resetActiveAndFocusedItem();
|
|
119
199
|
if (!isOpen) {
|
|
120
200
|
setIsOpen(true);
|
|
121
201
|
}
|
|
@@ -146,8 +226,11 @@ const FormSelectTypeahead = ({
|
|
|
146
226
|
autoComplete="off"
|
|
147
227
|
role="combobox"
|
|
148
228
|
isExpanded={isOpen}
|
|
149
|
-
aria-controls=
|
|
229
|
+
aria-controls={`${fieldId}-listbox`}
|
|
150
230
|
placeholder={placeholderText}
|
|
231
|
+
onKeyDown={onInputKeyDown}
|
|
232
|
+
innerRef={textInputRef}
|
|
233
|
+
{...(activeItemId && { 'aria-activedescendant': activeItemId })}
|
|
151
234
|
/>
|
|
152
235
|
</TextInputGroup>
|
|
153
236
|
</MenuToggle>
|
|
@@ -158,16 +241,26 @@ const FormSelectTypeahead = ({
|
|
|
158
241
|
if (!meta.touched) {
|
|
159
242
|
setTouched(true);
|
|
160
243
|
}
|
|
244
|
+
resetActiveAndFocusedItem();
|
|
245
|
+
} else {
|
|
246
|
+
textInputRef?.current?.focus();
|
|
161
247
|
}
|
|
162
248
|
setIsOpen(open);
|
|
163
249
|
}}
|
|
164
250
|
>
|
|
165
|
-
<SelectList className="fctl-form-select__menu">
|
|
166
|
-
{itemKeysFiltered.map((key) => {
|
|
251
|
+
<SelectList className="fctl-form-select__menu" id={`${fieldId}-listbox`}>
|
|
252
|
+
{itemKeysFiltered.map((key, index) => {
|
|
167
253
|
const item = items[key];
|
|
168
254
|
const desc = isItemObject(item) ? item.description : undefined;
|
|
169
255
|
return (
|
|
170
|
-
<SelectOption
|
|
256
|
+
<SelectOption
|
|
257
|
+
className="fctl-form-select__item"
|
|
258
|
+
key={key}
|
|
259
|
+
value={key}
|
|
260
|
+
description={desc}
|
|
261
|
+
isFocused={focusedItemIndex === index}
|
|
262
|
+
id={`${fieldId}-${key}`}
|
|
263
|
+
>
|
|
171
264
|
{getItemLabel(item)}
|
|
172
265
|
</SelectOption>
|
|
173
266
|
);
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useField } from 'formik';
|
|
3
|
+
import { Label, LabelGroup, Text, TextVariants } from '@patternfly/react-core';
|
|
4
|
+
|
|
5
|
+
import EditableLabelControl from '../common/EditableLabelControl';
|
|
6
|
+
import ErrorHelperText, { DefaultHelperText } from './FieldHelperText';
|
|
7
|
+
import { useTranslation } from '../../hooks/useTranslation';
|
|
8
|
+
|
|
9
|
+
type ListItemFieldProps = {
|
|
10
|
+
name: string;
|
|
11
|
+
isLoading?: boolean;
|
|
12
|
+
helperText?: React.ReactNode;
|
|
13
|
+
addButtonText?: string;
|
|
14
|
+
resolvedValue?: string | ((items: string[]) => string);
|
|
15
|
+
resolvedLabel?: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const maxWidthLabel = '18ch';
|
|
19
|
+
|
|
20
|
+
const ListItemField = ({
|
|
21
|
+
name,
|
|
22
|
+
helperText,
|
|
23
|
+
isLoading,
|
|
24
|
+
addButtonText,
|
|
25
|
+
resolvedValue,
|
|
26
|
+
resolvedLabel,
|
|
27
|
+
}: ListItemFieldProps) => {
|
|
28
|
+
const { t } = useTranslation();
|
|
29
|
+
const [{ value: items }, meta, { setValue: setItems }] = useField<string[]>(name);
|
|
30
|
+
|
|
31
|
+
const updateItems = async (newItems: string[]) => {
|
|
32
|
+
await setItems(newItems, true);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const onDelete = async (_ev: React.MouseEvent<Element, MouseEvent>, index: number) => {
|
|
36
|
+
if (isLoading) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const newItems = [...items];
|
|
40
|
+
newItems.splice(index, 1);
|
|
41
|
+
await updateItems(newItems);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const onAdd = async (text: string) => {
|
|
45
|
+
if (!text || !text.trim()) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const trimmedText = text.trim();
|
|
49
|
+
const newItems = [...items, trimmedText];
|
|
50
|
+
await updateItems(newItems);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const onEdit = async (index: number, nextText: string) => {
|
|
54
|
+
const trimmedText = nextText.trim();
|
|
55
|
+
if (!trimmedText) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const newItems = [...items];
|
|
60
|
+
newItems.splice(index, 1, trimmedText);
|
|
61
|
+
await updateItems(newItems);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const getResolvedValue = () => {
|
|
65
|
+
if (!resolvedValue || items.length === 0) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
if (typeof resolvedValue === 'function') {
|
|
69
|
+
return resolvedValue(items);
|
|
70
|
+
}
|
|
71
|
+
return resolvedValue;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const displayedResolvedValue = getResolvedValue();
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<>
|
|
78
|
+
<DefaultHelperText helperText={helperText} />
|
|
79
|
+
|
|
80
|
+
<LabelGroup
|
|
81
|
+
numLabels={5}
|
|
82
|
+
isEditable={!isLoading}
|
|
83
|
+
addLabelControl={
|
|
84
|
+
<EditableLabelControl
|
|
85
|
+
defaultLabel=""
|
|
86
|
+
addButtonText={addButtonText || t('Add item')}
|
|
87
|
+
onAddLabel={onAdd}
|
|
88
|
+
isEditable={!isLoading}
|
|
89
|
+
/>
|
|
90
|
+
}
|
|
91
|
+
>
|
|
92
|
+
{items.map((item, index) => {
|
|
93
|
+
const elKey = `${item}__${index}`;
|
|
94
|
+
const closeButtonProps = isLoading ? { isDisabled: true } : undefined;
|
|
95
|
+
const isItemEditable = !isLoading;
|
|
96
|
+
|
|
97
|
+
return (
|
|
98
|
+
<Label
|
|
99
|
+
key={elKey}
|
|
100
|
+
textMaxWidth={maxWidthLabel}
|
|
101
|
+
closeBtnProps={closeButtonProps}
|
|
102
|
+
onClose={(e) => onDelete(e, index)}
|
|
103
|
+
onEditCancel={(_, prevText) => onEdit(index, prevText)}
|
|
104
|
+
onEditComplete={(_, newText) => onEdit(index, newText)}
|
|
105
|
+
title={isItemEditable ? item : undefined}
|
|
106
|
+
isEditable={isItemEditable}
|
|
107
|
+
>
|
|
108
|
+
{item}
|
|
109
|
+
</Label>
|
|
110
|
+
);
|
|
111
|
+
})}
|
|
112
|
+
</LabelGroup>
|
|
113
|
+
{displayedResolvedValue && (
|
|
114
|
+
<Text component={TextVariants.small} style={{ marginTop: '0.5rem', color: 'var(--pf-v5-global--Color--200)' }}>
|
|
115
|
+
{resolvedLabel || t('Resolved')}: <strong>{displayedResolvedValue}</strong>
|
|
116
|
+
</Text>
|
|
117
|
+
)}
|
|
118
|
+
<ErrorHelperText meta={meta} touchRequired={false} />
|
|
119
|
+
</>
|
|
120
|
+
);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export default ListItemField;
|
|
@@ -7,6 +7,7 @@ import { useFetch } from '../../hooks/useFetch';
|
|
|
7
7
|
import { useTranslation } from '../../hooks/useTranslation';
|
|
8
8
|
import RichValidationTextField, { RichValidationTextFieldProps } from './RichValidationTextField';
|
|
9
9
|
import { TextFieldProps } from './TextField';
|
|
10
|
+
import { DefaultHelperText } from './FieldHelperText';
|
|
10
11
|
|
|
11
12
|
type NameFieldProps = TextFieldProps & {
|
|
12
13
|
resourceType: string;
|
|
@@ -71,13 +72,14 @@ const NameField = ({ name, validations, resourceType, ...rest }: NameFieldProps)
|
|
|
71
72
|
return <RichValidationTextField fieldName={name} validations={allValidations} {...rest} />;
|
|
72
73
|
};
|
|
73
74
|
|
|
74
|
-
const NameFieldWrapper = ({ name, isDisabled, validations, resourceType, ...rest }: NameFieldProps) => {
|
|
75
|
+
const NameFieldWrapper = ({ name, isDisabled, validations, resourceType, helperText, ...rest }: NameFieldProps) => {
|
|
75
76
|
const [{ value }] = useField<string>(name);
|
|
76
77
|
|
|
77
78
|
if (isDisabled) {
|
|
78
79
|
return (
|
|
79
80
|
<FormGroup label={rest?.['aria-label']} isRequired={rest.isRequired}>
|
|
80
81
|
<TextInput value={value} {...rest} isDisabled />
|
|
82
|
+
{helperText && <DefaultHelperText helperText={helperText} />}
|
|
81
83
|
</FormGroup>
|
|
82
84
|
);
|
|
83
85
|
}
|
|
@@ -5,10 +5,11 @@ import ErrorHelperText, { DefaultHelperText } from './FieldHelperText';
|
|
|
5
5
|
|
|
6
6
|
export interface SwitchFieldProps extends Omit<SwitchProps, 'onChange' | 'ref' | 'checked' | 'id'> {
|
|
7
7
|
name: string;
|
|
8
|
+
labelIcon?: React.ReactElement;
|
|
8
9
|
helperText?: React.ReactNode;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
|
-
const SwitchField = ({ helperText, name, ...props }: SwitchFieldProps) => {
|
|
12
|
+
const SwitchField = ({ label, labelIcon, helperText, name, ...props }: SwitchFieldProps) => {
|
|
12
13
|
const [field, meta, { setValue, setTouched }] = useField({
|
|
13
14
|
name,
|
|
14
15
|
});
|
|
@@ -21,7 +22,7 @@ const SwitchField = ({ helperText, name, ...props }: SwitchFieldProps) => {
|
|
|
21
22
|
const fieldId = `switchfield-${name}`;
|
|
22
23
|
|
|
23
24
|
return (
|
|
24
|
-
<FormGroup id={`form-control__${fieldId}`} fieldId={fieldId}>
|
|
25
|
+
<FormGroup id={`form-control__${fieldId}`} fieldId={fieldId} label={label} labelIcon={labelIcon}>
|
|
25
26
|
<Switch {...field} {...props} id={fieldId} onChange={onChange} isChecked={!!field.value} />
|
|
26
27
|
<DefaultHelperText helperText={helperText} />
|
|
27
28
|
<ErrorHelperText meta={meta} />
|