message: Show the new resource name, esp. when using generateName
diff: @@ -31,7 +31,7 @@ const reactPropFix = {
  translate: 'no',
  };
  -export const ImportYAMLPageStatus: React.FC<ImportYAMLStatusProps> = ({ errors, inFlight }) => {
  +export const ImportYAMLPageStatus: React.FC<ImportYAMLPageStatusProps> = ({ errors, inFlight }) => {
  const { t } = useTranslation();
  let StatusBlock: React.ReactNode;
  @@ -88,7 +88,7 @@ export const ImportYAMLResults: React.FC<ImportYAMLResultsProps> = ({
  retryFailed,
  }) => {
  const { t } = useTranslation();
  - const [importStatus, setImportStatus] = React.useState<ImportYAMLResourceStatusProps[]>(
  + const [importStatus, setImportStatus] = React.useState<ImportYAMLStatus[]>(
  importResources.map(() => ({
  creating: true,
  message: t('public~Creating'),
  @@ -102,7 +102,7 @@ export const ImportYAMLResults: React.FC<ImportYAMLResultsProps> = ({
  setImportStatus(
  results.map((result) => {
  if (result.status === 'fulfilled') {
  - return { creating: false, message: t('public~Created') };
  + return { creating: false, result: result.result, message: t('public~Created') };
  }
  if (result.status === 'rejected') {
  return {
  @@ -150,12 +150,19 @@ export const ImportYAMLResults: React.FC<ImportYAMLResultsProps> = ({
  </Tr>
  </Thead>
  <Tbody {...reactPropFix}>
  - {importResources.map((resource, index) => (
  - <Tr key={`${resource.metadata.name}-${resource.kind}`} {...reactPropFix}>
  + {importResources.map((importResource, index) => {
  + const status = importStatus[index];
  + const resource = status.result || importResource;
  + const name =
  + !resource.metadata.name && resource.metadata.generateName
  + ? `${resource.metadata.generateName}...`
  + : resource.metadata.name;
  + return (
  + <Tr key={index} {...reactPropFix}>
  <Td {...reactPropFix}>
  <ResourceLink
  kind={referenceFor(resource) || resource.kind}
  - name={resource.metadata.name}
  + name={name}
  namespace={resource.metadata?.namespace}
  linkTo={!inFlight && !importStatus[index].error}
  />
  @@ -168,14 +175,11 @@ export const ImportYAMLResults: React.FC<ImportYAMLResultsProps> = ({
  )}
  </Td>
  <Td {...reactPropFix}>
  - <ImportYAMLResourceStatus
  - creating={importStatus[index].creating}
  - error={importStatus[index].error}
  - message={importStatus[index].message}
  - />
  + <ImportYAMLResourceStatus {...status} />
  </Td>
  </Tr>
  - ))}
  + );
  + })}
  </Tbody>
  </TableComposable>
  {!inFlight && (
  @@ -210,7 +214,13 @@ export const ImportYAMLResults: React.FC<ImportYAMLResultsProps> = ({
  );
  };
  -type ImportYAMLStatusProps = {
  +type ImportYAMLStatus = {
  + creating: boolean;
  + result?: any;
  + error?: boolean;
  + message: string;
  +};
  +type ImportYAMLPageStatusProps = {
  errors?: boolean;
  inFlight: boolean;
  };
  