Skip to content

Commit

Permalink
add schema metadata (#224)
Browse files Browse the repository at this point in the history
Co-authored-by: Mailn Nifeli Snieske <[email protected]>
  • Loading branch information
malinnsnieske and Mailn Nifeli Snieske authored Jan 15, 2025
1 parent a42f9cc commit 0683be2
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions frisk.config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,33 @@ export async function getConfig(): Promise<FriskConfig> {
return { displayValue: "Utviklerportalen" };
},
},
{
key: "rr-skjema",
type: "text",
displayName: "Skjema (legacy)",
label: "Regelrett skjema",
showOn: "readOnly",
isRequired: false,
placeholder: "Sett inn skjema",
inheritFromParent: false,
isDeletable: true,
getDisplayValue: async (input) => {
const [contextId, tableName, __] = input.value.split(":splitTarget:");
const searchParams = new URLSearchParams({
redirectBackUrl: window.location.href,
redirectBackTitle: "Funksjonsregisteret",
});
const url = `${getregelrettFrontendUrl()}/context/${contextId}?${searchParams.toString()}`;
return {
displayValue: tableName.replaceAll("+", " "),
value: url,
displayOptions: {
type: "url",
isExternal: false,
},
};
},
},
...schemas.map(
(schema): InputMetadata => ({
key: schema.id,
Expand Down

0 comments on commit 0683be2

Please sign in to comment.