From 52fe1f4cdc527299a828621e5ca359f209fd4418 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 10 Feb 2025 15:29:32 -0800 Subject: [PATCH] qzoo --- README.md | 2 - checksum.txt | 2 +- sn_source_control.properties | 10 + ...dency_2d1bfa4bc327121097f6d075e401314f.xml | 18 + ...dency_a51bfa4bc327121097f6d075e401314c.xml | 18 + ...clone_5e993a07c327121097f6d075e40131ae.xml | 334 ++++++++++++++++ ...clone_6d1bfa4bc327121097f6d075e4013152.xml | 267 +++++++++++++ ...idget_02afae8bc3e3121097f6d075e4013123.xml | 77 ++++ ...idget_56993a07c327121097f6d075e40131aa.xml | 360 ++++++++++++++++++ ...idget_691bfa4bc327121097f6d075e4013149.xml | 282 ++++++++++++++ ...ilege_ea2b328bc327121097f6d075e401317a.xml | 22 ++ ...ilege_fdf9f60bc327121097f6d075e40131d9.xml | 22 ++ 12 files changed, 1411 insertions(+), 3 deletions(-) create mode 100644 sn_source_control.properties create mode 100644 update/m2m_sp_widget_dependency_2d1bfa4bc327121097f6d075e401314f.xml create mode 100644 update/m2m_sp_widget_dependency_a51bfa4bc327121097f6d075e401314c.xml create mode 100644 update/sp_rel_widget_clone_5e993a07c327121097f6d075e40131ae.xml create mode 100644 update/sp_rel_widget_clone_6d1bfa4bc327121097f6d075e4013152.xml create mode 100644 update/sp_widget_02afae8bc3e3121097f6d075e4013123.xml create mode 100644 update/sp_widget_56993a07c327121097f6d075e40131aa.xml create mode 100644 update/sp_widget_691bfa4bc327121097f6d075e4013149.xml create mode 100644 update/sys_scope_privilege_ea2b328bc327121097f6d075e401317a.xml create mode 100644 update/sys_scope_privilege_fdf9f60bc327121097f6d075e40131d9.xml diff --git a/README.md b/README.md index 03580841..455baff5 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # Generated files This repository contains generated files and a checksum. -**Do not edit the files in this repository outside of an instance of ServiceNow.** - If you find yourself unable to import your repository due to the presence of files edited outside an instance of ServiceNow, merge commits that mix files from different revisions, or other data that does not match the checksum, you may recover using either of the following techniques: * Remove the problem commits: 1. Clone your repository to a personal computer with the git command line tools installed and open a git command prompt in the repository root diff --git a/checksum.txt b/checksum.txt index 330d757d..493d7dbc 100644 --- a/checksum.txt +++ b/checksum.txt @@ -1 +1 @@ -vL4a2OmeZCGcRqgH8EBa4cARqlrfr4oq08X1XrND5FNlNUaQxFKFsMcu1-MrpgZfrpltN1VHJqjnzcg7qKvOFPFS9H3_qKGyWU8Ro7eAXm5TXwXi4biFJC4edVqkbpqom_9ZnwLw7HbeKHjni_Og0swtB3gilyfskE_wWVq_-aXTTumJTFyPxq3RrOXKQH3FUDIWi0RdXXBpXZnvCWQgWHBU5LzvXZQpmqfVYdtF_j3Jq5xYsFQA51DDOhjG4ws-eWzTTsj8aCK9sU-QHi-7K9agtfJ5IV80sICudJ5LPkKVi0KhHgMnbqEG0VFz7U1rqVe9U0ndccZXysVtpebYn8lhWfdqWAvKqz-p8PeMFf26ttFooY_ZIdr_-uPKOT9ga8D1QFrC_O7VAljwsLlcDSRxYqyAoFgRakYKSzMhDKKf3Grij19cgstj6ny0owevYxBozGto6altd3PsrFDLBxs1-WNPDbSXcS6Q9pAbvzpXQt0kacyymw_B_x7S9x0K0cFr4D6wra1ERnwpf4J5F-Oa-j3jXzVMXJDAoutIFdrU2YXqCiU6a4OVH6NjoKtJb608MekC_T_eToAxLTeSiM8ra8zI0YY_sM90mdo704CNVJsuuyj-UymArCQqomL9JvGV90-e9JB8mTuBaSsM7y9eoO26fXGH-UzmFPMsGDo \ No newline at end of file +JSgCS-gU8cPfjfu-mFtkVC_7uzTR4lKIZyvaRMCRDAWrXLuIMlvyruqgAFJENEggD4-_bSQADJkNOt7VNmcrbsstukzF33dOX1jfyD6LuxFG0uVPLJvqLve5a9i8WkWg_eAxXf2nHmld-YT99sz1gTUk-EhcddPSBBKGwCAlannFEQuNhv0cqAjGf-wkLk5mymTUR9fZVVEWrpLCD5pv90D7vP3f8tw68GI4iixt51qKvELp3o31fa9D1DGB5kGkzIcBly87VoYZ5UKWul2th1fnj9m3Nac2vFvkc8VtO6PSE7s7cKCqaQdrQLnyDJSyhxndsiEo5AuLJsud2vP9sT9QTfbemcyrAUhQZ4Eqzh7zrEPVrWl3PsNpZcd3G5J6r1dge0wkgSn-PtgITihWhxDAa8xuBNciiNBHE6WC-_3tn80bxt8-r0wOLCzq8L23BAn-wraFGhcHzfTutbXDGa2OVpOI5ZI8qwpNsRWKRuGVKW2XNaeqSMW_Uno-gilITZOuK5xdniNgzDwW-NUUOjBNePUepkQGUHih67aiOizwJZidk2Rhp1X3uecC1cWxRTXSUEnnMaXEI4DR6krojKLZlXOtNfTWCbdnDv8ly76lHD6YZbfn_X2nMGc5fJ4oPamoJIMZlCnDmkaVm114bW2C6gASpV3S5GNu-XUbjgE \ No newline at end of file diff --git a/sn_source_control.properties b/sn_source_control.properties new file mode 100644 index 00000000..a57e1194 --- /dev/null +++ b/sn_source_control.properties @@ -0,0 +1,10 @@ +############################################################# +# This ServiceNow-created file contains the path to the app in this repo +# path= +# For example, if the app content resides in a folder named x_my_custom_app, the path value would be: +# path=/x_my_custom_app +# Update the path value when you move the app to a new repo location. +############################################################ +# +#Mon Feb 10 15:27:11 PST 2025 +path= diff --git a/update/m2m_sp_widget_dependency_2d1bfa4bc327121097f6d075e401314f.xml b/update/m2m_sp_widget_dependency_2d1bfa4bc327121097f6d075e401314f.xml new file mode 100644 index 00000000..c111d150 --- /dev/null +++ b/update/m2m_sp_widget_dependency_2d1bfa4bc327121097f6d075e401314f.xml @@ -0,0 +1,18 @@ + + + e7f3f43c9f131200b18a7feea57fcf3b + 691bfa4bc327121097f6d075e4013149 + m2m_sp_widget_dependency + admin + 2025-02-10 21:37:46 + 2d1bfa4bc327121097f6d075e401314f + 0 + CAB Workbench - Misc.CAB + df5fd9a5090232007f44e1046c8ff69f + + df5fd9a5090232007f44e1046c8ff69f + m2m_sp_widget_dependency_2d1bfa4bc327121097f6d075e401314f + admin + 2025-02-10 21:37:46 + + diff --git a/update/m2m_sp_widget_dependency_a51bfa4bc327121097f6d075e401314c.xml b/update/m2m_sp_widget_dependency_a51bfa4bc327121097f6d075e401314c.xml new file mode 100644 index 00000000..eb761627 --- /dev/null +++ b/update/m2m_sp_widget_dependency_a51bfa4bc327121097f6d075e401314c.xml @@ -0,0 +1,18 @@ + + + 63d830f1eb10220034d1eeea1206feea + 691bfa4bc327121097f6d075e4013149 + m2m_sp_widget_dependency + admin + 2025-02-10 21:37:46 + a51bfa4bc327121097f6d075e401314c + 0 + CAB Workbench.CAB + df5fd9a5090232007f44e1046c8ff69f + + df5fd9a5090232007f44e1046c8ff69f + m2m_sp_widget_dependency_a51bfa4bc327121097f6d075e401314c + admin + 2025-02-10 21:37:46 + + diff --git a/update/sp_rel_widget_clone_5e993a07c327121097f6d075e40131ae.xml b/update/sp_rel_widget_clone_5e993a07c327121097f6d075e40131ae.xml new file mode 100644 index 00000000..758db26a --- /dev/null +++ b/update/sp_rel_widget_clone_5e993a07c327121097f6d075e40131ae.xml @@ -0,0 +1,334 @@ + + + 56993a07c327121097f6d075e40131aa + 2025-02-10 21:31:15 + 2025-02-10 21:31:15 + 31710c9243423110f6669c7385b8f25f + <?xml version="1.0" encoding="UTF-8"?><sp_widget><category>custom</category><client_script><![CDATA[api.controller=function($scope, spModal, spUtil) { + /* widget controller */ + var c = this; + + // Constants + var OPEN_RECORD_WIDGET_SYS_ID = c.data.openRecordWidget; + var OPEN_LIST_WIDGET_SYS_ID = c.data.openListWidget; + var PLAYBOOK_OPEN_RECORD = "PLAYBOOK#OPEN_RECORD"; + var PLAYBOOK_OPEN_LIST = "PLAYBOOK#OPEN_LIST"; + var PLAYBOOK_RECORD_GENERATED = "PLAYBOOK#RECORD_GENERATED"; + var PLAYBOOK_ADD_NOTIFICATIONS = "PLAYBOOK#ADD_NOTIFICATIONS"; + var PLAYBOOK_LINK_TO_DESTINATION = "PLAYBOOK#LINK_TO_DESTINATION"; + + // Setting height from data right away + var height = c.data.height; + $scope.iframeHeight = height; + + // Required Params + var table = c.data.table; + var sysId = c.data.sysId; + var layoutType = c.data.layoutType; + var playbookUIBPageUrl = c.data.playbookUIBPageUrl; + + // Optional Params + // All params are Kebab/Dashed case so we + // do not have convert the case in the loop + var params = { + "playbook-experience-id": c.data.playbookExperienceId, + "compact-mode" : c.data.compactMode, + "activity-view" : c.data.activityView, + "query" : c.data.query, + "full-width-cards" : c.data.fullWidthCards, + "hide-stage-picker" : c.data.hideStagePicker, + "number-of-stages" : c.data.numberOfStages, + "title": c.data.title, + "url-suffix": c.data.urlSuffix, + "extra-params": c.data.extraParams + }; + + // Theme variables + var theme = c.data.theme; + var themeVariant = c.data.themeVariant; + + // Base URL + // If playbookUIBPageUrl is not our default base do not use the layoutType param + var url = (playbookUIBPageUrl === "/now/playbook-portal/playbook") ? + playbookUIBPageUrl+"/"+table+"/"+sysId+"/"+layoutType : + playbookUIBPageUrl+"/"+table+"/"+sysId; + + // Add params to url if any are found that are truthy + for(var key in params) { + if(!params.hasOwnProperty(key) || !params[key]) continue; + + if(params[key] && !url.includes("params")) url += "/params"; + + if(params[key]) url += "/" + key + "/" + params[key]; + } + + // Adding theme variables to url if any are found that are truthy + // Example: ?themeId=31bf91ae07203010e03948f78ad30095&themeVariantId=1 + if(theme) + url += "?themeId=" + theme; + + if(theme && themeVariant) + url += "&themeVariantId=" + themeVariant; + + // setting the url used by the iframe here + $scope.iframeUrl = url; + + window.addEventListener("storage", function(event) { + + if(!event || !event.key) return; + + var key = event.key; + var newValue = event.newValue; + + if(key === PLAYBOOK_OPEN_RECORD) + openRecordInModal(newValue); + + if(key === PLAYBOOK_OPEN_LIST) + openListInModal(newValue); + + if(key === PLAYBOOK_RECORD_GENERATED) + handleRecordGenerator(newValue); + + if(key === PLAYBOOK_ADD_NOTIFICATIONS) + handleAddNotifications(newValue); + + if (key === PLAYBOOK_LINK_TO_DESTINATION) + handleLinkToDestination(newValue); + + }); + + function openModal(options) { + var modalOptions = options; + + spModal.open(modalOptions); + } + + function openRecordInModal(newValue) { + var value = JSON.parse(newValue); + + var widgetInput = { + table: value.table, + sys_id: value.sys_id, + isPopup: c.data.openRecordIsPopUp, + preventUrlUpdateOnSubmit: c.data.openRecordModalPreventUrlUpdateOnSubmit + }; + + if(c.data.openRecordModalView) + widgetInput.view = c.data.openRecordModalView; + + if(value.params && value.params.query) + widgetInput.query = value.params.query; + + var modalOptions = { + widget: OPEN_RECORD_WIDGET_SYS_ID, + widgetInput: widgetInput, + size: c.data.openRecordModalSize, + title: c.data.openRecordModalTitle, + message: c.data.openRecordModalMessage + }; + + if(c.data.openRecordModalButtons) + modalOptions.buttons = JSON.parse(c.data.openRecordModalButtons); + + // Open form widget in the spModal + openModal(modalOptions); + } + + function openListInModal(newValue) { + var value = JSON.parse(newValue); + + var widgetInput = { + table: value.table || value.fields && value.fields.table, + view: value.listView || value.params && value.params.listView, + filter: value.query || value.params && value.params.query + }; + + var modalOptions = { + widget: OPEN_LIST_WIDGET_SYS_ID, + widgetInput: widgetInput, + size: c.data.openListModalSize, + title: c.data.openListModalTitle, + message: c.data.openListModalMessage + }; + + if(c.data.openListModalButtons) + modalOptions.buttons = JSON.parse(c.data.openListModalButtons); + + // Open list widget in the spModal + openModal(modalOptions); + } + + function handleRecordGenerator(newValue) { + if(!newValue) return; + + var value = JSON.parse(newValue); + + if(!value) return; + + var urlParams = new URLSearchParams(window.location.search); + urlParams.set("sys_id", value.sysId); + urlParams.set("table", value.table); + + window.location.search = urlParams; + } + + function handleLinkToDestination(newValue) { + if(!newValue) return; + + var value = JSON.parse(newValue); + + if(!value || !value.external) return; + + window.open(value.external, value.targetRoute || '_blank'); + } + + function handleAddNotifications(newValue) { + if(!newValue) return; + + var value = JSON.parse(newValue); + + if(!value || !value.notifications) return; + + var notifications = value.notifications; + var INFO = "info"; + var ERROR = "error"; + var CRITICAL = "critical"; + + for(var i in notifications) { + var notification = notificationFactory(notifications[i]); + if(notification.type === INFO) { + spUtil.addInfoMessage(notification.message); + continue; + } + + if(notification.type === ERROR || notification.type === CRITICAL) { + spUtil.addErrorMessage(notification.message); + continue; + } + + if(notification.message) + spUtil.addTrivialMessage(notification.message); + } + + + } + + function notificationFactory(notification) { + + if(notification.status) { + var message = notification.content; + var header = notification.header; + + if(header && message) + message = header + " - " + message; + else if(header && !message) + message = header; + + return { + type: notification.status, + message: message + }; + } + + return notification; + } + +};]]></client_script><controller_as>c</controller_as><css/><data_table>sp_instance</data_table><demo_data/><description>Official widget to embed a Playbook into the Service Portal</description><docs/><field_list/><has_preview>true</has_preview><id>widget-playbook</id><internal>false</internal><link><![CDATA[function link(scope, element, attrs, controller) { + +}]]></link><name>Playbook</name><option_schema>[{"hint":"Height of the playbook. If not specified, it will be 850px","name":"height","section":"Presentation","label":"Height","type":"string"},{"hint":"Use this to override the url of the playbook UIB page. If not specified, it will be /now/playbook-portal/playbook","name":"playbook_uib_page_url","section":"Data","label":"Playbook UIB Page URL","type":"string"},{"hint":"The title of the Open Record modal. Will be empty if nothing is provided here.","name":"open_record_modal_title","section":"Presentation","label":"Open Record Modal Title","type":"string"},{"hint":"The message of the Open Record modal. Will be empty if nothing is provided here.","name":"open_record_modal_message","section":"Presentation","label":"Open Record Modal Message","type":"string"},{"hint":"The buttons of the Open Record modal. Will be empty if nothing is provided here. Needs to be valid JSON.","name":"open_record_modal_buttons","section":"Presentation","label":"Open Record Modal Buttons","type":"string"},{"displayValue":"Widget","hint":"The Sys ID of the widget for Open Record. Will be using form widget if nothing is provided here.","name":"open_record_modal_widget","section":"Data","default_value":"fd1f4ec347730200ba13a5554ee490c0","label":"Open Record Widget","type":"reference","value":"sp_widget","ed":{"reference":"sp_widget"}},{"hint":"The view to open the record in. This data will also come from the payload of Playbook Open Record.","name":"open_record_modal_view","section":"Presentation","label":"Open Record Modal View","type":"string"},{"hint":"Will show the reference picker inside the form if is pop up is true.","name":"open_record_is_pop_up","section":"Data","default_value":"true","label":"Open Record Is Pop Up","type":"boolean"},{"hint":"Will default to 'lg' if no other options is provided","name":"open_record_modal_size","section":"Presentation","label":"Open Record Modal Size","type":"choice","choices":[{"label":"sm","value":"sm"},{"label":"md","value":"md"},{"label":"lg","value":"lg"}]},{"hint":"The title of the Open List modal. Will be empty if nothing is provided here.","name":"open_list_modal_title","section":"Presentation","label":"Open List Modal Title","type":"string"},{"hint":"The message of the Open List modal. Will be empty if nothing is provided here.","name":"open_list_modal_message","section":"Presentation","label":"Open List Modal Message","type":"string"},{"hint":"The buttons of the Open List modal. Will be empty if nothing is provided here. Needs to be valid JSON.","name":"open_list_modal_buttons","section":"Presentation","label":"Open List Modal Buttons","type":"string"},{"displayValue":"Widget","hint":"The Sys ID of the widget for Open List. Will be using the Data Table from Instance Definition as a default.","name":"open_list_modal_widget","section":"Data","default_value":"38058ff1cb11020000f8d856634c9c8c","label":"Open List Widget","type":"reference","value":"sp_widget","ed":{"reference":"sp_widget"}},{"hint":"Will default to 'lg' if no other options is provided","name":"open_list_modal_size","section":"Presentation","label":"Open List Modal Size","type":"choice","choices":[{"label":"sm","value":"sm"},{"label":"md","value":"md"},{"label":"lg","value":"lg"}]},{"hint":"The activity view for your playbook","name":"activity_view","section":"Presentation","default_value":"focused","label":"Activity View","type":"choice","choices":[{"label":"focused","value":"focused"},{"label":"stacked","value":"stacked"}]},{"displayValue":"Playbook Experience","hint":"The playbook configuration record. If the value is in the url, then that will override what is in this field. If none is provided then the Global Playbook experience will be used.","name":"playbook_experience_id","section":"Presentation","default_value":"98e09a560f2200102920c912d4767e1a","label":"Playbook Experience ID","type":"reference","value":"sys_playbook_experience","ed":{"reference":"sys_playbook_experience"}},{"hint":"Prevent the url from updating when a new record is submitted from the open record modal","name":"open_record_modal_prevent_url_update_on_submit","section":"Presentation","default_value":"true","label":"Open Record Modal Prevent URL Update on Submit","type":"boolean"},{"hint":"Allows for arbitrary data to be passed from the widget to the underlying UIB page","name":"extra_params","section":"Data","default_value":"","label":"Extra Params","type":"string"}]</option_schema><public>false</public><roles>snc_external,snc_internal</roles><script><![CDATA[(function() { + // Get the portal record so it can used in multiple places + var portalRecord = $sp.getPortalRecord(); + + /* + * If the system property of ux_portal_theme_to_uib_theme_mapping exists that maps to the theme + * this widget is currently inside it will use that mapping record to set portal theme to a + * corresponding UXF theme + */ + function setThemeMapping() { + // Getting theme mapping via system property of ux_portal_theme_to_uib_theme_mapping + var themeID = portalRecord.getValue("theme"); // get the sys property themeID + + var gr = new GlideRecord("sys_properties"); + gr.addQuery("name","CONTAINS","ux_portal_theme_to_uib_theme_mapping."+themeID); + gr.orderByDesc("sys_created_on"); + gr.query(); + gr.next(); + + var mappingValues = gr.getValue("value"); + + if(mappingValues) { + var themeValues = mappingValues.split(","); + var uxTheme = themeValues[0] && themeValues[0].trim(); + var styleTheme = themeValues[1] && themeValues[1].trim(); + data.theme = uxTheme || null; + data.themeVariant = styleTheme || null; + } + } + + setThemeMapping(); + + // Required Params + data.table = $sp.getParameter("table") || "interaction"; + data.layoutType = $sp.getParameter("layoutType") || "monolith"; + data.sysId = $sp.getParameter("sys_id") || "-1"; + + // URL Suffix + data.urlSuffix = portalRecord.getDisplayValue("url_suffix") || null; + + // Optional Params + data.playbookExperienceId = $sp.getParameter("playbookExperienceId") || options.playbook_experience_id; + data.compactMode = $sp.getParameter("compactMode") || false; + data.activityView = $sp.getParameter("activityView") || options.activity_view || "focused"; + data.query = $sp.getParameter("query") || null; + data.fullWidthCards = $sp.getParameter("fullWidthCards") || false; + data.hideStagePicker = $sp.getParameter("hideStagePicker") || false; + data.numberOfStages = $sp.getParameter("numberOfStages") || null; + data.height = options.height ? options.height + "px" : "856px"; + data.title = $sp.getParameter("title") || null; + data.extraParams = options.extra_params || null; + + // Playbook UIB Page URL + data.playbookUIBPageUrl = options.playbook_uib_page_url || "/now/playbook-portal/playbook"; + + // Open Record + data.openRecordWidget = options.open_record_modal_widget || "fd1f4ec347730200ba13a5554ee490c0"; + data.openRecordModalSize = options.open_record_modal_size || "lg"; + data.openRecordModalTitle = options.open_record_modal_title || ""; + data.openRecordModalMessage = options.open_record_modal_message || ""; + data.openRecordModalButtons = options.open_record_modal_buttons || null; + data.openRecordModalView = options.open_record_modal_view || null; + data.openRecordIsPopUp = options.open_record_is_pop_up || true; + data.openRecordModalPreventUrlUpdateOnSubmit = (options.open_record_modal_prevent_url_update_on_submit === true || + options.open_record_modal_prevent_url_update_on_submit === "true") ? true : false; + + // Open List + data.openListWidget = options.open_list_modal_widget || "8ae61f55cb21020000f8d856634c9c93"; + data.openListModalSize = options.open_list_modal_size || "lg"; + data.openListModalTitle = options.open_list_modal_title || ""; + data.openListModalMessage = options.open_list_modal_message || ""; + data.openListModalButtons = options.open_list_modal_buttons || null; + + +})();]]></script><servicenow>false</servicenow><sys_class_name>sp_widget</sys_class_name><sys_created_by>admin</sys_created_by><sys_created_on>2023-10-24 18:23:08</sys_created_on><sys_id>31710c9243423110f6669c7385b8f25f</sys_id><sys_mod_count>137</sys_mod_count><sys_name>Playbook</sys_name><sys_package display_value="Playbook Experience" source="sn_playbook_exp">8c524e101b6e0010affd0e55cc4bcbed</sys_package><sys_policy>read</sys_policy><sys_scope display_value="Playbook Experience">8c524e101b6e0010affd0e55cc4bcbed</sys_scope><sys_update_name>sp_widget_31710c9243423110f6669c7385b8f25f</sys_update_name><sys_updated_by>admin</sys_updated_by><sys_updated_on>2024-05-22 20:41:22</sys_updated_on><template><![CDATA[<iframe + id="widget-playbook" + ng-src="{{iframeUrl}}" + sandbox="allow-forms allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-downloads" + width="100%" + height="{{iframeHeight}}" + frameBorder="0" +/> +]]></template></sp_widget> + sp_rel_widget_clone + admin + 2025-02-10 21:31:15 + 5e993a07c327121097f6d075e40131ae + 0 + 56993a07c327121097f6d075e40131aa + df5fd9a5090232007f44e1046c8ff69f + + df5fd9a5090232007f44e1046c8ff69f + sp_rel_widget_clone_5e993a07c327121097f6d075e40131ae + admin + 2025-02-10 21:31:15 + + diff --git a/update/sp_rel_widget_clone_6d1bfa4bc327121097f6d075e4013152.xml b/update/sp_rel_widget_clone_6d1bfa4bc327121097f6d075e4013152.xml new file mode 100644 index 00000000..44679e90 --- /dev/null +++ b/update/sp_rel_widget_clone_6d1bfa4bc327121097f6d075e4013152.xml @@ -0,0 +1,267 @@ + + + 691bfa4bc327121097f6d075e4013149 + 2025-02-10 21:37:46 + 2025-02-10 21:37:46 + a233c3669f531200b18a7feea57fcfcc + <?xml version="1.0" encoding="UTF-8"?><sp_widget><category>other</category><client_script><![CDATA[function($scope, runtimeState, meetingAgenda, CAB, i18n) { + // widget controller + var c = this; + var KEY = { + LEFT_ARROW: 37, + RIGHT_ARROW: 39, + }; + + $scope.hideFormButton = function() { + var hideFormViewButton = $scope.change && $scope.change.sys_class_name.value != "change_request"; + return hideFormViewButton; + }; + + $scope.hideCalendar = function() { + var hideCalendarViewButton = ($scope.change && $scope.change.sys_class_name.value != "change_request") || ($scope.change && (($scope.change.start_date && $scope.change.start_date.value === "") || ($scope.change.end_date && $scope.change.end_date.value === ""))); + if (hideCalendarViewButton && $scope.tab.selectedTabId === CAB.CAL_TAB) + $scope.tab.select(CAB.FORM_TAB); + return hideCalendarViewButton; + }; + + function clearTaskAndReset() { + $scope.change = null; + $scope.tab.select(CAB.FORM_TAB); + } + + function refreshAgendaItem(agendaItemId) { + if (!agendaItemId) { + $scope.agendaItem = null; + clearTaskAndReset(); + return; + } + + meetingAgenda.getAgendaItem(agendaItemId) + .then(function(agendaItem) { + $scope.agendaItem = agendaItem; + if (!agendaItem.task.record) { + clearTaskAndReset(); + return; + } + + $scope.change = agendaItem.task.record; + }, clearTaskAndReset); + } + + runtimeState.get($scope.data.meetingId) + .then(function(rs) { + $scope.rs = rs; + return meetingAgenda.get($scope.data.meetingId); + }) + .then(function(agenda) { + $scope.agenda = agenda; + + $scope.$watch(function() { + return runtimeState.getViewAgendaItem(); + }, refreshAgendaItem); + }); + + $scope.CAB = CAB; + $scope.aria = { + panelDesc: function() { + if (!$scope.change) + return; + + return i18n.format($scope.data.i18n.tabPanel, $scope.change.number.display_value); + }, + }; + + $scope.meeting = { + viewingChange: function() { + return runtimeState.getViewAgendaItem() ? true : false; + } + }; + + $scope.aItm = { + canReadTask: function() { + return $scope.agendaItem && $scope.agendaItem.task && $scope.agendaItem.task.record; + }, + }; + + $scope.tab = { + selected: function(tabId) { + return tabId === $scope.tab.selectedTabId; + }, + select: function(tabId) { + $scope.tab.selectedTabId = tabId; + }, + onClick: function($event, tabId) { + $scope.tab.select(tabId); + }, + onKeydown: function($event, tabId) { + if ($event.which === KEY.LEFT_ARROW || $event.which === KEY.RIGHT_ARROW) + if (!$scope.tab.selected(CAB.CAL_TAB)) { + $scope.tab.select(CAB.CAL_TAB); + document.getElementById(CAB.CAL_TAB).focus(); + } + else { + $scope.tab.select(CAB.FORM_TAB); + document.getElementById(CAB.FORM_TAB).focus(); + } + }, + selectedTabId: CAB.FORM_TAB + }; +}]]></client_script><controller_as>c</controller_as><css>.heading {&#13; + font-size: 14px;&#13; + height: 51px;&#13; + .title {&#13; + line-height: 30px;&#13; + vertical-align: middle;&#13; + }&#13; + background-color: $panel-default-heading-bg;&#13; + color: $gray-darker;&#13; + border-bottom: none;&#13; +}&#13; +&#13; +.cols:not(:first-child) {&#13; + border-left: 1px solid $color-lighter;&#13; +}&#13; +&#13; +.row {&#13; + display: table;&#13; + width: 100%;&#13; +}&#13; +&#13; +.cols {&#13; + float: none;&#13; + display: table-cell;&#13; + vertical-align: top;&#13; +}&#13; +&#13; +.btn-group {&#13; + .btn {&#13; + height: 100%;&#13; + color: $color-darkest;&#13; + background-color: $navbar-default-bg;&#13; + }&#13; + .focus-tab {&#13; + color: $color-darkest;&#13; + background-color: $navpage-nav-selected-color;&#13; + border-color: $color-accent !important;&#13; + z-index: 2;&#13; + }&#13; + .glyphicon-folder-close {&#13; + margin-top: -2px;&#13; + }&#13; + .glyphicon-calendar {&#13; + margin-top: -2px;&#13; + }&#13; +}&#13; +&#13; +.change-desc-wrap {&#13; + white-space: nowrap;&#13; + width: 600px;&#13; + text-overflow: ellipsis;&#13; + overflow: hidden;&#13; + display: inline-block;&#13; +}&#13; +&#13; +.panel {&#13; + margin-bottom: 0px !important;&#13; + .meeting-not-started {&#13; + height: 55px;&#13; + }&#13; +}&#13; +&#13; +.tab-body {&#13; + padding: 0;&#13; + min-height: 100px;&#13; + .row {&#13; + margin: 0;&#13; + .cols {&#13; + padding: 0;&#13; + }&#13; + }&#13; +}&#13; +</css><data_table>sp_instance</data_table><demo_data/><description/><docs/><field_list/><has_preview>false</has_preview><id>cab-change-tab</id><internal>false</internal><link/><name>CAB Workbench - Change Tab</name><option_schema/><public>false</public><roles/><script><![CDATA[(function() { + data.i18n = { + tabPanel: gs.getMessage('Tab panel for current Change {0}'), + tabPanelDefault: gs.getMessage('Current Change tab panel'), + showForm: gs.getMessage('Show form'), + currentChangeTabsGroup: gs.getMessage('Current Change tabs group') + }; + + data.widget = { + form: $sp.getWidget("cab-form-widget", {}), + calendar: $sp.getWidget("cab-change-calendar", {}) + }; + + data.meetingId = $sp.getParameter('sys_id'); // meeting id +})();]]></script><servicenow>false</servicenow><sys_class_name>sp_widget</sys_class_name><sys_created_by>admin</sys_created_by><sys_created_on>2016-05-13 11:42:13</sys_created_on><sys_id>a233c3669f531200b18a7feea57fcfcc</sys_id><sys_mod_count>216</sys_mod_count><sys_name>CAB Workbench - Change Tab</sys_name><sys_package display_value="Change Management - CAB Workbench" source="sn_change_cab">18351d53eb32120034d1eeea1206fe79</sys_package><sys_policy/><sys_scope display_value="Change Management - CAB Workbench">18351d53eb32120034d1eeea1206fe79</sys_scope><sys_update_name>sp_widget_a233c3669f531200b18a7feea57fcfcc</sys_update_name><sys_updated_by>admin</sys_updated_by><sys_updated_on>2021-03-25 11:11:02</sys_updated_on><template><![CDATA[<div role="region" tabindex="0" ng-attr-aria-label="{{aria.panelDesc() || c.data.i18n.tabPanelDefault}}"> +<div class="panel panel-default"> + <div class="panel-heading heading widget-heading" ng-class="{'meeting-not-started': !meeting.viewingChange()}"> + <div ng-if="aItm.canReadTask()" class="change-desc-wrap title"> + <span>{{change.number.display_value}} - <b>{{change.short_description.display_value}}</b></span> + </div> + <span ng-if="aItm.canReadTask()" class="pull-right"> + <div class="btn-group" role="tablist" aria-label="{{::c.data.i18n.currentChangeTabsGroup}}"> + <button id="cab-form-tab" class="btn btn-primary btn-sm" + ng-if="!hideFormButton()" + role="tab" aria-controls="cab-form-panel" aria-label="{{::c.data.i18n.showForm}}" + ng-attr-tabindex="{{tab.selected(CAB.FORM_TAB) ? 0 : -1}}" + ng-attr-aria-selected="{{tab.selected(CAB.FORM_TAB)}}" + + ng-class="{'focus-tab': tab.selected(CAB.FORM_TAB)}" + ng-keydown="tab.onKeydown($event, CAB.FORM_TAB)" + ng-click="tab.onClick($event, CAB.FORM_TAB)" + + uib-tooltip="{{::c.data.i18n.showForm}}" tooltip-placement="bottom" tooltip-append-to-body="true"> + <span class="glyphicon glyphicon-folder-close"></span> + <span class="sr-only">{{::c.data.i18n.showForm}}</span> + </button> + <button id="cab-cal-tab" class="btn btn-primary btn-sm" + ng-if="!hideCalendar()" + role="tab" aria-controls="cab-cal-panel" aria-label="${Show calendar}" + ng-attr-tabindex="{{tab.selected(CAB.CAL_TAB) ? 0 : -1}}" + ng-attr-aria-selected="{{tab.selected(CAB.CAL_TAB)}}" + + ng-class="{'focus-tab': tab.selected(CAB.CAL_TAB)}" + ng-keydown="tab.onKeydown($event, CAB.CAL_TAB)" + ng-click="tab.onClick($event, CAB.CAL_TAB)" + + uib-tooltip="${Show calendar}" tooltip-placement="bottom" tooltip-append-to-body="true"> + <span class="glyphicon glyphicon-calendar"></span> + <span class="sr-only">${Show calendar}</span> + </button> + </div> + </span> + </div> + <div class="clearfix"></div> +</div> +<div class="panel-body tab-body"> + <div id="cab-form-panel" role="tabpanel" aria-labelledby="cab-form-tab" + ng-attr-tabindex="{{tab.selected(CAB.FORM_TAB) ? 0 : -1}}" + ng-attr-aria-hidden="{{!tab.selected(CAB.FORM_TAB)}}"> + <div ng-show="tab.selected(CAB.FORM_TAB)" class="row"> + <div class="col-xs-12 cols"><sp-widget widget="data.widget.form"></sp-widget></div> + </div> + </div> + <div id="cab-cal-panel" role="tabpanel" aria-labelledby="cab-cal-tab" + ng-attr-tabindex="{{tab.selected(CAB.CAL_TAB) ? 0 : -1}}" + ng-attr-aria-hidden="{{!tab.selected(CAB.CAL_TAB)}}"> + <div ng-if="tab.selected(CAB.CAL_TAB)" class="row"> + <div class="col-xs-12 cols"><sp-widget widget="data.widget.calendar"></sp-widget></div> + </div> + </div> +</div> +</div> +]]></template></sp_widget> + sp_rel_widget_clone + admin + 2025-02-10 21:37:46 + 6d1bfa4bc327121097f6d075e4013152 + 0 + 691bfa4bc327121097f6d075e4013149 + df5fd9a5090232007f44e1046c8ff69f + + df5fd9a5090232007f44e1046c8ff69f + sp_rel_widget_clone_6d1bfa4bc327121097f6d075e4013152 + admin + 2025-02-10 21:37:46 + + diff --git a/update/sp_widget_02afae8bc3e3121097f6d075e4013123.xml b/update/sp_widget_02afae8bc3e3121097f6d075e4013123.xml new file mode 100644 index 00000000..751bc11b --- /dev/null +++ b/update/sp_widget_02afae8bc3e3121097f6d075e4013123.xml @@ -0,0 +1,77 @@ + + + custom + + c + + sp_instance + + + + + true + notes_body + false + + Notes Body + [] + false + + + false + sp_widget + admin + 2025-02-10 20:47:50 + 02afae8bc3e3121097f6d075e4013123 + 8 + Notes Body + df5fd9a5090232007f44e1046c8ff69f + + df5fd9a5090232007f44e1046c8ff69f + sp_widget_02afae8bc3e3121097f6d075e4013123 + admin + 2025-02-10 23:14:16 + + + diff --git a/update/sp_widget_56993a07c327121097f6d075e40131aa.xml b/update/sp_widget_56993a07c327121097f6d075e40131aa.xml new file mode 100644 index 00000000..1315b93e --- /dev/null +++ b/update/sp_widget_56993a07c327121097f6d075e40131aa.xml @@ -0,0 +1,360 @@ + + + custom + + c + + sp_instance + + Official widget to embed a Playbook into the Service Portal + + + true + + false + + Copy of Playbook + [{"hint":"Height of the playbook. If not specified, it will be 850px","name":"height","section":"Presentation","label":"Height","type":"string"},{"hint":"Use this to override the url of the playbook UIB page. If not specified, it will be /now/playbook-portal/playbook","name":"playbook_uib_page_url","section":"Data","label":"Playbook UIB Page URL","type":"string"},{"hint":"The title of the Open Record modal. Will be empty if nothing is provided here.","name":"open_record_modal_title","section":"Presentation","label":"Open Record Modal Title","type":"string"},{"hint":"The message of the Open Record modal. Will be empty if nothing is provided here.","name":"open_record_modal_message","section":"Presentation","label":"Open Record Modal Message","type":"string"},{"hint":"The buttons of the Open Record modal. Will be empty if nothing is provided here. Needs to be valid JSON.","name":"open_record_modal_buttons","section":"Presentation","label":"Open Record Modal Buttons","type":"string"},{"displayValue":"Widget","hint":"The Sys ID of the widget for Open Record. Will be using form widget if nothing is provided here.","name":"open_record_modal_widget","section":"Data","default_value":"fd1f4ec347730200ba13a5554ee490c0","label":"Open Record Widget","type":"reference","value":"sp_widget","ed":{"reference":"sp_widget"}},{"hint":"The view to open the record in. This data will also come from the payload of Playbook Open Record.","name":"open_record_modal_view","section":"Presentation","label":"Open Record Modal View","type":"string"},{"hint":"Will show the reference picker inside the form if is pop up is true.","name":"open_record_is_pop_up","section":"Data","default_value":"true","label":"Open Record Is Pop Up","type":"boolean"},{"hint":"Will default to 'lg' if no other options is provided","name":"open_record_modal_size","section":"Presentation","label":"Open Record Modal Size","type":"choice","choices":[{"label":"sm","value":"sm"},{"label":"md","value":"md"},{"label":"lg","value":"lg"}]},{"hint":"The title of the Open List modal. Will be empty if nothing is provided here.","name":"open_list_modal_title","section":"Presentation","label":"Open List Modal Title","type":"string"},{"hint":"The message of the Open List modal. Will be empty if nothing is provided here.","name":"open_list_modal_message","section":"Presentation","label":"Open List Modal Message","type":"string"},{"hint":"The buttons of the Open List modal. Will be empty if nothing is provided here. Needs to be valid JSON.","name":"open_list_modal_buttons","section":"Presentation","label":"Open List Modal Buttons","type":"string"},{"displayValue":"Widget","hint":"The Sys ID of the widget for Open List. Will be using the Data Table from Instance Definition as a default.","name":"open_list_modal_widget","section":"Data","default_value":"38058ff1cb11020000f8d856634c9c8c","label":"Open List Widget","type":"reference","value":"sp_widget","ed":{"reference":"sp_widget"}},{"hint":"Will default to 'lg' if no other options is provided","name":"open_list_modal_size","section":"Presentation","label":"Open List Modal Size","type":"choice","choices":[{"label":"sm","value":"sm"},{"label":"md","value":"md"},{"label":"lg","value":"lg"}]},{"hint":"The activity view for your playbook","name":"activity_view","section":"Presentation","default_value":"focused","label":"Activity View","type":"choice","choices":[{"label":"focused","value":"focused"},{"label":"stacked","value":"stacked"}]},{"displayValue":"Playbook Experience","hint":"The playbook configuration record. If the value is in the url, then that will override what is in this field. If none is provided then the Global Playbook experience will be used.","name":"playbook_experience_id","section":"Presentation","default_value":"98e09a560f2200102920c912d4767e1a","label":"Playbook Experience ID","type":"reference","value":"sys_playbook_experience","ed":{"reference":"sys_playbook_experience"}},{"hint":"Prevent the url from updating when a new record is submitted from the open record modal","name":"open_record_modal_prevent_url_update_on_submit","section":"Presentation","default_value":"true","label":"Open Record Modal Prevent URL Update on Submit","type":"boolean"},{"hint":"Allows for arbitrary data to be passed from the widget to the underlying UIB page","name":"extra_params","section":"Data","default_value":"","label":"Extra Params","type":"string"}] + false + snc_external,snc_internal + + false + sp_widget + admin + 2025-02-10 21:31:15 + 56993a07c327121097f6d075e40131aa + 0 + Copy of Playbook + df5fd9a5090232007f44e1046c8ff69f + + df5fd9a5090232007f44e1046c8ff69f + sp_widget_56993a07c327121097f6d075e40131aa + admin + 2025-02-10 21:31:15 + + + + 56993a07c327121097f6d075e40131aa + admin + 2025-02-10 21:31:23 + 5ca97ac7c327121097f6d075e401312a + 0 + admin + 2025-02-10 21:31:23 + sp_widget
+ false +
+
diff --git a/update/sp_widget_691bfa4bc327121097f6d075e4013149.xml b/update/sp_widget_691bfa4bc327121097f6d075e4013149.xml new file mode 100644 index 00000000..f619ca8f --- /dev/null +++ b/update/sp_widget_691bfa4bc327121097f6d075e4013149.xml @@ -0,0 +1,282 @@ + + + custom + + c + .heading { + font-size: 14px; + height: 51px; + .title { + line-height: 30px; + vertical-align: middle; + } + background-color: $panel-default-heading-bg; + color: $gray-darker; + border-bottom: none; +} + +.cols:not(:first-child) { + border-left: 1px solid $color-lighter; +} + +.row { + display: table; + width: 100%; +} + +.cols { + float: none; + display: table-cell; + vertical-align: top; +} + +.btn-group { + .btn { + height: 100%; + color: $color-darkest; + background-color: $navbar-default-bg; + } + .focus-tab { + color: $color-darkest; + background-color: $navpage-nav-selected-color; + border-color: $color-accent !important; + z-index: 2; + } + .glyphicon-folder-close { + margin-top: -2px; + } + .glyphicon-calendar { + margin-top: -2px; + } +} + +.change-desc-wrap { + white-space: nowrap; + width: 600px; + text-overflow: ellipsis; + overflow: hidden; + display: inline-block; +} + +.panel { + margin-bottom: 0px !important; + .meeting-not-started { + height: 55px; + } +} + +.tab-body { + padding: 0; + min-height: 100px; + .row { + margin: 0; + .cols { + padding: 0; + } + } +} + + sp_instance + + + + + false + cab + false + + CAB + + false + + + false + sp_widget + admin + 2025-02-10 21:37:46 + 691bfa4bc327121097f6d075e4013149 + 0 + CAB + df5fd9a5090232007f44e1046c8ff69f + + df5fd9a5090232007f44e1046c8ff69f + sp_widget_691bfa4bc327121097f6d075e4013149 + admin + 2025-02-10 21:37:46 + + + diff --git a/update/sys_scope_privilege_ea2b328bc327121097f6d075e401317a.xml b/update/sys_scope_privilege_ea2b328bc327121097f6d075e401317a.xml new file mode 100644 index 00000000..6f409b0e --- /dev/null +++ b/update/sys_scope_privilege_ea2b328bc327121097f6d075e401317a.xml @@ -0,0 +1,22 @@ + + + execute + df5fd9a5090232007f44e1046c8ff69f + allowed + sys_scope_privilege + admin + 2025-02-10 21:38:07 + ea2b328bc327121097f6d075e401317a + 0 + Glide API: string utilities + df5fd9a5090232007f44e1046c8ff69f + + df5fd9a5090232007f44e1046c8ff69f + sys_scope_privilege_ea2b328bc327121097f6d075e401317a + admin + 2025-02-10 21:38:07 + Glide API: string utilities + global + scriptable + + diff --git a/update/sys_scope_privilege_fdf9f60bc327121097f6d075e40131d9.xml b/update/sys_scope_privilege_fdf9f60bc327121097f6d075e40131d9.xml new file mode 100644 index 00000000..99f71a17 --- /dev/null +++ b/update/sys_scope_privilege_fdf9f60bc327121097f6d075e40131d9.xml @@ -0,0 +1,22 @@ + + + read + df5fd9a5090232007f44e1046c8ff69f + allowed + sys_scope_privilege + admin + 2025-02-10 21:32:52 + fdf9f60bc327121097f6d075e40131d9 + 0 + sys_properties + df5fd9a5090232007f44e1046c8ff69f + + df5fd9a5090232007f44e1046c8ff69f + sys_scope_privilege_fdf9f60bc327121097f6d075e40131d9 + admin + 2025-02-10 21:32:52 + sys_properties + global + sys_db_object + +