Skip to content

Commit

Permalink
Merge pull request #204 from orppst/200-contextual-help
Browse files Browse the repository at this point in the history
Proof of concept contextual help stuff
  • Loading branch information
pahjbo authored Aug 7, 2024
2 parents de6c169 + c154c99 commit 83f2e4d
Show file tree
Hide file tree
Showing 26 changed files with 618 additions and 123 deletions.
151 changes: 151 additions & 0 deletions src/main/webui/public/contextualHelpMessages.jsx
Original file line number Diff line number Diff line change
@@ -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."
}

];

109 changes: 72 additions & 37 deletions src/main/webui/src/App2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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.
Expand Down Expand Up @@ -135,115 +137,142 @@ function App2(): ReactElement {
{
path: "/manager",
element: <PSTManager />,
errorElement: <ErrorPage />,
children: [
{index: true, element: <PSTManagerStart />},
{
path: "cycle/:selectedCycleCode",
element: <CycleOverviewPanel />
element: <CycleOverviewPanel />,
errorElement: <ErrorPage />,
},
{
path: "cycle/:selectedCycleCode/title",
element: <CycleTitlePanel />
element: <CycleTitlePanel />,
errorElement: <ErrorPage />,
},
{
path: "cycle/:selectedCycleCode/tac",
element: <CycleTACPanel />
element: <CycleTACPanel />,
errorElement: <ErrorPage />,
},
{
path: "cycle/:selectedCycleCode/tac/new",
element: <CycleTACAddMemberPanel />
element: <CycleTACAddMemberPanel />,
errorElement: <ErrorPage />,
},
{
path: "cycle/:selectedCycleCode/dates",
element: <CycleDatesPanel />
element: <CycleDatesPanel />,
errorElement: <ErrorPage />,
},
{
path: "cycle/:selectedCycleCode/observingModes",
element: <CycleObservingModesPanel />
element: <CycleObservingModesPanel />,
errorElement: <ErrorPage />,
},
{
path: "cycle/:selectedCycleCode/availableResources",
element: <CycleAvailableResourcesPanel />
element: <CycleAvailableResourcesPanel />,
errorElement: <ErrorPage />,
},
{
path: "cycle/:selectedCycleCode/reviews",
element: <ReviewsPanel />
element: <ReviewsPanel />,
errorElement: <ErrorPage />,
},
{
path: "cycle/:selectedCycleCode/allocations",
element: <AllocationsPanel />
element: <AllocationsPanel />,
errorElement: <ErrorPage />,
},
{
path: "cycle/:selectedCycleCode/observatory",
element: <CycleObservatoryPanel />
element: <CycleObservatoryPanel />,
errorElement: <ErrorPage />,
},
{
path: "cycle/:selectedCycleCode/assignReviewers",
element: <AssignReviewersPanel />
element: <AssignReviewersPanel />,
errorElement: <ErrorPage />,
}
]
},
{
path: "/",
element: <PSTEditor/>,
errorElement: <ErrorPage />,
children: [
{index: true, element: <PSTStart/>} ,
{
path: "admin",
element: <AdminPanel />
element: <AdminPanel />,
errorElement: <ErrorPage />,
},
{
path: "proposal/new",
element: <NewProposalPanel />
element: <NewProposalPanel />,
errorElement: <ErrorPage />,
},
{
path: "proposal/:selectedProposalCode",
element: <OverviewPanel />
element: <OverviewPanel />,
errorElement: <ErrorPage />,
},
{
path: "proposal/:selectedProposalCode/title",
element: <TitlePanel />
element: <TitlePanel />,
errorElement: <ErrorPage />,
},
{
path: "proposal/:selectedProposalCode/summary",
element: <SummaryPanel />
element: <SummaryPanel />,
errorElement: <ErrorPage />,
},
{
path: "proposal/:selectedProposalCode/investigators",
element:<InvestigatorsPanel />
element:<InvestigatorsPanel />,
errorElement: <ErrorPage />,
},
{
path:
"proposal/:selectedProposalCode/investigators/new",
element:<AddInvestigatorPanel />
element:<AddInvestigatorPanel />,
errorElement: <ErrorPage />,
},
{
path: "proposal/:selectedProposalCode/justifications",
element: <JustificationsPanel />
element: <JustificationsPanel />,
errorElement: <ErrorPage />,
},
{
path: "proposal/:selectedProposalCode/targets",
element:<TargetPanel />
element:<TargetPanel />,
errorElement: <ErrorPage />,
},
{
path: "proposal/:selectedProposalCode/goals",
element:<TechnicalGoalsPanel />
element:<TechnicalGoalsPanel />,
errorElement: <ErrorPage />,
},
{
path: "proposal/:selectedProposalCode/observationFields",
element: <ObservationFieldsPanel />
element: <ObservationFieldsPanel />,
errorElement: <ErrorPage />,
},
{
path: "proposal/:selectedProposalCode/observations",
element:<ObservationsPanel />
element:<ObservationsPanel />,
errorElement: <ErrorPage />,
},
{
path: "proposal/:selectedProposalCode/documents",
element:<DocumentsPanel />
element:<DocumentsPanel />,
errorElement: <ErrorPage />,
} ,
{
path: "proposal/:selectedProposalCode/submit",
element:<SubmitPanel />
element:<SubmitPanel />,
errorElement: <ErrorPage />,
},

]}], {
Expand Down Expand Up @@ -354,16 +383,7 @@ function App2(): ReactElement {
label={"Proposals for " + proposalContext.user.fullName}
onClickEvent={handleSearch}
/>
<AddButton toolTipLabel={"new proposal"}
label={"Create a new proposal"}
onClickEvent={handleAddNew}/>
<FileButton onChange={handleUploadZip}
accept={".zip"}>
{(props) => <UploadButton
toolTipLabel="select a file from disk to upload"
label={"Import"}
onClick={props.onClick}/>}
</FileButton>

</Group>
</Grid.Col>
<Grid.Col span={1}>
Expand Down Expand Up @@ -406,6 +426,17 @@ function App2(): ReactElement {
pb={"md"}
/>
</Container>

<AddButton toolTipLabel={"new proposal"}
label={"Create a new proposal"}
onClickEvent={handleAddNew}/>
<FileButton onChange={handleUploadZip}
accept={".zip"}>
{(props) => <UploadButton
toolTipLabel="select a file from disk to upload"
label={"Import"}
onClick={props.onClick}/>}
</FileButton>
</AppShell.Section>
<AppShell.Section component={ScrollArea}>
<ProposalListWrapper
Expand Down Expand Up @@ -441,15 +472,19 @@ function App2(): ReactElement {
function PSTStart(): ReactElement {
return (
<Container pt={10}>

<Grid>
<Text fz={"lg"} fw={"bold"} c={"teal.7"}>
Polaris Landing Page
</Text>

<Grid.Col span={7.5}></Grid.Col>
<ContextualHelpButton messageId="General" />
<p> &emsp; </p>
</Grid>
<img src={"/pst/gui/temporary-ufo-landing.png"}
alt={"welcome image of a ufo crash landing"}
width={"100%"}
/>

</Container>
);
}
Expand Down
Loading

0 comments on commit 83f2e4d

Please sign in to comment.