diff --git a/packages/components/releaseNotes/components.md b/packages/components/releaseNotes/components.md index 0c70bc79a3..79e0f5f733 100644 --- a/packages/components/releaseNotes/components.md +++ b/packages/components/releaseNotes/components.md @@ -2,7 +2,7 @@ Components, models, actions, and utility functions for LabKey applications and pages. ### version 3.0.0 -*Released*: ?? November 2023 +*Released*: ?? December 2023 * Breaking Changes: * Upgrade react-router dependency to react-router-dom version 6.x * If you use react-router you will need to upgrade @@ -22,6 +22,11 @@ Components, models, actions, and utility functions for LabKey applications and p * Don't export UsersGridPanel or PermissionAssignments * AppRouteResolver: fetch now returns Promise instead of Promise * SubNav is no longer exported + * Removed unused constants + * SECURITY_LOGOUT + * SECURITY_SERVER_UNAVAILABLE + * SECURITY_SESSION_TIMEOUT + * Removed RoutingTableState and RoutingTableReducers ### version 2.395.2 *Released*: 29 November 2023 diff --git a/packages/components/src/index.ts b/packages/components/src/index.ts index a6615d369a..0682c5d998 100644 --- a/packages/components/src/index.ts +++ b/packages/components/src/index.ts @@ -629,7 +629,7 @@ import { OntologyBrowserPage } from './internal/components/ontology/OntologyBrow import { OntologyConceptOverviewPanel } from './internal/components/ontology/ConceptOverviewPanel'; import { OntologyBrowserFilterPanel } from './internal/components/ontology/OntologyBrowserFilterPanel'; import { OntologySearchInput } from './internal/components/ontology/OntologyTreeSearchContainer'; -import { AppModel, LogoutReason } from './internal/app/models'; +import { AppModel } from './internal/app/models'; import { Picklist, PICKLIST_SAMPLES_FILTER } from './internal/components/picklist/models'; import { PicklistCreationMenuItem } from './internal/components/picklist/PicklistCreationMenuItem'; import { PicklistButton } from './internal/components/picklist/PicklistButton'; @@ -652,7 +652,6 @@ import { ColumnSelectionModal } from './internal/components/ColumnSelectionModal import { AppReducers, ProductMenuReducers, - RoutingTableReducers, ServerNotificationReducers, } from './internal/app/reducers'; @@ -775,9 +774,6 @@ import { SAMPLE_TYPE_KEY, SAMPLES_KEY, SEARCH_KEY, - SECURITY_LOGOUT, - SECURITY_SERVER_UNAVAILABLE, - SECURITY_SESSION_TIMEOUT, SERVER_NOTIFICATION_MAX_ROWS, SOURCE_TYPE_KEY, SOURCES_KEY, @@ -843,7 +839,6 @@ enablePatches(); const App = { AppReducers, ProductMenuReducers, - RoutingTableReducers, ServerNotificationReducers, CloseEventCode, EntityCreationMode, @@ -909,9 +904,6 @@ const App = { userCanEditSharedViews, userCanDeletePublicPicklists, getCurrentProductName, - SECURITY_LOGOUT, - SECURITY_SERVER_UNAVAILABLE, - SECURITY_SESSION_TIMEOUT, UPDATE_USER, UPDATE_USER_DISPLAY_NAME, BIOLOGICS: BIOLOGICS_APP_PROPERTIES, @@ -1008,7 +1000,6 @@ export { App, AppModel, Hooks, - LogoutReason, getDefaultAPIWrapper, // global state functions initQueryGridState, @@ -1759,7 +1750,6 @@ export type { BulkAddData, SharedEditableGridPanelProps } from './internal/compo export type { IImportData, ISelectRowsResult } from './internal/query/api'; export type { Row, RowValue, SelectRowsOptions, SelectRowsResponse } from './internal/query/selectRows'; export type { - RoutingTableState, ServerNotificationState, ProductMenuState, AppReducerState, diff --git a/packages/components/src/internal/app/constants.ts b/packages/components/src/internal/app/constants.ts index 1716848482..bea3088b7e 100644 --- a/packages/components/src/internal/app/constants.ts +++ b/packages/components/src/internal/app/constants.ts @@ -90,10 +90,6 @@ export const USER_PERMISSIONS_REQUEST = '/app/USER_PERMISSIONS_REQUEST'; export const USER_PERMISSIONS_SUCCESS = '/app/USER_PERMISSIONS_SUCCESS'; export const UPDATE_USER = '/app/UPDATE_USER'; export const UPDATE_USER_DISPLAY_NAME = '/app/UPDATE_USER_DISPLAY_NAME'; -export const SECURITY_LOGOUT = '/app/SECURITY_LOGOUT'; -export const SECURITY_SESSION_TIMEOUT = '/app/SECURITY_SESSION_TIMEOUT'; -export const SECURITY_SERVER_UNAVAILABLE = '/app/SECURITY_SERVER_UNAVAILABLE'; -export const ADD_TABLE_ROUTE = '/app/ADD_TABLE_ROUTE'; export const MENU_LOADING_START = '/app/MENU_LOADING_START'; export const MENU_LOADING_END = '/app/MENU_LOADING_END'; export const MENU_LOADING_ERROR = '/app/MENU_LOADING_ERROR'; diff --git a/packages/components/src/internal/app/models.ts b/packages/components/src/internal/app/models.ts index dc8b7cca0e..8bb75f54d9 100644 --- a/packages/components/src/internal/app/models.ts +++ b/packages/components/src/internal/app/models.ts @@ -9,32 +9,22 @@ import { ComponentType } from 'react'; import { Container } from '../components/base/models/Container'; import { User } from '../components/base/models/User'; -import { ProjectConfigurableDataType } from '../components/entities/models'; const user = new User({ ...getServerContext().user, permissionsList: getServerContext().container?.effectivePermissions ?? [], }); -export enum LogoutReason { - SERVER_LOGOUT, - SESSION_EXPIRED, - SERVER_UNAVAILABLE, -} - export class AppModel extends Record({ container: new Container(getServerContext().container), contextPath: ActionURL.getContextPath(), initialUserId: user.id, logoutReason: undefined, - reloadRequired: false, user, }) { declare container: Container; declare contextPath: string; declare initialUserId: number; - declare logoutReason: LogoutReason; - declare reloadRequired: boolean; declare user: User; hasUserChanged(): boolean { @@ -42,7 +32,7 @@ export class AppModel extends Record({ } shouldReload(): boolean { - return this.reloadRequired || this.hasUserChanged(); + return this.hasUserChanged(); } } diff --git a/packages/components/src/internal/app/reducers.ts b/packages/components/src/internal/app/reducers.ts index 3a9f948cec..3936a939a1 100644 --- a/packages/components/src/internal/app/reducers.ts +++ b/packages/components/src/internal/app/reducers.ts @@ -10,14 +10,10 @@ import { ProductMenuModel } from '../components/navigation/model'; import { ServerNotificationModel } from '../components/notifications/model'; -import { AppModel, LogoutReason } from './models'; +import { AppModel } from './models'; import { - SECURITY_LOGOUT, - SECURITY_SERVER_UNAVAILABLE, - SECURITY_SESSION_TIMEOUT, UPDATE_USER, UPDATE_USER_DISPLAY_NAME, - ADD_TABLE_ROUTE, MENU_INVALIDATE, MENU_LOADING_START, MENU_LOADING_ERROR, @@ -37,33 +33,6 @@ export function AppReducers(state = new AppModel(), action): AppReducerState { return state.merge({ user: new User({ ...state.user, ...action.userProps }) }) as AppModel; case UPDATE_USER_DISPLAY_NAME: return state.merge({ user: new User({ ...state.user, displayName: action.displayName }) }) as AppModel; - case SECURITY_LOGOUT: - return state.merge({ - logoutReason: LogoutReason.SERVER_LOGOUT, - reloadRequired: true, - }) as AppModel; - // TODO: the following constants appear to never be dispatched, are these handlers needed? - case SECURITY_SESSION_TIMEOUT: - return state.merge({ - logoutReason: LogoutReason.SESSION_EXPIRED, - reloadRequired: true, - }) as AppModel; - case SECURITY_SERVER_UNAVAILABLE: - return state.merge({ - logoutReason: LogoutReason.SERVER_UNAVAILABLE, - reloadRequired: true, - }) as AppModel; - default: - return state; - } -} - -export type RoutingTableState = Map; - -export function RoutingTableReducers(state = Map(), action): RoutingTableState { - switch (action.type) { - case ADD_TABLE_ROUTE: - return state.set(action.fromRoute, action.toRoute) as RoutingTableState; default: return state; }