Skip to content

Commit 3634fa7

Browse files
committed
Update Portal Builder
Signed-off-by: David Weik <geekupyourlife@gmail.com>
1 parent b233b70 commit 3634fa7

File tree

4 files changed

+202
-3
lines changed

4 files changed

+202
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## SAS Portal Framework for SAS Viya v1.2.0
4+
5+
- Add: all currently supported objects to the Portal Builder object
6+
37
## SAS Portal Framework for SAS Viya v1.1.0
48

59
- Add: Data Product Registry object

language/de.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,22 @@
5151
"saveObjectButton": "Objekt speichern",
5252
"createObjectButton": "Objekt hinzufügen",
5353
"deleteObjectButton": "Objekt löschen",
54-
"noFurtherConfigurationText": "Es gibt keine weiteren Konfigurationsoptionen für diesen Objekttyp"
54+
"noFurtherConfigurationText": "Es gibt keine weiteren Konfigurationsoptionen für diesen Objekttyp",
55+
"runCustomCodeComputeContextPlaceholder": "Bitte den exakten Compute Context Namen eingeben, z.B. SAS Studio compute context",
56+
"runCustomCodeCodeExplainer": "Unter diesem Link finden Sie mehr Information wie man hier Code einfügt",
57+
"runCustomCodeCodePlaceholder": "[`%let user='${searchParams.user}';`,\"proc print data=sashelp.class; run; quit;\"]",
58+
"customCodeActionBehavior": ["Daten eines Berichts aktualisieren", "Bericht aktualisieren"],
59+
"runCustomCodeActionExplainer": "Die ausgewählte Aktion kann auf einen Berichts-Element angewendet werden",
60+
"runCustomCodeActionElementPlaceholder": "Die ID des Berichtsobjektes, z.B. pageShorthand-obj-objectID",
61+
"runCustomCodeUnloadCodePlaceholder": "Die Syntax ist analog zu der vorherigen Code Eingabe",
62+
"dateProductSchemaURIExplainer": "Hier finden Sie die Dokumentation für den Data Product Schema",
63+
"dataProductSchemaURI": "URI des Data Product Schemas /files/files/UUID",
64+
"dataProductFolderURI": "URI des Data Product Ordners in den die Nutzer dieser Seite schreiben können müssen /folders/folders/UUID",
65+
"copyContentExplainer": "Hinzufügen von URI die in den zu erstellenden Ordner kopiert werden soll - /reports/reports und /files/files wird understützt",
66+
"copyContentAddingButton": "Weitere URIs hinzufügen",
67+
"copyContentURIPlaceholder": "/reports/reports/UUID oder /files/files/UUID",
68+
"dataProductOwnerFolderURI": "Angabe des Ornders in der die Liste der gekauften Produkte gespeichert werden soll",
69+
"dataProductHeaderAttributesPlaceholder": "Geben Sie wie folgt die Attribute an die sie im Header sehen wollen: ['dataType', 'sensitivityLevel']"
5570
},
5671
"masScore": {
5772
"moduleSelect": "Wähle ein MAS Modul",

language/en.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,22 @@
5151
"saveObjectButton": "Save object",
5252
"createObjectButton": "Create object",
5353
"deleteObjectButton": "Delete object",
54-
"noFurtherConfigurationText": "There are no further configuration options for this object type"
54+
"noFurtherConfigurationText": "There are no further configuration options for this object type",
55+
"runCustomCodeComputeContextPlaceholder": "Please enter the exact compute context name, e.g. SAS Studio compute context",
56+
"runCustomCodeCodeExplainer": "Check this link for more information on how to enter code here",
57+
"runCustomCodeCodePlaceholder": "[`%let user='${searchParams.user}';`,\"proc print data=sashelp.class; run; quit;\"]",
58+
"customCodeActionBehavior": ["Refresh report data", "Refresh report"],
59+
"runCustomCodeActionExplainer": "The choosen action will be applied to a specified report object",
60+
"runCustomCodeActionElementPlaceholder": "ID of the report object, e.g. pageShorthand-obj-objectID",
61+
"runCustomCodeUnloadCodePlaceholder": "The syntax is similiar to the previous way code was entered",
62+
"dateProductSchemaURIExplainer": "Find the documentation on how to create a data product schema here",
63+
"dataProductSchemaURI": "URI of the data product schema /files/files/UUID",
64+
"dataProductFolderURI": "URI of the data product folder for which the user of this page require write access /folders/folders/UUID",
65+
"copyContentExplainer": "Add URIs of content that should be copied over - /reports/reports and /files/files are supported",
66+
"copyContentAddingButton": "Add additional URIs",
67+
"copyContentURIPlaceholder": "/reports/reports/UUID or /files/files/UUID",
68+
"dataProductOwnerFolderURI": "Enter the folder where the product purchases are stored",
69+
"dataProductHeaderAttributesPlaceholder": "Enter the attributes you want in the data like this: ['dataType', 'sensitivityLevel']"
5570
},
5671
"masScore": {
5772
"moduleSelect": "Please select a MAS Module",

static/portalBuilder.html

Lines changed: 166 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,163 @@
306306
otNoFurtherConfigurationText.className = 'fs-3';
307307
// Append to target container
308308
otContainer.appendChild(otNoFurtherConfigurationText);
309+
} else if (otObjectType === 'scrScore') {
310+
document.getElementById('objectWidthDropdown').selectedIndex = 1;
311+
let otNoFurtherConfigurationText = document.createElement('p');
312+
otNoFurtherConfigurationText.innerText = `${window.portalBuilderLanguage?.noFurtherConfigurationText}`;
313+
otNoFurtherConfigurationText.className = 'fs-3';
314+
// Append to target container
315+
otContainer.appendChild(otNoFurtherConfigurationText);
316+
} else if (otObjectType === 'runCustomCode') {
317+
// computeContext, code, action (refreshData, reloadReport), actionElement, unloadCode
318+
// Compute Context
319+
let otComputeContext = document.createElement('input');
320+
otComputeContext.type = 'text';
321+
otComputeContext.className = 'form-control';
322+
otComputeContext.id = 'otComputeContext';
323+
otComputeContext.value = otObjectDefinition?.computeContext === undefined ? '' : otObjectDefinition?.computeContext;
324+
otComputeContext.placeholder = `${window.portalBuilderLanguage?.runCustomCodeComputeContextPlaceholder}`;
325+
// Code
326+
let otCodeExplainer = document.createElement('a');
327+
otCodeExplainer.href = 'https://sassoftware.github.io/sas-portal-framework-for-sas-viya/Objects/run-custom-code-object';
328+
otCodeExplainer.target = '_blank';
329+
otCodeExplainer.rel = 'noopener noreferrer';
330+
otCodeExplainer.innerText = `${window.portalBuilderLanguage?.runCustomCodeCodeExplainer}`;
331+
let otCode = document.createElement('input');
332+
otCode.type = 'text';
333+
otCode.className = 'form-control';
334+
otCode.id = 'otCode';
335+
otCode.value = otObjectDefinition?.code === undefined ? '' : otObjectDefinition?.code;
336+
otCode.placeholder = `${window.portalBuilderLanguage?.runCustomCodeCodePlaceholder}`;
337+
// Action
338+
let otActionBehaviorExplainer = document.createElement('p');
339+
otActionBehaviorExplainer.innerText = `${window.portalBuilderLanguage?.runCustomCodeActionExplainer}`;
340+
let otActionBehaviorDropdown = document.createElement('select');
341+
otActionBehaviorDropdown.id = 'otActionBehaviorDropdown';
342+
otActionBehaviorDropdown.setAttribute('class', 'form-select');
343+
let actionBehaviorDictionary = [
344+
{"value": "refreshData", "text": `${window.portalBuilderLanguage?.customCodeActionBehavior[0]}`},
345+
{"value": "reloadReport", "text": `${window.portalBuilderLanguage?.customCodeActionBehavior[1]}`}
346+
]
347+
for (const actionBehaviorElement in actionBehaviorDictionary) {
348+
let actionBehaviorOption = document.createElement('option');
349+
actionBehaviorOption.value = actionBehaviorDictionary[actionBehaviorElement]?.value;
350+
actionBehaviorOption.innerText = actionBehaviorDictionary[actionBehaviorElement]?.text;
351+
otActionBehaviorDropdown.append(actionBehaviorOption);
352+
}
353+
otActionBehaviorDropdown.selectedIndex = otObjectDefinition.action === 'refreshData' ? 'refreshData' : 'reloadReport';
354+
// Action Element
355+
let otActionElement = document.createElement('input');
356+
otActionElement.type = 'text';
357+
otActionElement.className = 'form-control';
358+
otActionElement.id = 'otActionElement';
359+
otActionElement.value = otObjectDefinition?.actionElement === undefined ? '' : otObjectDefinition?.actionElement;
360+
otActionElement.placeholder = `${window.portalBuilderLanguage?.runCustomCodeActionElementPlaceholder}`;
361+
// Unload Code
362+
let otUnloadCodeElement = document.createElement('input');
363+
otUnloadCodeElement.type = 'text';
364+
otUnloadCodeElement.className = 'form-control';
365+
otUnloadCodeElement.id = 'otUnloadCodeElement';
366+
otUnloadCodeElement.value = otObjectDefinition?.unloadCode === undefined ? '' : otObjectDefinition?.unloadCode;
367+
otUnloadCodeElement.placeholder = `${window.portalBuilderLanguage?.runCustomCodeUnloadCodePlaceholder}`;
368+
// Append to target container
369+
otContainer.appendChild(otComputeContext);
370+
otContainer.appendChild(otCodeExplainer);
371+
otContainer.appendChild(otCode);
372+
otContainer.appendChild(otActionBehaviorExplainer);
373+
otContainer.appendChild(otActionBehaviorDropdown);
374+
otContainer.appendChild(otActionElement);
375+
otContainer.appendChild(otUnloadCodeElement);
376+
} else if (otObjectType === 'dataProductRegistry') {
377+
// dataProductSchemaURI, dataProductFolderURI, dataProductNewFolderParentURI, dataProductCopyContent
378+
// Data Product Schema URI
379+
let otDateProductSchemaURIExplainer = document.createElement('a');
380+
otDateProductSchemaURIExplainer.href = 'https://sassoftware.github.io/sas-portal-framework-for-sas-viya/Objects/data-product-registry-object#data-product-schema';
381+
otDateProductSchemaURIExplainer.target = '_blank';
382+
otDateProductSchemaURIExplainer.rel = 'noopener noreferrer';
383+
otDateProductSchemaURIExplainer.innerText = `${window.portalBuilderLanguage?.dateProductSchemaURIExplainer}`;
384+
let otDateProductSchemaURI = document.createElement('input');
385+
otDateProductSchemaURI.type = 'text';
386+
otDateProductSchemaURI.className = 'form-control';
387+
otDateProductSchemaURI.id = 'otDateProductSchemaURI';
388+
otDateProductSchemaURI.value = otObjectDefinition?.dataProductSchemaURI === undefined ? '' : otObjectDefinition?.dataProductSchemaURI;
389+
otDateProductSchemaURI.placeholder = `${window.portalBuilderLanguage?.dataProductSchemaURI}`;
390+
// Data Product Folder URI
391+
let otDateProductFolderURI = document.createElement('input');
392+
otDateProductFolderURI.type = 'text';
393+
otDateProductFolderURI.className = 'form-control';
394+
otDateProductFolderURI.id = 'otDateProductFolderURI';
395+
otDateProductFolderURI.value = otObjectDefinition?.dataProductFolderURI === undefined ? '' : otObjectDefinition?.dataProductFolderURI;
396+
otDateProductFolderURI.placeholder = `${window.portalBuilderLanguage?.dataProductFolderURI}`;
397+
// Data Product New Folder Parent URI
398+
let otDataProductNewFolderParentURI = document.createElement('input');
399+
otDataProductNewFolderParentURI.type = 'text';
400+
otDataProductNewFolderParentURI.className = 'form-control';
401+
otDataProductNewFolderParentURI.id = 'otDataProductNewFolderParentURI';
402+
otDataProductNewFolderParentURI.value = otObjectDefinition?.dataProductFolderURI === undefined ? '' : otObjectDefinition?.dataProductFolderURI;
403+
otDataProductNewFolderParentURI.placeholder = `${window.portalBuilderLanguage?.dataProductFolderURI}`;
404+
// Data Product Copy Content
405+
let otCopyContentContainer = document.createElement('div');
406+
otCopyContentContainer.id = 'otCopyContentContainer';
407+
let otCopyContentExplainer = document.createElement('p');
408+
otCopyContentExplainer.innerText = `${window.portalBuilderLanguage?.copyContentExplainer}`;
409+
let otCopyContentAddingButton = document.createElement('button');
410+
otCopyContentAddingButton.setAttribute('type', 'button');
411+
otCopyContentAddingButton.setAttribute('class', 'btn btn-primary');
412+
otCopyContentAddingButton.innerText = `${window.portalBuilderLanguage?.copyContentAddingButton}`;
413+
otLinkAddingButton.onclick = async function () {
414+
let otCopyContentURI= document.createElement('input');
415+
otCopyContentURI.type = 'text';
416+
otCopyContentURI.className = 'form-control';
417+
otCopyContentURI.placeholder = `${window.portalBuilderLanguage?.copyContentURIPlaceholder}`;
418+
let otBreakLine = document.createElement('br');
419+
otCopyContentContainer.appendChild(otBreakLine);
420+
otCopyContentContainer.appendChild(otCopyContentURI);
421+
}
422+
if(otObjectDefinition?.dataProductCopyContent?.length !== undefined) {
423+
for(const dataProductCopyContent in otObjectDefinition.dataProductCopyContent) {
424+
let otURIInput = document.createElement('input');
425+
otURIInput.type = 'text';
426+
otURIInput.className = 'form-control';
427+
otURIInput.value = otObjectDefinition.dataProductCopyContent[dataProductCopyContent];
428+
let otBreakLine = document.createElement('br');
429+
otCopyContentContainer.appendChild(otBreakLine);
430+
otCopyContentContainer.appendChild(otURIInput);
431+
}
432+
}
433+
// Append to target container
434+
otContainer.appendChild(otDateProductSchemaURIExplainer);
435+
otContainer.appendChild(otDateProductSchemaURI);
436+
otContainer.appendChild(otDateProductFolderURI);
437+
otContainer.appendChild(otDataProductNewFolderParentURI);
438+
otContainer.appendChild(otCopyContentContainer);
439+
} else if (otObjectType === 'dataProductMarketplace') {
440+
// dataProductSchemaURI, dataProductFolderURI, dataProductHeaderAttributes
441+
// Data Product Schema URI
442+
let otDateProductSchemaURI = document.createElement('input');
443+
otDateProductSchemaURI.type = 'text';
444+
otDateProductSchemaURI.className = 'form-control';
445+
otDateProductSchemaURI.id = 'otDateProductSchemaURI';
446+
otDateProductSchemaURI.value = otObjectDefinition?.dataProductSchemaURI === undefined ? '' : otObjectDefinition?.dataProductSchemaURI;
447+
otDateProductSchemaURI.placeholder = `${window.portalBuilderLanguage?.dataProductSchemaURI}`;
448+
// Data Product Folder URI
449+
let otDataProductOwnerFolderURI = document.createElement('input');
450+
otDataProductOwnerFolderURI.type = 'text';
451+
otDataProductOwnerFolderURI.className = 'form-control';
452+
otDataProductOwnerFolderURI.id = 'otDataProductOwnerFolderURI';
453+
otDataProductOwnerFolderURI.value = otObjectDefinition?.dataProductFolderURI === undefined ? '' : otObjectDefinition?.dataProductFolderURI;
454+
otDataProductOwnerFolderURI.placeholder = `${window.portalBuilderLanguage?.dataProductOwnerFolderURI}`;
455+
// Data Product Header Attributes
456+
let otDataProductHeaderAttributes = document.createElement('input');
457+
otDataProductHeaderAttributes.type = 'text';
458+
otDataProductHeaderAttributes.className = 'form-control';
459+
otDataProductHeaderAttributes.id = 'otDataProductHeaderAttributes';
460+
otDataProductHeaderAttributes.value = otObjectDefinition?.dataProductHeaderAttributes === undefined ? '' : otObjectDefinition?.dataProductHeaderAttributes;
461+
otDataProductHeaderAttributes.placeholder = `${window.portalBuilderLanguage?.dataProductHeaderAttributes}`;
462+
// Append to target container
463+
otContainer.appendChild(otDateProductSchemaURI);
464+
otContainer.appendChild(otDataProductOwnerFolderURI);
465+
otContainer.appendChild(otDataProductHeaderAttributes);
309466
} else if (otObjectType === 'clientAdministrator') {
310467
document.getElementById('objectWidthDropdown').selectedIndex = 1;
311468
let otNoFurtherConfigurationText = document.createElement('p');
@@ -387,8 +544,16 @@
387544
}
388545
} else if (otObjectType === 'masScore') {
389546
otObjectDefinition.width = 0;
547+
} else if (otObjectType === 'scrScore') {
548+
otObjectDefinition.width = 0;
390549
} else if (otObjectType === 'clientAdministrator') {
391550
otObjectDefinition.width = 0;
551+
} else if (otObjectType === 'runCustomCode') {
552+
otObjectDefinition.width = 0;
553+
} else if (otObjectType === 'dataProductRegistry') {
554+
otObjectDefinition.width = 0;
555+
} else if (otObjectType === 'dataProductMarketplace') {
556+
otObjectDefinition.width = 0;
392557
} else if (otObjectType === 'portalBuilder') {
393558
otObjectDefinition.width = 0;
394559
}
@@ -557,7 +722,7 @@
557722
objectTypeLayout(mode, this.options[this.selectedIndex].value, olObjectDefinition, olLayoutFileURI, olFolderURI);
558723
}
559724
// Add the type options
560-
let objectTypes = ["text", "linkList", "vaReport", "interactiveContent", "masScore", "clientAdministrator", "portalBuilder"]
725+
let objectTypes = ["text", "linkList", "vaReport", "interactiveContent", "masScore", "scrScore", "runCustomCode", "dataProductRegistry", "dataProductMarketplace", "clientAdministrator", "portalBuilder"]
561726
for (const objectType in objectTypes) {
562727
let objectTypeOption = document.createElement('option');
563728
objectTypeOption.value = objectTypes[objectType];

0 commit comments

Comments
 (0)