diff --git a/packages/admin-panel/src/importExport/ExportButton.jsx b/packages/admin-panel/src/importExport/ExportButton.jsx index f18c1c7f23..37d9d0d5fe 100644 --- a/packages/admin-panel/src/importExport/ExportButton.jsx +++ b/packages/admin-panel/src/importExport/ExportButton.jsx @@ -41,7 +41,7 @@ export const ExportButton = ({ actionConfig, row }) => { await api.download( endpoint, { queryParameters, ...extraQueryParameters }, - `${processedFileName}.json`, + processedFileName, ); }} > diff --git a/packages/auth/src/userAuth.js b/packages/auth/src/userAuth.js index 1142b10484..8c5bde9a43 100644 --- a/packages/auth/src/userAuth.js +++ b/packages/auth/src/userAuth.js @@ -110,6 +110,7 @@ export const getAuthorizationObject = async ({ email: user.email, profileImage: user.profile_image, verifiedEmail: user.verified_email, + preferences: user.preferences, accessPolicy, }; if (permissionGroups) { diff --git a/packages/database/src/__tests__/modelClasses/SurveyResponse.test.js b/packages/database/src/__tests__/modelClasses/SurveyResponse.test.js new file mode 100644 index 0000000000..108037112d --- /dev/null +++ b/packages/database/src/__tests__/modelClasses/SurveyResponse.test.js @@ -0,0 +1,67 @@ +/* + * Tupaia + * Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd + */ +import { getLeaderboard } from '../../modelClasses/SurveyResponse'; + +const USERS_EXCLUDED_FROM_LEADER_BOARD = [ + "'edmofro@gmail.com'", + "'kahlinda.mahoney@gmail.com'", + "'lparish1980@gmail.com'", + "'sus.lake@gmail.com'", + "'michaelnunan@hotmail.com'", + "'vanbeekandrew@gmail.com'", + "'gerardckelly@gmail.com'", + "'geoffreyfisher@hotmail.com'", + "'unicef.laos.edu@gmail.com'", +]; +const SYSTEM_USERS = ["'tamanu-server@tupaia.org'", "'public@tupaia.org'", "'josh@sussol.net'"]; + +const whitespace = /\s/g; +const expectToBe = (expected, received) => { + expect(received.replace(whitespace, '')).toBe(expected.replace(whitespace, '')); +}; + +describe('getLeaderboard()', () => { + it('should filter out internal users on standard projects', async () => { + const expectedLeaderboard = `SELECT r.user_id, user_account.first_name, user_account.last_name, r.coconuts, r.pigs + FROM ( + SELECT user_id, FLOOR(COUNT(*)) as coconuts, FLOOR(COUNT(*) / 100) as pigs + FROM survey_response + JOIN survey on survey.id=survey_id + WHERE survey.project_id = ? + GROUP BY user_id + ) r + JOIN user_account on user_account.id = r.user_id + WHERE email NOT IN (${[...SYSTEM_USERS, ...USERS_EXCLUDED_FROM_LEADER_BOARD].join(', ')}) + AND email NOT LIKE '%@beyondessential.com.au' AND email NOT LIKE '%@bes.au' + ORDER BY coconuts DESC + LIMIT ?;`; + + expectToBe(getLeaderboard('5dfc6eaf61f76a497716cddf'), expectedLeaderboard); + }); + + it('should not filter out internal users on internal projects', async () => { + const INTERNAL_PROJECT_IDS = [ + '6684ac9d0f018e110b000a00', // bes_asset_demo + '66a03660718c54751609eeed', // bes_asset_tracker + '6704622a45a4fc4941071605', // bes_reporting + ]; + const expectedLeaderboard = `SELECT r.user_id, user_account.first_name, user_account.last_name, r.coconuts, r.pigs + FROM ( + SELECT user_id, FLOOR(COUNT(*)) as coconuts, FLOOR(COUNT(*) / 100) as pigs + FROM survey_response + JOIN survey on survey.id=survey_id + WHERE survey.project_id = ? + GROUP BY user_id + ) r + JOIN user_account on user_account.id = r.user_id + WHERE email NOT IN (${SYSTEM_USERS.join(', ')}) + ORDER BY coconuts DESC + LIMIT ?;`; + + INTERNAL_PROJECT_IDS.forEach(projectId => { + expectToBe(getLeaderboard(projectId), expectedLeaderboard); + }); + }); +}); diff --git a/packages/database/src/modelClasses/SurveyResponse.js b/packages/database/src/modelClasses/SurveyResponse.js index 4bffa63794..5fdaf34ddf 100644 --- a/packages/database/src/modelClasses/SurveyResponse.js +++ b/packages/database/src/modelClasses/SurveyResponse.js @@ -16,12 +16,44 @@ const USERS_EXCLUDED_FROM_LEADER_BOARD = [ "'vanbeekandrew@gmail.com'", // Andrew "'gerardckelly@gmail.com'", // Gerry K "'geoffreyfisher@hotmail.com'", // Geoff F - "'josh@sussol.net'", // mSupply API Client "'unicef.laos.edu@gmail.com'", // Laos Schools Data Collector +]; +const SYSTEM_USERS = [ "'tamanu-server@tupaia.org'", // Tamanu Server "'public@tupaia.org'", // Public User + "'josh@sussol.net'", // mSupply API Client ]; const INTERNAL_EMAIL = ['@beyondessential.com.au', '@bes.au']; +const INTERNAL_PROJECT_IDS = [ + '6684ac9d0f018e110b000a00', // bes_asset_demo + '66a03660718c54751609eeed', // bes_asset_tracker + '6704622a45a4fc4941071605', // bes_reporting +]; + +export function getLeaderboard(projectId = '') { + const isInternalProject = projectId && INTERNAL_PROJECT_IDS.includes(projectId); + + const besUsersFilter = `AND ${INTERNAL_EMAIL.map(email => `email NOT LIKE '%${email}'`).join(' AND ')}`; + const excludedUserAccountList = isInternalProject + ? SYSTEM_USERS + : [...SYSTEM_USERS, ...USERS_EXCLUDED_FROM_LEADER_BOARD]; + + // FLOOR to force result to be returned as int, not string + return `SELECT r.user_id, user_account.first_name, user_account.last_name, r.coconuts, r.pigs + FROM ( + SELECT user_id, FLOOR(COUNT(*)) as coconuts, FLOOR(COUNT(*) / 100) as pigs + FROM survey_response + JOIN survey on survey.id=survey_id + ${projectId ? 'WHERE survey.project_id = ?' : ''} + GROUP BY user_id + ) r + JOIN user_account on user_account.id = r.user_id + WHERE email NOT IN (${excludedUserAccountList.join(',')}) + ${!isInternalProject ? besUsersFilter : ''} + ORDER BY coconuts DESC + LIMIT ?; + `; +} export class SurveyResponseRecord extends DatabaseRecord { static databaseRecord = RECORDS.SURVEY_RESPONSE; @@ -38,23 +70,7 @@ export class SurveyResponseModel extends MaterializedViewLogDatabaseModel { async getLeaderboard(projectId = '', rowCount = 10) { const bindings = projectId ? [projectId, rowCount] : [rowCount]; - return this.database.executeSql( - `SELECT r.user_id, user_account.first_name, user_account.last_name, r.coconuts, r.pigs - FROM ( - SELECT user_id, FLOOR(COUNT(*)) as coconuts, FLOOR(COUNT(*) / 100) as pigs - -- ^~~~~~~~~~~~~~~ FLOOR to force result to be returned as int, not string - FROM survey_response - JOIN survey on survey.id=survey_id - ${projectId ? 'WHERE survey.project_id = ?' : ''} - GROUP BY user_id - ) r - JOIN user_account on user_account.id = r.user_id - WHERE ${INTERNAL_EMAIL.map(email => `email NOT LIKE '%${email}'`).join(' AND ')} - AND email NOT IN (${USERS_EXCLUDED_FROM_LEADER_BOARD.join(',')}) - ORDER BY coconuts DESC - LIMIT ?; - `, - bindings, - ); + const query = getLeaderboard(projectId); + return this.database.executeSql(query, bindings); } } diff --git a/packages/datatrak-web/src/api/queries/useProjects.ts b/packages/datatrak-web/src/api/queries/useProjects.ts index 7459a1121d..8be6ee3cda 100644 --- a/packages/datatrak-web/src/api/queries/useProjects.ts +++ b/packages/datatrak-web/src/api/queries/useProjects.ts @@ -7,6 +7,28 @@ import { useQuery } from '@tanstack/react-query'; import { DatatrakWebProjectsRequest } from '@tupaia/types'; import { get } from '../api'; -export const useProjects = () => { - return useQuery(['projects'], (): Promise => get('projects')); +export const useProjects = (sortByAccess = true) => { + const { data, ...query } = useQuery( + ['projects'], + (): Promise => get('projects'), + ); + + if (data && sortByAccess) { + data.sort((a, b) => { + // Sort by hasAccess = true first + if (a.hasAccess !== b.hasAccess) { + return a.hasAccess ? -1 : 1; + } + + // Sort by hasPendingAccess = true second + if (a.hasPendingAccess !== b.hasPendingAccess) { + return a.hasPendingAccess ? -1 : 1; + } + + // Otherwise, sort alphabetically by name + return a.name.localeCompare(b.name); + }); + } + + return { ...query, data }; }; diff --git a/packages/datatrak-web/src/components/ChangeProjectButton.tsx b/packages/datatrak-web/src/components/ChangeProjectButton.tsx index 9337d41161..9c779ac1f7 100644 --- a/packages/datatrak-web/src/components/ChangeProjectButton.tsx +++ b/packages/datatrak-web/src/components/ChangeProjectButton.tsx @@ -77,7 +77,7 @@ export const ChangeProjectButton = ({ className }: { className?: string }) => { {projectName ?? 'Select project'} - {projectModalIsOpen && } + {projectModalIsOpen && } ); }; diff --git a/packages/datatrak-web/src/components/SelectList/index.ts b/packages/datatrak-web/src/components/SelectList/index.ts deleted file mode 100644 index 1dd5c6bbdb..0000000000 --- a/packages/datatrak-web/src/components/SelectList/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Tupaia - * Copyright (c) 2017 - 2023 Beyond Essential Systems Pty Ltd - */ - -export { SelectList } from './SelectList'; -export type { ListItemType } from './ListItem'; diff --git a/packages/datatrak-web/src/components/index.ts b/packages/datatrak-web/src/components/index.ts index f4ae7fc9f5..22e5a55246 100644 --- a/packages/datatrak-web/src/components/index.ts +++ b/packages/datatrak-web/src/components/index.ts @@ -5,7 +5,6 @@ export { PageContainer } from './PageContainer'; export * from './Icons'; -export * from './SelectList'; export { Autocomplete, QuestionAutocomplete } from './Autocomplete'; export { Button } from './Button'; export { ButtonLink } from './ButtonLink'; diff --git a/packages/datatrak-web/src/features/EntitySelector/ResultsList.tsx b/packages/datatrak-web/src/features/EntitySelector/ResultsList.tsx index bde1e21c8c..012298ed58 100644 --- a/packages/datatrak-web/src/features/EntitySelector/ResultsList.tsx +++ b/packages/datatrak-web/src/features/EntitySelector/ResultsList.tsx @@ -3,12 +3,12 @@ * Copyright (c) 2017 - 2023 Beyond Essential Systems Pty Ltd */ -import React from 'react'; +import React, { ReactNode } from 'react'; import styled from 'styled-components'; -import { Typography } from '@material-ui/core'; +import { FormLabelProps, Typography } from '@material-ui/core'; import RoomIcon from '@material-ui/icons/Room'; import { DatatrakWebEntityDescendantsRequest } from '@tupaia/types'; -import { ListItemType, SelectList } from '../../components'; +import { SelectList } from '@tupaia/ui-components'; const DARK_BLUE = '#004975'; @@ -43,6 +43,20 @@ export const ResultItem = ({ name, parentName }) => { ); }; +type ListItemType = Record & { + children?: ListItemType[]; + content: string | ReactNode; + value: string; + selected?: boolean; + icon?: ReactNode; + tooltip?: string; + button?: boolean; + disabled?: boolean; + labelProps?: FormLabelProps & { + component?: React.ElementType; + }; +}; + type SearchResults = DatatrakWebEntityDescendantsRequest.ResBody; interface ResultsListProps { value: string; diff --git a/packages/datatrak-web/src/features/GroupedSurveyList.tsx b/packages/datatrak-web/src/features/GroupedSurveyList.tsx index 222457548a..c32fd13e30 100644 --- a/packages/datatrak-web/src/features/GroupedSurveyList.tsx +++ b/packages/datatrak-web/src/features/GroupedSurveyList.tsx @@ -2,11 +2,12 @@ * Tupaia * Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd */ -import React, { useEffect } from 'react'; +import React, { ReactNode, useEffect } from 'react'; import styled from 'styled-components'; import { FormHelperText, FormLabelProps } from '@material-ui/core'; import { Country } from '@tupaia/types'; -import { ListItemType, SelectList, SurveyFolderIcon, SurveyIcon } from '../components'; +import { SelectList } from '@tupaia/ui-components'; +import { SurveyFolderIcon, SurveyIcon } from '../components'; import { Survey } from '../types'; import { useCurrentUserContext, useProjectSurveys } from '../api'; @@ -21,6 +22,20 @@ const ListWrapper = styled.div` } `; +type ListItemType = Record & { + children?: ListItemType[]; + content: string | ReactNode; + value: string; + selected?: boolean; + icon?: ReactNode; + tooltip?: string; + button?: boolean; + disabled?: boolean; + labelProps?: FormLabelProps & { + component?: React.ElementType; + }; +}; + const sortAlphanumerically = (a: ListItemType, b: ListItemType) => { return (a.content as string).trim()?.localeCompare((b.content as string).trim(), 'en', { numeric: true, diff --git a/packages/datatrak-web/src/features/RequestProjectAccess.tsx b/packages/datatrak-web/src/features/RequestProjectAccess.tsx index 4e98d364c7..252dc0004b 100644 --- a/packages/datatrak-web/src/features/RequestProjectAccess.tsx +++ b/packages/datatrak-web/src/features/RequestProjectAccess.tsx @@ -10,17 +10,17 @@ import { useCountryAccessList, useProject, useRequestProjectAccess } from '../ap interface RequestProjectAccessProps { variant?: 'page' | 'modal'; projectCode?: string; - onClose?: () => void; + onBack?: () => void; } -export const RequestProjectAccess = ({ projectCode, onClose }: RequestProjectAccessProps) => { +export const RequestProjectAccess = ({ projectCode, onBack }: RequestProjectAccessProps) => { const { data: project, isLoading: isLoadingProject, isFetched } = useProject(projectCode); const { mutate: requestProjectAccess, isLoading, isSuccess } = useRequestProjectAccess(); const { data: countries } = useCountryAccessList(projectCode); return ( void; + onBack: () => void; } -export const ProjectSelectModal = ({ onClose }: ModalProps) => { +export const ProjectSelectModal = ({ onBack }: ModalProps) => { const { projectId } = useCurrentUserContext(); const [requestAccessProjectCode, setRequestAccessProjectCode] = useState(null); + const { data: projects, isLoading } = useProjects(); + const { mutate: onConfirm, isLoading: isConfirming } = useEditUser(onBack); return ( // Enable the portal so it displays over any other content and we don't get z-index issues - + {requestAccessProjectCode ? ( setRequestAccessProjectCode(null)} + onBack={() => setRequestAccessProjectCode(null)} /> ) : ( )} diff --git a/packages/datatrak-web/src/layout/UserMenu/UserMenu.tsx b/packages/datatrak-web/src/layout/UserMenu/UserMenu.tsx index a876eed5bd..a8a5e750ac 100644 --- a/packages/datatrak-web/src/layout/UserMenu/UserMenu.tsx +++ b/packages/datatrak-web/src/layout/UserMenu/UserMenu.tsx @@ -58,7 +58,7 @@ export const UserMenu = () => { onCloseMenu={onCloseMenu} openProjectModal={openProjectModal} /> - {projectModalOpen && } + {projectModalOpen && } ); }; diff --git a/packages/datatrak-web/src/views/ProjectSelectPage.tsx b/packages/datatrak-web/src/views/ProjectSelectPage.tsx index f2028248eb..459f2be317 100644 --- a/packages/datatrak-web/src/views/ProjectSelectPage.tsx +++ b/packages/datatrak-web/src/views/ProjectSelectPage.tsx @@ -6,9 +6,10 @@ import React from 'react'; import styled from 'styled-components'; import { Paper } from '@material-ui/core'; import { useNavigate } from 'react-router-dom'; +import { ProjectSelectForm } from '@tupaia/ui-components'; import { useFromLocation } from '../utils'; -import { ProjectSelectForm } from '../features'; import { ROUTES } from '../constants'; +import { useEditUser, useProjects } from '../api'; const Container = styled(Paper).attrs({ variant: 'outlined', @@ -19,9 +20,19 @@ const Container = styled(Paper).attrs({ `; export const ProjectSelectPage = () => { + const { data: projects, isLoading } = useProjects(); + const { mutate: onConfirm, isLoading: isConfirming } = useEditUser(); + const navigate = useNavigate(); const from = useFromLocation(); + const onRequestAccess = (projectCode: string) => { + navigate({ + pathname: ROUTES.REQUEST_ACCESS, + search: `?project=${projectCode}`, + }); + }; + const onSuccess = () => { navigate(from || ROUTES.HOME, { state: null, @@ -30,7 +41,14 @@ export const ProjectSelectPage = () => { return ( - + ); }; diff --git a/packages/datatrak-web/src/views/RequestProjectAccessPage.tsx b/packages/datatrak-web/src/views/RequestProjectAccessPage.tsx index 18d0393f99..615ae0905c 100644 --- a/packages/datatrak-web/src/views/RequestProjectAccessPage.tsx +++ b/packages/datatrak-web/src/views/RequestProjectAccessPage.tsx @@ -34,7 +34,7 @@ export const RequestProjectAccessPage = () => { return ( ; user?: { email: string; accessPolicy: AccessPolicyObject; diff --git a/packages/server-boilerplate/src/orchestrator/index.ts b/packages/server-boilerplate/src/orchestrator/index.ts index 6b27f30c67..7af5bafa69 100644 --- a/packages/server-boilerplate/src/orchestrator/index.ts +++ b/packages/server-boilerplate/src/orchestrator/index.ts @@ -8,3 +8,4 @@ export { SessionModel, SessionRecord } from './models'; export { SessionCookie } from './types'; export { attachSession, attachSessionIfAvailable } from './session'; export { SessionSwitchingAuthHandler, RequiresSessionAuthHandler } from './auth'; +export { LoginRoute, LoginRequest } from './routes'; diff --git a/packages/tupaia-web-server/src/app/createApp.ts b/packages/tupaia-web-server/src/app/createApp.ts index 36e2626598..5599e14e2c 100644 --- a/packages/tupaia-web-server/src/app/createApp.ts +++ b/packages/tupaia-web-server/src/app/createApp.ts @@ -64,6 +64,8 @@ export async function createApp(db: TupaiaDatabase = new TupaiaDatabase()) { 'requestCountryAccess', handleWith(routes.RequestCountryAccessRoute), ) + // @ts-ignore LoginRoute types cannot be extended at this time + .post('loginUser', handleWith(routes.LoginRoute)) .get('entity/:projectCode/:entityCode', handleWith(routes.EntityRoute)) .get( 'entities/:projectCode/:rootEntityCode', @@ -100,6 +102,7 @@ export async function createApp(db: TupaiaDatabase = new TupaiaDatabase()) { ) .use('downloadFiles', forwardRequest(CENTRAL_API_URL, { authHandlerProvider })) .use('me/countries', forwardRequest(CENTRAL_API_URL, { authHandlerProvider })) + .use('me', forwardRequest(CENTRAL_API_URL, { authHandlerProvider })) // Forward everything else to webConfigApi .use('dashboards', forwardRequest(WEB_CONFIG_API_URL, { authHandlerProvider })) .use('export/chart', forwardRequest(WEB_CONFIG_API_URL, { authHandlerProvider })) diff --git a/packages/tupaia-web-server/src/routes/LoginRoute.ts b/packages/tupaia-web-server/src/routes/LoginRoute.ts new file mode 100644 index 0000000000..9b29b5d4a9 --- /dev/null +++ b/packages/tupaia-web-server/src/routes/LoginRoute.ts @@ -0,0 +1,28 @@ +/** + * Tupaia + * Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd + */ +import { + LoginRoute as BaseLoginRoute, + LoginRequest as BaseLoginRequest, +} from '@tupaia/server-boilerplate'; +import { getProjectById } from '../utils'; + +export type LoginRequest = BaseLoginRequest; + +type UserResponse = Record; + +export class LoginRoute extends BaseLoginRoute { + // @ts-ignore LoginRoute types cannot be extended at this time + public async buildResponse() { + const { ctx } = this.req; + const authResponse = await super.buildResponse(); + const user: UserResponse = authResponse.user; + + const projectId = user?.preferences?.project_id; + if (projectId) { + user.project = await getProjectById(ctx, projectId); + } + return user; + } +} diff --git a/packages/tupaia-web-server/src/routes/UserRoute.ts b/packages/tupaia-web-server/src/routes/UserRoute.ts index 1afd457952..32c23889b7 100644 --- a/packages/tupaia-web-server/src/routes/UserRoute.ts +++ b/packages/tupaia-web-server/src/routes/UserRoute.ts @@ -2,10 +2,10 @@ * Tupaia * Copyright (c) 2017 - 2023 Beyond Essential Systems Pty Ltd */ - import { Request } from 'express'; import { Route } from '@tupaia/server-boilerplate'; import { TupaiaWebUserRequest } from '@tupaia/types'; +import { getProjectById } from '../utils'; export type UserRequest = Request< TupaiaWebUserRequest.Params, @@ -28,8 +28,28 @@ export class UserRoute extends Route { first_name: firstName, last_name: lastName, email, + preferences, } = await ctx.services.central.getUser(); - return { userName: `${firstName} ${lastName}`, email }; + const userResponse: { + userName: string; + email: string; + project?: { + id: string; + name: string; + code: string; + homeEntityCode: string; + dashboardGroupName: string; + defaultMeasure: string; + }; + } = { userName: `${firstName} ${lastName}`, email }; + + const projectId = preferences?.project_id; + + if (projectId) { + userResponse.project = await getProjectById(ctx, projectId); + } + + return userResponse; } } diff --git a/packages/tupaia-web-server/src/routes/index.ts b/packages/tupaia-web-server/src/routes/index.ts index ee95acce3d..e8939e01a6 100644 --- a/packages/tupaia-web-server/src/routes/index.ts +++ b/packages/tupaia-web-server/src/routes/index.ts @@ -36,7 +36,6 @@ export { UnsubscribeDashboardMailingListRoute, UnsubscribeDashboardMailingListRequest, } from './UnsubscribeDashboardMailingListRoute'; - export { ExportMapOverlayRequest, ExportMapOverlayRoute } from './ExportMapOverlayRoute'; - +export { LoginRoute, LoginRequest } from './LoginRoute'; export { CountriesRequest, CountriesRoute } from './CountriesRoute'; diff --git a/packages/tupaia-web-server/src/utils/getProjectById.ts b/packages/tupaia-web-server/src/utils/getProjectById.ts new file mode 100644 index 0000000000..ae6b39675f --- /dev/null +++ b/packages/tupaia-web-server/src/utils/getProjectById.ts @@ -0,0 +1,28 @@ +/* + * Tupaia + * Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd + */ + +/** + * Fetches a project by its ID from webConfig server + * @param ctx + * @param projectId + */ +export const getProjectById = async (ctx: any, projectId: string) => { + const { projects = [] } = await ctx.services.webConfig.fetchProjects({ + showExcludedProjects: false, + }); + + const { id, name, code, homeEntityCode, dashboardGroupName, defaultMeasure } = projects.find( + ({ id }: { id: string }) => id === projectId, + ); + + return { + id, + name, + code, + homeEntityCode, + dashboardGroupName, + defaultMeasure, + }; +}; diff --git a/packages/tupaia-web-server/src/utils/index.ts b/packages/tupaia-web-server/src/utils/index.ts index 23a79f848f..15be9aaaf5 100644 --- a/packages/tupaia-web-server/src/utils/index.ts +++ b/packages/tupaia-web-server/src/utils/index.ts @@ -8,3 +8,4 @@ export { generateFrontendExcludedFilter, getTypesToExclude, } from './generateFrontendExcludedFilter'; +export { getProjectById } from './getProjectById'; diff --git a/packages/tupaia-web/src/ModalRoutes.tsx b/packages/tupaia-web/src/ModalRoutes.tsx index a74c5c8cc4..30781c4656 100644 --- a/packages/tupaia-web/src/ModalRoutes.tsx +++ b/packages/tupaia-web/src/ModalRoutes.tsx @@ -13,6 +13,7 @@ import { RequestProjectAccessModal, ForgotPasswordModal, ResetPasswordModal, + ProjectSelectModal, } from './views'; import { useModal, useGAEffect } from './utils'; @@ -25,6 +26,7 @@ export const ModalRoutes = () => { const modalViews = { [MODAL_ROUTES.PROJECTS]: ProjectsModal, + [MODAL_ROUTES.PROJECT_SELECT]: ProjectSelectModal, [MODAL_ROUTES.LOGIN]: LoginModal, [MODAL_ROUTES.REGISTER]: RegisterModal, [MODAL_ROUTES.REQUEST_PROJECT_ACCESS]: RequestProjectAccessModal, diff --git a/packages/tupaia-web/src/Routes.tsx b/packages/tupaia-web/src/Routes.tsx index 9365bd2a1c..9c0c1a8375 100644 --- a/packages/tupaia-web/src/Routes.tsx +++ b/packages/tupaia-web/src/Routes.tsx @@ -19,9 +19,14 @@ import { LoadingScreen } from './components'; import { gaEvent, useEntityLink } from './utils'; const HomeRedirect = () => { - const { isLoggedIn } = useUser(); + const { isLoggedIn, data } = useUser(); gaEvent('Navigate', 'Go Home'); + if (data?.project) { + const { code, homeEntityCode, dashboardGroupName } = data.project; + return ; + } + return ( ; + +export const useEditUser = (onSuccess?: (data: UserAccountDetails) => void) => { + const queryClient = useQueryClient(); + + return useMutation( + async ({ projectId }: Record) => { + const data = { + project_id: projectId, + }; + await put('me', { data }); + return { + projectId, + }; + }, + { + onSuccess: data => { + queryClient.invalidateQueries(['getUser']); + if (onSuccess) onSuccess(data); + }, + }, + ); +}; diff --git a/packages/tupaia-web/src/api/mutations/useLogin.ts b/packages/tupaia-web/src/api/mutations/useLogin.ts index bf5fa0f726..a170a2daf7 100644 --- a/packages/tupaia-web/src/api/mutations/useLogin.ts +++ b/packages/tupaia-web/src/api/mutations/useLogin.ts @@ -23,7 +23,7 @@ export const useLogin = () => { return useMutation( ({ email, password }: LoginCredentials) => { - return post('login', { + return post('loginUser', { data: { emailAddress: email, password, @@ -35,7 +35,7 @@ export const useLogin = () => { onMutate: () => { gaEvent('User', 'Log in', 'Attempt'); }, - onSuccess: () => { + onSuccess: data => { gaEvent('User', 'Login', 'success'); queryClient.invalidateQueries(); // if the user was redirected to the login page, redirect them back to the page they were on @@ -44,7 +44,12 @@ export const useLogin = () => { state: null, }); } else if (location.pathname.includes(DEFAULT_PROJECT_ENTITY)) { - navigateToModal(MODAL_ROUTES.PROJECTS); + if (data.project) { + const { code, homeEntityCode, dashboardGroupName } = data.project; + navigate(`/${code}/${homeEntityCode}/${dashboardGroupName}`); + } else { + navigateToModal(MODAL_ROUTES.PROJECTS); + } } else { closeModal(); } diff --git a/packages/tupaia-web/src/api/queries/useProject.ts b/packages/tupaia-web/src/api/queries/useProject.ts index 571695e080..360ac762c2 100644 --- a/packages/tupaia-web/src/api/queries/useProject.ts +++ b/packages/tupaia-web/src/api/queries/useProject.ts @@ -5,6 +5,7 @@ */ import { useQuery } from '@tanstack/react-query'; +import { useLocation } from 'react-router-dom'; import { SingleProject } from '../../types'; import { get } from '../api'; import { useUser } from './useUser'; @@ -13,6 +14,7 @@ import { MODAL_ROUTES, URL_SEARCH_PARAMS } from '../../constants'; export const useProject = (projectCode?: string) => { const { isLoggedIn } = useUser(); + const location = useLocation(); const { navigateToModal, navigateToLogin } = useModal(); return useQuery( ['project', projectCode], @@ -21,14 +23,21 @@ export const useProject = (projectCode?: string) => { enabled: !!projectCode, keepPreviousData: false, // this needs to be false, otherwise when we change project, the old one is returned for until the new data is fetched, which leads to extra requests to the wrong project+entity code onSuccess: (data: SingleProject) => { - if (data?.hasAccess) return; - if (isLoggedIn) + const locationIsRequestAccess = + location.hash.replace(/^#/, '') === MODAL_ROUTES.REQUEST_PROJECT_ACCESS; + + if (data?.hasAccess || locationIsRequestAccess) { + return; + } + + if (isLoggedIn && !locationIsRequestAccess) { return navigateToModal(MODAL_ROUTES.REQUEST_PROJECT_ACCESS, [ { param: URL_SEARCH_PARAMS.PROJECT, value: projectCode!, }, ]); + } return navigateToLogin(); }, }, diff --git a/packages/tupaia-web/src/api/queries/useProjects.ts b/packages/tupaia-web/src/api/queries/useProjects.ts index 226f140446..2766f9b86a 100644 --- a/packages/tupaia-web/src/api/queries/useProjects.ts +++ b/packages/tupaia-web/src/api/queries/useProjects.ts @@ -7,18 +7,12 @@ import { useQuery } from '@tanstack/react-query'; import { get } from '../api'; export const useProjects = () => { - return useQuery( - ['projects'], - () => - get('projects', { - params: { - showExcludedProjects: false, - }, - }), - { - placeholderData: { - projects: [], + return useQuery(['projects'], async () => { + const projectsResponse = await get('projects', { + params: { + showExcludedProjects: false, }, - }, - ); + }); + return projectsResponse?.projects.sort((a, b) => a.name.localeCompare(b.name)); + }); }; diff --git a/packages/tupaia-web/src/constants/url.ts b/packages/tupaia-web/src/constants/url.ts index d643f53eb5..e2e36f78ca 100644 --- a/packages/tupaia-web/src/constants/url.ts +++ b/packages/tupaia-web/src/constants/url.ts @@ -16,6 +16,7 @@ export const URL_SEARCH_PARAMS = { export enum MODAL_ROUTES { PROJECTS = 'projects', + PROJECT_SELECT = 'project-select', LOGIN = 'login', REGISTER = 'register', FORGOT_PASSWORD = 'forgot-password', diff --git a/packages/tupaia-web/src/features/Dashboard/Dashboard.tsx b/packages/tupaia-web/src/features/Dashboard/Dashboard.tsx index cf426d6fca..09bf480255 100644 --- a/packages/tupaia-web/src/features/Dashboard/Dashboard.tsx +++ b/packages/tupaia-web/src/features/Dashboard/Dashboard.tsx @@ -11,7 +11,7 @@ import { DEFAULT_BOUNDS } from '@tupaia/ui-map-components'; import { ErrorBoundary, SpinningLoader } from '@tupaia/ui-components'; import { MatrixConfig } from '@tupaia/types'; import { MOBILE_BREAKPOINT } from '../../constants'; -import { useDashboards, useEntity, useProject } from '../../api/queries'; +import { useDashboards, useEntity, useProject, useUser } from '../../api/queries'; import { DashboardItem as DashboardItemType } from '../../types'; import { gaEvent, getDefaultDashboard } from '../../utils'; import { DashboardItem } from '../DashboardItem'; @@ -23,6 +23,7 @@ import { StaticMap } from './StaticMap'; import { ExportDashboard } from './ExportDashboard'; import { DashboardContextProvider, useDashboard } from './utils'; import { SubscribeModal, DashboardMenu } from './DashboardMenu'; +import { useEditUser } from '../../api/mutations'; const MAX_SIDEBAR_EXPANDED_WIDTH = 1000; const MAX_SIDEBAR_COLLAPSED_WIDTH = 550; @@ -34,7 +35,9 @@ const Panel = styled.div<{ }>` position: relative; background-color: ${({ theme }) => theme.palette.background.paper}; - transition: width 0.3s ease, max-width 0.3s ease; + transition: + width 0.3s ease, + max-width 0.3s ease; width: 100%; overflow: visible; min-height: 100%; @@ -110,6 +113,14 @@ export const Dashboard = () => { const location = useLocation(); const { projectCode, entityCode } = useParams(); const { data: project, isLoading: isLoadingProject } = useProject(projectCode); + const { data: user } = useUser(); + const { mutate: updateUser } = useEditUser(); + + useEffect(() => { + if (project?.code !== user?.project?.code) { + updateUser({ projectId: project?.id }); + } + }, [project?.code, user?.project?.code]); const { activeDashboard } = useDashboard(); const { diff --git a/packages/tupaia-web/src/layout/ProjectCardList/ProjectCard.tsx b/packages/tupaia-web/src/layout/ProjectCardList/ProjectCard.tsx index 890ef0b882..4d55be500d 100644 --- a/packages/tupaia-web/src/layout/ProjectCardList/ProjectCard.tsx +++ b/packages/tupaia-web/src/layout/ProjectCardList/ProjectCard.tsx @@ -3,14 +3,17 @@ * Copyright (c) 2017 - 2023 Beyond Essential Systems Pty Ltd */ import React, { ComponentType } from 'react'; -import styled from 'styled-components'; +import styled, { css } from 'styled-components'; import Lock from '@material-ui/icons/Lock'; import Alarm from '@material-ui/icons/Alarm'; import { darken, lighten } from '@material-ui/core/styles'; import { Typography } from '@material-ui/core'; +import { Button as UIButton } from '@tupaia/ui-components'; import { SingleProject } from '../../types'; import { MODAL_ROUTES, MOBILE_BREAKPOINT } from '../../constants'; import { RouterButton } from '../../components'; +import { useNavigate } from 'react-router-dom'; +import { useEditUser } from '../../api/mutations'; const Card = styled.div` display: flex; @@ -35,10 +38,6 @@ const Card = styled.div` padding-left: 1.875rem; padding-right: 1.875rem; } - - button { - margin-top: auto; - } `; const LogoWrapper = styled.div` @@ -92,7 +91,7 @@ const TextWrapper = styled.div` height: 100%; `; -const BaseLink = styled(RouterButton)` +const ButtonStyles = css` background: ${({ theme }) => theme.palette.primary.main}; border: 1px solid ${({ theme }) => theme.palette.primary.main}; color: white; @@ -116,6 +115,14 @@ const BaseLink = styled(RouterButton)` } `; +const BaseLink = styled(RouterButton)` + ${ButtonStyles} +`; + +const Button = styled(UIButton)` + ${ButtonStyles} +`; + const OutlineLink = styled(BaseLink).attrs({ variant: 'outlined', })` @@ -162,11 +169,33 @@ export const ProjectPendingLink = () => ( ); -export const ProjectAllowedLink = ({ url, isLandingPage }: LinkProps) => ( - - View project - -); +type ProjectAllowedLinkProps = LinkProps & { + projectId: string; +}; + +export const ProjectAllowedLink = ({ projectId, url, isLandingPage }: ProjectAllowedLinkProps) => { + const navigate = useNavigate(); + const { mutate } = useEditUser(() => { + if (isLandingPage) { + window.open(url, '_blank'); + } else { + navigate(url); + } + }); + const handleSelectProject = () => { + mutate({ projectId }); + }; + return ( + + ); +}; interface ProjectCardProps extends Partial { ProjectButton: ComponentType; diff --git a/packages/tupaia-web/src/layout/ProjectCardList/ProjectCardList.tsx b/packages/tupaia-web/src/layout/ProjectCardList/ProjectCardList.tsx index da01ee6bcd..266d62436a 100644 --- a/packages/tupaia-web/src/layout/ProjectCardList/ProjectCardList.tsx +++ b/packages/tupaia-web/src/layout/ProjectCardList/ProjectCardList.tsx @@ -54,7 +54,6 @@ export const ProjectCardList = ({ .filter(project => { return project.names.includes(selectedCountry); }) - .sort((a, b) => a.name.localeCompare(b.name)) .map(project => ({ ...project, ActionButton: getActionButton(project), diff --git a/packages/tupaia-web/src/layout/UserMenu/DrawerMenu.tsx b/packages/tupaia-web/src/layout/UserMenu/DrawerMenu.tsx index 32f25e4ceb..e9bf1654ea 100644 --- a/packages/tupaia-web/src/layout/UserMenu/DrawerMenu.tsx +++ b/packages/tupaia-web/src/layout/UserMenu/DrawerMenu.tsx @@ -10,6 +10,8 @@ import { IconButton } from '@tupaia/ui-components'; import CloseIcon from '@material-ui/icons/Close'; import { MenuItem, MenuList } from './MenuList'; import { MOBILE_BREAKPOINT, MODAL_ROUTES } from '../../constants'; +import { User } from '../../types'; +import { RouterButton } from '../../components'; /** * DrawerMenu is a drawer menu used when the user is on a mobile device @@ -22,11 +24,11 @@ const Drawer = styled(MuiDrawer)` `; const MenuWrapper = styled.div` - padding: 0 1.5em; + padding: 0 1rem; li a, li button { font-size: 1.2rem; - padding: 0.8rem 0.5rem; + padding: 0.8rem 0.8rem; line-height: 1.4; text-align: left; width: 100%; @@ -42,29 +44,26 @@ const Username = styled.p<{ $secondaryColor?: string; }>` font-weight: 400; - margin: 0; + margin: 1rem 0 0 0; width: 100%; color: ${({ $secondaryColor }) => $secondaryColor}; opacity: 0.5; font-size: 1.2rem; - padding: 0.5rem 0.5em 0.3rem; `; -const MenuHeaderWrapper = styled.div` - padding: 0; -`; - -const MenuHeaderContainer = styled.div<{ +const MenuHeader = styled.div<{ $secondaryColor?: string; }>` display: flex; - justify-content: flex-end; - padding: 0.8em 0; - align-items: center; + padding: 0 0.8rem; + justify-content: space-between; + align-items: flex-start; border-bottom: 1px solid ${({ $secondaryColor }) => $secondaryColor}; color: ${({ $secondaryColor }) => $secondaryColor}; `; +const MenuHeaderContainer = styled.div``; + const MenuCloseIcon = styled(CloseIcon)<{ $secondaryColor?: string; }>` @@ -74,7 +73,32 @@ const MenuCloseIcon = styled(CloseIcon)<{ `; const MenuCloseButton = styled(IconButton)` - padding: 0; + padding: 1rem; + margin: 0 -1rem 0 0; +`; + +const ProjectButton = styled(RouterButton).attrs({ + variant: 'text', +})` + padding: 0.2rem 0.8rem 0.6rem; + margin-inline-start: -0.8rem; + text-decoration: none; + + .MuiButton-label { + text-decoration: none; + text-transform: none; + font-size: 0.875rem; + color: ${({ theme }) => theme.palette.text.primary}; + transition: color 0.2s; + } + + &:hover { + background: none; + .MuiButton-label { + color: ${({ theme }) => theme.palette.text.primary}; + text-decoration: underline; + } + } `; interface DrawerMenuProps { @@ -84,7 +108,7 @@ interface DrawerMenuProps { primaryColor?: string; secondaryColor?: string; isLoggedIn: boolean; - currentUserUsername?: string; + currentUser?: User; } export const DrawerMenu = ({ @@ -94,8 +118,10 @@ export const DrawerMenu = ({ primaryColor, secondaryColor, isLoggedIn, - currentUserUsername, + currentUser, }: DrawerMenuProps) => { + const currentUserUsername = currentUser?.userName; + const userProjectName = currentUser?.project?.name || 'Explore'; return ( - - + + {currentUserUsername && ( {currentUserUsername} )} - - - + {userProjectName && ( + { + onCloseMenu(); + }} + > + {userProjectName} + + )} - + + + + {/** If the user is not logged in, show the register and login buttons */} {!isLoggedIn && ( diff --git a/packages/tupaia-web/src/layout/UserMenu/UserInfo.tsx b/packages/tupaia-web/src/layout/UserMenu/UserInfo.tsx index bd6c0cd105..6bcb2bd514 100644 --- a/packages/tupaia-web/src/layout/UserMenu/UserInfo.tsx +++ b/packages/tupaia-web/src/layout/UserMenu/UserInfo.tsx @@ -6,8 +6,10 @@ import React from 'react'; import styled from 'styled-components'; import { LinkProps } from 'react-router-dom'; +import { Tooltip as UITooltip } from '@tupaia/ui-components'; import { MOBILE_BREAKPOINT, MODAL_ROUTES } from '../../constants'; import { RouterButton } from '../../components'; +import { User } from '../../types'; /** * UserInfo is a component that displays the user's name if user is logged in, or a register and sign in button if not set @@ -59,8 +61,37 @@ const SignInButton = styled(RouterButton).attrs({ padding-right: 1em; `; +const ProjectButton = styled(RouterButton).attrs({ + variant: 'text', +})` + padding-inline: 0.3rem; + + .MuiButton-label { + text-transform: none; + font-size: 0.875rem; + color: ${({ theme }) => theme.palette.text.secondary}; + line-height: 1.4; + transition: color 0.2s; + } + + &:hover { + background: none; + .MuiButton-label { + color: ${({ theme }) => theme.palette.text.primary}; + text-decoration: underline; + } + } +`; + +// Wrap the button in a to support the tooltip +const Tooltip = ({ children }) => ( + + {children} + +); + interface UserInfoProps { - currentUserUsername?: string; + user?: User; isLandingPage?: boolean; secondaryColor?: string; isLoggedIn?: boolean; @@ -69,16 +100,25 @@ interface UserInfoProps { /** * This is the username OR user buttons. These are only visible in desktop */ -export const UserInfo = ({ - currentUserUsername, - isLandingPage, - secondaryColor, - isLoggedIn, -}: UserInfoProps) => { - if (isLoggedIn) +export const UserInfo = ({ user, isLandingPage, secondaryColor, isLoggedIn }: UserInfoProps) => { + if (isLoggedIn) { + const userName = user?.userName; + const userProjectName = user?.project?.name || 'Explore'; return ( - {currentUserUsername} + + {userName} + {!isLandingPage ? ( + <> + {' '} + | + + {userProjectName} + + + ) : null} + ); + } return ( Register diff --git a/packages/tupaia-web/src/layout/UserMenu/UserMenu.tsx b/packages/tupaia-web/src/layout/UserMenu/UserMenu.tsx index 9f274f45f1..8ee8a02aa7 100644 --- a/packages/tupaia-web/src/layout/UserMenu/UserMenu.tsx +++ b/packages/tupaia-web/src/layout/UserMenu/UserMenu.tsx @@ -122,7 +122,7 @@ export const UserMenu = () => { { isLoggedIn={isLoggedIn} primaryColor={menuPrimaryColor} secondaryColor={menuSecondaryColor} - currentUserUsername={user?.name} + currentUser={user} > {menuItems} diff --git a/packages/tupaia-web/src/theme/theme.ts b/packages/tupaia-web/src/theme/theme.ts index 935ed94058..992642ab10 100644 --- a/packages/tupaia-web/src/theme/theme.ts +++ b/packages/tupaia-web/src/theme/theme.ts @@ -1,13 +1,23 @@ import { createMuiTheme } from '@material-ui/core'; +import { MOBILE_BREAKPOINT } from '../constants'; // MUI v4 doesn't support callbacks for theme overrides, so since these shades get used in multiple places, we need to define them here const LIGHT_BLACK = '#2e2f33'; const DARK_BLACK = '#202124'; const LIGHT_GREY = '#9BA0A6'; +const overMobileBreakpoint = `@media (min-width: ${MOBILE_BREAKPOINT})`; + export const theme = createMuiTheme({ typography: { fontSize: 16, // this needs to be 16 to correctly calculate the axis labels in recharts + h1: { + fontSize: '1rem', // page titles + fontWeight: 500, + [overMobileBreakpoint]: { + fontSize: '1.125rem', + }, + }, body1: { fontSize: '1rem', }, @@ -35,6 +45,7 @@ export const theme = createMuiTheme({ form: { border: '#d9d9d9', }, + tooltip: '#606368', overlaySelector: { overlayNameBackground: '#072849', menuBackground: '#203e5c', // Dark blue used for button and header background in mobile overlay selector, as well as the background of the menu list on desktop diff --git a/packages/tupaia-web/src/types/index.d.ts b/packages/tupaia-web/src/types/index.d.ts index 619664992e..e496aa8aef 100644 --- a/packages/tupaia-web/src/types/index.d.ts +++ b/packages/tupaia-web/src/types/index.d.ts @@ -6,4 +6,5 @@ export * from './types'; export * from './dashboard'; export * from './entity'; +export * from './user'; export * from './helpers'; diff --git a/packages/tupaia-web/src/types/material-ui.d.ts b/packages/tupaia-web/src/types/material-ui.d.ts index d8ddc4b6ff..9e65d59e29 100644 --- a/packages/tupaia-web/src/types/material-ui.d.ts +++ b/packages/tupaia-web/src/types/material-ui.d.ts @@ -1,6 +1,7 @@ import { PaletteOptions, Palette } from '@material-ui/core/styles/createPalette'; type CustomPalette = { + tooltip?: string; form?: { border: React.CSSProperties['color']; }; diff --git a/packages/tupaia-web/src/types/user.d.ts b/packages/tupaia-web/src/types/user.d.ts new file mode 100644 index 0000000000..c5db7b4498 --- /dev/null +++ b/packages/tupaia-web/src/types/user.d.ts @@ -0,0 +1,7 @@ +/* + * Tupaia + * Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd + */ +import { KeysToCamelCase, TupaiaWebUserRequest } from '@tupaia/types'; + +export type User = KeysToCamelCase; diff --git a/packages/tupaia-web/src/views/LandingPage/MultiProjectLandingPage.tsx b/packages/tupaia-web/src/views/LandingPage/MultiProjectLandingPage.tsx index 80c0d718c2..60c06d72a3 100644 --- a/packages/tupaia-web/src/views/LandingPage/MultiProjectLandingPage.tsx +++ b/packages/tupaia-web/src/views/LandingPage/MultiProjectLandingPage.tsx @@ -15,6 +15,7 @@ import { ProjectAllowedLink, ProjectPendingLink, } from '../../layout'; + const ProjectsWrapper = styled.div` width: 100%; max-width: ${({ theme }) => theme.breakpoints.values.lg}px; @@ -82,9 +83,10 @@ export function MultiProjectLandingPage({ projects={projects} actions={{ [PROJECT_ACCESS_TYPES.ALLOWED]: ({ - project: { code, homeEntityCode, dashboardGroupName }, + project: { id, code, homeEntityCode, dashboardGroupName }, }) => ( div { + max-block-size: 28rem; + } + + .MuiDialogActions-root { + position: relative; + top: 1rem; + } +`; + +const projectSort = (a, b) => { + // Sort by hasAccess = true first + if (a.hasAccess !== b.hasAccess) { + return a.hasAccess ? -1 : 1; + } + + // Sort by hasPendingAccess = true second + if (a.hasPendingAccess !== b.hasPendingAccess) { + return a.hasPendingAccess ? -1 : 1; + } + + // Otherwise, sort alphabetically by name + return a.name.localeCompare(b.name); +}; + +export const ProjectSelectModal = () => { + const { data: userData } = useUser(); + const location = useLocation(); + const projectId = userData?.project?.id; + const { data: projects = [], isFetching } = useProjects(); + const { closeModal } = useModal(); + const navigate = useNavigate(); + + const onSelectProject = data => { + const { projectId } = data; + const project = projects.find(p => p.id === projectId); + const { code, homeEntityCode } = project; + const dashboardGroupName = project.dashboardGroupName + ? encodeURIComponent(project.dashboardGroupName) + : ''; + navigate(`/${code}/${homeEntityCode}/${dashboardGroupName}`); + }; + + const { mutate: onConfirm, isLoading: isConfirming } = useEditUser(onSelectProject); + + const onRequestAccess = (projectCode: string) => { + const searchParams = new URLSearchParams(location.search); + searchParams.set(URL_SEARCH_PARAMS.PROJECT, projectCode); + navigate( + { + ...location, + search: searchParams.toString(), + hash: MODAL_ROUTES.REQUEST_PROJECT_ACCESS, + }, + { + state: { + referrer: location, + }, + }, + ); + }; + + const sortedProjects = projects.sort(projectSort); + + return ( + + + + + + ); +}; diff --git a/packages/tupaia-web/src/views/ProjectsModal.tsx b/packages/tupaia-web/src/views/ProjectsModal.tsx index 9655409fd4..652cba07a3 100644 --- a/packages/tupaia-web/src/views/ProjectsModal.tsx +++ b/packages/tupaia-web/src/views/ProjectsModal.tsx @@ -169,7 +169,7 @@ export const ProjectsModal = () => { value: string; } | null>(null); const { closeModal } = useModal(); - const { data, isFetching } = useProjects(); + const { data: projects = [], isFetching } = useProjects(); const { isLoggedIn } = useUser(); const location = useLocation(); const { data: countries, isLoading } = useCountries(); @@ -220,14 +220,15 @@ export const ProjectsModal = () => { ( { const [urlSearchParams] = useSearchParams(); const params = useParams(); + const { closeModal } = useModal(); const { mutate: requestCountryAccess, @@ -48,7 +49,10 @@ export const RequestProjectAccessModal = () => { error: requestCountryAccessError, isSuccess, } = useRequestCountryAccess(); - const { hash, ...location } = useLocation(); + + const { hash, state, ...location } = useLocation() as Location & { + state: { referrer?: Location }; + }; const navigate = useNavigate(); const { isLandingPage } = useLandingPage(); const { isLoggedIn, isLoading: isLoadingUser, isFetching } = useUser(); @@ -102,15 +106,16 @@ export const RequestProjectAccessModal = () => { // show the error if the user is getting a 403 error when trying to access an entity, as this means they have been redirected here from the useEntity hook const showError = (isError && entityError.code === 403) || hasRequestCountryAccessError; - const getBaseCloseLocation = () => { + const getBaseBackLocation = () => { if (isLandingPage) return location; if (isReturningToProjects) { + const newHash = state?.referrer?.hash ? state?.referrer.hash : MODAL_ROUTES.PROJECTS; return { ...location, // if the user has access to the project in the background, then return to the project with the project modal open, otherwise return to the default url with the project modal open pathname: backgroundProject?.hasAccess ? location.pathname : DEFAULT_URL, - hash: MODAL_ROUTES.PROJECTS, + hash: newHash, }; } @@ -125,20 +130,24 @@ export const RequestProjectAccessModal = () => { }; }; - const getCloseLocation = () => { - const baseCloseLocation = getBaseCloseLocation(); + const getBackLocation = () => { + const baseBackLocation = getBaseBackLocation(); // return the base close location with the project search param removed return { - ...baseCloseLocation, + ...baseBackLocation, search: removeUrlSearchParams([URL_SEARCH_PARAMS.PROJECT]), } as Location; }; - const closeLocation = getCloseLocation(); + const backLocation = getBackLocation(); const onCloseModal = () => { gaEvent('User', 'Close Dialog'); - navigate(closeLocation); + closeModal(); + }; + + const onBack = () => { + navigate(backLocation); }; return ( @@ -151,8 +160,8 @@ export const RequestProjectAccessModal = () => { isSubmitting={isSubmitting} onSubmit={requestCountryAccess} isSuccess={isSuccess} - onClose={onCloseModal} - closeButtonText={isReturningToProjects ? 'Return to projects' : 'Close'} + onBack={onBack} + backButtonText={isReturningToProjects ? 'Back to projects' : 'Close'} errorMessage={showError ? error.message : undefined} /> diff --git a/packages/tupaia-web/src/views/index.ts b/packages/tupaia-web/src/views/index.ts index c1b6549b68..3a07c55972 100644 --- a/packages/tupaia-web/src/views/index.ts +++ b/packages/tupaia-web/src/views/index.ts @@ -15,3 +15,4 @@ export { VerifyEmailResendModal } from './VerifyEmailResendModal'; export { DashboardPDFExport } from './DashboardPDFExport'; export { Unsubscribe } from './Unsubscribe'; export { MapOverlayPDFExport } from './MapOverlayPDFExport'; +export { ProjectSelectModal } from './ProjectSelectModal'; diff --git a/packages/types/src/schemas/schemas.ts b/packages/types/src/schemas/schemas.ts index 7eec0c1d0f..104cc4de39 100644 --- a/packages/types/src/schemas/schemas.ts +++ b/packages/types/src/schemas/schemas.ts @@ -64,7 +64,6 @@ export const DateOffsetSpecSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -130,7 +129,6 @@ export const DefaultTimePeriodSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -180,7 +178,6 @@ export const DefaultTimePeriodSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -232,7 +229,6 @@ export const DefaultTimePeriodSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -452,7 +448,6 @@ export const BaseConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -502,7 +497,6 @@ export const BaseConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -554,7 +548,6 @@ export const BaseConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -612,7 +605,6 @@ export const BaseConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -656,7 +648,6 @@ export const BaseConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -913,7 +904,6 @@ export const MatrixConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -963,7 +953,6 @@ export const MatrixConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -1015,7 +1004,6 @@ export const MatrixConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -1073,7 +1061,6 @@ export const MatrixConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -1117,7 +1104,6 @@ export const MatrixConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -1639,7 +1625,6 @@ export const MatrixVizBuilderConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -1689,7 +1674,6 @@ export const MatrixVizBuilderConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -1741,7 +1725,6 @@ export const MatrixVizBuilderConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -1799,7 +1782,6 @@ export const MatrixVizBuilderConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -1843,7 +1825,6 @@ export const MatrixVizBuilderConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -2860,7 +2841,6 @@ export const ComponentConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -2910,7 +2890,6 @@ export const ComponentConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -2962,7 +2941,6 @@ export const ComponentConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -3020,7 +2998,6 @@ export const ComponentConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -3064,7 +3041,6 @@ export const ComponentConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -3407,7 +3383,6 @@ export const BaseChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -3457,7 +3432,6 @@ export const BaseChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -3509,7 +3483,6 @@ export const BaseChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -3567,7 +3540,6 @@ export const BaseChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -3611,7 +3583,6 @@ export const BaseChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -4297,7 +4268,6 @@ export const CartesianChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -4347,7 +4317,6 @@ export const CartesianChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -4399,7 +4368,6 @@ export const CartesianChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -4457,7 +4425,6 @@ export const CartesianChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -4501,7 +4468,6 @@ export const CartesianChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -5132,7 +5098,6 @@ export const PieChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -5182,7 +5147,6 @@ export const PieChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -5234,7 +5198,6 @@ export const PieChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -5292,7 +5255,6 @@ export const PieChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -5336,7 +5298,6 @@ export const PieChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -5707,7 +5668,6 @@ export const BarChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -5757,7 +5717,6 @@ export const BarChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -5809,7 +5768,6 @@ export const BarChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -5867,7 +5825,6 @@ export const BarChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -5911,7 +5868,6 @@ export const BarChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -6678,7 +6634,6 @@ export const LineChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -6728,7 +6683,6 @@ export const LineChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -6780,7 +6734,6 @@ export const LineChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -6838,7 +6791,6 @@ export const LineChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -6882,7 +6834,6 @@ export const LineChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -7641,7 +7592,6 @@ export const ComposedChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -7691,7 +7641,6 @@ export const ComposedChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -7743,7 +7692,6 @@ export const ComposedChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -7801,7 +7749,6 @@ export const ComposedChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -7845,7 +7792,6 @@ export const ComposedChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -8420,7 +8366,6 @@ export const GaugeChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -8470,7 +8415,6 @@ export const GaugeChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -8522,7 +8466,6 @@ export const GaugeChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -8580,7 +8523,6 @@ export const GaugeChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -8624,7 +8566,6 @@ export const GaugeChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -8902,7 +8843,6 @@ export const ChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -8952,7 +8892,6 @@ export const ChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -9004,7 +8943,6 @@ export const ChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -9062,7 +9000,6 @@ export const ChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -9106,7 +9043,6 @@ export const ChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -9417,7 +9353,6 @@ export const ChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -9467,7 +9402,6 @@ export const ChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -9519,7 +9453,6 @@ export const ChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -9577,7 +9510,6 @@ export const ChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -9621,7 +9553,6 @@ export const ChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -10212,7 +10143,6 @@ export const ChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -10262,7 +10192,6 @@ export const ChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -10314,7 +10243,6 @@ export const ChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -10372,7 +10300,6 @@ export const ChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -10416,7 +10343,6 @@ export const ChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -11001,7 +10927,6 @@ export const ChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -11051,7 +10976,6 @@ export const ChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -11103,7 +11027,6 @@ export const ChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -11161,7 +11084,6 @@ export const ChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -11205,7 +11127,6 @@ export const ChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -11779,7 +11700,6 @@ export const ChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -11829,7 +11749,6 @@ export const ChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -11881,7 +11800,6 @@ export const ChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -11939,7 +11857,6 @@ export const ChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -11983,7 +11900,6 @@ export const ChartConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -12391,7 +12307,6 @@ export const BaseViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -12441,7 +12356,6 @@ export const BaseViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -12493,7 +12407,6 @@ export const BaseViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -12551,7 +12464,6 @@ export const BaseViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -12595,7 +12507,6 @@ export const BaseViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -12868,7 +12779,6 @@ export const MultiValueViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -12918,7 +12828,6 @@ export const MultiValueViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -12970,7 +12879,6 @@ export const MultiValueViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -13028,7 +12936,6 @@ export const MultiValueViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -13072,7 +12979,6 @@ export const MultiValueViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -13453,7 +13359,6 @@ export const MultiValueRowViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -13503,7 +13408,6 @@ export const MultiValueRowViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -13555,7 +13459,6 @@ export const MultiValueRowViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -13613,7 +13516,6 @@ export const MultiValueRowViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -13657,7 +13559,6 @@ export const MultiValueRowViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -13989,7 +13890,6 @@ export const SingleValueViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -14039,7 +13939,6 @@ export const SingleValueViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -14091,7 +13990,6 @@ export const SingleValueViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -14149,7 +14047,6 @@ export const SingleValueViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -14193,7 +14090,6 @@ export const SingleValueViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -14439,7 +14335,6 @@ export const MultiPhotographViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -14489,7 +14384,6 @@ export const MultiPhotographViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -14541,7 +14435,6 @@ export const MultiPhotographViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -14599,7 +14492,6 @@ export const MultiPhotographViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -14643,7 +14535,6 @@ export const MultiPhotographViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -14885,7 +14776,6 @@ export const MultiSingleValueViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -14935,7 +14825,6 @@ export const MultiSingleValueViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -14987,7 +14876,6 @@ export const MultiSingleValueViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -15045,7 +14933,6 @@ export const MultiSingleValueViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -15089,7 +14976,6 @@ export const MultiSingleValueViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -15331,7 +15217,6 @@ export const SingleDownloadLinkViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -15381,7 +15266,6 @@ export const SingleDownloadLinkViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -15433,7 +15317,6 @@ export const SingleDownloadLinkViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -15491,7 +15374,6 @@ export const SingleDownloadLinkViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -15535,7 +15417,6 @@ export const SingleDownloadLinkViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -15777,7 +15658,6 @@ export const DataDownloadViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -15827,7 +15707,6 @@ export const DataDownloadViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -15879,7 +15758,6 @@ export const DataDownloadViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -15937,7 +15815,6 @@ export const DataDownloadViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -15981,7 +15858,6 @@ export const DataDownloadViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -16223,7 +16099,6 @@ export const DataDownloadViewVizBuilderConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -16273,7 +16148,6 @@ export const DataDownloadViewVizBuilderConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -16325,7 +16199,6 @@ export const DataDownloadViewVizBuilderConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -16383,7 +16256,6 @@ export const DataDownloadViewVizBuilderConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -16427,7 +16299,6 @@ export const DataDownloadViewVizBuilderConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -16685,7 +16556,6 @@ export const SingleDateViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -16735,7 +16605,6 @@ export const SingleDateViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -16787,7 +16656,6 @@ export const SingleDateViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -16845,7 +16713,6 @@ export const SingleDateViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -16889,7 +16756,6 @@ export const SingleDateViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -17131,7 +16997,6 @@ export const DownloadFilesViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -17181,7 +17046,6 @@ export const DownloadFilesViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -17233,7 +17097,6 @@ export const DownloadFilesViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -17291,7 +17154,6 @@ export const DownloadFilesViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -17335,7 +17197,6 @@ export const DownloadFilesViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -17577,7 +17438,6 @@ export const QRCodeViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -17627,7 +17487,6 @@ export const QRCodeViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -17679,7 +17538,6 @@ export const QRCodeViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -17737,7 +17595,6 @@ export const QRCodeViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -17781,7 +17638,6 @@ export const QRCodeViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -18025,7 +17881,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -18075,7 +17930,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -18127,7 +17981,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -18185,7 +18038,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -18229,7 +18081,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -18483,7 +18334,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -18533,7 +18383,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -18585,7 +18434,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -18643,7 +18491,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -18687,7 +18534,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -19018,7 +18864,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -19068,7 +18913,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -19120,7 +18964,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -19178,7 +19021,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -19222,7 +19064,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -19467,7 +19308,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -19517,7 +19357,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -19569,7 +19408,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -19627,7 +19465,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -19671,7 +19508,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -19912,7 +19748,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -19962,7 +19797,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -20014,7 +19848,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -20072,7 +19905,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -20116,7 +19948,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -20357,7 +20188,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -20407,7 +20237,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -20459,7 +20288,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -20517,7 +20345,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -20561,7 +20388,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -20802,7 +20628,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -20852,7 +20677,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -20904,7 +20728,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -20962,7 +20785,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -21006,7 +20828,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -21247,7 +21068,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -21297,7 +21117,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -21349,7 +21168,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -21407,7 +21225,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -21451,7 +21268,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -21692,7 +21508,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -21742,7 +21557,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -21794,7 +21608,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -21852,7 +21665,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -21896,7 +21708,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -22137,7 +21948,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -22187,7 +21997,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -22239,7 +22048,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -22297,7 +22105,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -22341,7 +22148,6 @@ export const ViewConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -22697,7 +22503,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -22747,7 +22552,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -22799,7 +22603,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -22857,7 +22660,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -22901,7 +22703,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -23423,7 +23224,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -23473,7 +23273,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -23525,7 +23324,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -23583,7 +23381,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -23627,7 +23424,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -23852,7 +23648,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -23902,7 +23697,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -23954,7 +23748,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -24012,7 +23805,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -24056,7 +23848,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -24367,7 +24158,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -24417,7 +24207,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -24469,7 +24258,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -24527,7 +24315,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -24571,7 +24358,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -25162,7 +24948,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -25212,7 +24997,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -25264,7 +25048,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -25322,7 +25105,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -25366,7 +25148,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -25951,7 +25732,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -26001,7 +25781,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -26053,7 +25832,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -26111,7 +25889,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -26155,7 +25932,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -26729,7 +26505,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -26779,7 +26554,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -26831,7 +26605,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -26889,7 +26662,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -26933,7 +26705,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -27207,7 +26978,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -27257,7 +27027,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -27309,7 +27078,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -27367,7 +27135,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -27411,7 +27178,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -27665,7 +27431,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -27715,7 +27480,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -27767,7 +27531,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -27825,7 +27588,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -27869,7 +27631,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -28200,7 +27961,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -28250,7 +28010,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -28302,7 +28061,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -28360,7 +28118,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -28404,7 +28161,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -28649,7 +28405,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -28699,7 +28454,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -28751,7 +28505,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -28809,7 +28562,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -28853,7 +28605,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -29094,7 +28845,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -29144,7 +28894,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -29196,7 +28945,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -29254,7 +29002,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -29298,7 +29045,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -29539,7 +29285,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -29589,7 +29334,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -29641,7 +29385,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -29699,7 +29442,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -29743,7 +29485,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -29984,7 +29725,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -30034,7 +29774,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -30086,7 +29825,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -30144,7 +29882,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -30188,7 +29925,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -30429,7 +30165,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -30479,7 +30214,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -30531,7 +30265,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -30589,7 +30322,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -30633,7 +30365,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -30874,7 +30605,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -30924,7 +30654,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -30976,7 +30705,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -31034,7 +30762,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -31078,7 +30805,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -31319,7 +31045,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -31369,7 +31094,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -31421,7 +31145,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -31479,7 +31202,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -31523,7 +31245,6 @@ export const DashboardItemConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -33102,7 +32823,6 @@ export const BaseMapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -33146,7 +32866,6 @@ export const BaseMapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -33196,7 +32915,6 @@ export const BaseMapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -33246,7 +32964,6 @@ export const BaseMapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -33298,7 +33015,6 @@ export const BaseMapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -33667,7 +33383,6 @@ export const SpectrumMapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -33711,7 +33426,6 @@ export const SpectrumMapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -33761,7 +33475,6 @@ export const SpectrumMapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -33811,7 +33524,6 @@ export const SpectrumMapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -33863,7 +33575,6 @@ export const SpectrumMapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -34337,7 +34048,6 @@ export const IconMapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -34381,7 +34091,6 @@ export const IconMapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -34431,7 +34140,6 @@ export const IconMapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -34481,7 +34189,6 @@ export const IconMapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -34533,7 +34240,6 @@ export const IconMapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -34932,7 +34638,6 @@ export const RadiusMapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -34976,7 +34681,6 @@ export const RadiusMapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -35026,7 +34730,6 @@ export const RadiusMapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -35076,7 +34779,6 @@ export const RadiusMapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -35128,7 +34830,6 @@ export const RadiusMapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -35501,7 +35202,6 @@ export const ColorMapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -35545,7 +35245,6 @@ export const ColorMapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -35595,7 +35294,6 @@ export const ColorMapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -35645,7 +35343,6 @@ export const ColorMapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -35697,7 +35394,6 @@ export const ColorMapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -36084,7 +35780,6 @@ export const ShadingMapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -36128,7 +35823,6 @@ export const ShadingMapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -36178,7 +35872,6 @@ export const ShadingMapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -36228,7 +35921,6 @@ export const ShadingMapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -36280,7 +35972,6 @@ export const ShadingMapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -36659,7 +36350,6 @@ export const MapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -36703,7 +36393,6 @@ export const MapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -36753,7 +36442,6 @@ export const MapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -36803,7 +36491,6 @@ export const MapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -36855,7 +36542,6 @@ export const MapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -37328,7 +37014,6 @@ export const MapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -37372,7 +37057,6 @@ export const MapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -37422,7 +37106,6 @@ export const MapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -37472,7 +37155,6 @@ export const MapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -37524,7 +37206,6 @@ export const MapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -37922,7 +37603,6 @@ export const MapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -37966,7 +37646,6 @@ export const MapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -38016,7 +37695,6 @@ export const MapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -38066,7 +37744,6 @@ export const MapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -38118,7 +37795,6 @@ export const MapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -38490,7 +38166,6 @@ export const MapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -38534,7 +38209,6 @@ export const MapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -38584,7 +38258,6 @@ export const MapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -38634,7 +38307,6 @@ export const MapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -38686,7 +38358,6 @@ export const MapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -39072,7 +38743,6 @@ export const MapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -39116,7 +38786,6 @@ export const MapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -39166,7 +38835,6 @@ export const MapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -39216,7 +38884,6 @@ export const MapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -39268,7 +38935,6 @@ export const MapOverlayConfigSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -42363,7 +42029,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -42413,7 +42078,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -42465,7 +42129,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -42523,7 +42186,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -42567,7 +42229,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -43089,7 +42750,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -43139,7 +42799,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -43191,7 +42850,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -43249,7 +42907,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -43293,7 +42950,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -43518,7 +43174,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -43568,7 +43223,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -43620,7 +43274,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -43678,7 +43331,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -43722,7 +43374,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -44033,7 +43684,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -44083,7 +43733,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -44135,7 +43784,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -44193,7 +43841,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -44237,7 +43884,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -44828,7 +44474,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -44878,7 +44523,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -44930,7 +44574,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -44988,7 +44631,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -45032,7 +44674,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -45617,7 +45258,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -45667,7 +45307,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -45719,7 +45358,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -45777,7 +45415,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -45821,7 +45458,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -46395,7 +46031,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -46445,7 +46080,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -46497,7 +46131,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -46555,7 +46188,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -46599,7 +46231,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -46873,7 +46504,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -46923,7 +46553,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -46975,7 +46604,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -47033,7 +46661,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -47077,7 +46704,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -47331,7 +46957,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -47381,7 +47006,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -47433,7 +47057,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -47491,7 +47114,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -47535,7 +47157,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -47866,7 +47487,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -47916,7 +47536,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -47968,7 +47587,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -48026,7 +47644,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -48070,7 +47687,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -48315,7 +47931,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -48365,7 +47980,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -48417,7 +48031,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -48475,7 +48088,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -48519,7 +48131,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -48760,7 +48371,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -48810,7 +48420,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -48862,7 +48471,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -48920,7 +48528,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -48964,7 +48571,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -49205,7 +48811,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -49255,7 +48860,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -49307,7 +48911,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -49365,7 +48968,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -49409,7 +49011,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -49650,7 +49251,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -49700,7 +49300,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -49752,7 +49351,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -49810,7 +49408,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -49854,7 +49451,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -50095,7 +49691,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -50145,7 +49740,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -50197,7 +49791,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -50255,7 +49848,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -50299,7 +49891,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -50540,7 +50131,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -50590,7 +50180,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -50642,7 +50231,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -50700,7 +50288,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -50744,7 +50331,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -50985,7 +50571,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -51035,7 +50620,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -51087,7 +50671,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -51145,7 +50728,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -51189,7 +50771,6 @@ export const DashboardItemSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -51467,7 +51048,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -51517,7 +51097,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -51569,7 +51148,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -51627,7 +51205,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -51671,7 +51248,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -52193,7 +51769,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -52243,7 +51818,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -52295,7 +51869,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -52353,7 +51926,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -52397,7 +51969,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -52622,7 +52193,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -52672,7 +52242,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -52724,7 +52293,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -52782,7 +52350,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -52826,7 +52393,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -53137,7 +52703,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -53187,7 +52752,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -53239,7 +52803,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -53297,7 +52860,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -53341,7 +52903,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -53932,7 +53493,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -53982,7 +53542,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -54034,7 +53593,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -54092,7 +53650,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -54136,7 +53693,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -54721,7 +54277,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -54771,7 +54326,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -54823,7 +54377,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -54881,7 +54434,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -54925,7 +54477,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -55499,7 +55050,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -55549,7 +55099,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -55601,7 +55150,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -55659,7 +55207,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -55703,7 +55250,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -55977,7 +55523,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -56027,7 +55572,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -56079,7 +55623,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -56137,7 +55680,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -56181,7 +55723,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -56435,7 +55976,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -56485,7 +56025,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -56537,7 +56076,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -56595,7 +56133,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -56639,7 +56176,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -56970,7 +56506,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -57020,7 +56555,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -57072,7 +56606,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -57130,7 +56663,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -57174,7 +56706,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -57419,7 +56950,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -57469,7 +56999,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -57521,7 +57050,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -57579,7 +57107,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -57623,7 +57150,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -57864,7 +57390,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -57914,7 +57439,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -57966,7 +57490,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -58024,7 +57547,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -58068,7 +57590,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -58309,7 +57830,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -58359,7 +57879,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -58411,7 +57930,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -58469,7 +57987,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -58513,7 +58030,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -58754,7 +58270,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -58804,7 +58319,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -58856,7 +58370,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -58914,7 +58427,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -58958,7 +58470,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -59199,7 +58710,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -59249,7 +58759,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -59301,7 +58810,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -59359,7 +58867,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -59403,7 +58910,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -59644,7 +59150,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -59694,7 +59199,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -59746,7 +59250,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -59804,7 +59307,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -59848,7 +59350,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -60089,7 +59590,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -60139,7 +59639,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -60191,7 +59690,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -60249,7 +59747,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -60293,7 +59790,6 @@ export const DashboardItemCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -60565,7 +60061,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -60615,7 +60110,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -60667,7 +60161,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -60725,7 +60218,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -60769,7 +60261,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -61291,7 +60782,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -61341,7 +60831,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -61393,7 +60882,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -61451,7 +60939,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -61495,7 +60982,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -61720,7 +61206,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -61770,7 +61255,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -61822,7 +61306,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -61880,7 +61363,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -61924,7 +61406,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -62235,7 +61716,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -62285,7 +61765,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -62337,7 +61816,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -62395,7 +61873,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -62439,7 +61916,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -63030,7 +62506,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -63080,7 +62555,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -63132,7 +62606,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -63190,7 +62663,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -63234,7 +62706,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -63819,7 +63290,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -63869,7 +63339,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -63921,7 +63390,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -63979,7 +63447,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -64023,7 +63490,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -64597,7 +64063,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -64647,7 +64112,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -64699,7 +64163,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -64757,7 +64220,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -64801,7 +64263,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -65075,7 +64536,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -65125,7 +64585,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -65177,7 +64636,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -65235,7 +64693,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -65279,7 +64736,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -65533,7 +64989,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -65583,7 +65038,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -65635,7 +65089,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -65693,7 +65146,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -65737,7 +65189,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -66068,7 +65519,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -66118,7 +65568,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -66170,7 +65619,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -66228,7 +65676,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -66272,7 +65719,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -66517,7 +65963,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -66567,7 +66012,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -66619,7 +66063,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -66677,7 +66120,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -66721,7 +66163,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -66962,7 +66403,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -67012,7 +66452,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -67064,7 +66503,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -67122,7 +66560,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -67166,7 +66603,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -67407,7 +66843,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -67457,7 +66892,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -67509,7 +66943,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -67567,7 +67000,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -67611,7 +67043,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -67852,7 +67283,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -67902,7 +67332,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -67954,7 +67383,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -68012,7 +67440,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -68056,7 +67483,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -68297,7 +67723,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -68347,7 +67772,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -68399,7 +67823,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -68457,7 +67880,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -68501,7 +67923,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -68742,7 +68163,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -68792,7 +68212,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -68844,7 +68263,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -68902,7 +68320,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -68946,7 +68363,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -69187,7 +68603,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -69237,7 +68652,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -69289,7 +68703,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -69347,7 +68760,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -69391,7 +68803,6 @@ export const DashboardItemUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -72124,7 +71535,6 @@ export const MapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -72168,7 +71578,6 @@ export const MapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -72218,7 +71627,6 @@ export const MapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -72268,7 +71676,6 @@ export const MapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -72320,7 +71727,6 @@ export const MapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -72793,7 +72199,6 @@ export const MapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -72837,7 +72242,6 @@ export const MapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -72887,7 +72291,6 @@ export const MapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -72937,7 +72340,6 @@ export const MapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -72989,7 +72391,6 @@ export const MapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -73387,7 +72788,6 @@ export const MapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -73431,7 +72831,6 @@ export const MapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -73481,7 +72880,6 @@ export const MapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -73531,7 +72929,6 @@ export const MapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -73583,7 +72980,6 @@ export const MapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -73955,7 +73351,6 @@ export const MapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -73999,7 +73394,6 @@ export const MapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -74049,7 +73443,6 @@ export const MapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -74099,7 +73492,6 @@ export const MapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -74151,7 +73543,6 @@ export const MapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -74537,7 +73928,6 @@ export const MapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -74581,7 +73971,6 @@ export const MapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -74631,7 +74020,6 @@ export const MapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -74681,7 +74069,6 @@ export const MapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -74733,7 +74120,6 @@ export const MapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -75173,7 +74559,6 @@ export const MapOverlayCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -75217,7 +74602,6 @@ export const MapOverlayCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -75267,7 +74651,6 @@ export const MapOverlayCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -75317,7 +74700,6 @@ export const MapOverlayCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -75369,7 +74751,6 @@ export const MapOverlayCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -75842,7 +75223,6 @@ export const MapOverlayCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -75886,7 +75266,6 @@ export const MapOverlayCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -75936,7 +75315,6 @@ export const MapOverlayCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -75986,7 +75364,6 @@ export const MapOverlayCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -76038,7 +75415,6 @@ export const MapOverlayCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -76436,7 +75812,6 @@ export const MapOverlayCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -76480,7 +75855,6 @@ export const MapOverlayCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -76530,7 +75904,6 @@ export const MapOverlayCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -76580,7 +75953,6 @@ export const MapOverlayCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -76632,7 +76004,6 @@ export const MapOverlayCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -77004,7 +76375,6 @@ export const MapOverlayCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -77048,7 +76418,6 @@ export const MapOverlayCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -77098,7 +76467,6 @@ export const MapOverlayCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -77148,7 +76516,6 @@ export const MapOverlayCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -77200,7 +76567,6 @@ export const MapOverlayCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -77586,7 +76952,6 @@ export const MapOverlayCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -77630,7 +76995,6 @@ export const MapOverlayCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -77680,7 +77044,6 @@ export const MapOverlayCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -77730,7 +77093,6 @@ export const MapOverlayCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -77782,7 +77144,6 @@ export const MapOverlayCreateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -78215,7 +77576,6 @@ export const MapOverlayUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -78259,7 +77619,6 @@ export const MapOverlayUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -78309,7 +77668,6 @@ export const MapOverlayUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -78359,7 +77717,6 @@ export const MapOverlayUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -78411,7 +77768,6 @@ export const MapOverlayUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -78884,7 +78240,6 @@ export const MapOverlayUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -78928,7 +78283,6 @@ export const MapOverlayUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -78978,7 +78332,6 @@ export const MapOverlayUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -79028,7 +78381,6 @@ export const MapOverlayUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -79080,7 +78432,6 @@ export const MapOverlayUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -79478,7 +78829,6 @@ export const MapOverlayUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -79522,7 +78872,6 @@ export const MapOverlayUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -79572,7 +78921,6 @@ export const MapOverlayUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -79622,7 +78970,6 @@ export const MapOverlayUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -79674,7 +79021,6 @@ export const MapOverlayUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -80046,7 +79392,6 @@ export const MapOverlayUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -80090,7 +79435,6 @@ export const MapOverlayUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -80140,7 +79484,6 @@ export const MapOverlayUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -80190,7 +79533,6 @@ export const MapOverlayUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -80242,7 +79584,6 @@ export const MapOverlayUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -80628,7 +79969,6 @@ export const MapOverlayUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -80672,7 +80012,6 @@ export const MapOverlayUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -80722,7 +80061,6 @@ export const MapOverlayUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -80772,7 +80110,6 @@ export const MapOverlayUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -80824,7 +80161,6 @@ export const MapOverlayUpdateSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -86613,7 +85949,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -86663,7 +85998,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -86715,7 +86049,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -86773,7 +86106,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -86817,7 +86149,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -87339,7 +86670,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -87389,7 +86719,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -87441,7 +86770,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -87499,7 +86827,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -87543,7 +86870,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -87768,7 +87094,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -87818,7 +87143,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -87870,7 +87194,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -87928,7 +87251,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -87972,7 +87294,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -88283,7 +87604,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -88333,7 +87653,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -88385,7 +87704,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -88443,7 +87761,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -88487,7 +87804,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -89078,7 +88394,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -89128,7 +88443,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -89180,7 +88494,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -89238,7 +88551,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -89282,7 +88594,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -89867,7 +89178,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -89917,7 +89227,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -89969,7 +89278,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -90027,7 +89335,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -90071,7 +89378,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -90645,7 +89951,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -90695,7 +90000,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -90747,7 +90051,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -90805,7 +90108,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -90849,7 +90151,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -91123,7 +90424,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -91173,7 +90473,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -91225,7 +90524,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -91283,7 +90581,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -91327,7 +90624,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -91581,7 +90877,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -91631,7 +90926,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -91683,7 +90977,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -91741,7 +91034,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -91785,7 +91077,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -92116,7 +91407,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -92166,7 +91456,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -92218,7 +91507,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -92276,7 +91564,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -92320,7 +91607,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -92565,7 +91851,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -92615,7 +91900,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -92667,7 +91951,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -92725,7 +92008,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -92769,7 +92051,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -93010,7 +92291,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -93060,7 +92340,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -93112,7 +92391,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -93170,7 +92448,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -93214,7 +92491,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -93455,7 +92731,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -93505,7 +92780,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -93557,7 +92831,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -93615,7 +92888,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -93659,7 +92931,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -93900,7 +93171,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -93950,7 +93220,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -94002,7 +93271,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -94060,7 +93328,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -94104,7 +93371,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -94345,7 +93611,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -94395,7 +93660,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -94447,7 +93711,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -94505,7 +93768,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -94549,7 +93811,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -94790,7 +94051,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -94840,7 +94100,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -94892,7 +94151,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -94950,7 +94208,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -94994,7 +94251,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -95235,7 +94491,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -95285,7 +94540,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -95337,7 +94591,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -95395,7 +94648,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -95439,7 +94691,6 @@ export const DashboardWithMetadataSchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -95735,7 +94986,6 @@ export const TranslatedMapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -95779,7 +95029,6 @@ export const TranslatedMapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -95829,7 +95078,6 @@ export const TranslatedMapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -95879,7 +95127,6 @@ export const TranslatedMapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -95931,7 +95178,6 @@ export const TranslatedMapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -96427,7 +95673,6 @@ export const TranslatedMapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -96471,7 +95716,6 @@ export const TranslatedMapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -96521,7 +95765,6 @@ export const TranslatedMapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -96571,7 +95814,6 @@ export const TranslatedMapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -96623,7 +95865,6 @@ export const TranslatedMapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -97044,7 +96285,6 @@ export const TranslatedMapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -97088,7 +96328,6 @@ export const TranslatedMapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -97138,7 +96377,6 @@ export const TranslatedMapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -97188,7 +96426,6 @@ export const TranslatedMapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -97240,7 +96477,6 @@ export const TranslatedMapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -97635,7 +96871,6 @@ export const TranslatedMapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -97679,7 +96914,6 @@ export const TranslatedMapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -97729,7 +96963,6 @@ export const TranslatedMapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -97779,7 +97012,6 @@ export const TranslatedMapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -97831,7 +97063,6 @@ export const TranslatedMapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -98240,7 +97471,6 @@ export const TranslatedMapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -98284,7 +97514,6 @@ export const TranslatedMapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] } @@ -98334,7 +97563,6 @@ export const TranslatedMapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -98384,7 +97612,6 @@ export const TranslatedMapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, @@ -98436,7 +97663,6 @@ export const TranslatedMapOverlaySchema = { }, "additionalProperties": false, "required": [ - "offset", "unit" ] }, diff --git a/packages/types/src/types/models-extra/common.ts b/packages/types/src/types/models-extra/common.ts index 6bf5eb9fe8..a2428d1606 100644 --- a/packages/types/src/types/models-extra/common.ts +++ b/packages/types/src/types/models-extra/common.ts @@ -25,7 +25,7 @@ export type DateOffsetSpec = { /** * @description Offset distance (can be negative to offset to an earlier date) */ - offset: number; + offset?: number; /** * @description Used to modify the offset by either moving the date to the start/end of the modifier unit diff --git a/packages/types/src/types/requests/tupaia-web-server/UserRequest.ts b/packages/types/src/types/requests/tupaia-web-server/UserRequest.ts index f46e5dd6da..b8f27cd721 100644 --- a/packages/types/src/types/requests/tupaia-web-server/UserRequest.ts +++ b/packages/types/src/types/requests/tupaia-web-server/UserRequest.ts @@ -7,6 +7,13 @@ export type Params = Record; export interface ResBody { userName?: string; email?: string; -}; + project?: { + id: string; + code: string; + name: string; + homeEntityCode: string; + dashboardGroupName: string; + }; +} export type ReqBody = Record; export type ReqQuery = Record; diff --git a/packages/datatrak-web/src/components/SelectList/List.tsx b/packages/ui-components/src/components/SelectList/List.tsx similarity index 79% rename from packages/datatrak-web/src/components/SelectList/List.tsx rename to packages/ui-components/src/components/SelectList/List.tsx index d988ae33db..ea1ec55f13 100644 --- a/packages/datatrak-web/src/components/SelectList/List.tsx +++ b/packages/ui-components/src/components/SelectList/List.tsx @@ -1,11 +1,12 @@ /* * Tupaia - * Copyright (c) 2017 - 2023 Beyond Essential Systems Pty Ltd + * Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd */ import React from 'react'; import { List as MuiList } from '@material-ui/core'; -import { ListItem as Item, ListItemType } from './ListItem'; +import { ListItem as Item } from './ListItem'; +import { ListItemType } from './types'; interface SelectListProps { items?: ListItemType[]; diff --git a/packages/datatrak-web/src/components/SelectList/ListItem.tsx b/packages/ui-components/src/components/SelectList/ListItem.tsx similarity index 84% rename from packages/datatrak-web/src/components/SelectList/ListItem.tsx rename to packages/ui-components/src/components/SelectList/ListItem.tsx index eb90aeee69..09e4046cde 100644 --- a/packages/datatrak-web/src/components/SelectList/ListItem.tsx +++ b/packages/ui-components/src/components/SelectList/ListItem.tsx @@ -1,6 +1,6 @@ /* * Tupaia - * Copyright (c) 2017 - 2023 Beyond Essential Systems Pty Ltd + * Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd */ import React, { ReactElement, ReactNode, useState } from 'react'; @@ -11,9 +11,10 @@ import { ListItemProps as MuiListItemProps, } from '@material-ui/core'; import { Check, KeyboardArrowRight } from '@material-ui/icons'; -import { Tooltip } from '@tupaia/ui-components'; +import { Tooltip } from '../Tooltip'; +import { ListItemType } from './types'; -// explicity set the types so that the overrides are applied, for the `button` prop +// explicitly set the types so that the overrides are applied, for the `button` prop export const BaseListItem = styled(MuiListItem)` display: flex; align-items: center; @@ -30,9 +31,12 @@ export const BaseListItem = styled(MuiListItem)` &.MuiButtonBase-root { &:hover, &.Mui-selected:hover, - &:focus-visible, - &.Mui-selected:focus-visible { - background-color: ${({ theme }) => theme.palette.primary.main}33; + &:focus, + &.Mui-selected:focus { + background-color: ${({ theme }) => + theme.palette.type === 'light' + ? `${theme.palette.primary.main}33` + : 'rgba(96, 99, 104, 0.50)'}; } } .MuiSvgIcon-root { @@ -74,17 +78,6 @@ const IconWrapper = styled.div` } `; -export type ListItemType = Record & { - children?: ListItemType[]; - content: string | ReactNode; - value: string; - selected?: boolean; - icon?: ReactNode; - tooltip?: string; - button?: boolean; - disabled?: boolean; -}; - interface ListItemProps { item: ListItemType; children?: ReactNode; @@ -126,6 +119,7 @@ export const ListItem = ({ item, children, onSelect }: ListItemProps) => { return (
  • + {/*@ts-ignore*/} ` margin-bottom: 1rem; font-size: 0.875rem; - font-weight: 400; color: ${({ theme, color }) => theme.palette.text[color!]}; + font-weight: 400; `; + interface SelectListProps { items?: ListItemType[]; onSelect: (item: ListItemType) => void; diff --git a/packages/ui-components/src/components/SelectList/index.ts b/packages/ui-components/src/components/SelectList/index.ts new file mode 100644 index 0000000000..fec041cb2e --- /dev/null +++ b/packages/ui-components/src/components/SelectList/index.ts @@ -0,0 +1,8 @@ +/* + * Tupaia + * Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd + */ + +export { List } from './List'; +export { ListItem } from './ListItem'; +export { SelectList } from './SelectList'; diff --git a/packages/ui-components/src/components/SelectList/types.ts b/packages/ui-components/src/components/SelectList/types.ts new file mode 100644 index 0000000000..5daa477631 --- /dev/null +++ b/packages/ui-components/src/components/SelectList/types.ts @@ -0,0 +1,18 @@ +/* + * Tupaia + * Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd + */ + +import React, { ReactNode } from 'react'; +import { FormLabelProps } from '@material-ui/core'; + +export type ListItemType = Record & { + children?: ListItemType[]; + content: string | ReactNode; + value: string; + selected?: boolean; + icon?: ReactNode; + tooltip?: string; + button?: boolean; + disabled?: boolean; +}; diff --git a/packages/ui-components/src/components/Tooltip.tsx b/packages/ui-components/src/components/Tooltip.tsx index 522b7bd3e8..3e30ec0843 100644 --- a/packages/ui-components/src/components/Tooltip.tsx +++ b/packages/ui-components/src/components/Tooltip.tsx @@ -27,7 +27,7 @@ export const Tooltip = styled( ), )` & .MuiTooltip-tooltip { - background-color: ${TOOLTIP_COLOR}; + background-color: ${({ theme }) => theme.palette.tooltip || TOOLTIP_COLOR}; color: white; border-radius: 3px; font-size: 0.75rem; @@ -36,7 +36,7 @@ export const Tooltip = styled( letter-spacing: 0.4px; .MuiTooltip-arrow { - color: ${TOOLTIP_COLOR}; + color: ${({ theme }) => theme.palette.tooltip || TOOLTIP_COLOR}; } } `; diff --git a/packages/ui-components/src/components/index.ts b/packages/ui-components/src/components/index.ts index 6846547476..ace37eddb3 100644 --- a/packages/ui-components/src/components/index.ts +++ b/packages/ui-components/src/components/index.ts @@ -44,3 +44,4 @@ export * from './Tooltip'; export * from './UserMessage'; export * from './TooltipIconButton'; export * from './Pagination'; +export * from './SelectList'; diff --git a/packages/datatrak-web/src/features/ProjectSelectForm.tsx b/packages/ui-components/src/features/ProjectSelectForm.tsx similarity index 68% rename from packages/datatrak-web/src/features/ProjectSelectForm.tsx rename to packages/ui-components/src/features/ProjectSelectForm.tsx index e073e3ffcf..36fda7828f 100644 --- a/packages/datatrak-web/src/features/ProjectSelectForm.tsx +++ b/packages/ui-components/src/features/ProjectSelectForm.tsx @@ -3,16 +3,18 @@ * Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd */ -import React, { useState } from 'react'; -import { useNavigate } from 'react-router-dom'; +import React, { ReactNode, useState } from 'react'; import styled from 'styled-components'; -import { DialogActions, Typography } from '@material-ui/core'; +import { KeysToCamelCase, Entity, Project as ProjectT } from '@tupaia/types'; +import { DialogActions, Typography, useTheme } from '@material-ui/core'; import { Lock as LockIcon, WatchLater as ClockIcon } from '@material-ui/icons'; -import { Button as UIButton, SpinningLoader } from '@tupaia/ui-components'; -import { Project } from '@tupaia/types'; -import { Button, SelectList } from '../components'; -import { useEditUser, useProjects } from '../api'; -import { ROUTES } from '../constants'; +import { SelectList, SpinningLoader, Button as UIButton } from '../components'; + +const Button = styled(UIButton)` + text-transform: none; + font-size: 0.875rem; + padding: 0.5rem 1.6rem; +`; const LoadingContainer = styled.div` display: flex; @@ -42,11 +44,35 @@ const ListWrapper = styled.div<{ } `; +const CancelButton = ({ onClick, children }: { onClick: () => void; children: ReactNode }) => { + const { palette } = useTheme(); + const variant = palette.type === 'light' ? 'outlined' : 'text'; + const color = palette.type === 'light' ? 'primary' : 'default'; + return ( + + ); +}; + +type Project = KeysToCamelCase & { + hasAccess: boolean; + hasPendingAccess: boolean; + homeEntityCode: Entity['code']; + name: Entity['name']; + names?: Entity['name'][]; + value?: string; +}; + interface ProjectSelectFormProps { projectId?: Project['id']; variant?: 'modal' | 'page'; onClose: () => void; - onRequestAccess?: (projectCode: Project['code']) => void; + onRequestAccess: (projectCode: Project['code']) => void; + projects?: Project[]; + isLoading: boolean; + onConfirm: (data: Record) => void; + isConfirming: boolean; } export const ProjectSelectForm = ({ @@ -54,36 +80,25 @@ export const ProjectSelectForm = ({ onClose, variant = 'page', onRequestAccess, + projects, + isLoading, + onConfirm, + isConfirming, }: ProjectSelectFormProps) => { - const navigate = useNavigate(); const [selectedProjectId, setSelectedProjectId] = useState(projectId); - const { data: projects, isLoading } = useProjects(); - const { mutate, isLoading: isConfirming } = useEditUser(onClose); - - const onConfirm = () => { - mutate({ projectId: selectedProjectId! }); - }; - - const handleRequestAccess = project => { - if (variant === 'modal' && onRequestAccess) { - onRequestAccess(project.code); - } else { - navigate({ - pathname: ROUTES.REQUEST_ACCESS, - search: `?project=${project?.code}`, - }); - } - }; - - const onSelect = project => { + const onSelect = (project: any) => { if (project.hasAccess) { setSelectedProjectId(project.value); } else { - handleRequestAccess(project); + onRequestAccess(project.code); } }; + const handleConfirm = () => { + onConfirm({ projectId: selectedProjectId! }); + }; + const getProjectIcon = (hasAccess: boolean, hasPendingAccess: boolean) => { if (hasPendingAccess) return ; if (!hasAccess) return ; @@ -133,13 +148,9 @@ export const ProjectSelectForm = ({ )} - {variant === 'modal' && ( - - Cancel - - )} + {variant === 'modal' && Cancel}