Skip to content

Commit

Permalink
Merge pull request #281 from orppst/alternativeSubmitted
Browse files Browse the repository at this point in the history
gui with submittedProposal sub-type
  • Loading branch information
pahjbo authored Nov 22, 2024
2 parents f57196a + 242c5c7 commit acc17df
Show file tree
Hide file tree
Showing 10 changed files with 170 additions and 87 deletions.
101 changes: 48 additions & 53 deletions src/main/webui/[email protected]
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
--- proposalToolSchemas.ts.orig 2024-11-06 14:48:05
+++ proposalToolSchemas.ts 2024-11-06 14:50:42
@@ -7,6 +7,8 @@
--- proposalToolSchemas.ts.orig 2024-11-21 20:37:35
+++ proposalToolSchemas.ts 2024-11-21 20:40:44
@@ -7,6 +7,7 @@
* base proposal
*/
export type AbstractProposal = {
+ _id?: number;
/**
* the proposal title
*/
@@ -56,6 +57,8 @@
* A block of resources that have been allocated
*/
export type AllocatedBlock = {
Expand All @@ -9,47 +17,47 @@
/**
* A resource that will be consumed by allocating an observation from a proposal
*/
@@ -25,6 +27,7 @@
@@ -74,6 +77,7 @@
* an instance of a proposal that is allocated observing time
*/
export type AllocatedProposal = {
+ _id?: number
+ _id?: number;
/**
* what is allocated to the proposal
*/
@@ -39,6 +42,7 @@
@@ -88,6 +92,7 @@
* The final grade given by the TAC
*/
export type AllocationGrade = {
+ _id?: number;
/**
* the name of the grade
*/
@@ -130,6 +134,7 @@
@@ -179,6 +184,7 @@
*/
export type CalibrationObservation = {
xmlId?: string;
+ "@type"?: string;
/**
* any constraints on the observation
*/
@@ -163,6 +168,7 @@
@@ -212,6 +218,7 @@
* Spatial domain, three-dimensional cartesian coordinate space. The particulars of the axis descriptions depend on the physical constraints of the instance. In Appendix B, we provide the description of a Standard Cartesian Coordinate Space instance which applies to many Astronomical cases, and may be referenced in serializations.
*/
export type CartesianCoordSpace = {
+ "@type"?: string; // coords:CartesianCoordSpace
axis?: Axis[];
};

@@ -189,6 +195,7 @@
@@ -238,6 +245,7 @@
*/
export type CelestialTarget = {
xmlId?: string;
+ "@type"?: string; // proposal:CelestialTarget
/**
* A common name for the source
*/
@@ -198,7 +205,7 @@
@@ -247,7 +255,7 @@
*/
sourceCoordinates?: EquatorialPoint;
/**
Expand All @@ -58,7 +66,7 @@
*/
positionEpoch?: Epoch;
/**
@@ -289,9 +296,7 @@
@@ -338,9 +346,7 @@
/**
* Abstract head of the coordinate system object tree.
*/
Expand All @@ -69,7 +77,7 @@

/**
* Abstract base class for the Coordinate data types which represent an absolute location within a coordinate space. Coordinates MUST refer to a coordinate system, providing additional metadata relevant to interpreting the coordinate value, and its representation.
@@ -426,6 +431,8 @@
@@ -475,6 +481,8 @@
* A Point on the Unit Sphere
*/
export type EquatorialPoint = {
Expand All @@ -78,7 +86,7 @@
/**
* A real value with a unit.
*/
@@ -472,8 +479,10 @@
@@ -521,8 +529,10 @@
* Definition of an observing field pointing
*/
export type Field = {
Expand All @@ -89,16 +97,16 @@
};

export type FileUpload = Record<string, any>;
@@ -702,6 +711,8 @@
* An observation - occurs in a single non-overlapping time period
@@ -751,6 +761,8 @@
* An observation - a pointing of the telescope at a part of the sky, occurs in a single non-overlapping time period
*/
export type Observation = {
+ "@type"?: string; //ObsType (see above)
+ _id?: number;
/**
* any constraints on the observation
*/
@@ -750,6 +761,9 @@
@@ -799,6 +811,9 @@
* An organisation that can perform astronomical observations
*/
export type Observatory = {
Expand All @@ -108,23 +116,23 @@
xmlId?: string;
/**
* The name of the organization
@@ -795,6 +809,7 @@
@@ -844,6 +859,7 @@
* a configuration can be used to observe with.
*/
export type ObservingMode = {
+ _id?: number;
/**
* human readable name for the mode
*/
@@ -833,6 +848,7 @@
@@ -882,6 +898,7 @@
* a complete proposal
*/
export type ObservingProposal = {
+ "_id"?: number;
+ _id?: number;
xmlId?: string;
/**
* the proposal title
*/
@@ -886,6 +902,8 @@
@@ -931,6 +948,8 @@
* An institution that is a collection of people
*/
export type Organization = {
Expand All @@ -133,7 +141,7 @@
/**
* The name of the organization
*/
@@ -1110,6 +1128,8 @@
@@ -1155,6 +1174,8 @@
* Defines collection of resources and proposals for a particular observing season
*/
export type ProposalCycle = {
Expand All @@ -142,23 +150,23 @@
/**
* a human readable description of the cycle
*/
@@ -1183,6 +1203,7 @@
@@ -1228,6 +1249,7 @@
* A review of a proposal
*/
export type ProposalReview = {
+ _id?: number;
/**
* Description
*/
@@ -1265,6 +1286,7 @@
@@ -1309,6 +1331,7 @@
* A real value with a unit.
*/
export type RealQuantity = {
+ "@type"?: string; // ivoa:RealQuantity
/**
* Must conform to definition of unit in VOUnit spec.
*/
@@ -1296,6 +1318,8 @@
@@ -1340,6 +1363,8 @@
* A resource that will be consumed by allocating an observation from a proposal
*/
export type Resource = {
Expand All @@ -167,23 +175,23 @@
/**
* The amount of the resource
*
@@ -1326,6 +1350,7 @@
@@ -1370,6 +1395,7 @@
* a type of resource
*/
export type ResourceType = {
+ _id?: number;
/**
* the name of the resource type
*/
@@ -1338,6 +1363,7 @@
@@ -1382,6 +1408,7 @@
* assigned to review the proposal
*/
export type Reviewer = {
+ _id?: number;
/**
* person connected with the proposal
*/
@@ -1369,6 +1395,8 @@
@@ -1413,6 +1440,8 @@
/**
* Science oriented definition of a spectral window.
*/
Expand All @@ -192,23 +200,23 @@
spectralWindowSetup?: SpectralWindowSetup;
expectedSpectralLine?: ExpectedSpectralLine[];
};
@@ -1413,6 +1441,7 @@
@@ -1457,6 +1486,7 @@
* A SpaceFrame is specified by its reference frame (orientation), and a reference position (origin). Currently only standard reference frames are allowed. An equinox MUST be provided for pre-ICRS reference frames. A planetary ephemeris MAY be provided if relevant. If needed, but not provided, it is assumed to be 'DE405'.
*/
export type SpaceFrame = {
+ "@type": string; // coords:SpaceFrame
/**
* RefLocation defines the origin of the spatial coordinate space. This location is represented either by a standard reference position (for which the absolute location in phase space is known by definition), or a specified point in another Spatial frame. This object is used as the origin of the SpaceFrame here, but also to specify the Spatial Reference Position (refPosition) associated with other domain Frames. For example, in the Time domain, the Spatial Reference Position indicates that the 'time' values are the time that the 'event' occured at that location, which might be different from the detector location.
*/
@@ -1435,6 +1464,7 @@
@@ -1479,6 +1509,7 @@
* Specialized coordinate system for the Spatial domain. This object SHOULD include an appropriate SpaceFrame. In Appendix B, we define two standard spatial coordinate space instances (Spherical and Cartesian), which may be referenced in serializations. If a CoordSpace is not provided, it is assumed to be represented by a Standard Spherical Coordinate Space.
*/
export type SpaceSys = {
+ "@type": string; // coords:SpaceSys
xmlId?: string;
/**
* Abstract head of coordinate spaces related to physical properties.
@@ -1518,7 +1548,7 @@
@@ -1562,7 +1593,7 @@
/**
* person connected with the proposal
*/
Expand All @@ -217,15 +225,16 @@
uid?: string;
inKeycloakRealm?: boolean;
};
@@ -1538,6 +1568,7 @@
@@ -1582,6 +1613,8 @@
* an instance of a proposal that has been submitted
*/
export type SubmittedProposal = {
+ _id?: number;
+
xmlId?: string;
/**
* the date that the proposal was submitted
*
@@ -1601,17 +1632,20 @@
* the proposal title
@@ -1683,17 +1716,20 @@
* A target source
*/
export type Target = {
Expand All @@ -246,15 +255,15 @@
xmlId?: string;
name?: string;
};
@@ -1620,6 +1654,7 @@
@@ -1702,6 +1738,7 @@
* an observation of the scientific target
*/
export type TargetObservation = {
+ "@type"?: string;
xmlId?: string;
/**
* any constraints on the observation
@@ -1648,10 +1683,12 @@
@@ -1730,10 +1767,12 @@
*/
performance?: PerformanceParameters;
spectrum?: ScienceSpectralWindow[];
Expand All @@ -267,15 +276,15 @@
xmlId?: string;
/**
* telescope name
@@ -1671,6 +1708,7 @@
@@ -1753,6 +1792,7 @@
* a set of telescopes that are operated together for an observation
*/
export type TelescopeArray = {
+ "@type"?: string;
xmlId?: string;
/**
* the array name
@@ -1752,6 +1790,10 @@
@@ -1834,6 +1874,10 @@
* particular time range
*/
export type TimingWindow = {
Expand All @@ -286,17 +295,3 @@
note?: string;
isAvoidConstraint?: boolean;
/**
@@ -1774,13 +1816,6 @@
};

/**
- * Must conform to definition of unit in VOUnit spec.
- */
-export type Unit1 = {
- value?: string;
-};
-
-/**
* @format binary
*/
export type UploadItemSchema = Blob;
1 change: 1 addition & 0 deletions src/main/webui/src/ProposalEditorView/proposal/New.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const textFormatData = [
const emptyJustification : Justification = {text: " ", format: "asciidoc"};
const form = useForm({
initialValues: {
"@type": "proposal:ObservingProposal",
title: "",
summary: "",
kind: "Standard" as ProposalKind,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ function AllocatedAccordionItem(props: AllocatedItemProps) : ReactElement {
return (
<Accordion.Item value={String(allocatedProposal.data?._id)}>
<Accordion.Control>
{allocatedProposal.data?.submitted?.proposal?.title}
{allocatedProposal.data?.submitted?.title}
</Accordion.Control>
<Accordion.Panel>
{allocatedProposal.data?.allocation ?
<AllocatedBlocksTable
allocatedBlocks={allocatedProposal.data.allocation}
proposalTitle={allocatedProposal.data?.submitted?.proposal?.title!}
proposalTitle={allocatedProposal.data?.submitted?.title!}
allocatedProposalId={allocatedProposal.data._id!}
/> :
<Group justify={"centre"} grow>
<AllocatedBlockModal
proposalTitle={allocatedProposal.data?.submitted?.proposal?.title!}
proposalTitle={allocatedProposal.data?.submitted?.title!}
allocatedProposalId={allocatedProposal.data?._id!}
/>
</Group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function AllocationsTableRow(rowProps: AllocationTableRowProps) : ReactElement {
getErrorMessage(submittedProposal.error))
}

let title = submittedProposal.data?.proposal?.title
let title = submittedProposal.data?.title

async function handlePass(){

Expand Down Expand Up @@ -110,7 +110,7 @@ function AllocationsTableRow(rowProps: AllocationTableRowProps) : ReactElement {

return(
<Table.Tr>
<Table.Td>{submittedProposal.data?.proposal?.title}</Table.Td>
<Table.Td>{submittedProposal.data?.title}</Table.Td>
<Table.Td>
{
submittedProposal.data?.reviews?.length! == 0 ?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function SubmittedProposalItem(props: SubmittedProposalItemProp) : ReactElement
return (
<Accordion.Item value={String(props.proposalId)}>
<Accordion.Control>
<Text size={"lg"}>{proposal.data?.proposal?.title}</Text>
<Text size={"lg"}>{proposal.data?.title}</Text>
<Space h={"sm"}/>
<Group>
<Text size={"sm"} c={"gray.6"}> Assigned Reviewers: </Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export default function AssignReviewersForm(proposal: SubmittedProposal) : React
)}
onClick={()=>handleAssign(
{reviewerId: reviewer.dbid!, reviewerName: reviewer.name!,
proposalId: proposal._id!, proposalTitle: proposal.proposal?.title!}
proposalId: proposal._id!, proposalTitle: proposal.title!}
)}
/>
:
Expand All @@ -140,7 +140,7 @@ export default function AssignReviewersForm(proposal: SubmittedProposal) : React
)}
onClick={() => confirmRemoval(
{reviewerId: reviewer.dbid!, reviewerName: reviewer.name!,
proposalId: proposal._id!, proposalTitle: proposal.proposal?.title!}
proposalId: proposal._id!, proposalTitle: proposal.title!}
)}
/>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function ReviewsAccordion(props: ReviewsProps) : ReactElement {
<Accordion.Item value={String(itemProps.proposalId)}>
<Accordion.Control>
<Group>
<Text size={"lg"}>{proposal.data?.proposal?.title}</Text>
<Text size={"lg"}>{proposal.data?.title}</Text>
{hasUserCompletedReview()}
</Group>
<Space h={"sm"}/>
Expand Down
Loading

0 comments on commit acc17df

Please sign in to comment.