@flightctl/ui-components 0.0.1
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.js +3 -0
- package/dist/__mocks__/fileMock.js.map +1 -0
- package/dist/__mocks__/styleMock.js +3 -0
- package/dist/__mocks__/styleMock.js.map +1 -0
- package/dist/jest.config.js +24 -0
- package/dist/jest.config.js.map +1 -0
- package/dist/src/components/DetailsPage/DetailsNotFound.js +69 -0
- package/dist/src/components/DetailsPage/DetailsNotFound.js.map +1 -0
- package/dist/src/components/DetailsPage/DetailsPage.css +3 -0
- package/dist/src/components/DetailsPage/DetailsPage.js +42 -0
- package/dist/src/components/DetailsPage/DetailsPage.js.map +1 -0
- package/dist/src/components/DetailsPage/DetailsPage.spec.js +81 -0
- package/dist/src/components/DetailsPage/DetailsPage.spec.js.map +1 -0
- package/dist/src/components/DetailsPage/DetailsPageActions.js +30 -0
- package/dist/src/components/DetailsPage/DetailsPageActions.js.map +1 -0
- package/dist/src/components/DetailsPage/DetailsPageCard.css +8 -0
- package/dist/src/components/DetailsPage/DetailsPageCard.js +12 -0
- package/dist/src/components/DetailsPage/DetailsPageCard.js.map +1 -0
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.js +27 -0
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.js.map +1 -0
- package/dist/src/components/DetailsPage/Tables/ConditionsTable.js +24 -0
- package/dist/src/components/DetailsPage/Tables/ConditionsTable.js.map +1 -0
- package/dist/src/components/DetailsPage/Tables/IntegrityDetails.js +22 -0
- package/dist/src/components/DetailsPage/Tables/IntegrityDetails.js.map +1 -0
- package/dist/src/components/DetailsPage/Tables/SystemdDetailsTable.js +40 -0
- package/dist/src/components/DetailsPage/Tables/SystemdDetailsTable.js.map +1 -0
- package/dist/src/components/Device/AddDeviceModal/AddDeviceModal.js +63 -0
- package/dist/src/components/Device/AddDeviceModal/AddDeviceModal.js.map +1 -0
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.js +57 -0
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.js.map +1 -0
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.css +4 -0
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.js +114 -0
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.js.map +1 -0
- package/dist/src/components/Device/DeviceDetails/DeviceFleet.css +3 -0
- package/dist/src/components/Device/DeviceDetails/DeviceFleet.js +50 -0
- package/dist/src/components/Device/DeviceDetails/DeviceFleet.js.map +1 -0
- package/dist/src/components/Device/DeviceDetails/DeviceStatusDebugModal.css +3 -0
- package/dist/src/components/Device/DeviceDetails/DeviceStatusDebugModal.js +34 -0
- package/dist/src/components/Device/DeviceDetails/DeviceStatusDebugModal.js.map +1 -0
- package/dist/src/components/Device/DeviceDetails/SystemdTable.js +38 -0
- package/dist/src/components/Device/DeviceDetails/SystemdTable.js.map +1 -0
- package/dist/src/components/Device/DeviceDetails/TerminalTab.js +31 -0
- package/dist/src/components/Device/DeviceDetails/TerminalTab.js.map +1 -0
- package/dist/src/components/Device/DeviceList/DeviceFilterSelect.js +87 -0
- package/dist/src/components/Device/DeviceList/DeviceFilterSelect.js.map +1 -0
- package/dist/src/components/Device/DeviceList/DeviceList.js +157 -0
- package/dist/src/components/Device/DeviceList/DeviceList.js.map +1 -0
- package/dist/src/components/Device/DeviceList/DeviceTableRow.js +62 -0
- package/dist/src/components/Device/DeviceList/DeviceTableRow.js.map +1 -0
- package/dist/src/components/Device/DeviceList/DeviceTableToolbar.js +80 -0
- package/dist/src/components/Device/DeviceList/DeviceTableToolbar.js.map +1 -0
- package/dist/src/components/Device/DeviceList/types.js +4 -0
- package/dist/src/components/Device/DeviceList/types.js.map +1 -0
- package/dist/src/components/Device/DeviceList/useDeviceBackendFilters.js +94 -0
- package/dist/src/components/Device/DeviceList/useDeviceBackendFilters.js.map +1 -0
- package/dist/src/components/Device/DeviceList/useDeviceFilters.js +16 -0
- package/dist/src/components/Device/DeviceList/useDeviceFilters.js.map +1 -0
- package/dist/src/components/Device/DeviceList/useDeviceLikeResources.js +98 -0
- package/dist/src/components/Device/DeviceList/useDeviceLikeResources.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.css +4 -0
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js +92 -0
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardFooter.js +32 -0
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardFooter.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.js +36 -0
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.js +171 -0
- package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.js +15 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigK8sSecretTemplateForm.js +22 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigK8sSecretTemplateForm.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigTemplateForm.css +3 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigTemplateForm.js +96 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigTemplateForm.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.js +94 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.js +45 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/GeneralInfoStep.js +48 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/GeneralInfoStep.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.js +45 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/types.js +3 -0
- package/dist/src/components/Device/EditDeviceWizard/types.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/useEditDevice.js +35 -0
- package/dist/src/components/Device/EditDeviceWizard/useEditDevice.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/utils.js +65 -0
- package/dist/src/components/Device/EditDeviceWizard/utils.js.map +1 -0
- package/dist/src/components/Device/MatchPatternsModal/MatchPatternsForm.js +39 -0
- package/dist/src/components/Device/MatchPatternsModal/MatchPatternsForm.js.map +1 -0
- package/dist/src/components/Device/MatchPatternsModal/MatchPatternsModal.js +46 -0
- package/dist/src/components/Device/MatchPatternsModal/MatchPatternsModal.js.map +1 -0
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.css +3 -0
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js +103 -0
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js.map +1 -0
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.js +42 -0
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.js.map +1 -0
- package/dist/src/components/ErrorAlert/ErrorAlert.js +13 -0
- package/dist/src/components/ErrorAlert/ErrorAlert.js.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.css +3 -0
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.js +82 -0
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.js.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.js +32 -0
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.js.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.js +85 -0
- package/dist/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.js.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/steps/GeneralInfoStep.js +30 -0
- package/dist/src/components/Fleet/CreateFleet/steps/GeneralInfoStep.js.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.js +46 -0
- package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.js.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/types.js +3 -0
- package/dist/src/components/Fleet/CreateFleet/types.js.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/useEditFleet.js +35 -0
- package/dist/src/components/Fleet/CreateFleet/useEditFleet.js.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/utils.js +143 -0
- package/dist/src/components/Fleet/CreateFleet/utils.js.map +1 -0
- package/dist/src/components/Fleet/DeleteFleetModal/DeleteFleetModal.js +55 -0
- package/dist/src/components/Fleet/DeleteFleetModal/DeleteFleetModal.js.map +1 -0
- package/dist/src/components/Fleet/FleetDetails/FleetDetails.js +49 -0
- package/dist/src/components/Fleet/FleetDetails/FleetDetails.js.map +1 -0
- package/dist/src/components/Fleet/FleetDetails/FleetDetailsContent.js +69 -0
- package/dist/src/components/Fleet/FleetDetails/FleetDetailsContent.js.map +1 -0
- package/dist/src/components/Fleet/FleetDetails/FleetDevices.js +40 -0
- package/dist/src/components/Fleet/FleetDetails/FleetDevices.js.map +1 -0
- package/dist/src/components/Fleet/FleetDetails/FleetOwnerLink.js +37 -0
- package/dist/src/components/Fleet/FleetDetails/FleetOwnerLink.js.map +1 -0
- package/dist/src/components/Fleet/FleetDetails/chartUtils.js +29 -0
- package/dist/src/components/Fleet/FleetDetails/chartUtils.js.map +1 -0
- package/dist/src/components/Fleet/FleetList.js +130 -0
- package/dist/src/components/Fleet/FleetList.js.map +1 -0
- package/dist/src/components/Fleet/FleetRow.js +64 -0
- package/dist/src/components/Fleet/FleetRow.js.map +1 -0
- package/dist/src/components/Fleet/FleetStatus.js +34 -0
- package/dist/src/components/Fleet/FleetStatus.js.map +1 -0
- package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.css +3 -0
- package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.js +106 -0
- package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.js.map +1 -0
- package/dist/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.js +69 -0
- package/dist/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.js.map +1 -0
- package/dist/src/components/Fleet/ImportFleetWizard/steps/ResourceSyncStep.js +31 -0
- package/dist/src/components/Fleet/ImportFleetWizard/steps/ResourceSyncStep.js.map +1 -0
- package/dist/src/components/Fleet/ImportFleetWizard/steps/ReviewStep.js +37 -0
- package/dist/src/components/Fleet/ImportFleetWizard/steps/ReviewStep.js.map +1 -0
- package/dist/src/components/Fleet/ImportFleetWizard/types.js +3 -0
- package/dist/src/components/Fleet/ImportFleetWizard/types.js.map +1 -0
- package/dist/src/components/Fleet/ResourceSyncRow.js +36 -0
- package/dist/src/components/Fleet/ResourceSyncRow.js.map +1 -0
- package/dist/src/components/ListPage/ListPage.js +12 -0
- package/dist/src/components/ListPage/ListPage.js.map +1 -0
- package/dist/src/components/ListPage/ListPageActions.js +30 -0
- package/dist/src/components/ListPage/ListPageActions.js.map +1 -0
- package/dist/src/components/ListPage/ListPageBody.js +21 -0
- package/dist/src/components/ListPage/ListPageBody.js.map +1 -0
- package/dist/src/components/ListPage/types.js +3 -0
- package/dist/src/components/ListPage/types.js.map +1 -0
- package/dist/src/components/NavItem/NavItem.js +20 -0
- package/dist/src/components/NavItem/NavItem.js.map +1 -0
- package/dist/src/components/OverviewPage/Cards/Status/ApplicationStatusChart.js +30 -0
- package/dist/src/components/OverviewPage/Cards/Status/ApplicationStatusChart.js.map +1 -0
- package/dist/src/components/OverviewPage/Cards/Status/DeviceStatusChart.js +32 -0
- package/dist/src/components/OverviewPage/Cards/Status/DeviceStatusChart.js.map +1 -0
- package/dist/src/components/OverviewPage/Cards/Status/StatusCard.js +61 -0
- package/dist/src/components/OverviewPage/Cards/Status/StatusCard.js.map +1 -0
- package/dist/src/components/OverviewPage/Cards/Status/StatusCardFilters.js +64 -0
- package/dist/src/components/OverviewPage/Cards/Status/StatusCardFilters.js.map +1 -0
- package/dist/src/components/OverviewPage/Cards/Status/SystemUpdateStatusChart.js +30 -0
- package/dist/src/components/OverviewPage/Cards/Status/SystemUpdateStatusChart.js.map +1 -0
- package/dist/src/components/OverviewPage/Cards/Status/utils.js +31 -0
- package/dist/src/components/OverviewPage/Cards/Status/utils.js.map +1 -0
- package/dist/src/components/OverviewPage/Cards/ToDo/ToDoCard.js +46 -0
- package/dist/src/components/OverviewPage/Cards/ToDo/ToDoCard.js.map +1 -0
- package/dist/src/components/OverviewPage/Overview.js +16 -0
- package/dist/src/components/OverviewPage/Overview.js.map +1 -0
- package/dist/src/components/OverviewPage/OverviewPage.js +17 -0
- package/dist/src/components/OverviewPage/OverviewPage.js.map +1 -0
- package/dist/src/components/Repository/CreateRepository/CreateRepository.js +102 -0
- package/dist/src/components/Repository/CreateRepository/CreateRepository.js.map +1 -0
- package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.css +7 -0
- package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.js +215 -0
- package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.js.map +1 -0
- package/dist/src/components/Repository/CreateRepository/CreateResourceSyncsForm.js +31 -0
- package/dist/src/components/Repository/CreateRepository/CreateResourceSyncsForm.js.map +1 -0
- package/dist/src/components/Repository/CreateRepository/types.js +3 -0
- package/dist/src/components/Repository/CreateRepository/types.js.map +1 -0
- package/dist/src/components/Repository/CreateRepository/utils.js +454 -0
- package/dist/src/components/Repository/CreateRepository/utils.js.map +1 -0
- package/dist/src/components/Repository/RepositoryDetails/DeleteRepositoryModal.js +93 -0
- package/dist/src/components/Repository/RepositoryDetails/DeleteRepositoryModal.js.map +1 -0
- package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.js +39 -0
- package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.js.map +1 -0
- package/dist/src/components/Repository/RepositoryDetails/RepositoryGeneralDetailsCard.js +64 -0
- package/dist/src/components/Repository/RepositoryDetails/RepositoryGeneralDetailsCard.js.map +1 -0
- package/dist/src/components/Repository/RepositoryDetails/RepositoryResourceSyncsCard.js +18 -0
- package/dist/src/components/Repository/RepositoryDetails/RepositoryResourceSyncsCard.js.map +1 -0
- package/dist/src/components/Repository/RepositoryDetails/RepositorySource.js +24 -0
- package/dist/src/components/Repository/RepositoryDetails/RepositorySource.js.map +1 -0
- package/dist/src/components/Repository/RepositoryDetails/RepositorySourceList.js +64 -0
- package/dist/src/components/Repository/RepositoryDetails/RepositorySourceList.js.map +1 -0
- package/dist/src/components/Repository/RepositoryList.js +133 -0
- package/dist/src/components/Repository/RepositoryList.js.map +1 -0
- package/dist/src/components/ResourceSync/RepositoryResourceSyncList.css +7 -0
- package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js +140 -0
- package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js.map +1 -0
- package/dist/src/components/ResourceSync/ResourceSyncStatus.js +65 -0
- package/dist/src/components/ResourceSync/ResourceSyncStatus.js.map +1 -0
- package/dist/src/components/ResourceSync/ResourceSyncToRepository.js +49 -0
- package/dist/src/components/ResourceSync/ResourceSyncToRepository.js.map +1 -0
- package/dist/src/components/Status/ApplicationStatus.js +23 -0
- package/dist/src/components/Status/ApplicationStatus.js.map +1 -0
- package/dist/src/components/Status/ApplicationSummaryStatus.js +23 -0
- package/dist/src/components/Status/ApplicationSummaryStatus.js.map +1 -0
- package/dist/src/components/Status/DeviceResourceStatus.js +84 -0
- package/dist/src/components/Status/DeviceResourceStatus.js.map +1 -0
- package/dist/src/components/Status/DeviceStatus.js +18 -0
- package/dist/src/components/Status/DeviceStatus.js.map +1 -0
- package/dist/src/components/Status/EnrollmentRequestStatus.js +18 -0
- package/dist/src/components/Status/EnrollmentRequestStatus.js.map +1 -0
- package/dist/src/components/Status/IntegrityStatus.js +17 -0
- package/dist/src/components/Status/IntegrityStatus.js.map +1 -0
- package/dist/src/components/Status/RepositoryStatus.js +37 -0
- package/dist/src/components/Status/RepositoryStatus.js.map +1 -0
- package/dist/src/components/Status/StatusDisplay.css +9 -0
- package/dist/src/components/Status/StatusDisplay.js +33 -0
- package/dist/src/components/Status/StatusDisplay.js.map +1 -0
- package/dist/src/components/Status/SystemUpdateStatus.js +24 -0
- package/dist/src/components/Status/SystemUpdateStatus.js.map +1 -0
- package/dist/src/components/Status/SystemdStatus.js +21 -0
- package/dist/src/components/Status/SystemdStatus.js.map +1 -0
- package/dist/src/components/Status/utils.js +10 -0
- package/dist/src/components/Status/utils.js.map +1 -0
- package/dist/src/components/Table/Table.js +28 -0
- package/dist/src/components/Table/Table.js.map +1 -0
- package/dist/src/components/Table/TableActions.js +16 -0
- package/dist/src/components/Table/TableActions.js.map +1 -0
- package/dist/src/components/Table/TableTextSearch.js +13 -0
- package/dist/src/components/Table/TableTextSearch.js.map +1 -0
- package/dist/src/components/Terminal/Terminal.css +1 -0
- package/dist/src/components/Terminal/Terminal.js +79 -0
- package/dist/src/components/Terminal/Terminal.js.map +1 -0
- package/dist/src/components/UserPreferences/UserPreferencesModal.js +34 -0
- package/dist/src/components/UserPreferences/UserPreferencesModal.js.map +1 -0
- package/dist/src/components/UserPreferences/UserPreferencesProvider.js +19 -0
- package/dist/src/components/UserPreferences/UserPreferencesProvider.js.map +1 -0
- package/dist/src/components/charts/DonutChart.css +10 -0
- package/dist/src/components/charts/DonutChart.js +47 -0
- package/dist/src/components/charts/DonutChart.js.map +1 -0
- package/dist/src/components/common/CopyButton.js +18 -0
- package/dist/src/components/common/CopyButton.js.map +1 -0
- package/dist/src/components/common/EditableLabelControl.js +39 -0
- package/dist/src/components/common/EditableLabelControl.js.map +1 -0
- package/dist/src/components/common/ErrorBoundary.js +36 -0
- package/dist/src/components/common/ErrorBoundary.js.map +1 -0
- package/dist/src/components/common/HelperTextItems.js +25 -0
- package/dist/src/components/common/HelperTextItems.js.map +1 -0
- package/dist/src/components/common/LabelsView.css +9 -0
- package/dist/src/components/common/LabelsView.js +18 -0
- package/dist/src/components/common/LabelsView.js.map +1 -0
- package/dist/src/components/common/LeaveFormConfirmation.js +51 -0
- package/dist/src/components/common/LeaveFormConfirmation.js.map +1 -0
- package/dist/src/components/common/ResourceLink.css +29 -0
- package/dist/src/components/common/ResourceLink.js +30 -0
- package/dist/src/components/common/ResourceLink.js.map +1 -0
- package/dist/src/components/common/ResourceListEmptyState.js +10 -0
- package/dist/src/components/common/ResourceListEmptyState.js.map +1 -0
- package/dist/src/components/common/WithHelperText.css +3 -0
- package/dist/src/components/common/WithHelperText.js +16 -0
- package/dist/src/components/common/WithHelperText.js.map +1 -0
- package/dist/src/components/common/WithTooltip.js +8 -0
- package/dist/src/components/common/WithTooltip.js.map +1 -0
- package/dist/src/components/form/CheckboxField.js +29 -0
- package/dist/src/components/form/CheckboxField.js.map +1 -0
- package/dist/src/components/form/FieldHelperText.js +27 -0
- package/dist/src/components/form/FieldHelperText.js.map +1 -0
- package/dist/src/components/form/FilterSelect.css +8 -0
- package/dist/src/components/form/FilterSelect.js +30 -0
- package/dist/src/components/form/FilterSelect.js.map +1 -0
- package/dist/src/components/form/FlightCtlActionGroup.css +9 -0
- package/dist/src/components/form/FlightCtlActionGroup.js +10 -0
- package/dist/src/components/form/FlightCtlActionGroup.js.map +1 -0
- package/dist/src/components/form/FlightCtlForm.js +13 -0
- package/dist/src/components/form/FlightCtlForm.js.map +1 -0
- package/dist/src/components/form/FormSelect.css +8 -0
- package/dist/src/components/form/FormSelect.js +50 -0
- package/dist/src/components/form/FormSelect.js.map +1 -0
- package/dist/src/components/form/LabelsField.js +61 -0
- package/dist/src/components/form/LabelsField.js.map +1 -0
- package/dist/src/components/form/NameField.js +63 -0
- package/dist/src/components/form/NameField.js.map +1 -0
- package/dist/src/components/form/RadioField.js +32 -0
- package/dist/src/components/form/RadioField.js.map +1 -0
- package/dist/src/components/form/RichValidationTextField.js +66 -0
- package/dist/src/components/form/RichValidationTextField.js.map +1 -0
- package/dist/src/components/form/TextAreaField.js +28 -0
- package/dist/src/components/form/TextAreaField.js.map +1 -0
- package/dist/src/components/form/TextField.js +29 -0
- package/dist/src/components/form/TextField.js.map +1 -0
- package/dist/src/components/form/validations.js +286 -0
- package/dist/src/components/form/validations.js.map +1 -0
- package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceForm.js +36 -0
- package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceForm.js.map +1 -0
- package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.js +43 -0
- package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.js.map +1 -0
- package/dist/src/components/modals/ApproveDeviceModal/DeviceLabelMatch.css +24 -0
- package/dist/src/components/modals/ApproveDeviceModal/DeviceLabelMatch.js +62 -0
- package/dist/src/components/modals/ApproveDeviceModal/DeviceLabelMatch.js.map +1 -0
- package/dist/src/components/modals/CreateRepositoryModal/CreateRepositoryModal.js +14 -0
- package/dist/src/components/modals/CreateRepositoryModal/CreateRepositoryModal.js.map +1 -0
- package/dist/src/components/modals/DeleteModal/DeleteModal.js +41 -0
- package/dist/src/components/modals/DeleteModal/DeleteModal.js.map +1 -0
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.js +63 -0
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.js.map +1 -0
- package/dist/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.css +4 -0
- package/dist/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.js +126 -0
- package/dist/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.js.map +1 -0
- package/dist/src/components/modals/massModals/MassDeleteDeviceModal/MassDeleteDeviceModal.js +64 -0
- package/dist/src/components/modals/massModals/MassDeleteDeviceModal/MassDeleteDeviceModal.js.map +1 -0
- package/dist/src/components/modals/massModals/MassDeleteFleetModal/MassDeleteFleetModal.js +84 -0
- package/dist/src/components/modals/massModals/MassDeleteFleetModal/MassDeleteFleetModal.js.map +1 -0
- package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.js +94 -0
- package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.js.map +1 -0
- package/dist/src/components/modals/massModals/MassDeleteResourceSyncModal/MassDeleteResourceSyncModal.js +62 -0
- package/dist/src/components/modals/massModals/MassDeleteResourceSyncModal/MassDeleteResourceSyncModal.js.map +1 -0
- package/dist/src/constants.js +8 -0
- package/dist/src/constants.js.map +1 -0
- package/dist/src/hooks/useAppContext.js +61 -0
- package/dist/src/hooks/useAppContext.js.map +1 -0
- package/dist/src/hooks/useDeviceLabelMatch.js +78 -0
- package/dist/src/hooks/useDeviceLabelMatch.js.map +1 -0
- package/dist/src/hooks/useDocumentTitle.js +17 -0
- package/dist/src/hooks/useDocumentTitle.js.map +1 -0
- package/dist/src/hooks/useFetch.js +10 -0
- package/dist/src/hooks/useFetch.js.map +1 -0
- package/dist/src/hooks/useFetchPeriodically.js +75 -0
- package/dist/src/hooks/useFetchPeriodically.js.map +1 -0
- package/dist/src/hooks/useNavigate.js +65 -0
- package/dist/src/hooks/useNavigate.js.map +1 -0
- package/dist/src/hooks/useTableSelect.js +45 -0
- package/dist/src/hooks/useTableSelect.js.map +1 -0
- package/dist/src/hooks/useTableSort.js +38 -0
- package/dist/src/hooks/useTableSort.js.map +1 -0
- package/dist/src/hooks/useTableTextSearch.js +23 -0
- package/dist/src/hooks/useTableTextSearch.js.map +1 -0
- package/dist/src/hooks/useTemplateVersion.js +22 -0
- package/dist/src/hooks/useTemplateVersion.js.map +1 -0
- package/dist/src/hooks/useThemePreferences.js +61 -0
- package/dist/src/hooks/useThemePreferences.js.map +1 -0
- package/dist/src/hooks/useTranslation.js +12 -0
- package/dist/src/hooks/useTranslation.js.map +1 -0
- package/dist/src/hooks/useUserPreferences.js +16 -0
- package/dist/src/hooks/useUserPreferences.js.map +1 -0
- package/dist/src/hooks/useWebSocket.js +69 -0
- package/dist/src/hooks/useWebSocket.js.map +1 -0
- package/dist/src/setupTests.js +24 -0
- package/dist/src/setupTests.js.map +1 -0
- package/dist/src/tests/test-utils.js +21 -0
- package/dist/src/tests/test-utils.js.map +1 -0
- package/dist/src/types/deviceSpec.js +20 -0
- package/dist/src/types/deviceSpec.js.map +1 -0
- package/dist/src/types/extraTypes.js +20 -0
- package/dist/src/types/extraTypes.js.map +1 -0
- package/dist/src/types/typeUtils.js +12 -0
- package/dist/src/types/typeUtils.js.map +1 -0
- package/dist/src/utils/api.js +68 -0
- package/dist/src/utils/api.js.map +1 -0
- package/dist/src/utils/dates.js +53 -0
- package/dist/src/utils/dates.js.map +1 -0
- package/dist/src/utils/devices.js +37 -0
- package/dist/src/utils/devices.js.map +1 -0
- package/dist/src/utils/error.js +25 -0
- package/dist/src/utils/error.js.map +1 -0
- package/dist/src/utils/labels.js +44 -0
- package/dist/src/utils/labels.js.map +1 -0
- package/dist/src/utils/metrics.js +48 -0
- package/dist/src/utils/metrics.js.map +1 -0
- package/dist/src/utils/patch.js +108 -0
- package/dist/src/utils/patch.js.map +1 -0
- package/dist/src/utils/resource.js +6 -0
- package/dist/src/utils/resource.js.map +1 -0
- package/dist/src/utils/search.js +14 -0
- package/dist/src/utils/search.js.map +1 -0
- package/dist/src/utils/sort/device.js +89 -0
- package/dist/src/utils/sort/device.js.map +1 -0
- package/dist/src/utils/sort/fleet.js +20 -0
- package/dist/src/utils/sort/fleet.js.map +1 -0
- package/dist/src/utils/sort/generic.js +34 -0
- package/dist/src/utils/sort/generic.js.map +1 -0
- package/dist/src/utils/sort/repository.js +28 -0
- package/dist/src/utils/sort/repository.js.map +1 -0
- package/dist/src/utils/sort/resourceSync.js +29 -0
- package/dist/src/utils/sort/resourceSync.js.map +1 -0
- package/dist/src/utils/status/applications.js +56 -0
- package/dist/src/utils/status/applications.js.map +1 -0
- package/dist/src/utils/status/common.js +63 -0
- package/dist/src/utils/status/common.js.map +1 -0
- package/dist/src/utils/status/devices.js +65 -0
- package/dist/src/utils/status/devices.js.map +1 -0
- package/dist/src/utils/status/enrollmentRequest.js +49 -0
- package/dist/src/utils/status/enrollmentRequest.js.map +1 -0
- package/dist/src/utils/status/fleet.js +38 -0
- package/dist/src/utils/status/fleet.js.map +1 -0
- package/dist/src/utils/status/integrity.js +28 -0
- package/dist/src/utils/status/integrity.js.map +1 -0
- package/dist/src/utils/status/repository.js +88 -0
- package/dist/src/utils/status/repository.js.map +1 -0
- package/dist/src/utils/status/system.js +29 -0
- package/dist/src/utils/status/system.js.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const React = tslib_1.__importStar(require("react"));
|
|
5
|
+
const formik_1 = require("formik");
|
|
6
|
+
const react_core_1 = require("@patternfly/react-core");
|
|
7
|
+
const error_1 = require("../../../utils/error");
|
|
8
|
+
const labels_1 = require("../../../utils/labels");
|
|
9
|
+
const useTranslation_1 = require("../../../hooks/useTranslation");
|
|
10
|
+
const useNavigate_1 = require("../../../hooks/useNavigate");
|
|
11
|
+
const LeaveFormConfirmation_1 = tslib_1.__importDefault(require("../../common/LeaveFormConfirmation"));
|
|
12
|
+
const ErrorBoundary_1 = tslib_1.__importDefault(require("../../common/ErrorBoundary"));
|
|
13
|
+
const GeneralInfoStep_1 = tslib_1.__importStar(require("./steps/GeneralInfoStep"));
|
|
14
|
+
const DeviceTemplateStep_1 = tslib_1.__importStar(require("./steps/DeviceTemplateStep"));
|
|
15
|
+
const ReviewDeviceStep_1 = tslib_1.__importStar(require("./steps/ReviewDeviceStep"));
|
|
16
|
+
const utils_1 = require("./utils");
|
|
17
|
+
const deviceSpecUtils_1 = require("./deviceSpecUtils");
|
|
18
|
+
const useFetch_1 = require("../../../hooks/useFetch");
|
|
19
|
+
const useEditDevice_1 = require("./useEditDevice");
|
|
20
|
+
const EditDeviceWizardNav_1 = tslib_1.__importDefault(require("./EditDeviceWizardNav"));
|
|
21
|
+
const EditDeviceWizardFooter_1 = tslib_1.__importDefault(require("./EditDeviceWizardFooter"));
|
|
22
|
+
require("./EditDeviceWizard.css");
|
|
23
|
+
const EditDeviceWizard = () => {
|
|
24
|
+
var _a, _b, _c;
|
|
25
|
+
const { t } = (0, useTranslation_1.useTranslation)();
|
|
26
|
+
const [submitError, setSubmitError] = React.useState();
|
|
27
|
+
const navigate = (0, useNavigate_1.useNavigate)();
|
|
28
|
+
const { patch } = (0, useFetch_1.useFetch)();
|
|
29
|
+
const [deviceId, device, isLoading, loadError] = (0, useEditDevice_1.useEditDevice)();
|
|
30
|
+
const deviceAlias = ((_a = device === null || device === void 0 ? void 0 : device.metadata.labels) === null || _a === void 0 ? void 0 : _a.alias) || '';
|
|
31
|
+
const displayText = device ? deviceAlias || t('Untitled') : deviceId;
|
|
32
|
+
let body;
|
|
33
|
+
if (isLoading) {
|
|
34
|
+
body = (React.createElement(react_core_1.Bullseye, null,
|
|
35
|
+
React.createElement(react_core_1.Spinner, null)));
|
|
36
|
+
}
|
|
37
|
+
else if (loadError) {
|
|
38
|
+
body = (React.createElement(react_core_1.Alert, { isInline: true, variant: "danger", title: t('An error occurred') }, (0, error_1.getErrorMessage)(loadError)));
|
|
39
|
+
}
|
|
40
|
+
else if (!!(device === null || device === void 0 ? void 0 : device.metadata.owner)) {
|
|
41
|
+
body = (React.createElement(react_core_1.Alert, { isInline: true, variant: "info", title: t('Device is non-editable') }, t('This device is managed by a fleet and it cannot be edited directly.')));
|
|
42
|
+
}
|
|
43
|
+
else if (device) {
|
|
44
|
+
body = (React.createElement(formik_1.Formik, { initialValues: {
|
|
45
|
+
deviceAlias,
|
|
46
|
+
osImage: (_c = (_b = device.spec) === null || _b === void 0 ? void 0 : _b.os) === null || _c === void 0 ? void 0 : _c.image,
|
|
47
|
+
labels: (0, labels_1.fromAPILabel)(device.metadata.labels || {}).filter((label) => label.key !== 'alias'),
|
|
48
|
+
configTemplates: (0, deviceSpecUtils_1.getConfigTemplatesValues)(device.spec),
|
|
49
|
+
fleetMatch: '', // Initially this is always a fleetless device
|
|
50
|
+
}, validationSchema: (0, utils_1.getValidationSchema)(t), validateOnMount: true, onSubmit: (values) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
51
|
+
setSubmitError(undefined);
|
|
52
|
+
try {
|
|
53
|
+
const patches = (0, utils_1.getDevicePatches)(device, values);
|
|
54
|
+
if (patches.length > 0) {
|
|
55
|
+
yield patch(`devices/${deviceId}`, patches);
|
|
56
|
+
}
|
|
57
|
+
navigate({ route: useNavigate_1.ROUTE.DEVICE_DETAILS, postfix: deviceId });
|
|
58
|
+
}
|
|
59
|
+
catch (e) {
|
|
60
|
+
setSubmitError((0, error_1.getErrorMessage)(e));
|
|
61
|
+
}
|
|
62
|
+
}) }, ({ values, errors: formikErrors }) => {
|
|
63
|
+
const generalStepValid = (0, GeneralInfoStep_1.isGeneralInfoStepValid)(formikErrors);
|
|
64
|
+
const templateStepValid = (0, DeviceTemplateStep_1.isDeviceTemplateStepValid)(formikErrors);
|
|
65
|
+
const canEditTemplate = !values.fleetMatch;
|
|
66
|
+
const isTemplateStepDisabled = !(generalStepValid && canEditTemplate);
|
|
67
|
+
return (React.createElement(React.Fragment, null,
|
|
68
|
+
React.createElement(LeaveFormConfirmation_1.default, null),
|
|
69
|
+
React.createElement(react_core_1.Wizard, { className: "fctl-edit-device__wizard", footer: React.createElement(EditDeviceWizardFooter_1.default, null), nav: React.createElement(EditDeviceWizardNav_1.default, null) },
|
|
70
|
+
React.createElement(react_core_1.WizardStep, { name: t('General info'), id: GeneralInfoStep_1.generalInfoStepId },
|
|
71
|
+
React.createElement(GeneralInfoStep_1.default, null)),
|
|
72
|
+
React.createElement(react_core_1.WizardStep, { name: t('Device template'), id: DeviceTemplateStep_1.deviceTemplateStepId, isDisabled: isTemplateStepDisabled },
|
|
73
|
+
React.createElement(DeviceTemplateStep_1.default, { isFleet: false })),
|
|
74
|
+
React.createElement(react_core_1.WizardStep, { name: t('Review and update'), id: ReviewDeviceStep_1.reviewDeviceStepId, isDisabled: !templateStepValid },
|
|
75
|
+
React.createElement(ReviewDeviceStep_1.default, { error: submitError })))));
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
78
|
+
return (React.createElement(React.Fragment, null,
|
|
79
|
+
React.createElement(react_core_1.PageSection, { variant: "light", type: "breadcrumb" },
|
|
80
|
+
React.createElement(react_core_1.Breadcrumb, null,
|
|
81
|
+
React.createElement(react_core_1.BreadcrumbItem, null,
|
|
82
|
+
React.createElement(useNavigate_1.Link, { to: useNavigate_1.ROUTE.DEVICES }, t('Devices'))),
|
|
83
|
+
deviceId && (React.createElement(react_core_1.BreadcrumbItem, null,
|
|
84
|
+
React.createElement(useNavigate_1.Link, { to: { route: useNavigate_1.ROUTE.DEVICE_DETAILS, postfix: deviceId } }, displayText))),
|
|
85
|
+
React.createElement(react_core_1.BreadcrumbItem, { isActive: true }, t('Edit device')))),
|
|
86
|
+
React.createElement(react_core_1.PageSection, { variant: react_core_1.PageSectionVariants.light },
|
|
87
|
+
React.createElement(react_core_1.Title, { headingLevel: "h1", size: "3xl" }, t('Edit device'))),
|
|
88
|
+
React.createElement(react_core_1.PageSection, { variant: react_core_1.PageSectionVariants.light, type: "wizard" },
|
|
89
|
+
React.createElement(ErrorBoundary_1.default, null, body))));
|
|
90
|
+
};
|
|
91
|
+
exports.default = EditDeviceWizard;
|
|
92
|
+
//# sourceMappingURL=EditDeviceWizard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditDeviceWizard.js","sourceRoot":"","sources":["../../../../../src/components/Device/EditDeviceWizard/EditDeviceWizard.tsx"],"names":[],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,OAAO,CACL;QACE,oBAAC,wBAAW,IAAC,OAAO,EAAC,OAAO,EAAC,IAAI,EAAC,YAAY;YAC5C,oBAAC,uBAAU;gBACT,oBAAC,2BAAc;oBACb,oBAAC,kBAAI,IAAC,EAAE,EAAE,mBAAK,CAAC,OAAO,IAAG,CAAC,CAAC,SAAS,CAAC,CAAQ,CAC/B;gBAChB,QAAQ,IAAI,CACX,oBAAC,2BAAc;oBACb,oBAAC,kBAAI,IAAC,EAAE,EAAE,EAAE,KAAK,EAAE,mBAAK,CAAC,cAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAG,WAAW,CAAQ,CACnE,CAClB;gBACD,oBAAC,2BAAc,IAAC,QAAQ,UAAE,CAAC,CAAC,aAAa,CAAC,CAAkB,CACjD,CACD;QACd,oBAAC,wBAAW,IAAC,OAAO,EAAE,gCAAmB,CAAC,KAAK;YAC7C,oBAAC,kBAAK,IAAC,YAAY,EAAC,IAAI,EAAC,IAAI,EAAC,KAAK,IAChC,CAAC,CAAC,aAAa,CAAC,CACX,CACI;QACd,oBAAC,wBAAW,IAAC,OAAO,EAAE,gCAAmB,CAAC,KAAK,EAAE,IAAI,EAAC,QAAQ;YAC5D,oBAAC,uBAAa,QAAE,IAAI,CAAiB,CACzB,CACb,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const React = tslib_1.__importStar(require("react"));
|
|
5
|
+
const formik_1 = require("formik");
|
|
6
|
+
const react_core_1 = require("@patternfly/react-core");
|
|
7
|
+
const useTranslation_1 = require("../../../hooks/useTranslation");
|
|
8
|
+
const useNavigate_1 = require("../../../hooks/useNavigate");
|
|
9
|
+
const GeneralInfoStep_1 = require("./steps/GeneralInfoStep");
|
|
10
|
+
const DeviceTemplateStep_1 = require("./steps/DeviceTemplateStep");
|
|
11
|
+
const ReviewDeviceStep_1 = require("./steps/ReviewDeviceStep");
|
|
12
|
+
const EditDeviceWizardFooter = () => {
|
|
13
|
+
const { t } = (0, useTranslation_1.useTranslation)();
|
|
14
|
+
const { goToNextStep, goToPrevStep, activeStep } = (0, react_core_1.useWizardContext)();
|
|
15
|
+
const { submitForm, isSubmitting, errors } = (0, formik_1.useFormikContext)();
|
|
16
|
+
const navigate = (0, useNavigate_1.useNavigate)();
|
|
17
|
+
const isSubmitStep = activeStep.id === ReviewDeviceStep_1.reviewDeviceStepId;
|
|
18
|
+
let isStepValid = true;
|
|
19
|
+
if (activeStep.id === GeneralInfoStep_1.generalInfoStepId) {
|
|
20
|
+
isStepValid = (0, GeneralInfoStep_1.isGeneralInfoStepValid)(errors);
|
|
21
|
+
}
|
|
22
|
+
else if (activeStep.id === DeviceTemplateStep_1.deviceTemplateStepId) {
|
|
23
|
+
isStepValid = (0, DeviceTemplateStep_1.isDeviceTemplateStepValid)(errors);
|
|
24
|
+
}
|
|
25
|
+
const primaryBtn = isSubmitStep ? (React.createElement(react_core_1.Button, { variant: "primary", onClick: submitForm, isDisabled: isSubmitting, isLoading: isSubmitting }, t('Save'))) : (React.createElement(react_core_1.Button, { variant: "primary", onClick: goToNextStep, isDisabled: !isStepValid }, t('Next')));
|
|
26
|
+
return (React.createElement(react_core_1.WizardFooterWrapper, null,
|
|
27
|
+
primaryBtn,
|
|
28
|
+
activeStep.id !== GeneralInfoStep_1.generalInfoStepId && (React.createElement(react_core_1.Button, { variant: "secondary", onClick: goToPrevStep, isDisabled: isSubmitting }, t('Back'))),
|
|
29
|
+
React.createElement(react_core_1.Button, { variant: "link", onClick: () => navigate(-1), isDisabled: isSubmitting }, t('Cancel'))));
|
|
30
|
+
};
|
|
31
|
+
exports.default = EditDeviceWizardFooter;
|
|
32
|
+
//# sourceMappingURL=EditDeviceWizardFooter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file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,CAAC,MAAM,CAAC,CACH,CACV,CAAC;IAEF,OAAO,CACL,oBAAC,gCAAmB;QACjB,UAAU;QACV,UAAU,CAAC,EAAE,KAAK,mCAAiB,IAAI,CACtC,oBAAC,mBAAM,IAAC,OAAO,EAAC,WAAW,EAAC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,IACxE,CAAC,CAAC,MAAM,CAAC,CACH,CACV;QACD,oBAAC,mBAAM,IAAC,OAAO,EAAC,MAAM,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,YAAY,IACzE,CAAC,CAAC,QAAQ,CAAC,CACL,CACW,CACvB,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const React = tslib_1.__importStar(require("react"));
|
|
5
|
+
const react_core_1 = require("@patternfly/react-core");
|
|
6
|
+
const info_circle_icon_1 = require("@patternfly/react-icons/dist/js/icons/info-circle-icon");
|
|
7
|
+
const useTranslation_1 = require("../../../hooks/useTranslation");
|
|
8
|
+
const generalInfoStepIndex = 0;
|
|
9
|
+
const deviceTemplateStepIndex = 1;
|
|
10
|
+
const reviewDeviceStepIndex = 2;
|
|
11
|
+
const disabledTemplateReason = (t) => t('The device will be bound to a fleet. As a result, its configurations cannot be edited directly.');
|
|
12
|
+
const EditDeviceWizardNav = () => {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
const { t } = (0, useTranslation_1.useTranslation)();
|
|
15
|
+
const { activeStep, steps, goToStepByIndex } = (0, react_core_1.useWizardContext)();
|
|
16
|
+
const isEditTemplateDisabled = (_a = steps[deviceTemplateStepIndex]) === null || _a === void 0 ? void 0 : _a.isDisabled;
|
|
17
|
+
const isReviewDeviceDisabled = (_b = steps[reviewDeviceStepIndex]) === null || _b === void 0 ? void 0 : _b.isDisabled;
|
|
18
|
+
return (React.createElement(react_core_1.WizardNav, null,
|
|
19
|
+
React.createElement(react_core_1.WizardNavItem, { stepIndex: generalInfoStepIndex, content: t('General info'), isCurrent: !activeStep || (activeStep === null || activeStep === void 0 ? void 0 : activeStep.index) === generalInfoStepIndex + 1, onClick: () => {
|
|
20
|
+
goToStepByIndex(generalInfoStepIndex + 1);
|
|
21
|
+
} }),
|
|
22
|
+
React.createElement(react_core_1.WizardNavItem, { stepIndex: deviceTemplateStepIndex, content: t('Device template'), isCurrent: (activeStep === null || activeStep === void 0 ? void 0 : activeStep.index) === deviceTemplateStepIndex + 1, isDisabled: isEditTemplateDisabled, onClick: () => {
|
|
23
|
+
if (!isEditTemplateDisabled) {
|
|
24
|
+
goToStepByIndex(deviceTemplateStepIndex + 1);
|
|
25
|
+
}
|
|
26
|
+
} }, isEditTemplateDisabled && (React.createElement(react_core_1.Tooltip, { content: disabledTemplateReason(t) },
|
|
27
|
+
React.createElement(react_core_1.Icon, { status: "info", size: "sm" },
|
|
28
|
+
React.createElement(info_circle_icon_1.InfoCircleIcon, null))))),
|
|
29
|
+
React.createElement(react_core_1.WizardNavItem, { stepIndex: reviewDeviceStepIndex, content: t('Review and update'), isCurrent: (activeStep === null || activeStep === void 0 ? void 0 : activeStep.index) === reviewDeviceStepIndex + 1, isDisabled: isReviewDeviceDisabled, onClick: () => {
|
|
30
|
+
if (!isReviewDeviceDisabled) {
|
|
31
|
+
goToStepByIndex(reviewDeviceStepIndex + 1);
|
|
32
|
+
}
|
|
33
|
+
} })));
|
|
34
|
+
};
|
|
35
|
+
exports.default = EditDeviceWizardNav;
|
|
36
|
+
//# sourceMappingURL=EditDeviceWizardNav.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditDeviceWizardNav.js","sourceRoot":"","sources":["../../../../../src/components/Device/EditDeviceWizard/EditDeviceWizardNav.tsx"],"names":[],"mappings":";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AC;oBAC5B,eAAe,CAAC,uBAAuB,GAAG,CAAC,CAAC,CAAC;gBAC/C,CAAC;YACH,CAAC,IAEA,sBAAsB,IAAI,CACzB,oBAAC,oBAAO,IAAC,OAAO,EAAE,sBAAsB,CAAC,CAAC,CAAC;YACzC,oBAAC,iBAAI,IAAC,MAAM,EAAC,MAAM,EAAC,IAAI,EAAC,IAAI;gBAC3B,oBAAC,iCAAc,OAAG,CACb,CACC,CACX,CACa;QAChB,oBAAC,0BAAa,IACZ,SAAS,EAAE,qBAAqB,EAChC,OAAO,EAAE,CAAC,CAAC,mBAAmB,CAAC,EAC/B,SAAS,EAAE,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,MAAK,qBAAqB,GAAG,CAAC,EAC1D,UAAU,EAAE,sBAAsB,EAClC,OAAO,EAAE,GAAG,EAAE;gBACZ,IAAI,CAAC,sBAAsB,EAAE,CAAC;oBAC5B,eAAe,CAAC,qBAAqB,GAAG,CAAC,CAAC,CAAC;gBAC7C,CAAC;YACH,CAAC,GACD,CACQ,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getConfigTemplatesValues = exports.getAPIConfig = exports.getDeviceSpecConfigPatches = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const yaml = tslib_1.__importStar(require("js-yaml"));
|
|
6
|
+
const isEqual_1 = tslib_1.__importDefault(require("lodash/isEqual"));
|
|
7
|
+
const deviceSpec_1 = require("../../../types/deviceSpec");
|
|
8
|
+
const isSameGitConf = (a, b) => {
|
|
9
|
+
const aRef = a.gitRef;
|
|
10
|
+
const bRef = b.gitRef;
|
|
11
|
+
return (a.name === b.name &&
|
|
12
|
+
aRef.path === bRef.path &&
|
|
13
|
+
aRef.repository === bRef.repository &&
|
|
14
|
+
aRef.targetRevision === bRef.targetRevision &&
|
|
15
|
+
(aRef.mountPath || '') === (bRef.mountPath || ''));
|
|
16
|
+
};
|
|
17
|
+
const isSameHttpConf = (a, b) => {
|
|
18
|
+
const aRef = a.httpRef;
|
|
19
|
+
const bRef = b.httpRef;
|
|
20
|
+
return (a.name === b.name &&
|
|
21
|
+
aRef.filePath === bRef.filePath &&
|
|
22
|
+
aRef.repository === bRef.repository &&
|
|
23
|
+
(aRef.suffix || '') === (bRef.suffix || ''));
|
|
24
|
+
};
|
|
25
|
+
const isSameSecretConf = (a, b) => {
|
|
26
|
+
const aRef = a.secretRef;
|
|
27
|
+
const bRef = b.secretRef;
|
|
28
|
+
return (a.name === b.name &&
|
|
29
|
+
aRef.name === bRef.name &&
|
|
30
|
+
aRef.namespace === bRef.namespace &&
|
|
31
|
+
aRef.mountPath === bRef.mountPath);
|
|
32
|
+
};
|
|
33
|
+
const isSameInlineConf = (a, b) => {
|
|
34
|
+
return a.name === b.name && (0, isEqual_1.default)(a.inline, b.inline);
|
|
35
|
+
};
|
|
36
|
+
const getDeviceSpecConfigPatches = (currentConfigs, newConfigs, configPath) => {
|
|
37
|
+
const allPatches = [];
|
|
38
|
+
if (currentConfigs.length === 0 && newConfigs.length > 0) {
|
|
39
|
+
allPatches.push({
|
|
40
|
+
path: configPath,
|
|
41
|
+
op: 'add',
|
|
42
|
+
value: newConfigs,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
else if (currentConfigs.length > 0 && newConfigs.length === 0) {
|
|
46
|
+
allPatches.push({
|
|
47
|
+
path: configPath,
|
|
48
|
+
op: 'remove',
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
else if (currentConfigs.length !== newConfigs.length) {
|
|
52
|
+
allPatches.push({
|
|
53
|
+
path: configPath,
|
|
54
|
+
op: 'replace',
|
|
55
|
+
value: newConfigs,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
const hasConfigChanges = newConfigs.some((newConfig) => {
|
|
60
|
+
// Attempts to find a new config which has been changed from "currentConfigs"
|
|
61
|
+
const isUnchanged = currentConfigs.some((conf) => {
|
|
62
|
+
if (conf.configType !== newConfig.configType) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
switch (conf.configType) {
|
|
66
|
+
case 'GitConfigProviderSpec':
|
|
67
|
+
return isSameGitConf(newConfig, conf);
|
|
68
|
+
case 'HttpConfigProviderSpec':
|
|
69
|
+
return isSameHttpConf(newConfig, conf);
|
|
70
|
+
case 'KubernetesSecretProviderSpec':
|
|
71
|
+
return isSameSecretConf(newConfig, conf);
|
|
72
|
+
case 'InlineConfigProviderSpec':
|
|
73
|
+
return isSameInlineConf(newConfig, conf);
|
|
74
|
+
}
|
|
75
|
+
return false;
|
|
76
|
+
});
|
|
77
|
+
return !isUnchanged;
|
|
78
|
+
});
|
|
79
|
+
if (hasConfigChanges) {
|
|
80
|
+
allPatches.push({
|
|
81
|
+
path: configPath,
|
|
82
|
+
op: 'replace',
|
|
83
|
+
value: newConfigs,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return allPatches;
|
|
88
|
+
};
|
|
89
|
+
exports.getDeviceSpecConfigPatches = getDeviceSpecConfigPatches;
|
|
90
|
+
const getAPIConfig = (ct) => {
|
|
91
|
+
if ((0, deviceSpec_1.isGitConfigTemplate)(ct)) {
|
|
92
|
+
return {
|
|
93
|
+
configType: 'GitConfigProviderSpec',
|
|
94
|
+
name: ct.name,
|
|
95
|
+
gitRef: {
|
|
96
|
+
path: ct.path,
|
|
97
|
+
repository: ct.repository,
|
|
98
|
+
targetRevision: ct.targetRevision,
|
|
99
|
+
mountPath: ct.mountPath,
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
if ((0, deviceSpec_1.isKubeSecretTemplate)(ct)) {
|
|
104
|
+
return {
|
|
105
|
+
configType: 'KubernetesSecretProviderSpec',
|
|
106
|
+
name: ct.name,
|
|
107
|
+
secretRef: {
|
|
108
|
+
mountPath: ct.mountPath,
|
|
109
|
+
name: ct.secretName,
|
|
110
|
+
namespace: ct.secretNs,
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
if ((0, deviceSpec_1.isHttpConfigTemplate)(ct)) {
|
|
115
|
+
return {
|
|
116
|
+
configType: 'HttpConfigProviderSpec',
|
|
117
|
+
name: ct.name,
|
|
118
|
+
httpRef: {
|
|
119
|
+
repository: ct.repository,
|
|
120
|
+
suffix: ct.suffix,
|
|
121
|
+
filePath: ct.filePath,
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
return {
|
|
126
|
+
configType: 'InlineConfigProviderSpec',
|
|
127
|
+
inline: yaml.load(ct.inline),
|
|
128
|
+
name: ct.name,
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
exports.getAPIConfig = getAPIConfig;
|
|
132
|
+
const getConfigTemplatesValues = (deviceSpec) => {
|
|
133
|
+
var _a;
|
|
134
|
+
return ((_a = deviceSpec === null || deviceSpec === void 0 ? void 0 : deviceSpec.config) === null || _a === void 0 ? void 0 : _a.map((c) => {
|
|
135
|
+
if ((0, deviceSpec_1.isGitProviderSpec)(c)) {
|
|
136
|
+
return {
|
|
137
|
+
type: 'git',
|
|
138
|
+
name: c.name,
|
|
139
|
+
path: c.gitRef.path,
|
|
140
|
+
mountPath: c.gitRef.mountPath,
|
|
141
|
+
repository: c.gitRef.repository,
|
|
142
|
+
targetRevision: c.gitRef.targetRevision,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
if ((0, deviceSpec_1.isKubeProviderSpec)(c)) {
|
|
146
|
+
return {
|
|
147
|
+
type: 'secret',
|
|
148
|
+
name: c.name,
|
|
149
|
+
mountPath: c.secretRef.mountPath,
|
|
150
|
+
secretName: c.secretRef.name,
|
|
151
|
+
secretNs: c.secretRef.namespace,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
if ((0, deviceSpec_1.isHttpProviderSpec)(c)) {
|
|
155
|
+
return {
|
|
156
|
+
type: 'http',
|
|
157
|
+
name: c.name,
|
|
158
|
+
repository: c.httpRef.repository,
|
|
159
|
+
suffix: c.httpRef.suffix,
|
|
160
|
+
filePath: c.httpRef.filePath,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
return {
|
|
164
|
+
type: 'inline',
|
|
165
|
+
name: c.name,
|
|
166
|
+
inline: yaml.dump(c.inline),
|
|
167
|
+
};
|
|
168
|
+
})) || [];
|
|
169
|
+
};
|
|
170
|
+
exports.getConfigTemplatesValues = getConfigTemplatesValues;
|
|
171
|
+
//# sourceMappingURL=deviceSpecUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deviceSpecUtils.js","sourceRoot":"","sources":["../../../../../src/components/Device/EditDeviceWizard/deviceSpecUtils.ts"],"names":[],"mappings":";;;;AAAA,sDAAgC;AAChC,qEAAqC;AAUrC,0DAYmC;AAQnC,MAAM,aAAa,GAAG,CAAC,CAAwB,EAAE,CAAwB,EAAE,EAAE;IAC3E,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC;IACtB,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC;IACtB,OAAO,CACL,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI;QACjB,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI;QACvB,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,UAAU;QACnC,IAAI,CAAC,cAAc,KAAK,IAAI,CAAC,cAAc;QAC3C,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC,CAClD,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,CAAyB,EAAE,CAAyB,EAAE,EAAE;IAC9E,MAAM,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC;IACvB,M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AAQ;aACP,CAAC;QAC1B,CAAC;QACD,OAAO;YACL,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;SACJ,CAAC;IAC5B,CAAC,CAAC,KAAI,EAAE,CAAA;CAAA,CAAC;AAnCE,QAAA,wBAAwB,4BAmC1B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const React = tslib_1.__importStar(require("react"));
|
|
5
|
+
const react_core_1 = require("@patternfly/react-core");
|
|
6
|
+
const useTranslation_1 = require("../../../../hooks/useTranslation");
|
|
7
|
+
const HelperTextItems_1 = require("../../../common/HelperTextItems");
|
|
8
|
+
const TextAreaField_1 = tslib_1.__importDefault(require("../../../form/TextAreaField"));
|
|
9
|
+
const ConfigInlineTemplateForm = ({ index }) => {
|
|
10
|
+
const { t } = (0, useTranslation_1.useTranslation)();
|
|
11
|
+
return (React.createElement(react_core_1.FormGroup, { label: t('Inline'), isRequired: true },
|
|
12
|
+
React.createElement(TextAreaField_1.default, { name: `configTemplates.${index}.inline`, helperText: React.createElement(HelperTextItems_1.IgnitionFileHelperText, null) })));
|
|
13
|
+
};
|
|
14
|
+
exports.default = ConfigInlineTemplateForm;
|
|
15
|
+
//# sourceMappingURL=ConfigInlineTemplateForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigInlineTemplateForm.js","sourceRoot":"","sources":["../../../../../../src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.tsx"],"names":[],"mappings":";;;AAAA,qDAA+B;AAC/B,uDAAmD;AAEnD,qEAAkE;AAClE,qEAAyE;AACzE,wFAAwD;AAMxD,MAAM,wBAAwB,GAAG,CAAC,EAAE,KAAK,EAAiC,EAAE,EAAE;IAC5E,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,+BAAc,GAAE,CAAC;IAC/B,OAAO,CACL,oBAAC,sBAAS,IAAC,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,UAAU;QACvC,oBAAC,uBAAa,IAAC,IAAI,EAAE,mBAAmB,KAAK,SAAS,EAAE,UAAU,EAAE,oBAAC,wCAAsB,OAAG,GAAI,CACxF,CACb,CAAC;AACJ,CAAC,CAAC;AACF,kBAAe,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const React = tslib_1.__importStar(require("react"));
|
|
5
|
+
const formik_1 = require("formik");
|
|
6
|
+
const react_core_1 = require("@patternfly/react-core");
|
|
7
|
+
const useTranslation_1 = require("../../../../hooks/useTranslation");
|
|
8
|
+
const TextField_1 = tslib_1.__importDefault(require("../../../form/TextField"));
|
|
9
|
+
const ConfigK8sSecretTemplateForm = ({ index }) => {
|
|
10
|
+
const { t } = (0, useTranslation_1.useTranslation)();
|
|
11
|
+
const { values } = (0, formik_1.useFormikContext)();
|
|
12
|
+
const template = values.configTemplates[index];
|
|
13
|
+
return (React.createElement(React.Fragment, null,
|
|
14
|
+
React.createElement(react_core_1.FormGroup, { label: t('Secret name'), isRequired: true },
|
|
15
|
+
React.createElement(TextField_1.default, { "aria-label": t('Secret name'), value: template.secretName, name: `configTemplates.${index}.secretName` })),
|
|
16
|
+
React.createElement(react_core_1.FormGroup, { label: t('Secret namespace'), isRequired: true },
|
|
17
|
+
React.createElement(TextField_1.default, { "aria-label": t('Secret namespace'), name: `configTemplates.${index}.secretNs`, value: template.secretNs })),
|
|
18
|
+
React.createElement(react_core_1.FormGroup, { label: t('Mount path'), isRequired: true },
|
|
19
|
+
React.createElement(TextField_1.default, { "aria-label": t('Mount path'), name: `configTemplates.${index}.mountPath`, value: template.mountPath, placeholder: t('/absolute/path') }))));
|
|
20
|
+
};
|
|
21
|
+
exports.default = ConfigK8sSecretTemplateForm;
|
|
22
|
+
//# sourceMappingURL=ConfigK8sSecretTemplateForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigK8sSecretTemplateForm.js","sourceRoot":"","sources":["../../../../../../src/components/Device/EditDeviceWizard/steps/ConfigK8sSecretTemplateForm.tsx"],"names":[],"mappings":";;;AAAA,qDAA+B;AAC/B,mCAA0C;AAC1C,uDAAmD;AAEnD,qEAAkE;AAElE,gFAAgD;AAQhD,MAAM,2BAA2B,GAAG,CAAC,EAAE,KAAK,EAAoC,EAAE,EAAE;IAClF,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,+BAAc,GAAE,CAAC;IAC/B,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,yBAAgB,GAA8B,CAAC;IAClE,MAAM,QAAQ,GAAG,MAAM,CAAC,eAAe,CAAC,KAAK,CAAuB,CAAC;IACrE,OAAO,CACL;QACE,oBAAC,sBAAS,IAAC,KAAK,EAAE,CAAC,CAAC,aAAa,CAAC,EAAE,UAAU;YAC5C,oBAAC,mBAAS,kBACI,CAAC,CAAC,aAAa,CAAC,EAC5B,KAAK,EAAE,QAAQ,CAAC,UAAU,EAC1B,IAAI,EAAE,mBAAmB,KAAK,aAAa,GAC3C,CACQ;QACZ,oBAAC,sBAAS,IAAC,KAAK,EAAE,CAAC,CAAC,kBAAkB,CAAC,EAAE,UAAU;YACjD,oBAAC,mBAAS,kBACI,CAAC,CAAC,kBAAkB,CAAC,EACjC,IAAI,EAAE,mBAAmB,KAAK,WAAW,EACzC,KAAK,EAAE,QAAQ,CAAC,QAAQ,GACxB,CACQ;QACZ,oBAAC,sBAAS,IAAC,KAAK,EAAE,CAAC,CAAC,YAAY,CAAC,EAAE,UAAU;YAC3C,oBAAC,mBAAS,kBACI,CAAC,CAAC,YAAY,CAAC,EAC3B,IAAI,EAAE,mBAAmB,KAAK,YAAY,EAC1C,KAAK,EAAE,QAAQ,CAAC,SAAS,EACzB,WAAW,EAAE,CAAC,CAAC,gBAAgB,CAAC,GAChC,CACQ,CACX,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const React = tslib_1.__importStar(require("react"));
|
|
5
|
+
const react_core_1 = require("@patternfly/react-core");
|
|
6
|
+
const formik_1 = require("formik");
|
|
7
|
+
const minus_circle_icon_1 = require("@patternfly/react-icons/dist/js/icons/minus-circle-icon");
|
|
8
|
+
const plus_circle_icon_1 = require("@patternfly/react-icons/dist/js/icons/plus-circle-icon");
|
|
9
|
+
const exclamation_circle_icon_1 = require("@patternfly/react-icons/dist/js/icons/exclamation-circle-icon");
|
|
10
|
+
const useTranslation_1 = require("../../../../hooks/useTranslation");
|
|
11
|
+
const useFetchPeriodically_1 = require("../../../../hooks/useFetchPeriodically");
|
|
12
|
+
const error_1 = require("../../../../utils/error");
|
|
13
|
+
const generic_1 = require("../../../../utils/sort/generic");
|
|
14
|
+
const WithTooltip_1 = tslib_1.__importDefault(require("../../../common/WithTooltip"));
|
|
15
|
+
const validations_1 = require("../../../form/validations");
|
|
16
|
+
const FieldHelperText_1 = tslib_1.__importDefault(require("../../../form/FieldHelperText"));
|
|
17
|
+
const FormSelect_1 = tslib_1.__importDefault(require("../../../form/FormSelect"));
|
|
18
|
+
const RichValidationTextField_1 = tslib_1.__importDefault(require("../../../form/RichValidationTextField"));
|
|
19
|
+
const ConfigWithRepositoryTemplateForm_1 = tslib_1.__importDefault(require("./ConfigWithRepositoryTemplateForm"));
|
|
20
|
+
const ConfigK8sSecretTemplateForm_1 = tslib_1.__importDefault(require("./ConfigK8sSecretTemplateForm"));
|
|
21
|
+
const ConfigInlineTemplateForm_1 = tslib_1.__importDefault(require("./ConfigInlineTemplateForm"));
|
|
22
|
+
require("./ConfigTemplateForm.css");
|
|
23
|
+
const useValidateOnMount = () => {
|
|
24
|
+
const { validateForm } = (0, formik_1.useFormikContext)();
|
|
25
|
+
// validate new config section on mount
|
|
26
|
+
React.useEffect(() => {
|
|
27
|
+
validateForm();
|
|
28
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
29
|
+
}, []);
|
|
30
|
+
};
|
|
31
|
+
const ConfigSection = ({ ct, index, repositories, repoRefetch }) => {
|
|
32
|
+
const { t } = (0, useTranslation_1.useTranslation)();
|
|
33
|
+
const [isExpanded, setIsExpanded] = React.useState(true);
|
|
34
|
+
const fieldName = `configTemplates[${index}]`;
|
|
35
|
+
const { setFieldTouched } = (0, formik_1.useFormikContext)();
|
|
36
|
+
const [{ value: template }, { error }, { setTouched }] = (0, formik_1.useField)(fieldName);
|
|
37
|
+
useValidateOnMount();
|
|
38
|
+
return (React.createElement(react_core_1.ExpandableSection, { toggleContent: React.createElement(react_core_1.Split, { hasGutter: true },
|
|
39
|
+
React.createElement(react_core_1.SplitItem, null, t('Configurations/applications')),
|
|
40
|
+
!isExpanded && !!template.name && React.createElement(react_core_1.SplitItem, { style: { color: 'black' } }, template.name),
|
|
41
|
+
!isExpanded && error && (React.createElement(react_core_1.SplitItem, null,
|
|
42
|
+
React.createElement(WithTooltip_1.default, { showTooltip: true, content: t('Invalid configuration') },
|
|
43
|
+
React.createElement(exclamation_circle_icon_1.ExclamationCircleIcon, { className: "fctl-config-template--error" }))))), isIndented: true, isExpanded: isExpanded, onToggle: (_, expanded) => {
|
|
44
|
+
setTouched(true);
|
|
45
|
+
Object.keys(error || {}).forEach((key) => {
|
|
46
|
+
setFieldTouched(`${fieldName}.${key}`, true);
|
|
47
|
+
});
|
|
48
|
+
setIsExpanded(expanded);
|
|
49
|
+
} },
|
|
50
|
+
React.createElement(react_core_1.Grid, { hasGutter: true },
|
|
51
|
+
React.createElement(RichValidationTextField_1.default, { fieldName: `${fieldName}.name`, "aria-label": t('Source name'), validations: (0, validations_1.getDnsSubdomainValidations)(t), isRequired: true }),
|
|
52
|
+
React.createElement(react_core_1.FormGroup, { label: t('Source type'), isRequired: true },
|
|
53
|
+
React.createElement(FormSelect_1.default, { items: {
|
|
54
|
+
git: t('Git config provider'),
|
|
55
|
+
http: t('Http config provider'),
|
|
56
|
+
// secret: t('Kubernetes secret provider'), not supported yet
|
|
57
|
+
inline: t('Inline config provider'),
|
|
58
|
+
}, name: `${fieldName}.type`, placeholderText: t('Select a source type') })),
|
|
59
|
+
ct.type === 'secret' && React.createElement(ConfigK8sSecretTemplateForm_1.default, { index: index }),
|
|
60
|
+
ct.type === 'inline' && React.createElement(ConfigInlineTemplateForm_1.default, { index: index }),
|
|
61
|
+
(ct.type === 'http' || ct.type === 'git') && (React.createElement(ConfigWithRepositoryTemplateForm_1.default, { repoType: ct.type, index: index, repositories: repositories, repoRefetch: repoRefetch })))));
|
|
62
|
+
};
|
|
63
|
+
const ConfigTemplateForm = () => {
|
|
64
|
+
const { t } = (0, useTranslation_1.useTranslation)();
|
|
65
|
+
const { values, errors } = (0, formik_1.useFormikContext)();
|
|
66
|
+
const [repositoryList, isLoading, error, refetch] = (0, useFetchPeriodically_1.useFetchPeriodically)({
|
|
67
|
+
endpoint: 'repositories',
|
|
68
|
+
});
|
|
69
|
+
const repositories = React.useMemo(() => (0, generic_1.sortByName)((repositoryList === null || repositoryList === void 0 ? void 0 : repositoryList.items) || []), [repositoryList]);
|
|
70
|
+
const generalError = typeof errors.configTemplates === 'string' ? errors.configTemplates : undefined;
|
|
71
|
+
if (error) {
|
|
72
|
+
return (React.createElement(react_core_1.Alert, { isInline: true, variant: "danger", title: t('Failed to load repositories') }, (0, error_1.getErrorMessage)(error)));
|
|
73
|
+
}
|
|
74
|
+
else if (isLoading) {
|
|
75
|
+
return (React.createElement(react_core_1.Bullseye, null,
|
|
76
|
+
React.createElement(react_core_1.Spinner, null)));
|
|
77
|
+
}
|
|
78
|
+
return (React.createElement(formik_1.FieldArray, { name: "configTemplates" }, ({ push, remove }) => (React.createElement(React.Fragment, null,
|
|
79
|
+
values.configTemplates.map((ct, index) => (React.createElement(react_core_1.FormSection, { key: index },
|
|
80
|
+
React.createElement(react_core_1.Split, { hasGutter: true },
|
|
81
|
+
React.createElement(react_core_1.SplitItem, { isFilled: true },
|
|
82
|
+
React.createElement(ConfigSection, { ct: ct, index: index, repositories: repositories, repoRefetch: refetch })),
|
|
83
|
+
React.createElement(react_core_1.SplitItem, null,
|
|
84
|
+
React.createElement(react_core_1.Button, { variant: "link", icon: React.createElement(minus_circle_icon_1.MinusCircleIcon, null), iconPosition: "start", onClick: () => remove(index) })))))),
|
|
85
|
+
React.createElement(react_core_1.FormSection, null,
|
|
86
|
+
React.createElement(react_core_1.FormGroup, null,
|
|
87
|
+
React.createElement(react_core_1.Button, { variant: "link", icon: React.createElement(plus_circle_icon_1.PlusCircleIcon, null), iconPosition: "start", onClick: () => {
|
|
88
|
+
push({
|
|
89
|
+
name: '',
|
|
90
|
+
type: '',
|
|
91
|
+
});
|
|
92
|
+
} }, t('Add configurations/applications')))),
|
|
93
|
+
React.createElement(FieldHelperText_1.default, { error: generalError })))));
|
|
94
|
+
};
|
|
95
|
+
exports.default = ConfigTemplateForm;
|
|
96
|
+
//# sourceMappingURL=ConfigTemplateForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigTemplateForm.js","sourceRoot":"","sources":["../../../../../../src/components/Device/EditDeviceWizard/steps/ConfigTemplateForm.tsx"],"names":[],"mappings":";;;AAAA,qDAA+B;AAE/B,uDAWgC;AAChC,mCAAgE;AAChE,+FAA0F;AAC1F,6FAAwF;AACxF,2GAAsG;AAMtG,qEAAkE;AAClE,iFAA8E;AAC9E,mDAA0D;AAC1D,4DAA4D;AAC5D,sFAAsD;AACtD,2DAAuE;AACvE,4FAA4D;AAC5D,kFAAkD;AAClD,4GAA4E;AAC5E,kHAAkF;AACl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