How to configure side panel in planning console in project workspace

Reddymahesh
Tera Contributor

I want to add/remove existing items in side panel of planning console in project workspace. 

Reddymahesh_0-1738958320186.png

 

 

1 REPLY 1

Vishwa Pandya19
Mega Sage

Hello,

 

If you want to hide options like "Planning", "Details" etc you can use below code. 
There is an OOB Script include called "ProjectWorkspaceHelper". Add below code to it. Here we are hiding Financials, Analytics and Docs section

 

var ProjectWorkspaceHelper = Class.create();
ProjectWorkspaceHelper.prototype = Object.extendsObject(ProjectWorkspaceHelperSNC, {

	getPlannerSubPageItems(projectId, sysClassName) {
		const plannerSubPageItems = [];
		const planningItem = {
			id: "planning",
			label: gs.getMessage("Planning"),
			route: "planning",
			icon: "Roadmap Fill",
			order: 1,
			actionable: true,
			isTableMandatoryParam: true, //We will set table param during navigation automatically
			isSysIdMandatoryParam: true, //We will set sysId param during navigation automatically
			isTimeStampMandatoryParam: true, //We will set timeStamp param during navigation automatically
			forceRefreshOnNavigation: true, //On every navigation, we will update the timeStamp automatically.
			fields: { //Mention route params here other than table sysId and timeStamp
			},
			params: {
				pageName: "planning"
			}
		};
		plannerSubPageItems.push(planningItem);

		const hasPPMFinanceReadRole = gs.getUser().hasRole('sn_ppm_finance_read');
		const hasProjectManagerRole = gs.getUser().hasRole('project_manager');
		const hasProgramManagerRole = gs.getUser().hasRole('program_manager');
		if (hasPPMFinanceReadRole || hasProjectManagerRole || hasProgramManagerRole) {
			const finacilasItem = {
				id: "financials",
				label: gs.getMessage("Financials"),
				route: "pw-financials",
				icon: "Chart Control Fill",
				order: 3,
				actionable: true,
				isTableMandatoryParam: true, //We will set table param during navigation automatically
				isSysIdMandatoryParam: true, //We will set sysId param during navigation automatically
				isTimeStampMandatoryParam: true, //We will set timeStamp param during navigation automatically
				forceRefreshOnNavigation: true, //On every navigation, we will update the timeStamp automatically.
				fields: { //Mention route params here other than table sysId and timeStamp
				},
				params: {
					pageName: "financials"
				}
			};
			//plannerSubPageItems.push(finacilasItem);
		}

		const ridacItem = {
			id: "ridac-monitor",
			label: gs.getMessage("RIDAC"),
			route: "ridac-monitor",
			icon: "Table Fill",
			order: 4,
			actionable: true,
			isTableMandatoryParam: true, //We will set table param during navigation automatically
			isSysIdMandatoryParam: true, //We will set sysId param during navigation automatically
			isTimeStampMandatoryParam: true, //We will set timeStamp param during navigation automatically
			forceRefreshOnNavigation: true, //On every navigation, we will update the timeStamp automatically.
			fields: { //Mention route params here other than table sysId and timeStamp
			},
			params: {
				pageName: "ridac-monitor"
			}
		};
		plannerSubPageItems.push(ridacItem);

		const detailsPage = { //record page
			id: "details",
			label: gs.getMessage("Details"),
			route: "record",
			icon: "Form fill",
			order: 2,
			actionable: true,
			isTableMandatoryParam: true, //We will set table param during navigation automatically
			isSysIdMandatoryParam: true, //We will set sysId param during navigation automatically
			isTimeStampMandatoryParam: false, //We will set timeStamp param during navigation automatically
			forceRefreshOnNavigation: false, //On every navigation, we will update the timeStamp automatically.
			fields: { //Mention route params here other than table sysId and timeStamp
			},
			params: {
				pageName: "details",
				timeStamp: Date.now() //handling details page differently as we are using same screen of record page
			}
		};
		plannerSubPageItems.push(detailsPage);

		const analyticsPage = { //analytics page
            id: "analytics",
            label: gs.getMessage("Analytics"),
            route: "analytics",
            icon: "analytics-center-outline",
            order: 5,
            actionable: true,
            isTableMandatoryParam: true, //We will set table param during navigation automatically
            isSysIdMandatoryParam: true, //We will set sysId param during navigation automatically
            isTimeStampMandatoryParam: true, //We will set timeStamp param during navigation automatically
            forceRefreshOnNavigation: true, //On every navigation, we will update the timeStamp automatically.
            fields: { //Mention route params here other than table sysId and timeStamp
            },
            params: {
                pageName: "analytics"
            }
        };
        //plannerSubPageItems.push(analyticsPage);

		const docsPage = {
            id: "docs",
            label: gs.getMessage("Docs"),
            route: "docs",
            icon: "Form fill",
            order: 6,
            actionable: true,
            isTableMandatoryParam: true, //We will set table param during navigation automatically
            isSysIdMandatoryParam: true, //We will set sysId param during navigation automatically
            isTimeStampMandatoryParam: false, //We will set timeStamp param during navigation automatically
            forceRefreshOnNavigation: true, //On every navigation, we will update the timeStamp automatically.
            fields: { //Mention route params here other than table sysId and timeStamp
            },
            params: {
                pageName: "docs"
            }
        };
        //plannerSubPageItems.push(docsPage);

		plannerSubPageItems.sort((a,b) => a.order - b.order);
		return {
			plannerSubPageItems,
			defaultPage: planningItem
		};
	},

	getClassicWorkspaceItems(projectId, sysClassName) {
		const classicConsoleOpenLinkIcon = "Open Link Right Fill";
		const classicWorkspaceItems = [
			{
				id: "details",
				label: gs.getMessage("Details"),
				icon: classicConsoleOpenLinkIcon,
				hasExternalUrl: true,
				order: 1,
				url: `/$pmview.do?sysparm_entity=project&sysparm_view=details&sysparm_projid=${projectId}&sysparm_class_name=${sysClassName}`,
				actionable: true
			}
			//,
			// {
			// 	id: "financials",
			// 	label: gs.getMessage("Financials"),
			// 	icon: classicConsoleOpenLinkIcon,
			// 	hasExternalUrl: true,
			// 	url: `/$pmview.do?sysparm_entity=project&sysparm_view=financials&sysparm_projid=${projectId}&sysparm_class_name=${sysClassName}`,
			// 	order: 3,
			// 	actionable: true
			// },
			// {
			// 	id: "status_report",
			// 	label: gs.getMessage("Status Report"),
			// 	icon: classicConsoleOpenLinkIcon,
			// 	hasExternalUrl: true,
			// 	url: `/$pmview.do?sysparm_entity=project&sysparm_view=status_report&sysparm_projid=${projectId}&sysparm_class_name=${sysClassName}`,
			// 	order: 4,
			// 	actionable: true
			// }
		];
		// if (gs.getUser().hasRole('it_project_manager')) {
		// 	classicWorkspaceItems.push({
		// 		id: "resources",
		// 		label: gs.getMessage("Resources"),
		// 		icon: classicConsoleOpenLinkIcon,
		// 		hasExternalUrl: true,
		// 		url: `/$pmview.do?sysparm_entity=project&sysparm_view=resources&sysparm_projid=${projectId}&sysparm_class_name=${sysClassName}`,
		// 		order: 2,
		// 		actionable: true
		// 	});
		// }
		classicWorkspaceItems.sort((a,b) => a.order - b.order);
		return classicWorkspaceItems;
	},

    type: 'ProjectWorkspaceHelper'
});

 

 

VishwaPandya19_0-1739353932339.png

 

 

If my answer has helped you in any way please mark it as correct or helpful.