|
306 | 306 | otNoFurtherConfigurationText.className = 'fs-3';
|
307 | 307 | // Append to target container
|
308 | 308 | 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); |
309 | 466 | } else if (otObjectType === 'clientAdministrator') {
|
310 | 467 | document.getElementById('objectWidthDropdown').selectedIndex = 1;
|
311 | 468 | let otNoFurtherConfigurationText = document.createElement('p');
|
|
387 | 544 | }
|
388 | 545 | } else if (otObjectType === 'masScore') {
|
389 | 546 | otObjectDefinition.width = 0;
|
| 547 | + } else if (otObjectType === 'scrScore') { |
| 548 | + otObjectDefinition.width = 0; |
390 | 549 | } else if (otObjectType === 'clientAdministrator') {
|
391 | 550 | 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; |
392 | 557 | } else if (otObjectType === 'portalBuilder') {
|
393 | 558 | otObjectDefinition.width = 0;
|
394 | 559 | }
|
|
557 | 722 | objectTypeLayout(mode, this.options[this.selectedIndex].value, olObjectDefinition, olLayoutFileURI, olFolderURI);
|
558 | 723 | }
|
559 | 724 | // 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"] |
561 | 726 | for (const objectType in objectTypes) {
|
562 | 727 | let objectTypeOption = document.createElement('option');
|
563 | 728 | objectTypeOption.value = objectTypes[objectType];
|
|
0 commit comments