MCPcopy Create free account
hub / github.com/error311/FileRise / addEmptyPortalRow

Function addEmptyPortalRow

public/js/adminPortals.js:1704–1736  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1702}
1703
1704function addEmptyPortalRow() {
1705 if (!__portalsCache || typeof __portalsCache !== 'object') {
1706 __portalsCache = {};
1707 }
1708
1709 let base = 'portal-' + Math.random().toString(36).slice(2, 8);
1710 let slug = base;
1711 let i = 1;
1712 while (__portalsCache[slug]) {
1713 slug = `${base}-${i++}`;
1714 }
1715
1716 __portalsCache[slug] = {
1717 label: 'New client portal',
1718 folder: '',
1719 sourceId: getDefaultPortalSourceId(),
1720 clientEmail: '',
1721 uploadOnly: true,
1722 allowDownload: false,
1723 allowSubfolders: false,
1724 expiresAt: '',
1725 portalUser: {
1726 create: true,
1727 preset: 'match',
1728 username: ''
1729 },
1730 _isNewPortal: true
1731 };
1732
1733 // After re-render, auto-focus this portal's folder field
1734 __portalSlugToFocus = slug;
1735 loadClientPortalsList(true);
1736}
1737
1738// ─────────────────────
1739// Folder picker helpers

Callers

nothing calls this directly

Calls 2

getDefaultPortalSourceIdFunction · 0.85
loadClientPortalsListFunction · 0.85

Tested by

no test coverage detected