@flightctl/ui-components 0.0.3 → 0.0.5
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/__mocks__/fileMock.d.ts +3 -0
- package/dist/__mocks__/fileMock.d.ts.map +1 -0
- package/dist/__mocks__/styleMock.d.ts +2 -0
- package/dist/__mocks__/styleMock.d.ts.map +1 -0
- package/dist/jest.config.d.ts +12 -0
- package/dist/jest.config.d.ts.map +1 -0
- package/dist/src/components/DetailsPage/DetailsNotFound.d.ts +8 -0
- package/dist/src/components/DetailsPage/DetailsNotFound.d.ts.map +1 -0
- package/dist/src/components/DetailsPage/DetailsPage.d.ts +18 -0
- package/dist/src/components/DetailsPage/DetailsPage.d.ts.map +1 -0
- package/dist/src/components/DetailsPage/DetailsPage.spec.d.ts +2 -0
- package/dist/src/components/DetailsPage/DetailsPage.spec.d.ts.map +1 -0
- package/dist/src/components/DetailsPage/DetailsPageActions.d.ts +17 -0
- package/dist/src/components/DetailsPage/DetailsPageActions.d.ts.map +1 -0
- package/dist/src/components/DetailsPage/DetailsPageCard.d.ts +7 -0
- package/dist/src/components/DetailsPage/DetailsPageCard.d.ts.map +1 -0
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.d.ts +8 -0
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.d.ts.map +1 -0
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.js +2 -3
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.js.map +1 -1
- package/dist/src/components/DetailsPage/Tables/ConditionsTable.d.ts +9 -0
- package/dist/src/components/DetailsPage/Tables/ConditionsTable.d.ts.map +1 -0
- package/dist/src/components/DetailsPage/Tables/IntegrityDetails.d.ts +8 -0
- package/dist/src/components/DetailsPage/Tables/IntegrityDetails.d.ts.map +1 -0
- package/dist/src/components/DetailsPage/Tables/IntegrityDetails.js +2 -1
- package/dist/src/components/DetailsPage/Tables/IntegrityDetails.js.map +1 -1
- package/dist/src/components/DetailsPage/Tables/SystemdDetailsTable.d.ts +12 -0
- package/dist/src/components/DetailsPage/Tables/SystemdDetailsTable.d.ts.map +1 -0
- package/dist/src/components/Device/AddDeviceModal/AddDeviceModal.d.ts +6 -0
- package/dist/src/components/Device/AddDeviceModal/AddDeviceModal.d.ts.map +1 -0
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.d.ts +4 -0
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.d.ts.map +1 -0
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.js +10 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.js.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.d.ts +12 -0
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.d.ts.map +1 -0
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.js +24 -22
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.js.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceFleet.d.ts +8 -0
- package/dist/src/components/Device/DeviceDetails/DeviceFleet.d.ts.map +1 -0
- package/dist/src/components/Device/DeviceDetails/DeviceFleet.js +3 -3
- package/dist/src/components/Device/DeviceDetails/DeviceFleet.js.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceOs.d.ts +7 -0
- package/dist/src/components/Device/DeviceDetails/DeviceOs.d.ts.map +1 -0
- package/dist/src/components/Device/DeviceDetails/DeviceOs.js +24 -0
- package/dist/src/components/Device/DeviceDetails/DeviceOs.js.map +1 -0
- package/dist/src/components/Device/DeviceDetails/DeviceStatusDebugModal.d.ts +9 -0
- package/dist/src/components/Device/DeviceDetails/DeviceStatusDebugModal.d.ts.map +1 -0
- package/dist/src/components/Device/DeviceDetails/SystemdTable.d.ts +10 -0
- package/dist/src/components/Device/DeviceDetails/SystemdTable.d.ts.map +1 -0
- package/dist/src/components/Device/DeviceDetails/TerminalTab.d.ts +7 -0
- package/dist/src/components/Device/DeviceDetails/TerminalTab.d.ts.map +1 -0
- package/dist/src/components/Device/DevicesPage/DeviceFilterSelect.d.ts +17 -0
- package/dist/src/components/Device/DevicesPage/DeviceFilterSelect.d.ts.map +1 -0
- package/dist/src/components/Device/DevicesPage/DeviceFilterSelect.js +61 -0
- package/dist/src/components/Device/DevicesPage/DeviceFilterSelect.js.map +1 -0
- package/dist/src/components/Device/DevicesPage/DeviceTableRow.d.ts +14 -0
- package/dist/src/components/Device/DevicesPage/DeviceTableRow.d.ts.map +1 -0
- package/dist/src/components/Device/{DeviceList → DevicesPage}/DeviceTableRow.js +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceTableRow.js.map +1 -0
- package/dist/src/components/Device/DevicesPage/DeviceTableToolbar.d.ts +21 -0
- package/dist/src/components/Device/DevicesPage/DeviceTableToolbar.d.ts.map +1 -0
- package/dist/src/components/Device/{DeviceList → DevicesPage}/DeviceTableToolbar.js +5 -6
- package/dist/src/components/Device/DevicesPage/DeviceTableToolbar.js.map +1 -0
- package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.css +16 -0
- package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.d.ts +18 -0
- package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.d.ts.map +1 -0
- package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.js +127 -0
- package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.js.map +1 -0
- package/dist/src/components/Device/DevicesPage/DevicesPage.d.ts +22 -0
- package/dist/src/components/Device/DevicesPage/DevicesPage.d.ts.map +1 -0
- package/dist/src/components/Device/{DeviceList/DeviceList.js → DevicesPage/DevicesPage.js} +20 -47
- package/dist/src/components/Device/DevicesPage/DevicesPage.js.map +1 -0
- package/dist/src/components/Device/DevicesPage/EnrollmentRequestList.d.ts +13 -0
- package/dist/src/components/Device/DevicesPage/EnrollmentRequestList.d.ts.map +1 -0
- package/dist/src/components/Device/DevicesPage/EnrollmentRequestList.js +104 -0
- package/dist/src/components/Device/DevicesPage/EnrollmentRequestList.js.map +1 -0
- package/dist/src/components/Device/DevicesPage/EnrollmentRequestTableToolbar.d.ts +11 -0
- package/dist/src/components/Device/DevicesPage/EnrollmentRequestTableToolbar.d.ts.map +1 -0
- package/dist/src/components/Device/DevicesPage/EnrollmentRequestTableToolbar.js +18 -0
- package/dist/src/components/Device/DevicesPage/EnrollmentRequestTableToolbar.js.map +1 -0
- package/dist/src/components/Device/DevicesPage/types.d.ts +18 -0
- package/dist/src/components/Device/DevicesPage/types.d.ts.map +1 -0
- package/dist/src/components/Device/DevicesPage/types.js.map +1 -0
- package/dist/src/components/Device/DevicesPage/useDeviceBackendFilters.d.ts +12 -0
- package/dist/src/components/Device/DevicesPage/useDeviceBackendFilters.d.ts.map +1 -0
- package/dist/src/components/Device/{DeviceList → DevicesPage}/useDeviceBackendFilters.js +1 -1
- package/dist/src/components/Device/DevicesPage/useDeviceBackendFilters.js.map +1 -0
- package/dist/src/components/Device/DevicesPage/useDeviceFilters.d.ts +8 -0
- package/dist/src/components/Device/DevicesPage/useDeviceFilters.d.ts.map +1 -0
- package/dist/src/components/Device/{DeviceList → DevicesPage}/useDeviceFilters.js +3 -3
- package/dist/src/components/Device/DevicesPage/useDeviceFilters.js.map +1 -0
- package/dist/src/components/Device/DevicesPage/useDevices.d.ts +21 -0
- package/dist/src/components/Device/DevicesPage/useDevices.d.ts.map +1 -0
- package/dist/src/components/Device/DevicesPage/useDevices.js +83 -0
- package/dist/src/components/Device/DevicesPage/useDevices.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.d.ts +5 -0
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js +1 -0
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardFooter.d.ts +4 -0
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardFooter.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.d.ts +4 -0
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.d.ts +10 -0
- package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.js +87 -21
- package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationsForm.css +4 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationsForm.d.ts +5 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationsForm.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationsForm.js +61 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationsForm.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.d.ts +7 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.js +88 -4
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigK8sSecretTemplateForm.d.ts +7 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigK8sSecretTemplateForm.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigK8sSecretTemplateForm.js +3 -3
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigK8sSecretTemplateForm.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigTemplateForm.d.ts +4 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigTemplateForm.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigTemplateForm.js +26 -31
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigTemplateForm.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.d.ts +11 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.d.ts +10 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.js +14 -12
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/GeneralInfoStep.d.ts +8 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/GeneralInfoStep.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewApplications.d.ts +7 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewApplications.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewApplications.js +26 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewApplications.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.d.ts +7 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.js +9 -4
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/types.d.ts +20 -0
- package/dist/src/components/Device/EditDeviceWizard/types.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/useEditDevice.d.ts +3 -0
- package/dist/src/components/Device/EditDeviceWizard/useEditDevice.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/utils.d.ts +44 -0
- package/dist/src/components/Device/EditDeviceWizard/utils.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/utils.js +6 -4
- package/dist/src/components/Device/EditDeviceWizard/utils.js.map +1 -1
- package/dist/src/components/Device/MatchPatternsModal/MatchPatternsForm.d.ts +11 -0
- package/dist/src/components/Device/MatchPatternsModal/MatchPatternsForm.d.ts.map +1 -0
- package/dist/src/components/Device/MatchPatternsModal/MatchPatternsModal.d.ts +17 -0
- package/dist/src/components/Device/MatchPatternsModal/MatchPatternsModal.d.ts.map +1 -0
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.d.ts +5 -0
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.d.ts.map +1 -0
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js +2 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.d.ts +15 -0
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.d.ts.map +1 -0
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.js +9 -13
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.js.map +1 -1
- package/dist/src/components/ErrorAlert/ErrorAlert.d.ts +6 -0
- package/dist/src/components/ErrorAlert/ErrorAlert.d.ts.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.d.ts +5 -0
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.d.ts.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.d.ts +7 -0
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.d.ts.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.d.ts +4 -0
- package/dist/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.d.ts.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.js +4 -5
- package/dist/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/GeneralInfoStep.d.ts +10 -0
- package/dist/src/components/Fleet/CreateFleet/steps/GeneralInfoStep.d.ts.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.d.ts +7 -0
- package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.d.ts.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.js +11 -6
- package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/types.d.ts +8 -0
- package/dist/src/components/Fleet/CreateFleet/types.d.ts.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/useEditFleet.d.ts +3 -0
- package/dist/src/components/Fleet/CreateFleet/useEditFleet.d.ts.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/utils.d.ts +9 -0
- package/dist/src/components/Fleet/CreateFleet/utils.d.ts.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/utils.js +8 -3
- package/dist/src/components/Fleet/CreateFleet/utils.js.map +1 -1
- package/dist/src/components/Fleet/DeleteFleetModal/DeleteFleetModal.d.ts +7 -0
- package/dist/src/components/Fleet/DeleteFleetModal/DeleteFleetModal.d.ts.map +1 -0
- package/dist/src/components/Fleet/FleetDetails/FleetDetails.d.ts +4 -0
- package/dist/src/components/Fleet/FleetDetails/FleetDetails.d.ts.map +1 -0
- package/dist/src/components/Fleet/FleetDetails/FleetDetailsContent.d.ts +7 -0
- package/dist/src/components/Fleet/FleetDetails/FleetDetailsContent.d.ts.map +1 -0
- package/dist/src/components/Fleet/FleetDetails/FleetDetailsContent.js +10 -20
- package/dist/src/components/Fleet/FleetDetails/FleetDetailsContent.js.map +1 -1
- package/dist/src/components/Fleet/FleetDetails/FleetDevices.d.ts +9 -0
- package/dist/src/components/Fleet/FleetDetails/FleetDevices.d.ts.map +1 -0
- package/dist/src/components/Fleet/FleetDetails/FleetDevices.js +18 -12
- package/dist/src/components/Fleet/FleetDetails/FleetDevices.js.map +1 -1
- package/dist/src/components/Fleet/FleetDetails/FleetDevicesLink.d.ts +7 -0
- package/dist/src/components/Fleet/FleetDetails/FleetDevicesLink.d.ts.map +1 -0
- package/dist/src/components/Fleet/FleetDetails/FleetDevicesLink.js +13 -0
- package/dist/src/components/Fleet/FleetDetails/FleetDevicesLink.js.map +1 -0
- package/dist/src/components/Fleet/FleetDetails/FleetOwnerLink.d.ts +13 -0
- package/dist/src/components/Fleet/FleetDetails/FleetOwnerLink.d.ts.map +1 -0
- package/dist/src/components/Fleet/FleetDetails/FleetOwnerLink.js +1 -0
- package/dist/src/components/Fleet/FleetDetails/FleetOwnerLink.js.map +1 -1
- package/dist/src/components/Fleet/FleetResourceSyncs.d.ts +7 -0
- package/dist/src/components/Fleet/FleetResourceSyncs.d.ts.map +1 -0
- package/dist/src/components/Fleet/FleetResourceSyncs.js +115 -0
- package/dist/src/components/Fleet/FleetResourceSyncs.js.map +1 -0
- package/dist/src/components/Fleet/FleetRow.d.ts +13 -0
- package/dist/src/components/Fleet/FleetRow.d.ts.map +1 -0
- package/dist/src/components/Fleet/FleetRow.js +5 -5
- package/dist/src/components/Fleet/FleetRow.js.map +1 -1
- package/dist/src/components/Fleet/FleetStatus.d.ts +7 -0
- package/dist/src/components/Fleet/FleetStatus.d.ts.map +1 -0
- package/dist/src/components/Fleet/FleetsPage.d.ts +4 -0
- package/dist/src/components/Fleet/FleetsPage.d.ts.map +1 -0
- package/dist/src/components/Fleet/{FleetList.js → FleetsPage.js} +28 -42
- package/dist/src/components/Fleet/FleetsPage.js.map +1 -0
- package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.d.ts +5 -0
- package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.d.ts.map +1 -0
- package/dist/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.d.ts +12 -0
- package/dist/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.d.ts.map +1 -0
- package/dist/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.js +1 -1
- package/dist/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.js.map +1 -1
- package/dist/src/components/Fleet/ImportFleetWizard/steps/ResourceSyncStep.d.ts +8 -0
- package/dist/src/components/Fleet/ImportFleetWizard/steps/ResourceSyncStep.d.ts.map +1 -0
- package/dist/src/components/Fleet/ImportFleetWizard/steps/ReviewStep.d.ts +7 -0
- package/dist/src/components/Fleet/ImportFleetWizard/steps/ReviewStep.d.ts.map +1 -0
- package/dist/src/components/Fleet/ImportFleetWizard/types.d.ts +6 -0
- package/dist/src/components/Fleet/ImportFleetWizard/types.d.ts.map +1 -0
- package/dist/src/components/ListPage/ListPage.d.ts +10 -0
- package/dist/src/components/ListPage/ListPage.d.ts.map +1 -0
- package/dist/src/components/ListPage/ListPage.js +2 -2
- package/dist/src/components/ListPage/ListPage.js.map +1 -1
- package/dist/src/components/ListPage/ListPageActions.d.ts +17 -0
- package/dist/src/components/ListPage/ListPageActions.d.ts.map +1 -0
- package/dist/src/components/ListPage/ListPageActions.js +13 -2
- package/dist/src/components/ListPage/ListPageActions.js.map +1 -1
- package/dist/src/components/ListPage/ListPageBody.d.ts +9 -0
- package/dist/src/components/ListPage/ListPageBody.d.ts.map +1 -0
- package/dist/src/components/ListPage/types.d.ts +16 -0
- package/dist/src/components/ListPage/types.d.ts.map +1 -0
- package/dist/src/components/NavItem/NavItem.d.ts +8 -0
- package/dist/src/components/NavItem/NavItem.d.ts.map +1 -0
- package/dist/src/components/OverviewPage/Cards/Status/ApplicationStatusChart.d.ts +9 -0
- package/dist/src/components/OverviewPage/Cards/Status/ApplicationStatusChart.d.ts.map +1 -0
- package/dist/src/components/OverviewPage/Cards/Status/ApplicationStatusChart.js +5 -17
- package/dist/src/components/OverviewPage/Cards/Status/ApplicationStatusChart.js.map +1 -1
- package/dist/src/components/OverviewPage/Cards/Status/DeviceStatusChart.d.ts +9 -0
- package/dist/src/components/OverviewPage/Cards/Status/DeviceStatusChart.d.ts.map +1 -0
- package/dist/src/components/OverviewPage/Cards/Status/DeviceStatusChart.js +7 -20
- package/dist/src/components/OverviewPage/Cards/Status/DeviceStatusChart.js.map +1 -1
- package/dist/src/components/OverviewPage/Cards/Status/StatusCard.d.ts +4 -0
- package/dist/src/components/OverviewPage/Cards/Status/StatusCard.d.ts.map +1 -0
- package/dist/src/components/OverviewPage/Cards/Status/StatusCard.js +11 -10
- package/dist/src/components/OverviewPage/Cards/Status/StatusCard.js.map +1 -1
- package/dist/src/components/OverviewPage/Cards/Status/StatusCardFilters.d.ts +14 -0
- package/dist/src/components/OverviewPage/Cards/Status/StatusCardFilters.d.ts.map +1 -0
- package/dist/src/components/OverviewPage/Cards/Status/StatusCardFilters.js +22 -51
- package/dist/src/components/OverviewPage/Cards/Status/StatusCardFilters.js.map +1 -1
- package/dist/src/components/OverviewPage/Cards/Status/SystemUpdateStatusChart.d.ts +9 -0
- package/dist/src/components/OverviewPage/Cards/Status/SystemUpdateStatusChart.d.ts.map +1 -0
- package/dist/src/components/OverviewPage/Cards/Status/SystemUpdateStatusChart.js +5 -17
- package/dist/src/components/OverviewPage/Cards/Status/SystemUpdateStatusChart.js.map +1 -1
- package/dist/src/components/OverviewPage/Cards/Status/utils.d.ts +15 -0
- package/dist/src/components/OverviewPage/Cards/Status/utils.d.ts.map +1 -0
- package/dist/src/components/OverviewPage/Cards/Status/utils.js +9 -26
- package/dist/src/components/OverviewPage/Cards/Status/utils.js.map +1 -1
- package/dist/src/components/OverviewPage/Cards/ToDo/ToDoCard.d.ts +4 -0
- package/dist/src/components/OverviewPage/Cards/ToDo/ToDoCard.d.ts.map +1 -0
- package/dist/src/components/OverviewPage/Cards/ToDo/ToDoCard.js +2 -3
- package/dist/src/components/OverviewPage/Cards/ToDo/ToDoCard.js.map +1 -1
- package/dist/src/components/OverviewPage/Overview.d.ts +4 -0
- package/dist/src/components/OverviewPage/Overview.d.ts.map +1 -0
- package/dist/src/components/OverviewPage/OverviewPage.d.ts +4 -0
- package/dist/src/components/OverviewPage/OverviewPage.d.ts.map +1 -0
- package/dist/src/components/Repository/CreateRepository/CreateRepository.d.ts +4 -0
- package/dist/src/components/Repository/CreateRepository/CreateRepository.d.ts.map +1 -0
- package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.d.ts +21 -0
- package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.d.ts.map +1 -0
- package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.js +8 -1
- package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.js.map +1 -1
- package/dist/src/components/Repository/CreateRepository/CreateResourceSyncsForm.d.ts +9 -0
- package/dist/src/components/Repository/CreateRepository/CreateResourceSyncsForm.d.ts.map +1 -0
- package/dist/src/components/Repository/CreateRepository/CreateResourceSyncsForm.js +18 -11
- package/dist/src/components/Repository/CreateRepository/CreateResourceSyncsForm.js.map +1 -1
- package/dist/src/components/Repository/CreateRepository/types.d.ts +42 -0
- package/dist/src/components/Repository/CreateRepository/types.d.ts.map +1 -0
- package/dist/src/components/Repository/CreateRepository/utils.d.ts +75 -0
- package/dist/src/components/Repository/CreateRepository/utils.d.ts.map +1 -0
- package/dist/src/components/Repository/CreateRepository/utils.js +40 -7
- package/dist/src/components/Repository/CreateRepository/utils.js.map +1 -1
- package/dist/src/components/Repository/RepositoryDetails/DeleteRepositoryModal.d.ts +9 -0
- package/dist/src/components/Repository/RepositoryDetails/DeleteRepositoryModal.d.ts.map +1 -0
- package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.d.ts +4 -0
- package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.d.ts.map +1 -0
- package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.js +3 -2
- package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.js.map +1 -1
- package/dist/src/components/Repository/RepositoryDetails/RepositoryGeneralDetailsCard.d.ts +7 -0
- package/dist/src/components/Repository/RepositoryDetails/RepositoryGeneralDetailsCard.d.ts.map +1 -0
- package/dist/src/components/Repository/RepositoryDetails/RepositoryGeneralDetailsCard.js +14 -13
- package/dist/src/components/Repository/RepositoryDetails/RepositoryGeneralDetailsCard.js.map +1 -1
- package/dist/src/components/Repository/RepositoryDetails/RepositoryResourceSyncsCard.d.ts +6 -0
- package/dist/src/components/Repository/RepositoryDetails/RepositoryResourceSyncsCard.d.ts.map +1 -0
- package/dist/src/components/Repository/RepositoryDetails/RepositorySource.d.ts +22 -0
- package/dist/src/components/Repository/RepositoryDetails/RepositorySource.d.ts.map +1 -0
- package/dist/src/components/Repository/RepositoryDetails/RepositorySource.js +43 -11
- package/dist/src/components/Repository/RepositoryDetails/RepositorySource.js.map +1 -1
- package/dist/src/components/Repository/RepositoryDetails/RepositorySourceList.d.ts +7 -0
- package/dist/src/components/Repository/RepositoryDetails/RepositorySourceList.d.ts.map +1 -0
- package/dist/src/components/Repository/RepositoryDetails/RepositorySourceList.js +30 -33
- package/dist/src/components/Repository/RepositoryDetails/RepositorySourceList.js.map +1 -1
- package/dist/src/components/Repository/RepositoryList.d.ts +5 -0
- package/dist/src/components/Repository/RepositoryList.d.ts.map +1 -0
- package/dist/src/components/Repository/RepositoryList.js +3 -3
- package/dist/src/components/Repository/RepositoryList.js.map +1 -1
- package/dist/src/components/ResourceSync/RepositoryResourceSyncList.css +7 -0
- package/dist/src/components/ResourceSync/RepositoryResourceSyncList.d.ts +7 -0
- package/dist/src/components/ResourceSync/RepositoryResourceSyncList.d.ts.map +1 -0
- package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js +72 -25
- package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js.map +1 -1
- package/dist/src/components/ResourceSync/ResourceSyncStatus.d.ts +9 -0
- package/dist/src/components/ResourceSync/ResourceSyncStatus.d.ts.map +1 -0
- package/dist/src/components/ResourceSync/ResourceSyncStatus.js +9 -18
- package/dist/src/components/ResourceSync/ResourceSyncStatus.js.map +1 -1
- package/dist/src/components/ResourceSync/ResourceSyncToRepository.d.ts +4 -0
- package/dist/src/components/ResourceSync/ResourceSyncToRepository.d.ts.map +1 -0
- package/dist/src/components/Status/ApplicationStatus.d.ts +13 -0
- package/dist/src/components/Status/ApplicationStatus.d.ts.map +1 -0
- package/dist/src/components/Status/ApplicationSummaryStatus.d.ts +13 -0
- package/dist/src/components/Status/ApplicationSummaryStatus.d.ts.map +1 -0
- package/dist/src/components/Status/ApplicationSummaryStatus.js.map +1 -1
- package/dist/src/components/Status/DeviceResourceStatus.d.ts +9 -0
- package/dist/src/components/Status/DeviceResourceStatus.d.ts.map +1 -0
- package/dist/src/components/Status/DeviceStatus.d.ts +7 -0
- package/dist/src/components/Status/DeviceStatus.d.ts.map +1 -0
- package/dist/src/components/Status/EnrollmentRequestStatus.d.ts +7 -0
- package/dist/src/components/Status/EnrollmentRequestStatus.d.ts.map +1 -0
- package/dist/src/components/Status/IntegrityStatus.d.ts +7 -0
- package/dist/src/components/Status/IntegrityStatus.d.ts.map +1 -0
- package/dist/src/components/Status/RepositoryStatus.d.ts +10 -0
- package/dist/src/components/Status/RepositoryStatus.d.ts.map +1 -0
- package/dist/src/components/Status/StatusDisplay.css +3 -0
- package/dist/src/components/Status/StatusDisplay.d.ts +23 -0
- package/dist/src/components/Status/StatusDisplay.d.ts.map +1 -0
- package/dist/src/components/Status/SystemUpdateStatus.d.ts +7 -0
- package/dist/src/components/Status/SystemUpdateStatus.d.ts.map +1 -0
- package/dist/src/components/Status/SystemdStatus.d.ts +6 -0
- package/dist/src/components/Status/SystemdStatus.d.ts.map +1 -0
- package/dist/src/components/Status/utils.d.ts +5 -0
- package/dist/src/components/Status/utils.d.ts.map +1 -0
- package/dist/src/components/Table/Table.d.ts +25 -0
- package/dist/src/components/Table/Table.d.ts.map +1 -0
- package/dist/src/components/Table/TableActions.d.ts +7 -0
- package/dist/src/components/Table/TableActions.d.ts.map +1 -0
- package/dist/src/components/Table/TableActions.js +3 -3
- package/dist/src/components/Table/TableActions.js.map +1 -1
- package/dist/src/components/Table/TableTextSearch.d.ts +9 -0
- package/dist/src/components/Table/TableTextSearch.d.ts.map +1 -0
- package/dist/src/components/Table/TableTextSearch.js +2 -4
- package/dist/src/components/Table/TableTextSearch.js.map +1 -1
- package/dist/src/components/Terminal/Terminal.d.ts +15 -0
- package/dist/src/components/Terminal/Terminal.d.ts.map +1 -0
- package/dist/src/components/UserPreferences/UserPreferencesModal.d.ts +7 -0
- package/dist/src/components/UserPreferences/UserPreferencesModal.d.ts.map +1 -0
- package/dist/src/components/UserPreferences/UserPreferencesProvider.d.ts +11 -0
- package/dist/src/components/UserPreferences/UserPreferencesProvider.d.ts.map +1 -0
- package/dist/src/components/charts/DonutChart.d.ts +17 -0
- package/dist/src/components/charts/DonutChart.d.ts.map +1 -0
- package/dist/src/components/charts/utils.d.ts +15 -0
- package/dist/src/components/charts/utils.d.ts.map +1 -0
- package/dist/src/components/charts/utils.js +30 -0
- package/dist/src/components/charts/utils.js.map +1 -0
- package/dist/src/components/common/CopyButton.d.ts +10 -0
- package/dist/src/components/common/CopyButton.d.ts.map +1 -0
- package/dist/src/components/common/CopyButton.js +3 -3
- package/dist/src/components/common/CopyButton.js.map +1 -1
- package/dist/src/components/common/EditableLabelControl.d.ts +10 -0
- package/dist/src/components/common/EditableLabelControl.d.ts.map +1 -0
- package/dist/src/components/common/ErrorBoundary.d.ts +9 -0
- package/dist/src/components/common/ErrorBoundary.d.ts.map +1 -0
- package/dist/src/components/common/FlightCtlDescriptionList.d.ts +5 -0
- package/dist/src/components/common/FlightCtlDescriptionList.d.ts.map +1 -0
- package/dist/src/components/common/FlightCtlDescriptionList.js +13 -0
- package/dist/src/components/common/FlightCtlDescriptionList.js.map +1 -0
- package/dist/src/components/common/HelperTextItems.d.ts +3 -0
- package/dist/src/components/common/HelperTextItems.d.ts.map +1 -0
- package/dist/src/components/common/HelperTextItems.js +1 -9
- package/dist/src/components/common/HelperTextItems.js.map +1 -1
- package/dist/src/components/common/LabelsView.d.ts +10 -0
- package/dist/src/components/common/LabelsView.d.ts.map +1 -0
- package/dist/src/components/common/LeaveFormConfirmation.d.ts +4 -0
- package/dist/src/components/common/LeaveFormConfirmation.d.ts.map +1 -0
- package/dist/src/components/common/LeaveFormConfirmation.js +4 -1
- package/dist/src/components/common/LeaveFormConfirmation.js.map +1 -1
- package/dist/src/components/common/ResourceLink.d.ts +13 -0
- package/dist/src/components/common/ResourceLink.d.ts.map +1 -0
- package/dist/src/components/common/ResourceListEmptyState.d.ts +8 -0
- package/dist/src/components/common/ResourceListEmptyState.d.ts.map +1 -0
- package/dist/src/components/common/WithHelperText.d.ts +11 -0
- package/dist/src/components/common/WithHelperText.d.ts.map +1 -0
- package/dist/src/components/common/WithTooltip.d.ts +10 -0
- package/dist/src/components/common/WithTooltip.d.ts.map +1 -0
- package/dist/src/components/form/CheckboxField.d.ts +10 -0
- package/dist/src/components/form/CheckboxField.d.ts.map +1 -0
- package/dist/src/components/{Device/EditDeviceWizard/steps/ConfigTemplateForm.css → form/ExpandableFormSection.css} +2 -2
- package/dist/src/components/form/ExpandableFormSection.d.ts +11 -0
- package/dist/src/components/form/ExpandableFormSection.d.ts.map +1 -0
- package/dist/src/components/form/ExpandableFormSection.js +30 -0
- package/dist/src/components/form/ExpandableFormSection.js.map +1 -0
- package/dist/src/components/form/FieldHelperText.d.ts +14 -0
- package/dist/src/components/form/FieldHelperText.d.ts.map +1 -0
- package/dist/src/components/form/FilterSelect.css +11 -1
- package/dist/src/components/form/FilterSelect.d.ts +16 -0
- package/dist/src/components/form/FilterSelect.d.ts.map +1 -0
- package/dist/src/components/form/FilterSelect.js +14 -9
- package/dist/src/components/form/FilterSelect.js.map +1 -1
- package/dist/src/components/form/FlightCtlActionGroup.d.ts +5 -0
- package/dist/src/components/form/FlightCtlActionGroup.d.ts.map +1 -0
- package/dist/src/components/form/FlightCtlForm.d.ts +6 -0
- package/dist/src/components/form/FlightCtlForm.d.ts.map +1 -0
- package/dist/src/components/form/FormSelect.css +8 -0
- package/dist/src/components/form/FormSelect.d.ts +16 -0
- package/dist/src/components/form/FormSelect.d.ts.map +1 -0
- package/dist/src/components/form/FormSelectTypeahead.d.ts +19 -0
- package/dist/src/components/form/FormSelectTypeahead.d.ts.map +1 -0
- package/dist/src/components/form/FormSelectTypeahead.js +116 -0
- package/dist/src/components/form/FormSelectTypeahead.js.map +1 -0
- package/dist/src/components/form/LabelsField.d.ts +12 -0
- package/dist/src/components/form/LabelsField.d.ts.map +1 -0
- package/dist/src/components/form/NameField.d.ts +10 -0
- package/dist/src/components/form/NameField.d.ts.map +1 -0
- package/dist/src/components/form/RadioField.d.ts +12 -0
- package/dist/src/components/form/RadioField.d.ts.map +1 -0
- package/dist/src/components/form/RichValidationTextField.d.ts +13 -0
- package/dist/src/components/form/RichValidationTextField.d.ts.map +1 -0
- package/dist/src/components/form/SwitchField.d.ts +9 -0
- package/dist/src/components/form/SwitchField.d.ts.map +1 -0
- package/dist/src/components/form/SwitchField.js +24 -0
- package/dist/src/components/form/SwitchField.js.map +1 -0
- package/dist/src/components/form/TextAreaField.d.ts +11 -0
- package/dist/src/components/form/TextAreaField.d.ts.map +1 -0
- package/dist/src/components/form/TextField.d.ts +10 -0
- package/dist/src/components/form/TextField.d.ts.map +1 -0
- package/dist/src/components/form/UploadField.d.ts +13 -0
- package/dist/src/components/form/UploadField.d.ts.map +1 -0
- package/dist/src/components/form/UploadField.js +74 -0
- package/dist/src/components/form/UploadField.js.map +1 -0
- package/dist/src/components/form/validations.d.ts +82 -0
- package/dist/src/components/form/validations.d.ts.map +1 -0
- package/dist/src/components/form/validations.js +54 -19
- package/dist/src/components/form/validations.js.map +1 -1
- package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceForm.d.ts +16 -0
- package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceForm.d.ts.map +1 -0
- package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.d.ts +6 -0
- package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.d.ts.map +1 -0
- package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.js +1 -1
- package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.js.map +1 -1
- package/dist/src/components/modals/ApproveDeviceModal/DeviceLabelMatch.d.ts +8 -0
- package/dist/src/components/modals/ApproveDeviceModal/DeviceLabelMatch.d.ts.map +1 -0
- package/dist/src/components/modals/CreateRepositoryModal/CreateRepositoryModal.d.ts +11 -0
- package/dist/src/components/modals/CreateRepositoryModal/CreateRepositoryModal.d.ts.map +1 -0
- package/dist/src/components/modals/DeleteModal/DeleteModal.d.ts +10 -0
- package/dist/src/components/modals/DeleteModal/DeleteModal.d.ts.map +1 -0
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.d.ts +9 -0
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.d.ts.map +1 -0
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.js +1 -2
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.js.map +1 -1
- package/dist/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.d.ts +11 -0
- package/dist/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.d.ts.map +1 -0
- package/dist/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.js +3 -41
- package/dist/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.js.map +1 -1
- package/dist/src/components/modals/massModals/MassDeleteDeviceModal/MassDeleteDeviceModal.d.ts +10 -0
- package/dist/src/components/modals/massModals/MassDeleteDeviceModal/MassDeleteDeviceModal.d.ts.map +1 -0
- package/dist/src/components/modals/massModals/MassDeleteDeviceModal/MassDeleteDeviceModal.js +4 -4
- package/dist/src/components/modals/massModals/MassDeleteDeviceModal/MassDeleteDeviceModal.js.map +1 -1
- package/dist/src/components/modals/massModals/MassDeleteFleetModal/MassDeleteFleetModal.d.ts +10 -0
- package/dist/src/components/modals/massModals/MassDeleteFleetModal/MassDeleteFleetModal.d.ts.map +1 -0
- package/dist/src/components/modals/massModals/MassDeleteFleetModal/MassDeleteFleetModal.js +22 -21
- package/dist/src/components/modals/massModals/MassDeleteFleetModal/MassDeleteFleetModal.js.map +1 -1
- package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.d.ts +10 -0
- package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.d.ts.map +1 -0
- package/dist/src/components/modals/massModals/MassDeleteResourceSyncModal/MassDeleteResourceSyncModal.d.ts +10 -0
- package/dist/src/components/modals/massModals/MassDeleteResourceSyncModal/MassDeleteResourceSyncModal.d.ts.map +1 -0
- package/dist/src/constants.d.ts +4 -0
- package/dist/src/constants.d.ts.map +1 -0
- package/dist/src/hooks/useAppContext.d.ts +70 -0
- package/dist/src/hooks/useAppContext.d.ts.map +1 -0
- package/dist/src/hooks/useDeviceLabelMatch.d.ts +9 -0
- package/dist/src/hooks/useDeviceLabelMatch.d.ts.map +1 -0
- package/dist/src/hooks/useDocumentTitle.d.ts +2 -0
- package/dist/src/hooks/useDocumentTitle.d.ts.map +1 -0
- package/dist/src/hooks/useFetch.d.ts +12 -0
- package/dist/src/hooks/useFetch.d.ts.map +1 -0
- package/dist/src/hooks/useFetchPeriodically.d.ts +3 -0
- package/dist/src/hooks/useFetchPeriodically.d.ts.map +1 -0
- package/dist/src/hooks/useNavigate.d.ts +38 -0
- package/dist/src/hooks/useNavigate.d.ts.map +1 -0
- package/dist/src/hooks/useTableSelect.d.ts +13 -0
- package/dist/src/hooks/useTableSelect.d.ts.map +1 -0
- package/dist/src/hooks/useTableSort.d.ts +7 -0
- package/dist/src/hooks/useTableSort.d.ts.map +1 -0
- package/dist/src/hooks/useTableTextSearch.d.ts +6 -0
- package/dist/src/hooks/useTableTextSearch.d.ts.map +1 -0
- package/dist/src/hooks/useTemplateVersion.d.ts +3 -0
- package/dist/src/hooks/useTemplateVersion.d.ts.map +1 -0
- package/dist/src/hooks/useThemePreferences.d.ts +8 -0
- package/dist/src/hooks/useThemePreferences.d.ts.map +1 -0
- package/dist/src/hooks/useTranslation.d.ts +2 -0
- package/dist/src/hooks/useTranslation.d.ts.map +1 -0
- package/dist/src/hooks/useUserPreferences.d.ts +2 -0
- package/dist/src/hooks/useUserPreferences.d.ts.map +1 -0
- package/dist/src/hooks/useWebSocket.d.ts +8 -0
- package/dist/src/hooks/useWebSocket.d.ts.map +1 -0
- package/dist/src/setupTests.d.ts +2 -0
- package/dist/src/setupTests.d.ts.map +1 -0
- package/dist/src/tests/test-utils.d.ts +7 -0
- package/dist/src/tests/test-utils.d.ts.map +1 -0
- package/dist/src/types/deviceSpec.d.ts +57 -0
- package/dist/src/types/deviceSpec.d.ts.map +1 -0
- package/dist/src/types/deviceSpec.js +41 -9
- package/dist/src/types/deviceSpec.js.map +1 -1
- package/dist/src/types/extraTypes.d.ts +36 -0
- package/dist/src/types/extraTypes.d.ts.map +1 -0
- package/dist/src/types/extraTypes.js +1 -3
- package/dist/src/types/extraTypes.js.map +1 -1
- package/dist/src/types/typeUtils.d.ts +3 -0
- package/dist/src/types/typeUtils.d.ts.map +1 -0
- package/dist/src/utils/api.d.ts +24 -0
- package/dist/src/utils/api.d.ts.map +1 -0
- package/dist/src/utils/dates.d.ts +5 -0
- package/dist/src/utils/dates.d.ts.map +1 -0
- package/dist/src/utils/devices.d.ts +4 -0
- package/dist/src/utils/devices.d.ts.map +1 -0
- package/dist/src/utils/devices.js +1 -27
- package/dist/src/utils/devices.js.map +1 -1
- package/dist/src/utils/error.d.ts +4 -0
- package/dist/src/utils/error.d.ts.map +1 -0
- package/dist/src/utils/labels.d.ts +11 -0
- package/dist/src/utils/labels.d.ts.map +1 -0
- package/dist/src/utils/labels.js +4 -14
- package/dist/src/utils/labels.js.map +1 -1
- package/dist/src/utils/metrics.d.ts +9 -0
- package/dist/src/utils/metrics.d.ts.map +1 -0
- package/dist/src/utils/patch.d.ts +15 -0
- package/dist/src/utils/patch.d.ts.map +1 -0
- package/dist/src/utils/patch.js +71 -1
- package/dist/src/utils/patch.js.map +1 -1
- package/dist/src/utils/resource.d.ts +6 -0
- package/dist/src/utils/resource.d.ts.map +1 -0
- package/dist/src/utils/search.d.ts +3 -0
- package/dist/src/utils/search.d.ts.map +1 -0
- package/dist/src/utils/search.js +15 -1
- package/dist/src/utils/search.js.map +1 -1
- package/dist/src/utils/sort/device.d.ts +4 -0
- package/dist/src/utils/sort/device.d.ts.map +1 -0
- package/dist/src/utils/sort/device.js +3 -43
- package/dist/src/utils/sort/device.js.map +1 -1
- package/dist/src/utils/sort/fleet.d.ts +4 -0
- package/dist/src/utils/sort/fleet.d.ts.map +1 -0
- package/dist/src/utils/sort/fleet.js +6 -8
- package/dist/src/utils/sort/fleet.js.map +1 -1
- package/dist/src/utils/sort/generic.d.ts +8 -0
- package/dist/src/utils/sort/generic.d.ts.map +1 -0
- package/dist/src/utils/sort/generic.js +14 -11
- package/dist/src/utils/sort/generic.js.map +1 -1
- package/dist/src/utils/sort/repository.d.ts +6 -0
- package/dist/src/utils/sort/repository.d.ts.map +1 -0
- package/dist/src/utils/sort/repository.js +2 -2
- package/dist/src/utils/sort/repository.js.map +1 -1
- package/dist/src/utils/sort/resourceSync.d.ts +6 -0
- package/dist/src/utils/sort/resourceSync.d.ts.map +1 -0
- package/dist/src/utils/status/applications.d.ts +7 -0
- package/dist/src/utils/status/applications.d.ts.map +1 -0
- package/dist/src/utils/status/applications.js +19 -21
- package/dist/src/utils/status/applications.js.map +1 -1
- package/dist/src/utils/status/common.d.ts +12 -0
- package/dist/src/utils/status/common.d.ts.map +1 -0
- package/dist/src/utils/status/devices.d.ts +17 -0
- package/dist/src/utils/status/devices.d.ts.map +1 -0
- package/dist/src/utils/status/devices.js +9 -19
- package/dist/src/utils/status/devices.js.map +1 -1
- package/dist/src/utils/status/enrollmentRequest.d.ts +12 -0
- package/dist/src/utils/status/enrollmentRequest.d.ts.map +1 -0
- package/dist/src/utils/status/fleet.d.ts +15 -0
- package/dist/src/utils/status/fleet.d.ts.map +1 -0
- package/dist/src/utils/status/integrity.d.ts +5 -0
- package/dist/src/utils/status/integrity.d.ts.map +1 -0
- package/dist/src/utils/status/repository.d.ts +24 -0
- package/dist/src/utils/status/repository.d.ts.map +1 -0
- package/dist/src/utils/status/repository.js +9 -5
- package/dist/src/utils/status/repository.js.map +1 -1
- package/dist/src/utils/status/system.d.ts +6 -0
- package/dist/src/utils/status/system.d.ts.map +1 -0
- package/dist/src/utils/status/system.js +5 -5
- package/dist/src/utils/status/system.js.map +1 -1
- package/package.json +11 -3
- package/src/components/DetailsPage/DetailsNotFound.tsx +114 -0
- package/src/components/DetailsPage/DetailsPage.css +3 -0
- package/src/components/DetailsPage/DetailsPage.spec.tsx +128 -0
- package/src/components/DetailsPage/DetailsPage.tsx +99 -0
- package/src/components/DetailsPage/DetailsPageActions.tsx +73 -0
- package/src/components/DetailsPage/DetailsPageCard.css +8 -0
- package/src/components/DetailsPage/DetailsPageCard.tsx +12 -0
- package/src/components/DetailsPage/Tables/ApplicationsTable.tsx +44 -0
- package/src/components/DetailsPage/Tables/ConditionsTable.tsx +40 -0
- package/src/components/DetailsPage/Tables/IntegrityDetails.tsx +44 -0
- package/src/components/DetailsPage/Tables/SystemdDetailsTable.tsx +63 -0
- package/src/components/Device/AddDeviceModal/AddDeviceModal.tsx +146 -0
- package/src/components/Device/DeviceDetails/DeviceDetailsPage.tsx +117 -0
- package/src/components/Device/DeviceDetails/DeviceDetailsTab.css +4 -0
- package/src/components/Device/DeviceDetails/DeviceDetailsTab.tsx +216 -0
- package/src/components/Device/DeviceDetails/DeviceFleet.css +3 -0
- package/src/components/Device/DeviceDetails/DeviceFleet.tsx +76 -0
- package/src/components/Device/DeviceDetails/DeviceOs.tsx +43 -0
- package/src/components/Device/DeviceDetails/DeviceStatusDebugModal.css +3 -0
- package/src/components/Device/DeviceDetails/DeviceStatusDebugModal.tsx +60 -0
- package/src/components/Device/DeviceDetails/SystemdTable.tsx +65 -0
- package/src/components/Device/DeviceDetails/TerminalTab.tsx +53 -0
- package/src/components/Device/DevicesPage/DeviceFilterSelect.tsx +111 -0
- package/src/components/Device/DevicesPage/DeviceTableRow.tsx +95 -0
- package/src/components/Device/DevicesPage/DeviceTableToolbar.tsx +195 -0
- package/src/components/Device/DevicesPage/DeviceToolbarFilters.css +16 -0
- package/src/components/Device/DevicesPage/DeviceToolbarFilters.tsx +305 -0
- package/src/components/Device/DevicesPage/DevicesPage.tsx +265 -0
- package/src/components/Device/DevicesPage/EnrollmentRequestList.tsx +183 -0
- package/src/components/Device/DevicesPage/EnrollmentRequestTableToolbar.tsx +35 -0
- package/src/components/Device/DevicesPage/types.ts +22 -0
- package/src/components/Device/DevicesPage/useDeviceBackendFilters.ts +119 -0
- package/src/components/Device/DevicesPage/useDeviceFilters.ts +15 -0
- package/src/components/Device/DevicesPage/useDevices.ts +112 -0
- package/src/components/Device/EditDeviceWizard/EditDeviceWizard.css +4 -0
- package/src/components/Device/EditDeviceWizard/EditDeviceWizard.tsx +150 -0
- package/src/components/Device/EditDeviceWizard/EditDeviceWizardFooter.tsx +52 -0
- package/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.tsx +66 -0
- package/src/components/Device/EditDeviceWizard/deviceSpecUtils.ts +278 -0
- package/src/components/Device/EditDeviceWizard/steps/ApplicationsForm.css +4 -0
- package/src/components/Device/EditDeviceWizard/steps/ApplicationsForm.tsx +140 -0
- package/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.tsx +161 -0
- package/src/components/Device/EditDeviceWizard/steps/ConfigK8sSecretTemplateForm.tsx +50 -0
- package/src/components/Device/EditDeviceWizard/steps/ConfigTemplateForm.tsx +174 -0
- package/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.tsx +229 -0
- package/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.tsx +75 -0
- package/src/components/Device/EditDeviceWizard/steps/GeneralInfoStep.tsx +61 -0
- package/src/components/Device/EditDeviceWizard/steps/ReviewApplications.tsx +35 -0
- package/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.tsx +83 -0
- package/src/components/Device/EditDeviceWizard/types.ts +19 -0
- package/src/components/Device/EditDeviceWizard/useEditDevice.ts +36 -0
- package/src/components/Device/EditDeviceWizard/utils.ts +79 -0
- package/src/components/Device/MatchPatternsModal/MatchPatternsForm.tsx +92 -0
- package/src/components/Device/MatchPatternsModal/MatchPatternsModal.tsx +62 -0
- package/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.css +3 -0
- package/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.tsx +226 -0
- package/src/components/EnrollmentRequest/EnrollmentRequestTableRow.tsx +69 -0
- package/src/components/ErrorAlert/ErrorAlert.tsx +15 -0
- package/src/components/Fleet/CreateFleet/CreateFleetWizard.css +3 -0
- package/src/components/Fleet/CreateFleet/CreateFleetWizard.tsx +152 -0
- package/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.tsx +56 -0
- package/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.tsx +114 -0
- package/src/components/Fleet/CreateFleet/steps/GeneralInfoStep.tsx +55 -0
- package/src/components/Fleet/CreateFleet/steps/ReviewStep.tsx +83 -0
- package/src/components/Fleet/CreateFleet/types.ts +8 -0
- package/src/components/Fleet/CreateFleet/useEditFleet.ts +35 -0
- package/src/components/Fleet/CreateFleet/utils.ts +160 -0
- package/src/components/Fleet/DeleteFleetModal/DeleteFleetModal.tsx +89 -0
- package/src/components/Fleet/FleetDetails/FleetDetails.tsx +97 -0
- package/src/components/Fleet/FleetDetails/FleetDetailsContent.tsx +97 -0
- package/src/components/Fleet/FleetDetails/FleetDevices.tsx +115 -0
- package/src/components/Fleet/FleetDetails/FleetDevicesLink.tsx +16 -0
- package/src/components/Fleet/FleetDetails/FleetOwnerLink.tsx +51 -0
- package/src/components/Fleet/FleetResourceSyncs.tsx +161 -0
- package/src/components/Fleet/FleetRow.tsx +86 -0
- package/src/components/Fleet/FleetStatus.tsx +37 -0
- package/src/components/Fleet/FleetsPage.tsx +204 -0
- package/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.css +3 -0
- package/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.tsx +216 -0
- package/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.tsx +115 -0
- package/src/components/Fleet/ImportFleetWizard/steps/ResourceSyncStep.tsx +42 -0
- package/src/components/Fleet/ImportFleetWizard/steps/ReviewStep.tsx +70 -0
- package/src/components/Fleet/ImportFleetWizard/types.ts +6 -0
- package/src/components/ListPage/ListPage.tsx +22 -0
- package/src/components/ListPage/ListPageActions.tsx +68 -0
- package/src/components/ListPage/ListPageBody.tsx +34 -0
- package/src/components/ListPage/types.ts +13 -0
- package/src/components/NavItem/NavItem.tsx +42 -0
- package/src/components/OverviewPage/Cards/Status/ApplicationStatusChart.tsx +39 -0
- package/src/components/OverviewPage/Cards/Status/DeviceStatusChart.tsx +38 -0
- package/src/components/OverviewPage/Cards/Status/StatusCard.tsx +115 -0
- package/src/components/OverviewPage/Cards/Status/StatusCardFilters.tsx +111 -0
- package/src/components/OverviewPage/Cards/Status/SystemUpdateStatusChart.tsx +39 -0
- package/src/components/OverviewPage/Cards/Status/utils.ts +19 -0
- package/src/components/OverviewPage/Cards/ToDo/ToDoCard.tsx +72 -0
- package/src/components/OverviewPage/Overview.tsx +19 -0
- package/src/components/OverviewPage/OverviewPage.tsx +22 -0
- package/src/components/Repository/CreateRepository/CreateRepository.tsx +144 -0
- package/src/components/Repository/CreateRepository/CreateRepositoryForm.css +7 -0
- package/src/components/Repository/CreateRepository/CreateRepositoryForm.tsx +440 -0
- package/src/components/Repository/CreateRepository/CreateResourceSyncsForm.tsx +98 -0
- package/src/components/Repository/CreateRepository/types.ts +43 -0
- package/src/components/Repository/CreateRepository/utils.ts +539 -0
- package/src/components/Repository/RepositoryDetails/DeleteRepositoryModal.tsx +156 -0
- package/src/components/Repository/RepositoryDetails/RepositoryDetails.tsx +78 -0
- package/src/components/Repository/RepositoryDetails/RepositoryGeneralDetailsCard.tsx +102 -0
- package/src/components/Repository/RepositoryDetails/RepositoryResourceSyncsCard.tsx +28 -0
- package/src/components/Repository/RepositoryDetails/RepositorySource.tsx +96 -0
- package/src/components/Repository/RepositoryDetails/RepositorySourceList.tsx +79 -0
- package/src/components/Repository/RepositoryList.tsx +216 -0
- package/src/components/ResourceSync/RepositoryResourceSyncList.css +14 -0
- package/src/components/ResourceSync/RepositoryResourceSyncList.tsx +322 -0
- package/src/components/ResourceSync/ResourceSyncStatus.tsx +77 -0
- package/src/components/ResourceSync/ResourceSyncToRepository.tsx +73 -0
- package/src/components/Status/ApplicationStatus.tsx +25 -0
- package/src/components/Status/ApplicationSummaryStatus.tsx +24 -0
- package/src/components/Status/DeviceResourceStatus.tsx +112 -0
- package/src/components/Status/DeviceStatus.tsx +20 -0
- package/src/components/Status/EnrollmentRequestStatus.tsx +24 -0
- package/src/components/Status/IntegrityStatus.tsx +19 -0
- package/src/components/Status/RepositoryStatus.tsx +50 -0
- package/src/components/Status/StatusDisplay.css +12 -0
- package/src/components/Status/StatusDisplay.tsx +83 -0
- package/src/components/Status/SystemUpdateStatus.tsx +34 -0
- package/src/components/Status/SystemdStatus.tsx +22 -0
- package/src/components/Status/utils.ts +8 -0
- package/src/components/Table/Table.tsx +78 -0
- package/src/components/Table/TableActions.tsx +33 -0
- package/src/components/Table/TableTextSearch.tsx +23 -0
- package/src/components/Terminal/Terminal.css +1 -0
- package/src/components/Terminal/Terminal.tsx +100 -0
- package/src/components/UserPreferences/UserPreferencesModal.tsx +85 -0
- package/src/components/UserPreferences/UserPreferencesProvider.tsx +29 -0
- package/src/components/charts/DonutChart.css +10 -0
- package/src/components/charts/DonutChart.tsx +115 -0
- package/src/components/charts/utils.ts +38 -0
- package/src/components/common/CopyButton.tsx +36 -0
- package/src/components/common/EditableLabelControl.tsx +69 -0
- package/src/components/common/ErrorBoundary.tsx +53 -0
- package/src/components/common/FlightCtlDescriptionList.tsx +13 -0
- package/src/components/common/HelperTextItems.tsx +25 -0
- package/src/components/common/LabelsView.css +9 -0
- package/src/components/common/LabelsView.tsx +38 -0
- package/src/components/common/LeaveFormConfirmation.tsx +96 -0
- package/src/components/common/ResourceLink.css +29 -0
- package/src/components/common/ResourceLink.tsx +42 -0
- package/src/components/common/ResourceListEmptyState.tsx +19 -0
- package/src/components/common/WithHelperText.css +3 -0
- package/src/components/common/WithHelperText.tsx +34 -0
- package/src/components/common/WithTooltip.tsx +14 -0
- package/src/components/form/CheckboxField.tsx +39 -0
- package/src/components/form/ExpandableFormSection.css +3 -0
- package/src/components/form/ExpandableFormSection.tsx +59 -0
- package/src/components/form/FieldHelperText.tsx +45 -0
- package/src/components/form/FilterSelect.css +18 -0
- package/src/components/form/FilterSelect.tsx +92 -0
- package/src/components/form/FlightCtlActionGroup.css +9 -0
- package/src/components/form/FlightCtlActionGroup.tsx +11 -0
- package/src/components/form/FlightCtlForm.tsx +18 -0
- package/src/components/form/FormSelect.css +16 -0
- package/src/components/form/FormSelect.tsx +96 -0
- package/src/components/form/FormSelectTypeahead.tsx +212 -0
- package/src/components/form/LabelsField.tsx +116 -0
- package/src/components/form/NameField.tsx +73 -0
- package/src/components/form/RadioField.tsx +57 -0
- package/src/components/form/RichValidationTextField.tsx +142 -0
- package/src/components/form/SwitchField.tsx +32 -0
- package/src/components/form/TextAreaField.tsx +46 -0
- package/src/components/form/TextField.tsx +49 -0
- package/src/components/form/UploadField.tsx +133 -0
- package/src/components/form/validations.ts +386 -0
- package/src/components/modals/ApproveDeviceModal/ApproveDeviceForm.tsx +74 -0
- package/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.tsx +65 -0
- package/src/components/modals/ApproveDeviceModal/DeviceLabelMatch.css +24 -0
- package/src/components/modals/ApproveDeviceModal/DeviceLabelMatch.tsx +101 -0
- package/src/components/modals/CreateRepositoryModal/CreateRepositoryModal.tsx +25 -0
- package/src/components/modals/DeleteModal/DeleteModal.tsx +68 -0
- package/src/components/modals/EditLabelsModal/EditLabelsForm.tsx +101 -0
- package/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.css +4 -0
- package/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.tsx +192 -0
- package/src/components/modals/massModals/MassDeleteDeviceModal/MassDeleteDeviceModal.tsx +117 -0
- package/src/components/modals/massModals/MassDeleteFleetModal/MassDeleteFleetModal.tsx +193 -0
- package/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.tsx +172 -0
- package/src/components/modals/massModals/MassDeleteResourceSyncModal/MassDeleteResourceSyncModal.tsx +116 -0
- package/src/constants.ts +4 -0
- package/src/hooks/useAppContext.tsx +108 -0
- package/src/hooks/useDeviceLabelMatch.ts +101 -0
- package/src/hooks/useDocumentTitle.ts +12 -0
- package/src/hooks/useFetch.ts +10 -0
- package/src/hooks/useFetchPeriodically.ts +82 -0
- package/src/hooks/useNavigate.tsx +92 -0
- package/src/hooks/useTableSelect.ts +48 -0
- package/src/hooks/useTableSort.ts +42 -0
- package/src/hooks/useTableTextSearch.ts +23 -0
- package/src/hooks/useTemplateVersion.ts +23 -0
- package/src/hooks/useThemePreferences.ts +64 -0
- package/src/hooks/useTranslation.ts +8 -0
- package/src/hooks/useUserPreferences.ts +16 -0
- package/src/hooks/useWebSocket.ts +74 -0
- package/src/setupTests.ts +21 -0
- package/src/tests/test-utils.tsx +21 -0
- package/src/types/deviceSpec.ts +110 -0
- package/src/types/extraTypes.ts +52 -0
- package/src/types/typeUtils.ts +7 -0
- package/src/typings.d.ts +12 -0
- package/src/utils/api.ts +87 -0
- package/src/utils/dates.ts +60 -0
- package/src/utils/devices.ts +10 -0
- package/src/utils/error.ts +24 -0
- package/src/utils/labels.ts +40 -0
- package/src/utils/metrics.ts +49 -0
- package/src/utils/patch.ts +202 -0
- package/src/utils/resource.ts +4 -0
- package/src/utils/search.ts +25 -0
- package/src/utils/sort/device.ts +60 -0
- package/src/utils/sort/fleet.ts +16 -0
- package/src/utils/sort/generic.ts +37 -0
- package/src/utils/sort/repository.ts +28 -0
- package/src/utils/sort/resourceSync.ts +30 -0
- package/src/utils/status/applications.ts +58 -0
- package/src/utils/status/common.ts +71 -0
- package/src/utils/status/devices.ts +74 -0
- package/src/utils/status/enrollmentRequest.ts +49 -0
- package/src/utils/status/fleet.ts +47 -0
- package/src/utils/status/integrity.ts +26 -0
- package/src/utils/status/repository.ts +117 -0
- package/src/utils/status/system.ts +28 -0
- package/dist/src/components/Device/DeviceList/DeviceFilterSelect.js +0 -87
- package/dist/src/components/Device/DeviceList/DeviceFilterSelect.js.map +0 -1
- package/dist/src/components/Device/DeviceList/DeviceList.js.map +0 -1
- package/dist/src/components/Device/DeviceList/DeviceTableRow.js.map +0 -1
- package/dist/src/components/Device/DeviceList/DeviceTableToolbar.js.map +0 -1
- package/dist/src/components/Device/DeviceList/types.js.map +0 -1
- package/dist/src/components/Device/DeviceList/useDeviceBackendFilters.js.map +0 -1
- package/dist/src/components/Device/DeviceList/useDeviceFilters.js.map +0 -1
- package/dist/src/components/Device/DeviceList/useDeviceLikeResources.js +0 -98
- package/dist/src/components/Device/DeviceList/useDeviceLikeResources.js.map +0 -1
- package/dist/src/components/Fleet/FleetDetails/chartUtils.js +0 -29
- package/dist/src/components/Fleet/FleetDetails/chartUtils.js.map +0 -1
- package/dist/src/components/Fleet/FleetList.js.map +0 -1
- package/dist/src/components/Fleet/ResourceSyncRow.js +0 -36
- package/dist/src/components/Fleet/ResourceSyncRow.js.map +0 -1
- /package/dist/src/components/Device/{DeviceList → DevicesPage}/types.js +0 -0
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
import * as Yup from 'yup';
|
|
2
|
+
import { TFunction } from 'i18next';
|
|
3
|
+
import countBy from 'lodash/countBy';
|
|
4
|
+
|
|
5
|
+
import { FlightCtlLabel } from '../../types/extraTypes';
|
|
6
|
+
import {
|
|
7
|
+
GitConfigTemplate,
|
|
8
|
+
HttpConfigTemplate,
|
|
9
|
+
InlineConfigTemplate,
|
|
10
|
+
KubeSecretTemplate,
|
|
11
|
+
SpecConfigTemplate,
|
|
12
|
+
isGitConfigTemplate,
|
|
13
|
+
isHttpConfigTemplate,
|
|
14
|
+
isInlineConfigTemplate,
|
|
15
|
+
isKubeSecretTemplate,
|
|
16
|
+
} from '../../types/deviceSpec';
|
|
17
|
+
import { labelToString } from '../../utils/labels';
|
|
18
|
+
import { ApplicationFormSpec } from '../Device/EditDeviceWizard/types';
|
|
19
|
+
|
|
20
|
+
type UnvalidatedLabel = Partial<FlightCtlLabel>;
|
|
21
|
+
|
|
22
|
+
const SYSTEMD_PATTERNS_REGEXP = /^[a-z][a-z0-9-_.]*$/;
|
|
23
|
+
const SYSTEMD_UNITS_MAX_PATTERNS = 256;
|
|
24
|
+
|
|
25
|
+
// Accepts uppercase characters, and "underscore" symbols
|
|
26
|
+
const K8S_LABEL_VALUE_START_END = /^[a-z0-9A-Z](.*[a-z0-9A-Z])?$/;
|
|
27
|
+
const K8S_LABEL_VALUE_ALLOWED_CHARACTERS = /^[a-z0-9A-Z._-]*$/;
|
|
28
|
+
const K8S_LABEL_VALUE_MAX_LENGTH = 63;
|
|
29
|
+
|
|
30
|
+
// Does not accept uppercase characters, nor "underscore" symbols
|
|
31
|
+
const K8S_DNS_SUBDOMAIN_START_END = /^[a-z0-9](.*[a-z0-9])?$/;
|
|
32
|
+
const K8S_DNS_SUBDOMAIN_ALLOWED_CHARACTERS = /^[a-z0-9.-]*$/;
|
|
33
|
+
const K8S_DNS_SUBDOMAIN_VALUE_MAX_LENGTH = 253;
|
|
34
|
+
|
|
35
|
+
const absolutePathRegex = /^\/.*$/;
|
|
36
|
+
export const MAX_TARGET_REVISION_LENGTH = 244;
|
|
37
|
+
|
|
38
|
+
export const getLabelValueValidations = (t: TFunction) => [
|
|
39
|
+
{ key: 'labelValueStartAndEnd', message: t('Starts and ends with a letter or a number.') },
|
|
40
|
+
{
|
|
41
|
+
key: 'labelValueAllowedChars',
|
|
42
|
+
message: t('Contains only letters, numbers, dashes (-), dots (.), and underscores (_).'),
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
key: 'labelValueMaxLength',
|
|
46
|
+
message: t('1-{{ maxCharacters }} characters', { maxCharacters: K8S_LABEL_VALUE_MAX_LENGTH }),
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
export const getDnsSubdomainValidations = (t: TFunction) => [
|
|
51
|
+
{ key: 'dnsSubdomainStartAndEnd', message: t('Starts and ends with a lowercase letter or a number.') },
|
|
52
|
+
{
|
|
53
|
+
key: 'dnsSubdomainAllowedChars',
|
|
54
|
+
message: t('Contains only lowercase letters, numbers, dashes (-), and dots (.).'),
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
key: 'dnsSubdomainMaxLength',
|
|
58
|
+
message: t('1-{{ maxCharacters }} characters', { maxCharacters: K8S_DNS_SUBDOMAIN_VALUE_MAX_LENGTH }),
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
export const getKubernetesLabelValueErrors = (labelValue: string) => {
|
|
63
|
+
const errorKeys: Record<string, string> = {};
|
|
64
|
+
if (!K8S_LABEL_VALUE_START_END.test(labelValue)) {
|
|
65
|
+
errorKeys.labelValueStartAndEnd = 'failed';
|
|
66
|
+
}
|
|
67
|
+
if (!K8S_LABEL_VALUE_ALLOWED_CHARACTERS.test(labelValue)) {
|
|
68
|
+
errorKeys.labelValueAllowedChars = 'failed';
|
|
69
|
+
}
|
|
70
|
+
if (labelValue?.length > K8S_LABEL_VALUE_MAX_LENGTH) {
|
|
71
|
+
errorKeys.labelValueMaxLength = 'failed';
|
|
72
|
+
}
|
|
73
|
+
return errorKeys;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const getKubernetesDnsSubdomainErrors = (value: string) => {
|
|
77
|
+
const errorKeys: Record<string, string> = {};
|
|
78
|
+
if (!K8S_DNS_SUBDOMAIN_START_END.test(value)) {
|
|
79
|
+
errorKeys.dnsSubdomainStartAndEnd = 'failed';
|
|
80
|
+
}
|
|
81
|
+
if (!K8S_DNS_SUBDOMAIN_ALLOWED_CHARACTERS.test(value)) {
|
|
82
|
+
errorKeys.dnsSubdomainAllowedChars = 'failed';
|
|
83
|
+
}
|
|
84
|
+
if (value?.length > K8S_DNS_SUBDOMAIN_VALUE_MAX_LENGTH) {
|
|
85
|
+
errorKeys.dnsSubdomainMaxLength = 'failed';
|
|
86
|
+
}
|
|
87
|
+
return errorKeys;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export const hasUniqueLabelKeys = (labels: UnvalidatedLabel[]) => {
|
|
91
|
+
const uniqueKeys = new Set(labels.map((label) => label.key));
|
|
92
|
+
return uniqueKeys.size === labels.length;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export const getInvalidKubernetesLabels = (labels: UnvalidatedLabel[]) => {
|
|
96
|
+
return labels.filter((unvalidatedLabel) => {
|
|
97
|
+
const key = unvalidatedLabel.key || '';
|
|
98
|
+
const value = unvalidatedLabel.value || '';
|
|
99
|
+
|
|
100
|
+
const keyParts = key.split('/');
|
|
101
|
+
if (keyParts.length > 2) {
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Key prefix validations
|
|
106
|
+
const keyPrefix = keyParts.length === 2 ? keyParts[0] : '';
|
|
107
|
+
if (keyPrefix) {
|
|
108
|
+
if (
|
|
109
|
+
keyPrefix.length > K8S_DNS_SUBDOMAIN_VALUE_MAX_LENGTH ||
|
|
110
|
+
!K8S_DNS_SUBDOMAIN_START_END.test(keyPrefix) ||
|
|
111
|
+
!K8S_DNS_SUBDOMAIN_ALLOWED_CHARACTERS.test(keyPrefix)
|
|
112
|
+
) {
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Key name validations
|
|
118
|
+
const keyName = keyPrefix ? keyParts[1] : key;
|
|
119
|
+
if (
|
|
120
|
+
keyName.length > K8S_LABEL_VALUE_MAX_LENGTH ||
|
|
121
|
+
!K8S_LABEL_VALUE_START_END.test(keyName) ||
|
|
122
|
+
!K8S_LABEL_VALUE_ALLOWED_CHARACTERS.test(keyName)
|
|
123
|
+
) {
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Value validations
|
|
128
|
+
return value.length === 0
|
|
129
|
+
? false
|
|
130
|
+
: value.length > K8S_LABEL_VALUE_MAX_LENGTH ||
|
|
131
|
+
!K8S_LABEL_VALUE_START_END.test(value) ||
|
|
132
|
+
!K8S_LABEL_VALUE_ALLOWED_CHARACTERS.test(value);
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export const validKubernetesDnsSubdomain = (
|
|
137
|
+
t: TFunction,
|
|
138
|
+
{ isRequired, fieldName }: { isRequired: boolean; fieldName?: string },
|
|
139
|
+
) =>
|
|
140
|
+
isRequired
|
|
141
|
+
? Yup.string()
|
|
142
|
+
.defined(t('{{ fieldName }} is required', { fieldName: fieldName || t('Name') }))
|
|
143
|
+
.test('k8sDnsSubdomainFormat', (value: string, testContext) => {
|
|
144
|
+
const errorKeys = getKubernetesDnsSubdomainErrors(value);
|
|
145
|
+
return Object.keys(errorKeys).length > 0
|
|
146
|
+
? testContext.createError({
|
|
147
|
+
message: errorKeys,
|
|
148
|
+
})
|
|
149
|
+
: true;
|
|
150
|
+
})
|
|
151
|
+
: Yup.string();
|
|
152
|
+
|
|
153
|
+
const labelValueValidations = (labelValue: string | undefined, testContext: Yup.TestContext) => {
|
|
154
|
+
if (!labelValue) {
|
|
155
|
+
return true;
|
|
156
|
+
}
|
|
157
|
+
const errorKeys: Partial<Record<string, string>> = {};
|
|
158
|
+
if (!K8S_LABEL_VALUE_START_END.test(labelValue)) {
|
|
159
|
+
errorKeys.labelValueStartAndEnd = 'failed';
|
|
160
|
+
}
|
|
161
|
+
if (!K8S_LABEL_VALUE_ALLOWED_CHARACTERS.test(labelValue)) {
|
|
162
|
+
errorKeys.labelValueAllowedChars = 'failed';
|
|
163
|
+
}
|
|
164
|
+
if (labelValue.length > K8S_LABEL_VALUE_MAX_LENGTH) {
|
|
165
|
+
errorKeys.labelValueMaxLength = 'failed';
|
|
166
|
+
}
|
|
167
|
+
if (Object.keys(errorKeys).length === 0) {
|
|
168
|
+
return true;
|
|
169
|
+
}
|
|
170
|
+
return testContext.createError({
|
|
171
|
+
message: errorKeys,
|
|
172
|
+
});
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
export const validKubernetesLabelValue = (
|
|
176
|
+
t: TFunction,
|
|
177
|
+
{ isRequired, fieldName }: { isRequired: boolean; fieldName?: string },
|
|
178
|
+
) =>
|
|
179
|
+
isRequired
|
|
180
|
+
? Yup.string()
|
|
181
|
+
.required(t('{{ fieldName }} is required', { fieldName: fieldName || t('Name') }))
|
|
182
|
+
.test('k8sLabelValueFormat', labelValueValidations)
|
|
183
|
+
: Yup.string().test('k8sLabelValueFormat', labelValueValidations);
|
|
184
|
+
|
|
185
|
+
export const maxLengthString = (t: TFunction, props: { maxLength: number; fieldName: string }) =>
|
|
186
|
+
Yup.string().max(props.maxLength, t('{{ fieldName }} must not exceed {{ maxLength }} characters', props));
|
|
187
|
+
|
|
188
|
+
export const validLabelsSchema = (t: TFunction) =>
|
|
189
|
+
Yup.array()
|
|
190
|
+
.of(
|
|
191
|
+
Yup.object<UnvalidatedLabel>().shape({
|
|
192
|
+
// We'll define the mandatory key restriction for all labels, not individually
|
|
193
|
+
key: Yup.string(),
|
|
194
|
+
value: Yup.string(),
|
|
195
|
+
}),
|
|
196
|
+
)
|
|
197
|
+
.required()
|
|
198
|
+
.test('missing keys', (labels: UnvalidatedLabel[], testContext) => {
|
|
199
|
+
const missingKeyLabels = labels.filter((label) => !label.key).map((label) => label.value);
|
|
200
|
+
return missingKeyLabels.length > 0
|
|
201
|
+
? testContext.createError({
|
|
202
|
+
message: t('Label keys are required. Invalid labels: {{invalidLabels}}', {
|
|
203
|
+
invalidLabels: `=${missingKeyLabels.join(', =')}`,
|
|
204
|
+
}),
|
|
205
|
+
})
|
|
206
|
+
: true;
|
|
207
|
+
})
|
|
208
|
+
.test('unique keys', t('Label keys must be unique'), hasUniqueLabelKeys)
|
|
209
|
+
.test('invalid-labels', (labels: UnvalidatedLabel[], testContext) => {
|
|
210
|
+
const invalidLabels = getInvalidKubernetesLabels(labels);
|
|
211
|
+
|
|
212
|
+
return invalidLabels.length > 0
|
|
213
|
+
? testContext.createError({
|
|
214
|
+
message: t('The following labels are not valid Kubernetes labels: {{invalidLabels}}', {
|
|
215
|
+
invalidLabels: `${invalidLabels.map((label) => labelToString(label as FlightCtlLabel)).join(', ')}`,
|
|
216
|
+
}),
|
|
217
|
+
})
|
|
218
|
+
: true;
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
export const validApplicationsSchema = (t: TFunction) => {
|
|
222
|
+
return Yup.array()
|
|
223
|
+
.of(
|
|
224
|
+
Yup.object().shape({
|
|
225
|
+
name: Yup.string(),
|
|
226
|
+
image: Yup.string().required(t('Image is required.')),
|
|
227
|
+
variables: Yup.array()
|
|
228
|
+
.of(
|
|
229
|
+
Yup.object().shape({
|
|
230
|
+
name: Yup.string().required(t('Variable name is required.')),
|
|
231
|
+
value: Yup.string().required(t('Variable value is required.')),
|
|
232
|
+
}),
|
|
233
|
+
)
|
|
234
|
+
.required(),
|
|
235
|
+
}),
|
|
236
|
+
)
|
|
237
|
+
.test('unique-app-ids', (apps: ApplicationFormSpec[] | undefined, testContext) => {
|
|
238
|
+
if (!apps?.length) {
|
|
239
|
+
return true;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// App name is optional, in which case the ID is the app image.
|
|
243
|
+
// Apps should have different names or images
|
|
244
|
+
const getAppId = (app: ApplicationFormSpec) => app.name || app.image;
|
|
245
|
+
|
|
246
|
+
const appIds = apps.map(getAppId);
|
|
247
|
+
const duplicateIds = Object.entries(countBy(appIds))
|
|
248
|
+
.filter(([, count]) => {
|
|
249
|
+
return count > 1;
|
|
250
|
+
})
|
|
251
|
+
.map(([id]) => id);
|
|
252
|
+
if (duplicateIds.length === 0) {
|
|
253
|
+
return true;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
const errors = apps.reduce((errors, app, appIndex) => {
|
|
257
|
+
if (duplicateIds.includes(getAppId(app))) {
|
|
258
|
+
const error = app.name
|
|
259
|
+
? new Yup.ValidationError(t('Application name must be unique.'), '', `applications[${appIndex}].name`)
|
|
260
|
+
: new Yup.ValidationError(
|
|
261
|
+
t('Name is required, another application uses the same image.'),
|
|
262
|
+
'',
|
|
263
|
+
`applications[${appIndex}].name`,
|
|
264
|
+
);
|
|
265
|
+
|
|
266
|
+
errors.push(error);
|
|
267
|
+
}
|
|
268
|
+
return errors;
|
|
269
|
+
}, [] as Yup.ValidationError[]);
|
|
270
|
+
|
|
271
|
+
return testContext.createError({
|
|
272
|
+
message: () => errors,
|
|
273
|
+
});
|
|
274
|
+
});
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
export const validConfigTemplatesSchema = (t: TFunction) =>
|
|
278
|
+
Yup.array()
|
|
279
|
+
.test('unique-names', t('Source names must be unique'), (templates: SpecConfigTemplate[] | undefined) => {
|
|
280
|
+
if (!templates) {
|
|
281
|
+
return true;
|
|
282
|
+
}
|
|
283
|
+
const uniqueNames = new Set(templates.map((template) => template.name));
|
|
284
|
+
return uniqueNames.size === templates.length;
|
|
285
|
+
})
|
|
286
|
+
.of(
|
|
287
|
+
Yup.lazy((value: SpecConfigTemplate) => {
|
|
288
|
+
if (isGitConfigTemplate(value)) {
|
|
289
|
+
return Yup.object<GitConfigTemplate>().shape({
|
|
290
|
+
type: Yup.string().required(t('Source type is required.')),
|
|
291
|
+
name: validKubernetesDnsSubdomain(t, { isRequired: true }),
|
|
292
|
+
path: Yup.string().required(t('Path is required.')).matches(absolutePathRegex, t('Path must be absolute.')),
|
|
293
|
+
mountPath: Yup.string()
|
|
294
|
+
.required(t('Mount path is required.'))
|
|
295
|
+
.matches(absolutePathRegex, t('Mount path must be absolute.')),
|
|
296
|
+
repository: Yup.string().required(t('Repository is required.')),
|
|
297
|
+
targetRevision: maxLengthString(t, {
|
|
298
|
+
maxLength: MAX_TARGET_REVISION_LENGTH,
|
|
299
|
+
fieldName: t('Target revision'),
|
|
300
|
+
}).required(t('Branch/tag/commit is required.')),
|
|
301
|
+
});
|
|
302
|
+
} else if (isHttpConfigTemplate(value)) {
|
|
303
|
+
return Yup.object<HttpConfigTemplate>().shape({
|
|
304
|
+
type: Yup.string().required(t('Source type is required.')),
|
|
305
|
+
name: validKubernetesDnsSubdomain(t, { isRequired: true }),
|
|
306
|
+
filePath: Yup.string()
|
|
307
|
+
.required(t('File path is required.'))
|
|
308
|
+
.matches(absolutePathRegex, t('Path must be absolute.')),
|
|
309
|
+
suffix: Yup.string(),
|
|
310
|
+
});
|
|
311
|
+
} else if (isKubeSecretTemplate(value)) {
|
|
312
|
+
return Yup.object<KubeSecretTemplate>().shape({
|
|
313
|
+
type: Yup.string().required(t('Source type is required.')),
|
|
314
|
+
name: validKubernetesDnsSubdomain(t, { isRequired: true }),
|
|
315
|
+
secretName: Yup.string().required(t('Secret name is required.')),
|
|
316
|
+
secretNs: Yup.string().required(t('Secret namespace is required.')),
|
|
317
|
+
mountPath: Yup.string()
|
|
318
|
+
.required(t('Mount path is required.'))
|
|
319
|
+
.matches(absolutePathRegex, t('Mount path must be absolute.')),
|
|
320
|
+
});
|
|
321
|
+
} else if (isInlineConfigTemplate(value)) {
|
|
322
|
+
return Yup.object<InlineConfigTemplate>().shape({
|
|
323
|
+
type: Yup.string().required(t('Source type is required.')),
|
|
324
|
+
name: validKubernetesDnsSubdomain(t, { isRequired: true }),
|
|
325
|
+
files: Yup.array().of(
|
|
326
|
+
Yup.object<InlineConfigTemplate['files'][0]>().shape({
|
|
327
|
+
path: Yup.string()
|
|
328
|
+
.required(t('Path is required.'))
|
|
329
|
+
.matches(absolutePathRegex, t('File path must be absolute.'))
|
|
330
|
+
.test(
|
|
331
|
+
'unique-paths',
|
|
332
|
+
t('File path must be unique.'),
|
|
333
|
+
(path) => !path || value.files.filter((file) => file.path === path).length == 1,
|
|
334
|
+
),
|
|
335
|
+
content: Yup.string().required(t('File content is required.')),
|
|
336
|
+
}),
|
|
337
|
+
),
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
return Yup.object<InlineConfigTemplate>().shape({
|
|
342
|
+
name: validKubernetesDnsSubdomain(t, { isRequired: true }),
|
|
343
|
+
type: Yup.string().required(t('Source type is required.')),
|
|
344
|
+
});
|
|
345
|
+
}),
|
|
346
|
+
);
|
|
347
|
+
|
|
348
|
+
export const deviceSystemdUnitsValidationSchema = (t: TFunction) =>
|
|
349
|
+
Yup.object({
|
|
350
|
+
matchPatterns: Yup.array()
|
|
351
|
+
.max(
|
|
352
|
+
SYSTEMD_UNITS_MAX_PATTERNS,
|
|
353
|
+
t('The maximum number of systemd units is {{maxSystemUnits}}.', { maxSystemUnits: SYSTEMD_UNITS_MAX_PATTERNS }),
|
|
354
|
+
)
|
|
355
|
+
.of(Yup.string().required('Unit name is required.'))
|
|
356
|
+
.test('invalid patterns', (patterns: string[] | undefined, testContext) => {
|
|
357
|
+
// TODO analyze https://github.com/systemd/systemd/blob/9cebda59e818cdb89dc1e53ab5bb51b91b3dc3ff/src/basic/unit-name.c#L42
|
|
358
|
+
// and adjust the regular expression and / or the validation to accommodate for it
|
|
359
|
+
const invalidPatterns = (patterns || []).filter((pattern) => {
|
|
360
|
+
return pattern.length > SYSTEMD_UNITS_MAX_PATTERNS || !SYSTEMD_PATTERNS_REGEXP.test(pattern);
|
|
361
|
+
});
|
|
362
|
+
if (invalidPatterns.length === 0) {
|
|
363
|
+
return true;
|
|
364
|
+
}
|
|
365
|
+
return testContext.createError({
|
|
366
|
+
message: t('Invalid systemd unit names: {{invalidPatterns}}', {
|
|
367
|
+
invalidPatterns: invalidPatterns.join(', '),
|
|
368
|
+
}),
|
|
369
|
+
});
|
|
370
|
+
})
|
|
371
|
+
.test('unique patterns', t('Systemd unit names must be unique'), (patterns: string[] | undefined) => {
|
|
372
|
+
const uniqueKeys = new Set(patterns || []);
|
|
373
|
+
return uniqueKeys.size === (patterns?.length || 0);
|
|
374
|
+
}),
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
export const deviceApprovalValidationSchema = (t: TFunction, conf: { isSingleDevice: boolean }) =>
|
|
378
|
+
Yup.object({
|
|
379
|
+
deviceAlias: conf.isSingleDevice
|
|
380
|
+
? validKubernetesLabelValue(t, { isRequired: false, fieldName: t('Alias') })
|
|
381
|
+
: Yup.string().matches(
|
|
382
|
+
/{{n}}/,
|
|
383
|
+
t('Device aliases must be unique. Add a number to the template to generate unique aliases.'),
|
|
384
|
+
),
|
|
385
|
+
labels: validLabelsSchema(t),
|
|
386
|
+
});
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useFormikContext } from 'formik';
|
|
3
|
+
import { Alert, Button, FormGroup } from '@patternfly/react-core';
|
|
4
|
+
|
|
5
|
+
import { EnrollmentRequest } from '@flightctl/types';
|
|
6
|
+
import RichValidationTextField from '../../form/RichValidationTextField';
|
|
7
|
+
import LabelsField from '../../form/LabelsField';
|
|
8
|
+
import { getLabelValueValidations } from '../../form/validations';
|
|
9
|
+
import FlightCtlActionGroup from '../../form/FlightCtlActionGroup';
|
|
10
|
+
import FlightCtlForm from '../../form/FlightCtlForm';
|
|
11
|
+
import { FlightCtlLabel } from '../../../types/extraTypes';
|
|
12
|
+
import { useTranslation } from '../../../hooks/useTranslation';
|
|
13
|
+
import useDeviceLabelMatch from '../../../hooks/useDeviceLabelMatch';
|
|
14
|
+
import ResourceLink from '../../common/ResourceLink';
|
|
15
|
+
import DeviceLabelMatch from './DeviceLabelMatch';
|
|
16
|
+
|
|
17
|
+
export type ApproveDeviceFormValues = {
|
|
18
|
+
labels: FlightCtlLabel[];
|
|
19
|
+
deviceAlias: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type ApproveDeviceFormProps = {
|
|
23
|
+
enrollmentRequest: EnrollmentRequest;
|
|
24
|
+
onClose: (refetch?: boolean) => void;
|
|
25
|
+
error?: string;
|
|
26
|
+
children?: React.ReactNode;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const ApproveDeviceForm: React.FC<ApproveDeviceFormProps> = ({ enrollmentRequest, onClose, error, children }) => {
|
|
30
|
+
const { t } = useTranslation();
|
|
31
|
+
const { submitForm, isSubmitting, errors: formErrors } = useFormikContext<ApproveDeviceFormValues>();
|
|
32
|
+
|
|
33
|
+
const disableSubmit = Object.keys(formErrors).length > 0;
|
|
34
|
+
const [matchLabelsOnChange, matchStatus] = useDeviceLabelMatch();
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<FlightCtlForm>
|
|
38
|
+
<RichValidationTextField
|
|
39
|
+
fieldName="deviceAlias"
|
|
40
|
+
aria-label={t('Alias')}
|
|
41
|
+
validations={getLabelValueValidations(t)}
|
|
42
|
+
/>
|
|
43
|
+
{enrollmentRequest && (
|
|
44
|
+
<FormGroup label={t('Name')} aria-label={t('Name')}>
|
|
45
|
+
<ResourceLink id={enrollmentRequest.metadata.name as string} variant="full" />
|
|
46
|
+
</FormGroup>
|
|
47
|
+
)}
|
|
48
|
+
<FormGroup label={t('Labels')}>
|
|
49
|
+
<LabelsField name="labels" onChangeCallback={matchLabelsOnChange} />
|
|
50
|
+
</FormGroup>
|
|
51
|
+
<FormGroup label={t('Fleet name')}>
|
|
52
|
+
<DeviceLabelMatch matchStatus={matchStatus} />
|
|
53
|
+
</FormGroup>
|
|
54
|
+
{children}
|
|
55
|
+
{error && <Alert isInline title={error} variant="danger" />}
|
|
56
|
+
<FlightCtlActionGroup>
|
|
57
|
+
<Button
|
|
58
|
+
key="confirm"
|
|
59
|
+
variant="primary"
|
|
60
|
+
onClick={submitForm}
|
|
61
|
+
isDisabled={disableSubmit || isSubmitting}
|
|
62
|
+
isLoading={isSubmitting}
|
|
63
|
+
>
|
|
64
|
+
{t('Approve')}
|
|
65
|
+
</Button>
|
|
66
|
+
<Button key="cancel" variant="link" onClick={() => onClose()} isDisabled={isSubmitting}>
|
|
67
|
+
{t('Cancel')}
|
|
68
|
+
</Button>
|
|
69
|
+
</FlightCtlActionGroup>
|
|
70
|
+
</FlightCtlForm>
|
|
71
|
+
);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export default ApproveDeviceForm;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { EnrollmentRequestApproval } from '@flightctl/types';
|
|
3
|
+
import { Alert, Modal } from '@patternfly/react-core';
|
|
4
|
+
import { Formik } from 'formik';
|
|
5
|
+
|
|
6
|
+
import { useFetch } from '../../../hooks/useFetch';
|
|
7
|
+
import { getErrorMessage } from '../../../utils/error';
|
|
8
|
+
import ApproveDeviceForm, { ApproveDeviceFormProps, ApproveDeviceFormValues } from './ApproveDeviceForm';
|
|
9
|
+
import {
|
|
10
|
+
EnrollmentRequestStatus as EnrollmentRequestStatusType,
|
|
11
|
+
getApprovalStatus,
|
|
12
|
+
} from '../../../utils/status/enrollmentRequest';
|
|
13
|
+
import { useTranslation } from '../../../hooks/useTranslation';
|
|
14
|
+
import { deviceApprovalValidationSchema } from '../../form/validations';
|
|
15
|
+
|
|
16
|
+
import { fromAPILabel, toAPILabel } from '../../../utils/labels';
|
|
17
|
+
import { useAppContext } from '../../../hooks/useAppContext';
|
|
18
|
+
|
|
19
|
+
type DeviceEnrollmentModalProps = Omit<ApproveDeviceFormProps, 'error'>;
|
|
20
|
+
|
|
21
|
+
const DeviceEnrollmentModal: React.FC<DeviceEnrollmentModalProps> = ({ enrollmentRequest, onClose }) => {
|
|
22
|
+
const { t } = useTranslation();
|
|
23
|
+
const { post } = useFetch();
|
|
24
|
+
const [error, setError] = React.useState<string>();
|
|
25
|
+
const { user } = useAppContext();
|
|
26
|
+
return (
|
|
27
|
+
<Formik<ApproveDeviceFormValues>
|
|
28
|
+
initialValues={{
|
|
29
|
+
labels: fromAPILabel(enrollmentRequest.spec.labels || {}, { isDefault: true }),
|
|
30
|
+
deviceAlias: '',
|
|
31
|
+
}}
|
|
32
|
+
validationSchema={deviceApprovalValidationSchema(t, { isSingleDevice: true })}
|
|
33
|
+
onSubmit={async ({ labels, deviceAlias }) => {
|
|
34
|
+
setError(undefined);
|
|
35
|
+
const deviceLabels: EnrollmentRequestApproval['labels'] = toAPILabel(labels);
|
|
36
|
+
if (deviceAlias) {
|
|
37
|
+
deviceLabels.alias = deviceAlias;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
try {
|
|
41
|
+
await post<EnrollmentRequestApproval>(`enrollmentrequests/${enrollmentRequest.metadata.name}/approval`, {
|
|
42
|
+
approved: true,
|
|
43
|
+
labels: deviceLabels,
|
|
44
|
+
approvedBy: user,
|
|
45
|
+
});
|
|
46
|
+
onClose(true);
|
|
47
|
+
} catch (e) {
|
|
48
|
+
setError(getErrorMessage(e));
|
|
49
|
+
}
|
|
50
|
+
}}
|
|
51
|
+
>
|
|
52
|
+
{({ isSubmitting }) => (
|
|
53
|
+
<Modal title={t('Approve pending device')} isOpen onClose={() => !isSubmitting && onClose()} variant="small">
|
|
54
|
+
{getApprovalStatus(enrollmentRequest) !== EnrollmentRequestStatusType.Approved ? (
|
|
55
|
+
<ApproveDeviceForm enrollmentRequest={enrollmentRequest} onClose={onClose} error={error} />
|
|
56
|
+
) : (
|
|
57
|
+
<Alert isInline variant="info" title={t('Enrollment request is already approved.')} />
|
|
58
|
+
)}
|
|
59
|
+
</Modal>
|
|
60
|
+
)}
|
|
61
|
+
</Formik>
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export default DeviceEnrollmentModal;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/* Style to get the appearance of a disabled Input with messages spanning multiple lines */
|
|
2
|
+
.fctl-device-label-match {
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
background-color: var(--pf-v5-global--disabled-color--300);
|
|
6
|
+
padding: 0.5rem;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.fctl-device-label-match__icon {
|
|
10
|
+
margin-right: 0.5rem;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.fctl-device-label-match__placeholder {
|
|
14
|
+
color: var(--pf-v5-global--disabled-color--100);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* Dark theme variations */
|
|
18
|
+
.pf-v5-theme-dark .fctl-device-label-match {
|
|
19
|
+
background-color: var(--pf-v5-global--disabled-color--200);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.pf-v5-theme-dark .fctl-device-label-match__placeholder {
|
|
23
|
+
color: var(--pf-v5-global--Color--light-100);
|
|
24
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Icon, Spinner } from '@patternfly/react-core';
|
|
3
|
+
import { CheckCircleIcon } from '@patternfly/react-icons/dist/js/icons/check-circle-icon';
|
|
4
|
+
import { ExclamationTriangleIcon } from '@patternfly/react-icons/dist/js/icons/exclamation-triangle-icon';
|
|
5
|
+
import { ExclamationCircleIcon } from '@patternfly/react-icons/dist/js/icons/exclamation-circle-icon';
|
|
6
|
+
|
|
7
|
+
import { useTranslation } from '../../../hooks/useTranslation';
|
|
8
|
+
import { DeviceMatchStatus } from '../../../hooks/useDeviceLabelMatch';
|
|
9
|
+
|
|
10
|
+
import './DeviceLabelMatch.css';
|
|
11
|
+
|
|
12
|
+
const DeviceLabelMatchContent = ({
|
|
13
|
+
iconStatus,
|
|
14
|
+
text,
|
|
15
|
+
isPlaceholder,
|
|
16
|
+
}: {
|
|
17
|
+
iconStatus?: 'success' | 'warning' | 'danger' | 'loader';
|
|
18
|
+
text?: string;
|
|
19
|
+
isPlaceholder?: boolean;
|
|
20
|
+
}) => {
|
|
21
|
+
let icon: React.ReactNode;
|
|
22
|
+
switch (iconStatus) {
|
|
23
|
+
case 'warning':
|
|
24
|
+
icon = (
|
|
25
|
+
<Icon status="warning">
|
|
26
|
+
<ExclamationTriangleIcon />
|
|
27
|
+
</Icon>
|
|
28
|
+
);
|
|
29
|
+
break;
|
|
30
|
+
case 'danger':
|
|
31
|
+
icon = (
|
|
32
|
+
<Icon status="danger">
|
|
33
|
+
<ExclamationCircleIcon />
|
|
34
|
+
</Icon>
|
|
35
|
+
);
|
|
36
|
+
break;
|
|
37
|
+
case 'success':
|
|
38
|
+
icon = (
|
|
39
|
+
<Icon status="success">
|
|
40
|
+
<CheckCircleIcon />
|
|
41
|
+
</Icon>
|
|
42
|
+
);
|
|
43
|
+
break;
|
|
44
|
+
case 'loader':
|
|
45
|
+
icon = <Spinner size="sm" />;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<div className="fctl-device-label-match">
|
|
51
|
+
{icon && <span className="fctl-device-label-match__icon">{icon}</span>}
|
|
52
|
+
<span className={isPlaceholder ? 'fctl-device-label-match__placeholder' : ''}>{text}</span>
|
|
53
|
+
</div>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const DeviceLabelMatch = ({ matchStatus }: { matchStatus: DeviceMatchStatus }) => {
|
|
58
|
+
const { t } = useTranslation();
|
|
59
|
+
|
|
60
|
+
switch (matchStatus.status) {
|
|
61
|
+
case 'unchecked':
|
|
62
|
+
return <DeviceLabelMatchContent text={t('Add labels to select a fleet.')} isPlaceholder />;
|
|
63
|
+
case 'unchecked--invalid':
|
|
64
|
+
return (
|
|
65
|
+
<DeviceLabelMatchContent
|
|
66
|
+
iconStatus="warning"
|
|
67
|
+
text={t('Fleet label match cannot cannot be evaluated when there are invalid labels.')}
|
|
68
|
+
isPlaceholder
|
|
69
|
+
/>
|
|
70
|
+
);
|
|
71
|
+
case 'checking':
|
|
72
|
+
return <DeviceLabelMatchContent iconStatus="loader" />;
|
|
73
|
+
case 'checked--unique':
|
|
74
|
+
return (
|
|
75
|
+
<DeviceLabelMatchContent
|
|
76
|
+
iconStatus="success"
|
|
77
|
+
/* The matching fleet's name */
|
|
78
|
+
text={matchStatus.detail}
|
|
79
|
+
/>
|
|
80
|
+
);
|
|
81
|
+
case 'checked--empty':
|
|
82
|
+
return <DeviceLabelMatchContent iconStatus="warning" text={t('No fleet is matching the selected labels.')} />;
|
|
83
|
+
case 'checked--multiple':
|
|
84
|
+
return (
|
|
85
|
+
<DeviceLabelMatchContent
|
|
86
|
+
iconStatus="danger"
|
|
87
|
+
text={t(
|
|
88
|
+
"More than one fleet is matching the selected labels. The device will ignore the fleets' configurations.",
|
|
89
|
+
)}
|
|
90
|
+
/>
|
|
91
|
+
);
|
|
92
|
+
case 'checked--error': {
|
|
93
|
+
const text = t('Check for matching fleet(s) failed. {{errorMessage}}', {
|
|
94
|
+
errorMessage: matchStatus.detail || t('Unknown error'),
|
|
95
|
+
});
|
|
96
|
+
return <DeviceLabelMatchContent iconStatus="danger" text={text} />;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export default DeviceLabelMatch;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Modal } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
import { Repository } from '@flightctl/types';
|
|
5
|
+
import { useTranslation } from '../../../hooks/useTranslation';
|
|
6
|
+
import CreateRepositoryForm, {
|
|
7
|
+
CreateRepositoryFormProps,
|
|
8
|
+
} from '../../Repository/CreateRepository/CreateRepositoryForm';
|
|
9
|
+
|
|
10
|
+
type CreateRepositoryModalProps = {
|
|
11
|
+
onClose: VoidFunction;
|
|
12
|
+
onSuccess: (repository: Repository) => void;
|
|
13
|
+
options?: CreateRepositoryFormProps['options'];
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const CreateRepositoryModal = ({ options, onClose, onSuccess }: CreateRepositoryModalProps) => {
|
|
17
|
+
const { t } = useTranslation();
|
|
18
|
+
return (
|
|
19
|
+
<Modal variant="medium" isOpen title={t('Create repository')} showClose={false}>
|
|
20
|
+
<CreateRepositoryForm onClose={onClose} onSuccess={onSuccess} options={options} />
|
|
21
|
+
</Modal>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default CreateRepositoryModal;
|