mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 20:27:12 +00:00
misc: added loading state
This commit is contained in:
+5
-1
@@ -9,7 +9,7 @@ type Props = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const CamundaDestinationSyncCol = ({ secretSync }: Props) => {
|
export const CamundaDestinationSyncCol = ({ secretSync }: Props) => {
|
||||||
const { data: clusters } = useCamundaConnectionListClusters(secretSync.connectionId);
|
const { data: clusters, isPending } = useCamundaConnectionListClusters(secretSync.connectionId);
|
||||||
|
|
||||||
const { primaryText, secondaryText } = getSecretSyncDestinationColValues({
|
const { primaryText, secondaryText } = getSecretSyncDestinationColValues({
|
||||||
...secretSync,
|
...secretSync,
|
||||||
@@ -21,5 +21,9 @@ export const CamundaDestinationSyncCol = ({ secretSync }: Props) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (isPending) {
|
||||||
|
return <SecretSyncTableCell primaryText="Loading cluster info..." secondaryText="Cluster" />;
|
||||||
|
}
|
||||||
|
|
||||||
return <SecretSyncTableCell primaryText={primaryText} secondaryText={secondaryText} />;
|
return <SecretSyncTableCell primaryText={primaryText} secondaryText={secondaryText} />;
|
||||||
};
|
};
|
||||||
|
|||||||
+5
-1
@@ -7,11 +7,15 @@ type Props = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const CamundaSyncDestinationSection = ({ secretSync }: Props) => {
|
export const CamundaSyncDestinationSection = ({ secretSync }: Props) => {
|
||||||
const { data: clusters } = useCamundaConnectionListClusters(secretSync.connectionId);
|
const { data: clusters, isPending } = useCamundaConnectionListClusters(secretSync.connectionId);
|
||||||
const {
|
const {
|
||||||
destinationConfig: { clusterUUID }
|
destinationConfig: { clusterUUID }
|
||||||
} = secretSync;
|
} = secretSync;
|
||||||
|
|
||||||
|
if (isPending) {
|
||||||
|
return <GenericFieldLabel label="Cluster">Loading...</GenericFieldLabel>;
|
||||||
|
}
|
||||||
|
|
||||||
const clusterName = clusters?.find((cluster) => cluster.uuid === clusterUUID)?.name;
|
const clusterName = clusters?.find((cluster) => cluster.uuid === clusterUUID)?.name;
|
||||||
return <GenericFieldLabel label="Cluster">{clusterName ?? clusterUUID}</GenericFieldLabel>;
|
return <GenericFieldLabel label="Cluster">{clusterName ?? clusterUUID}</GenericFieldLabel>;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user