diff --git a/src/main/webui/public/contextualHelpMessages.jsx b/src/main/webui/public/contextualHelpMessages.jsx new file mode 100644 index 00000000..fca6f31d --- /dev/null +++ b/src/main/webui/public/contextualHelpMessages.jsx @@ -0,0 +1,151 @@ +export const contextualHelpMessages = [ + { + id: "General-eng", + message: " " + + " Your own proposals are displayed on the left. You can search for others by title or investigator." + + " Create a new proposal by clicking the Create a new proposal button," + + " or upload a new one in a zip file by clicking the Import button." + + " To maintain an existing proposal, select it from the list and then choose one of the menu items that appear such as Title, Summary, etc. " + + " The Polaris system will capture only sufficient information to allow the TAC to make an informed decision on time allocation for a proposal." + + " The detailed requirements will be negotiated once an allocation has been made." + + " No viability checks will be made by Polaris, " + + " it is the PI's responsibility to ensure that the intended Observatory is capable of performing the observations described in the proposal." + } +, { + id: "Overview-eng", + message: " " + + " An overview of the selected proposal is shown below. You can choose another by clicking its dropdown button in the list." + + " You can maintain a component by clicking one of the menuitems, eg Title, Summary, etc." +} +, { + id: "CreaProp-eng", + message: " " + + " You must provide a title and a summary." + + " Once at least they have been entered, you can save immediately by clicking the Save button following the summary field," + + " and come back later, or cancel and return with the Cancel button." + + " Or you can continue with the remaining fields" + + " indicating the kind of proposal and providing the scientific and technical justifications." + + " You have the option to provide your justification in LaTeX, RST or ASCII format." + + " Save your changes with the Save button at bottom right, or cancel and return without saving by clicking the Cancel button." +} +, { + id: "MaintTitle-eng", + message: " Add or edit the title below." + + " Save your changes with the Save button at bottom right, or cancel and return without saving by clicking the Cancel button." +} +, { + id: "MaintSum-eng", + message: " Add or edit the summary below." + + " Save your changes with the Save button at bottom right, or cancel and return without saving by clicking the Cancel button." +} +, { + id: "MaintInvestList-eng", + message: " " + + " Add a new investigator by clicking the Add button at the bottom right of the list." + + " Remove an investigator by clicking the Delete button in the same row." +} + +,{ + id: "MaintInvestAdd-eng", + message: " " + + " Select a new investigator from the drop-down list." + + " They will automatically be assigned as a co-investigator." + + " Tick the PhD box if this work forms part of their PhD." + + " Save your changes with the Save button at bottom right, or cancel and return without saving by clicking the Cancel button." +} + , { + id: "MaintJustList-eng", + message: " " + + " Click the Edit button next to the scientific or technical justification summary in order to edit it." + +} + , { + id: "MaintSciJust-eng", + message: " " + + " State briefly the justification for your proposal." + + " This must not include details that should be captured elsewhere in Polaris." + + " Save your changes with the Save button at bottom right, or cancel and return without saving by clicking the Cancel button." +} + +, { + id: "MaintTechJust-eng", + message: " " + + " State briefly the justification for your proposal." + + " This must not include details that should be captured elsewhere in Polaris." + + " Save your changes with the Save button at bottom right, or cancel and return without saving by clicking the Cancel button." +} +, { + id: "MaintTargList-eng", + message: " Add a new Target by clicking the Add button at bottom right of the list." + + " Remove a Target by clicking the Delete button in its row. (You can't delete a target that is in use.)" +} +, { + id: "MaintTarg-eng", + message: " You must enter a unique target name, its coordinates and their Standard Epoch." + + " Alternatively, having entered a known target, you can browse for its details using the Lookup button, " + + " which will fill those values for you if the target can be found in Simbad." + + " Another possibility, having entered a known target, is to drag the window until the cross-wires are over your desired target." + + " Releasing the left-click button will populate the details of that location too." + + " Save your changes with the Save button at bottom right, or cancel and return without saving by clicking the Cancel button." +} +, { + id: "MaintTechGoalList-eng", + message: " " + + " To add a new technical goal click the Add button at bottom right." + + " To edit an existing technical goal click the Edit button in the row," + + " or to remove it click the Delete button." + + " You can make a copy of any existing technical goal by clicking its Copy button." +} +, { + id: "MaintTechGoal-eng", + message: " " + + " You must provide values and units for the following performance parameters" + + " - Angular resolution, Largest scale, Sensitivity, and Spectral point." + + " Spectral windows are optional, but if you select one you must enter values and units for" + + " Start, End, and Resolution, as well as polarization." + + " Save your changes with the Save button at bottom right of the spectral windows, or cancel and return without saving by clicking the Cancel button." +} +, { + id: "MaintObsFieldList-eng", + message: " " + + " To add a new observation field click the Add button at bottom right." + + " To edit an existing observation field click the Edit button in the row," + + " or to remove it click the Delete button." + + " (You can't delete a field that is in use.)" +} +, { + id: "MaintObsField-eng", + message: " Enter a field name and select its type." + + " Save your changes with the Save button at bottom right, or cancel and return without saving by clicking the Cancel button." +} +, { + id: "MaintObsList-eng", + message: " " + + " To add a new observation click the Add button at bottom right." + + " To edit an existing observation click the Edit button in the row," + + " or to remove it click the Delete button." + + " You can make a copy of any existing observation by clicking its Copy button." +} +, { + id: "MaintObs-eng", + message: " " + + " You must select one Target, and one Technical Goal (Performance parameters), followed by both Observation field and type. " + + " If your observation type is Calibration, you must choose Calibration intended use." + + " Timing windows are optional, but if you select one, you must provide start and end dates and times" + + " (choose the date from the calendar and then select a time from the bottom of the calendar)." + + " The slider next to the time fields identifies the window as one to be avoided, and you may add a brief note." + + " Save your changes with the Save button at bottom right of the timing windows, or cancel and return without saving by clicking the Cancel button." +} +, { + id: "ManageDocs-eng", + message: " " + + " Upload a document by clicking Choose a file, or cancel your request by clicking the Cancel button." +} +, { + id: "ManageSubmit-eng", + message: " " + + " Select a cycle and confirm your request with the Submit proposal button at bottom right, or cancel and return without submitting by clicking the Cancel button." +} + +]; + diff --git a/src/main/webui/src/App2.tsx b/src/main/webui/src/App2.tsx index a0ca0d8c..cc017a53 100644 --- a/src/main/webui/src/App2.tsx +++ b/src/main/webui/src/App2.tsx @@ -49,6 +49,7 @@ import { import {useDisclosure} from "@mantine/hooks"; import AddButton from './commonButtons/add'; import DatabaseSearchButton from './commonButtons/databaseSearch'; +import {ContextualHelpButton} from "./commonButtons/contextualHelp.tsx" import { APP_HEADER_HEIGHT, CLOSE_DELAY, ICON_SIZE, NAV_BAR_DEFAULT_WIDTH, NAV_BAR_LARGE_WIDTH, @@ -72,6 +73,7 @@ import CycleTACAddMemberPanel from "./ProposalManagerView/TAC/tacNewMember.tsx" import CycleTitlePanel from "./ProposalManagerView/proposalCycle/title.tsx"; import ObservationFieldsPanel from "./ProposalEditorView/observationFields/ObservationFieldsPanel.tsx"; import AssignReviewersPanel from "./ProposalManagerView/assignReviewers/AssignReviewersPanel.tsx"; +import ErrorPage from "./errorHandling/error-page.jsx" /** * defines the user context type. @@ -135,115 +137,142 @@ function App2(): ReactElement { { path: "/manager", element: , + errorElement: , children: [ {index: true, element: }, { path: "cycle/:selectedCycleCode", - element: + element: , + errorElement: , }, { path: "cycle/:selectedCycleCode/title", - element: + element: , + errorElement: , }, { path: "cycle/:selectedCycleCode/tac", - element: + element: , + errorElement: , }, { path: "cycle/:selectedCycleCode/tac/new", - element: + element: , + errorElement: , }, { path: "cycle/:selectedCycleCode/dates", - element: + element: , + errorElement: , }, { path: "cycle/:selectedCycleCode/observingModes", - element: + element: , + errorElement: , }, { path: "cycle/:selectedCycleCode/availableResources", - element: + element: , + errorElement: , }, { path: "cycle/:selectedCycleCode/reviews", - element: + element: , + errorElement: , }, { path: "cycle/:selectedCycleCode/allocations", - element: + element: , + errorElement: , }, { path: "cycle/:selectedCycleCode/observatory", - element: + element: , + errorElement: , }, { path: "cycle/:selectedCycleCode/assignReviewers", - element: + element: , + errorElement: , } ] }, { path: "/", element: , + errorElement: , children: [ {index: true, element: } , { path: "admin", - element: + element: , + errorElement: , }, { path: "proposal/new", - element: + element: , + errorElement: , }, { path: "proposal/:selectedProposalCode", - element: + element: , + errorElement: , }, { path: "proposal/:selectedProposalCode/title", - element: + element: , + errorElement: , }, { path: "proposal/:selectedProposalCode/summary", - element: + element: , + errorElement: , }, { path: "proposal/:selectedProposalCode/investigators", - element: + element:, + errorElement: , }, { path: "proposal/:selectedProposalCode/investigators/new", - element: + element:, + errorElement: , }, { path: "proposal/:selectedProposalCode/justifications", - element: + element: , + errorElement: , }, { path: "proposal/:selectedProposalCode/targets", - element: + element:, + errorElement: , }, { path: "proposal/:selectedProposalCode/goals", - element: + element:, + errorElement: , }, { path: "proposal/:selectedProposalCode/observationFields", - element: + element: , + errorElement: , }, { path: "proposal/:selectedProposalCode/observations", - element: + element:, + errorElement: , }, { path: "proposal/:selectedProposalCode/documents", - element: + element:, + errorElement: , } , { path: "proposal/:selectedProposalCode/submit", - element: + element:, + errorElement: , }, ]}], { @@ -354,16 +383,7 @@ function App2(): ReactElement { label={"Proposals for " + proposalContext.user.fullName} onClickEvent={handleSearch} /> - - - {(props) => } - + @@ -406,6 +426,17 @@ function App2(): ReactElement { pb={"md"} /> + + + + {(props) => } + - + Polaris Landing Page - + + +

+
{"welcome + ); } diff --git a/src/main/webui/src/ProposalEditorView/investigators/List.tsx b/src/main/webui/src/ProposalEditorView/investigators/List.tsx index ad991654..090902f8 100644 --- a/src/main/webui/src/ProposalEditorView/investigators/List.tsx +++ b/src/main/webui/src/ProposalEditorView/investigators/List.tsx @@ -6,7 +6,7 @@ import { useInvestigatorResourceGetInvestigators, } from "src/generated/proposalToolComponents.ts"; import {useQueryClient} from "@tanstack/react-query"; -import {Box, Stack, Table, Text} from "@mantine/core"; +import {Box, Grid, Stack, Table, Text} from "@mantine/core"; import {modals} from "@mantine/modals"; import {randomId} from "@mantine/hooks"; import DeleteButton from "src/commonButtons/delete"; @@ -14,6 +14,7 @@ import AddButton from "src/commonButtons/add"; import { JSON_SPACES } from 'src/constants.tsx'; import {EditorPanelHeader, PanelFrame} from "../../commonPanel/appearance.tsx"; import {notifyError} from "../../commonPanel/notifications.tsx"; +import {ContextualHelpButton} from "../../commonButtons/contextualHelp.tsx" /** * the data associated with a given person. @@ -57,6 +58,7 @@ function InvestigatorsPanel(): ReactElement { return ( + {data?.length === 0 ?
Please add an investigator
: @@ -78,9 +80,15 @@ function InvestigatorsPanel(): ReactElement { } } - +
+

+ + + + +

); } @@ -92,17 +100,24 @@ function InvestigatorsPanel(): ReactElement { * header. * @constructor */ + function InvestigatorsHeader(): ReactElement { return ( + <> + + Type Name eMail Institute + + + ); } diff --git a/src/main/webui/src/ProposalEditorView/investigators/New.tsx b/src/main/webui/src/ProposalEditorView/investigators/New.tsx index d68431a0..c04bf701 100644 --- a/src/main/webui/src/ProposalEditorView/investigators/New.tsx +++ b/src/main/webui/src/ProposalEditorView/investigators/New.tsx @@ -7,7 +7,7 @@ import { import {useNavigate, useParams} from "react-router-dom"; import {useQueryClient} from "@tanstack/react-query"; import {InvestigatorKind} from "src/generated/proposalToolSchemas.ts"; -import {Checkbox, Select, Stack} from "@mantine/core"; +import {Checkbox, Grid, Select, Stack} from "@mantine/core"; import {useForm} from "@mantine/form"; import {FormSubmitButton} from "src/commonButtons/save"; import DeleteButton from "src/commonButtons/delete"; @@ -15,6 +15,7 @@ import { JSON_SPACES } from 'src/constants.tsx'; import {EditorPanelHeader, PanelFrame} from "../../commonPanel/appearance.tsx"; import {notifyError} from "../../commonPanel/notifications.tsx"; import getErrorMessage from "../../errorHandling/getErrorMessage.tsx"; +import {ContextualHelpButton} from "src/commonButtons/contextualHelp.tsx" /** * Render s form panel to add an investigator to the current proposal. @@ -108,6 +109,7 @@ function AddInvestigatorPanel(): ReactElement { return ( +
- +

+ + + + +
diff --git a/src/main/webui/src/ProposalEditorView/proposal/Overview.tsx b/src/main/webui/src/ProposalEditorView/proposal/Overview.tsx index 774c7405..5de7d135 100644 --- a/src/main/webui/src/ProposalEditorView/proposal/Overview.tsx +++ b/src/main/webui/src/ProposalEditorView/proposal/Overview.tsx @@ -27,6 +27,7 @@ import { DIMMED_FONT_WEIGHT, JSON_SPACES } from 'src/constants.tsx'; import { TargetTable } from '../targets/TargetTable.tsx'; import { TechnicalGoalsTable } from '../technicalGoals/technicalGoalTable.tsx'; import {PreviewJustification} from "../justifications/justification.preview.tsx"; +import {ContextualHelpButton} from "../../commonButtons/contextualHelp.tsx" /* title -- string @@ -562,6 +563,7 @@ function OverviewPanel(): ReactElement {
+ diff --git a/src/main/webui/src/ProposalEditorView/proposal/Submit.tsx b/src/main/webui/src/ProposalEditorView/proposal/Submit.tsx index 1866cb9c..3a40f164 100644 --- a/src/main/webui/src/ProposalEditorView/proposal/Submit.tsx +++ b/src/main/webui/src/ProposalEditorView/proposal/Submit.tsx @@ -1,5 +1,5 @@ -import {ReactElement, useEffect, useState} from "react"; -import {Box, Select, Stack, Text} from "@mantine/core"; +import {ReactElement, SyntheticEvent, useEffect, useState} from "react"; +import {Box, Grid, Select, Stack, Text} from "@mantine/core"; import { fetchProposalCyclesResourceGetProposalCycleDates, fetchSubmittedProposalResourceSubmitProposal, @@ -10,11 +10,13 @@ import {useNavigate, useParams} from "react-router-dom"; import {useForm} from "@mantine/form"; import {JSON_SPACES} from "src/constants.tsx"; import {SubmitButton} from "src/commonButtons/save.tsx"; +import DeleteButton from "src/commonButtons/delete.tsx"; import {useQueryClient} from "@tanstack/react-query"; import ValidationOverview from "./ValidationOverview.tsx"; import {EditorPanelHeader, PanelFrame} from "../../commonPanel/appearance.tsx"; import {notifyError, notifySuccess} from "../../commonPanel/notifications.tsx"; import getErrorMessage from "../../errorHandling/getErrorMessage.tsx"; +import {ContextualHelpButton} from "../../commonButtons/contextualHelp.tsx" function SubmitPanel(): ReactElement { const {selectedProposalCode} = useParams(); @@ -80,6 +82,10 @@ function SubmitPanel(): ReactElement { .catch((error) => notifyError("Submission failed", getErrorMessage(error)) ) }); + function handleCancel(event: SyntheticEvent) { + event.preventDefault(); + navigate("../",{relative:"path"}) + } return ( @@ -88,19 +94,31 @@ function SubmitPanel(): ReactElement { +