diff --git a/src/dashboard/Settings/Modals/editParseVersionModal.react.js b/src/dashboard/Settings/Modals/editParseVersionModal.react.js index 9e76e957ed..23a776f45b 100644 --- a/src/dashboard/Settings/Modals/editParseVersionModal.react.js +++ b/src/dashboard/Settings/Modals/editParseVersionModal.react.js @@ -16,6 +16,9 @@ export const EditParseVersionModal = ({ context, setParentState, currentParseVer const [dropdownOpen, setDropdownOpen] = useState(false); const [note, setNote] = useState(''); const [noteColor, setNoteColor] = useState('red'); + const [migrationLinks, setMigrationLinks] = useState([]); + + const isGDPR = !!(context && context.custom && context.custom.isGDPR); const parseDependencies = (deps) => { if (!deps) { @@ -66,7 +69,7 @@ export const EditParseVersionModal = ({ context, setParentState, currentParseVer useEffect(() => { setProcessing(true); - context.supportedParseServerVersionsForApp() + const versionsPromise = context.supportedParseServerVersionsForApp() .then((data) => { const versions = Array.isArray(data) ? data : (data.results || []); setParseVersions(versions); @@ -77,13 +80,28 @@ export const EditParseVersionModal = ({ context, setParentState, currentParseVer setNote(e.error || 'Failed to load versions'); console.log('e', e); setNoteColor('red'); + }); + + // Migration links are best-effort: if they fail we still show the version picker. + const linksPromise = context.parseServerMigrationLinks() + .then((data) => { + const links = Array.isArray(data) ? data : (data?.results || []); + setMigrationLinks(links); }) - .finally(() => setProcessing(false)); + .catch(() => { + setMigrationLinks([]); + }); + + Promise.all([versionsPromise, linksPromise]).finally(() => setProcessing(false)); }, []); const npmModules = parseDependencies(selectedVersion?.dependencies ?? selectedVersion?.npmModules); const hasSelectedVersion = !!selectedVersion?.version; + const visibleMigrations = isGDPR + ? [] + : (migrationLinks || []).filter((m) => m && m.link && m.version !== selectedVersion?.version); + const close = () => setParentState({ showEditParseVersionModal: false }); const save = async () => { @@ -126,6 +144,44 @@ export const EditParseVersionModal = ({ context, setParentState, currentParseVer
{m.description}
+ )} +