mirror of
https://github.com/Kingsrook/qqq-frontend-material-dashboard.git
synced 2025-07-21 22:58:43 +00:00
Add some urlencoding of primary keys in query, view, and run process; updated qqq-frontend-core to also do more urlencoding
This commit is contained in:
@ -76,7 +76,7 @@ interface Props
|
||||
isModal?: boolean;
|
||||
isWidget?: boolean;
|
||||
isReport?: boolean;
|
||||
recordIds?: string | QQueryFilter;
|
||||
recordIds?: string[] | QQueryFilter;
|
||||
closeModalHandler?: (event: object, reason: string) => void;
|
||||
forceReInit?: number;
|
||||
overrideLabel?: string;
|
||||
@ -1082,8 +1082,10 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
|
||||
let queryStringPairsForInit = [];
|
||||
if (urlSearchParams.get("recordIds"))
|
||||
{
|
||||
const recordIdsFromQueryString = urlSearchParams.get("recordIds").split(",");
|
||||
const encodedRecordIds = recordIdsFromQueryString.map(r => encodeURIComponent(r)).join(",");
|
||||
queryStringPairsForInit.push("recordsParam=recordIds");
|
||||
queryStringPairsForInit.push(`recordIds=${urlSearchParams.get("recordIds")}`);
|
||||
queryStringPairsForInit.push(`recordIds=${encodedRecordIds}`);
|
||||
}
|
||||
else if (urlSearchParams.get("filterJSON"))
|
||||
{
|
||||
@ -1097,16 +1099,17 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
|
||||
// }
|
||||
else if (recordIds)
|
||||
{
|
||||
if (typeof recordIds === "string")
|
||||
{
|
||||
queryStringPairsForInit.push("recordsParam=recordIds");
|
||||
queryStringPairsForInit.push(`recordIds=${recordIds}`);
|
||||
}
|
||||
else if (recordIds instanceof QQueryFilter)
|
||||
if (recordIds instanceof QQueryFilter)
|
||||
{
|
||||
queryStringPairsForInit.push("recordsParam=filterJSON");
|
||||
queryStringPairsForInit.push(`filterJSON=${JSON.stringify(recordIds)}`);
|
||||
}
|
||||
else if (typeof recordIds === "object" && recordIds.length)
|
||||
{
|
||||
const encodedRecordIds = recordIds.map(r => encodeURIComponent(r)).join(",");
|
||||
queryStringPairsForInit.push("recordsParam=recordIds");
|
||||
queryStringPairsForInit.push(`recordIds=${encodedRecordIds}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (tableVariantLocalStorageKey && localStorage.getItem(tableVariantLocalStorageKey))
|
||||
@ -1162,7 +1165,7 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
|
||||
|
||||
if (tableMetaData)
|
||||
{
|
||||
queryStringPairsForInit.push(`tableName=${tableMetaData.name}`);
|
||||
queryStringPairsForInit.push(`tableName=${encodeURIComponent(tableMetaData.name)}`);
|
||||
}
|
||||
|
||||
try
|
||||
|
Reference in New Issue
Block a user