{filteredItems.length ? (
filteredItems.map((item) => )
) : (
diff --git a/public/app/features/provisioning/Wizard/ProvisioningWizard.tsx b/public/app/features/provisioning/Wizard/ProvisioningWizard.tsx
index edf8b5aea3e..6c9ef49e917 100644
--- a/public/app/features/provisioning/Wizard/ProvisioningWizard.tsx
+++ b/public/app/features/provisioning/Wizard/ProvisioningWizard.tsx
@@ -6,11 +6,12 @@ import { useNavigate } from 'react-router-dom-v5-compat';
import { AppEvents, GrafanaTheme2 } from '@grafana/data';
import { t } from '@grafana/i18n';
import { getAppEvents, isFetchError } from '@grafana/runtime';
-import { Alert, Box, Button, Stack, Text, useStyles2 } from '@grafana/ui';
+import { Box, Button, Stack, Text, useStyles2 } from '@grafana/ui';
import { useDeleteRepositoryMutation, useGetFrontendSettingsQuery } from 'app/api/clients/provisioning/v0alpha1';
import { FormPrompt } from 'app/core/components/FormPrompt/FormPrompt';
import { getDefaultValues } from '../Config/defaults';
+import { ProvisioningAlert } from '../Shared/ProvisioningAlert';
import { PROVISIONING_URL } from '../constants';
import { useCreateOrUpdateRepository } from '../hooks/useCreateOrUpdateRepository';
import { dataToSpec } from '../utils/data';
@@ -64,7 +65,8 @@ export function ProvisioningWizard({ type }: { type: RepoType }) {
const [isSubmitting, setIsSubmitting] = useState(false);
const [isCancelling, setIsCancelling] = useState(false);
- const { stepStatusInfo, setStepStatusInfo, isStepSuccess, isStepRunning, hasStepError } = useStepStatus();
+ const { stepStatusInfo, setStepStatusInfo, isStepSuccess, isStepRunning, hasStepError, hasStepWarning } =
+ useStepStatus();
const { data } = useGetFrontendSettingsQuery();
const isLegacyStorage = Boolean(data?.legacyStorage);
@@ -250,8 +252,8 @@ export function ProvisioningWizard({ type }: { type: RepoType }) {
setIsSubmitting(false);
}
} else {
- // only proceed if the job was successful
- if (isStepSuccess) {
+ // proceed if the job was successful or had warnings
+ if (isStepSuccess || hasStepWarning) {
handleNext();
}
}
@@ -262,9 +264,9 @@ export function ProvisioningWizard({ type }: { type: RepoType }) {
if (activeStep !== 'connection' && hasStepError) {
return true;
}
- // Synchronize step requires success to proceed
+ // Synchronize step requires success or warning to proceed
if (activeStep === 'synchronize') {
- return !isStepSuccess; // Disable next button if the step is not successful
+ return !(isStepSuccess || hasStepWarning); // Disable next button if the step is not successful or has warnings
}
return isSubmitting || isCancelling || isStepRunning || isCreatingSkipJob;
};
@@ -283,9 +285,8 @@ export function ProvisioningWizard({ type }: { type: RepoType }) {
- {hasStepError && 'error' in stepStatusInfo && stepStatusInfo.error && (
-
- )}
+ {hasStepError && 'error' in stepStatusInfo && }
+ {hasStepWarning && 'warning' in stepStatusInfo && }
{activeStep === 'connection' && }
diff --git a/public/app/features/provisioning/Wizard/StepStatusContext.tsx b/public/app/features/provisioning/Wizard/StepStatusContext.tsx
index e3081bfba02..efd86869979 100644
--- a/public/app/features/provisioning/Wizard/StepStatusContext.tsx
+++ b/public/app/features/provisioning/Wizard/StepStatusContext.tsx
@@ -11,6 +11,7 @@ interface StepStatusContextData {
// Computed status checks
hasStepError: boolean;
+ hasStepWarning: boolean;
isStepRunning: boolean;
isStepSuccess: boolean;
isStepIdle: boolean;
@@ -29,6 +30,7 @@ export const StepStatusProvider = ({ children }: PropsWithChildren) => {
stepStatusInfo,
setStepStatusInfo,
hasStepError: stepStatusInfo.status === 'error',
+ hasStepWarning: stepStatusInfo.status === 'warning',
isStepRunning: stepStatusInfo.status === 'running',
isStepSuccess: stepStatusInfo.status === 'success',
isStepIdle: stepStatusInfo.status === 'idle',
diff --git a/public/app/features/provisioning/Wizard/types.ts b/public/app/features/provisioning/Wizard/types.ts
index 7b77e277ffa..fd9fcd00f1c 100644
--- a/public/app/features/provisioning/Wizard/types.ts
+++ b/public/app/features/provisioning/Wizard/types.ts
@@ -1,6 +1,6 @@
import { RepositorySpec, SyncOptions } from 'app/api/clients/provisioning/v0alpha1';
-import { RepositoryFormData } from '../types';
+import { ProvisioningErrorInfo, RepositoryFormData } from '../types';
export type WizardStep = 'connection' | 'bootstrap' | 'finish' | 'synchronize';
@@ -26,5 +26,7 @@ export interface ModeOption {
subtitle: string;
}
-export type StepStatus = 'idle' | 'running' | 'error' | 'success';
-export type StepStatusInfo = { status: StepStatus } | { status: 'error'; error: string };
+export type StepStatusInfo =
+ | { status: 'idle' | 'running' | 'success' }
+ | { status: 'error'; error: string | ProvisioningErrorInfo }
+ | { status: 'warning'; warning: string | ProvisioningErrorInfo };
diff --git a/public/app/features/provisioning/types.ts b/public/app/features/provisioning/types.ts
index 516beb0dc67..8f8ee2df385 100644
--- a/public/app/features/provisioning/types.ts
+++ b/public/app/features/provisioning/types.ts
@@ -89,3 +89,8 @@ export type HistoryListResponse = {
metadata?: Record;
items?: HistoryItem[];
};
+
+export interface ProvisioningErrorInfo {
+ title?: string;
+ message?: string | string[];
+}
diff --git a/public/locales/en-US/grafana.json b/public/locales/en-US/grafana.json
index 8a70d10f52d..4de18dad330 100644
--- a/public/locales/en-US/grafana.json
+++ b/public/locales/en-US/grafana.json
@@ -11070,10 +11070,10 @@
"title-instant-updates-requests-webhooks": "Instant updates and pull requests with webhooks.",
"title-visual-previews-in-pull-requests": "Visual previews in pull requests with image rendering"
},
+ "error-title-default": "Error",
"expanded-row": {
"job-specification": "Job Specification",
- "summary": "Summary",
- "title-error": "Error"
+ "summary": "Summary"
},
"features-list": {
"actions": {
@@ -11218,10 +11218,12 @@
"starting": "Starting...",
"status": {
"title-error-running-job": "Error running job",
- "title-job-completed-successfully": "Job completed successfully",
"title-warning-running-job": "Job completed with warnings"
},
- "summary": "Summary"
+ "summary": "Summary",
+ "title": {
+ "error-fetching-active-job": "Error fetching active job"
+ }
},
"local": {
"path-description": "Local file system path to the repository",
@@ -11387,6 +11389,7 @@
"go-to": "Go to",
"make-sure": "Make sure to include these permissions"
},
+ "warning-title-default": "Warning",
"wizard": {
"alert-point-1": "Resources won't be able to be created, edited, or deleted during this process. In the last step, they will disappear.",
"alert-point-2": "Once provisioning is complete, resources will reappear and be managed through external storage.",