Updated the calendar to improve opportunity display and navigation
This commit is contained in:
@@ -5,7 +5,7 @@ function createContentApplication(overrides = {}) {
|
||||
navigator: globalThis.navigator,
|
||||
crypto: globalThis.crypto,
|
||||
get localStorage() { return globalThis.localStorage; },
|
||||
fetch: globalThis.fetch,
|
||||
fetch: globalThis.fetch && ((...args) => globalThis.fetch.call(undefined, ...args)),
|
||||
browser: globalThis.browser,
|
||||
chrome: globalThis.chrome,
|
||||
MutationObserver: globalThis.MutationObserver,
|
||||
@@ -13,8 +13,9 @@ function createContentApplication(overrides = {}) {
|
||||
requestAnimationFrame: globalThis.requestAnimationFrame,
|
||||
performance: globalThis.performance,
|
||||
cancelAnimationFrame: globalThis.cancelAnimationFrame,
|
||||
setTimeout: globalThis.setTimeout,
|
||||
clearTimeout: globalThis.clearTimeout,
|
||||
setTimeout: globalThis.setTimeout && ((...args) => globalThis.setTimeout.call(undefined, ...args)),
|
||||
clearTimeout: globalThis.clearTimeout && ((...args) => globalThis.clearTimeout.call(undefined, ...args)),
|
||||
AbortController: globalThis.AbortController,
|
||||
matchMedia: globalThis.matchMedia,
|
||||
...overrides
|
||||
};
|
||||
@@ -28,7 +29,6 @@ function createContentApplication(overrides = {}) {
|
||||
const contracts = createContentContracts();
|
||||
const searchableSelect = createSearchableSelect({ environment });
|
||||
const authSessionState = createAuthSessionState(contracts);
|
||||
const authSalesCommonState = createAuthSalesCommonState();
|
||||
const opportunitiesQueryState = createOpportunitiesQueryState();
|
||||
const tableSorting = createTableSorting({ environment });
|
||||
const orgChartIcons = createOrgChartIcons({ environment });
|
||||
@@ -57,11 +57,10 @@ function createContentApplication(overrides = {}) {
|
||||
const preferencesState = createPreferencesState(contracts);
|
||||
const activityCache = createActivityCache({ authSessionState, preferencesState, environment });
|
||||
const productsContentState = createProductsContentState();
|
||||
const aiSummaryState = createAiSummaryState();
|
||||
const consumptionPlansState = createConsumptionPlansState();
|
||||
const consumptionTrendState = createConsumptionTrendState();
|
||||
const opportunitiesDashboardState = createOpportunitiesDashboardState(contracts);
|
||||
const debugState = createDebugState();
|
||||
const debugState = createDebugState(environment);
|
||||
const columns = createOpportunitiesColumns({
|
||||
formatOracleResponseDate: (...args) => opportunitiesFormatters.formatOracleResponseDate(...args),
|
||||
formatRevenue: (...args) => opportunitiesFormatters.formatRevenue(...args),
|
||||
@@ -227,11 +226,6 @@ function createContentApplication(overrides = {}) {
|
||||
sendRuntimeMessage: (...args) => platformContentMessages.sendRuntimeMessage(...args),
|
||||
updateAuthBadge: (...args) => contentModal.updateAuthBadge(...args)
|
||||
});
|
||||
const authSalesCommon = createAuthSalesCommon({
|
||||
TOKEN_RELAY_URL: contracts.TOKEN_RELAY_URL,
|
||||
authSalesCommonState,
|
||||
requestTokenRelay: (...args) => authTokenRelay.requestTokenRelay(...args)
|
||||
});
|
||||
const authTokenRelay = createAuthTokenRelay({
|
||||
authSessionState,
|
||||
TOKEN_RELAY_URL: contracts.TOKEN_RELAY_URL,
|
||||
@@ -279,6 +273,7 @@ function createContentApplication(overrides = {}) {
|
||||
setOpportunitiesTableState: (...args) => opportunitiesTable.setOpportunitiesTableState(...args)
|
||||
});
|
||||
const fusionOpportunities = createFusionOpportunities({
|
||||
resetDebugRequests: () => debugState.reset(),
|
||||
OPPORTUNITIES_PAGE_LIMIT: contracts.OPPORTUNITIES_PAGE_LIMIT,
|
||||
OPPORTUNITIES_QUERY_URL: contracts.OPPORTUNITIES_QUERY_URL,
|
||||
isCurrentPeriodRequest: (...args) => opportunitiesController.isCurrentPeriodRequest(...args),
|
||||
@@ -370,11 +365,14 @@ function createContentApplication(overrides = {}) {
|
||||
isCurrentPeriodRequest: (...args) => opportunitiesController.isCurrentPeriodRequest(...args), environment
|
||||
});
|
||||
const opportunityCalendar = createOpportunityCalendar({
|
||||
productTypeSelection: opportunitiesFilterState.selectedProductTypes,
|
||||
onProductTypeChange: () => opportunitiesTable.renderOpportunitiesTable(),
|
||||
createViewIcon: view => contentIcons.createViewIcon(view),
|
||||
environment, loadLibrary: () => loadOpportunityCalendarLibrary(),
|
||||
getState: () => opportunitiesTableState.opportunitiesTableState,
|
||||
getItems: () => opportunitiesFilters.getSortedOpportunities(),
|
||||
getVersion: () => opportunitiesQueryState.periodRequestVersion,
|
||||
getRange: () => opportunitiesQueryState.dateRange,
|
||||
formatRevenue: item => opportunitiesFormatters.formatRevenue(item),
|
||||
formatDate: value => opportunitiesFormatters.formatOracleResponseDate(value),
|
||||
getOwnerName: item => opportunitiesFormatters.getOwnerName(item),
|
||||
@@ -429,6 +427,13 @@ function createContentApplication(overrides = {}) {
|
||||
environment
|
||||
});
|
||||
const opportunitiesFilters = createOpportunitiesFilters({
|
||||
matchesProductType: item => {
|
||||
const selected = opportunitiesFilterState.selectedProductTypes;
|
||||
if (selected.size === 2) return true;
|
||||
const result = productsContentState.opptyProductsByNumber.get(String(item.OptyNumber));
|
||||
if (!result || result.error) return false;
|
||||
return selected.has(productsDetails.isBooking(result.items) ? "Booking" : "Workload");
|
||||
},
|
||||
matchesActivities: item => activityFilters.matches(item),
|
||||
CUSTOMER_FILTER_BUTTON_ID: contracts.CUSTOMER_FILTER_BUTTON_ID,
|
||||
CUSTOMER_FILTER_LIST_ID: contracts.CUSTOMER_FILTER_LIST_ID,
|
||||
@@ -496,7 +501,7 @@ function createContentApplication(overrides = {}) {
|
||||
const refreshAll = createRefreshAll({
|
||||
createRefreshIcon: () => contentIcons.createRefreshIcon(),
|
||||
messageTypes, activityCache, opportunitiesQueryState, productsContentState,
|
||||
consumptionPlansState, consumptionTrendState, aiSummaryState, environment,
|
||||
consumptionPlansState, consumptionTrendState, environment,
|
||||
sendRuntimeMessage: (...args) => platformContentMessages.sendRuntimeMessage(...args),
|
||||
reload: (...args) => opportunitiesController.requestOpportunitiesForPeriod(...args),
|
||||
onFailure: error => opportunitiesTable.setOpportunitiesTableState({ status: "error", message: error.message || "Unable to refresh cached data." }),
|
||||
@@ -517,7 +522,8 @@ function createContentApplication(overrides = {}) {
|
||||
opportunitiesTable.setOpportunitiesTableState({ status: "loading", message: "Refreshing data..." });
|
||||
}
|
||||
});
|
||||
const activityProgress = createActivityProgress({ MODAL_ID: contracts.MODAL_ID, environment });
|
||||
const activityProgress = createActivityProgress({ MODAL_ID: contracts.MODAL_ID, environment,
|
||||
retrySession: () => srSessionPreparation.retry() });
|
||||
const srSessionPreparation = createSrSessionPreparation({
|
||||
async onReady() {
|
||||
const result = await platformContentMessages.sendRuntimeMessage({ type: messageTypes.requestResourceUser, emailAddress: currentUser.getUserId() });
|
||||
@@ -611,13 +617,12 @@ function createContentApplication(overrides = {}) {
|
||||
});
|
||||
const productsDetails = createProductsDetails({
|
||||
createProjectionIndicator: (...args) => rampProjectionView.createIndicator(...args),
|
||||
openProjection: (products, opportunity, trigger) => rampProjectionView.open(products[0], opportunity, trigger, products),
|
||||
setBadgeContent: (...args) => opportunityBadgeContent.setContent(...args),
|
||||
OPPORTUNITIES_COLUMNS: columns,
|
||||
createAiSummaryAlert: (...args) => aiSummaryContent.createAiSummaryAlert(...args),
|
||||
formatOracleResponseDate: (...args) => opportunitiesFormatters.formatOracleResponseDate(...args),
|
||||
productsContentState,
|
||||
renderOpportunitiesTable: (...args) => opportunitiesTable.renderOpportunitiesTable(...args),
|
||||
requestGenerateAiSummary: (...args) => aiSummaryContent.requestGenerateAiSummary(...args),
|
||||
environment
|
||||
});
|
||||
const rampProjection = createRampProjection();
|
||||
@@ -645,16 +650,6 @@ function createContentApplication(overrides = {}) {
|
||||
formatDate: value => opportunitiesFormatters.formatOracleResponseDate(value),
|
||||
environment
|
||||
});
|
||||
const aiSummaryContent = createAiSummaryContent({
|
||||
aiSummaryState,
|
||||
invalidateSalesCommonToken: (...args) => authSalesCommon.invalidateSalesCommonToken(...args),
|
||||
logRequestFailure: (...args) => debugContentLog.logRequestFailure(...args),
|
||||
logRequestStart: (...args) => debugContentLog.logRequestStart(...args),
|
||||
logRequestSuccess: (...args) => debugContentLog.logRequestSuccess(...args),
|
||||
readResponseBodyForDebug: (...args) => debugContentLog.readResponseBodyForDebug(...args),
|
||||
requestTokenRelaySalesCommon: (...args) => authSalesCommon.requestTokenRelaySalesCommon(...args),
|
||||
environment
|
||||
});
|
||||
const customerTableSearch = createCustomerTableSearch({ environment });
|
||||
const installBaseView = createInstallBaseView({
|
||||
tableSorting,
|
||||
@@ -810,13 +805,11 @@ function createContentApplication(overrides = {}) {
|
||||
opportunityWorkloadActions,
|
||||
fusionCrmServiceRequests, opportunityCrmServiceRequests,
|
||||
authSessionState,
|
||||
authSalesCommonState,
|
||||
opportunitiesQueryState,
|
||||
opportunitiesTableState,
|
||||
opportunitiesFilterState,
|
||||
preferencesState,
|
||||
productsContentState,
|
||||
aiSummaryState,
|
||||
consumptionPlansState,
|
||||
consumptionTrendState,
|
||||
opportunitiesDashboardState,
|
||||
@@ -828,7 +821,6 @@ function createContentApplication(overrides = {}) {
|
||||
contentStyles,
|
||||
authContentSession,
|
||||
currentUser,
|
||||
authSalesCommon,
|
||||
authTokenRelay,
|
||||
authXsrfContent,
|
||||
platformContentMessages,
|
||||
@@ -853,7 +845,6 @@ function createContentApplication(overrides = {}) {
|
||||
rampProjection,
|
||||
workloadForecastUpdate,
|
||||
rampProjectionView,
|
||||
aiSummaryContent,
|
||||
consumptionPlansAction,
|
||||
installBaseAction,
|
||||
installBaseView,
|
||||
|
||||
Reference in New Issue
Block a user