import { openSwitchPrompt } from '@@/modals/SwitchPrompt'; import { buildConfirmButton } from '@@/modals/utils'; export async function confirmUpdateAppIngress( ingressesToUpdate: Array, servicePortsToUpdate: Array ) { const hasOneIngress = ingressesToUpdate.length === 1; const hasOnePort = servicePortsToUpdate.length === 1; const rulePlural = !hasOneIngress ? 'rules' : 'rule'; const noMatchSentence = !hasOnePort ? `Service ports in this application no longer match the ingress ${rulePlural}.` : `A service port in this application no longer matches the ingress ${rulePlural} which may break ingress rule paths.`; const inputLabel = `Update ingress ${rulePlural} to match the service port changes`; const result = await openSwitchPrompt('Are you sure?', inputLabel, { message: ( ), confirmButton: buildConfirmButton('Update'), 'data-cy': 'kube-update-ingress-prompt-switch', }); return result ? { noMatch: result.value } : undefined; }