From 2109e95970538743be73b84dcdf5ce526f32a650 Mon Sep 17 00:00:00 2001 From: Paul Harrison Date: Tue, 19 Nov 2024 15:18:51 +0000 Subject: [PATCH 1/3] gui builds with submittedProposal sub-type --- src/main/webui/Add_@types.patch | 192 +++++------------- .../allocations/allocated.accordion.tsx | 6 +- .../allocations/allocations.table.tsx | 4 +- .../assignReviewers.accordion.tsx | 2 +- .../assignReviewers/assignReviewers.form.tsx | 4 +- .../reviews/reviews.accordion.tsx | 2 +- .../reviews/reviews.form.tsx | 4 +- src/main/webui/src/auth/Auth.tsx | 11 +- .../src/generated/proposalToolComponents.ts | 10 +- .../src/generated/proposalToolSchemas.ts | 126 ++++++++++-- 10 files changed, 181 insertions(+), 180 deletions(-) diff --git a/src/main/webui/Add_@types.patch b/src/main/webui/Add_@types.patch index 62532730..3abd10b8 100644 --- a/src/main/webui/Add_@types.patch +++ b/src/main/webui/Add_@types.patch @@ -1,30 +1,31 @@ ---- proposalToolSchemas.ts.orig 2024-10-30 13:50:57 -+++ proposalToolSchemas.ts 2024-10-30 13:55:30 -@@ -7,12 +7,14 @@ +--- proposalToolSchemas.ts.orig 2024-11-19 14:35:32 ++++ proposalToolSchemas.ts 2024-11-19 15:16:29 +@@ -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 = { + _id?: number; -+ "@type"?: string; //proposalManagement:AllocatedBlock ++ "@type"?: string; /** * A resource that will be consumed by allocating an observation from a proposal */ - resource?: Resource; - /** -- * a configuration that has been chosen to observe with. -+ * a configuration can be used to observe with. - */ - mode?: ObservingMode; - /** -@@ -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 = { @@ -32,7 +33,7 @@ /** * the name of the grade */ -@@ -130,6 +134,7 @@ +@@ -179,6 +184,7 @@ */ export type CalibrationObservation = { xmlId?: string; @@ -40,7 +41,7 @@ /** * 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 = { @@ -48,7 +49,7 @@ axis?: Axis[]; }; -@@ -189,6 +195,7 @@ +@@ -238,6 +245,7 @@ */ export type CelestialTarget = { xmlId?: string; @@ -56,7 +57,7 @@ /** * A common name for the source */ -@@ -198,7 +205,7 @@ +@@ -247,7 +255,7 @@ */ sourceCoordinates?: EquatorialPoint; /** @@ -65,7 +66,7 @@ */ positionEpoch?: Epoch; /** -@@ -289,9 +296,7 @@ +@@ -338,9 +346,7 @@ /** * Abstract head of the coordinate system object tree. */ @@ -76,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 = { @@ -85,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 = { @@ -96,8 +97,8 @@ }; export type FileUpload = Record; -@@ -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) @@ -105,16 +106,7 @@ /** * any constraints on the observation */ -@@ -741,7 +752,7 @@ - */ - observation?: Observation[]; - /** -- * a configuration that has been chosen to observe with. -+ * a configuration can be used to observe with. - */ - mode?: ObservingMode; - }; -@@ -750,6 +761,9 @@ +@@ -799,6 +811,9 @@ * An organisation that can perform astronomical observations */ export type Observatory = { @@ -124,56 +116,23 @@ xmlId?: string; /** * The name of the organization -@@ -765,6 +779,10 @@ - */ - wikiId?: WikiDataId; - /** -+ * the home page for the Observatory -+ */ -+ homePage?: string; -+ /** - * the telescopes that the observatory controls - */ - telescopes?: Telescope[]; -@@ -788,9 +806,10 @@ - export type ObservingConstraint = Record; - - /** -- * a configuration that has been chosen to observe with. -+ * a configuration can be used to observe with. +@@ -844,6 +859,7 @@ + * a configuration can be used to observe with. */ export type ObservingMode = { + _id?: number; /** * human readable name for the mode */ -@@ -800,17 +819,6 @@ - */ - description?: string; - /** -- * A particular observation combination that is possible -- */ -- configuration?: ObservingModeConfiguration; -- xmlId?: string; --}; -- --/** -- * A particular observation combination that is possible -- */ --export type ObservingModeConfiguration = { -- /** - * Available filters /bandpasses for intruments - */ - filter?: Filter; -@@ -840,6 +848,7 @@ +@@ -882,6 +898,7 @@ * a complete proposal */ export type ObservingProposal = { -+ "_id"?: number; ++ _id?: number; + xmlId?: string; /** * the proposal title - */ -@@ -893,6 +902,8 @@ +@@ -931,6 +948,8 @@ * An institution that is a collection of people */ export type Organization = { @@ -182,7 +141,7 @@ /** * The name of the organization */ -@@ -1117,11 +1128,17 @@ +@@ -1155,6 +1174,8 @@ * Defines collection of resources and proposals for a particular observing season */ export type ProposalCycle = { @@ -191,16 +150,7 @@ /** * a human readable description of the cycle */ - title?: string; - /** -+ * pointer to more detailed instructions about the cycle -+ */ -+ instructions?: string; -+ /** - * the date by which observing proposals must be submitted to be considered for this cycle - * - * @format date -@@ -1186,6 +1203,7 @@ +@@ -1228,6 +1249,7 @@ * A review of a proposal */ export type ProposalReview = { @@ -208,7 +158,7 @@ /** * Description */ -@@ -1268,6 +1286,7 @@ +@@ -1309,6 +1331,7 @@ * A real value with a unit. */ export type RealQuantity = { @@ -216,7 +166,7 @@ /** * Must conform to definition of unit in VOUnit spec. */ -@@ -1299,6 +1318,8 @@ +@@ -1340,6 +1363,8 @@ * A resource that will be consumed by allocating an observation from a proposal */ export type Resource = { @@ -225,16 +175,7 @@ /** * The amount of the resource * -@@ -1320,7 +1341,7 @@ - */ - resource?: Resource; - /** -- * a configuration that has been chosen to observe with. -+ * a configuration can be used to observe with. - */ - mode?: ObservingMode; - }; -@@ -1329,6 +1350,7 @@ +@@ -1370,6 +1395,7 @@ * a type of resource */ export type ResourceType = { @@ -242,7 +183,7 @@ /** * the name of the resource type */ -@@ -1341,6 +1363,7 @@ +@@ -1382,6 +1408,7 @@ * assigned to review the proposal */ export type Reviewer = { @@ -250,7 +191,7 @@ /** * person connected with the proposal */ -@@ -1372,6 +1395,8 @@ +@@ -1413,6 +1440,8 @@ /** * Science oriented definition of a spectral window. */ @@ -259,7 +200,7 @@ spectralWindowSetup?: SpectralWindowSetup; expectedSpectralLine?: ExpectedSpectralLine[]; }; -@@ -1416,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 = { @@ -267,7 +208,7 @@ /** * 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. */ -@@ -1438,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 = { @@ -275,7 +216,7 @@ xmlId?: string; /** * Abstract head of coordinate spaces related to physical properties. -@@ -1521,7 +1548,7 @@ +@@ -1562,7 +1593,7 @@ /** * person connected with the proposal */ @@ -284,35 +225,16 @@ uid?: string; inKeycloakRealm?: boolean; }; -@@ -1541,6 +1568,7 @@ +@@ -1582,6 +1613,8 @@ * an instance of a proposal that has been submitted */ export type SubmittedProposal = { + _id?: number; - /** - * the date that the proposal was submitted - * -@@ -1559,15 +1587,15 @@ - * @example "2022-03-10T00:00:00.000Z" - */ - reviewsCompleteDate?: Date; -- /** -- * a complete proposal -- */ -- proposal?: ObservingProposal; - config?: ObservationConfiguration[]; - /** - * the reviews - */ - reviews?: ProposalReview[]; -+ /** -+ * a complete proposal -+ */ -+ proposal?: ObservingProposal; ++ xmlId?: string; - }; - -@@ -1604,17 +1632,20 @@ + /** + * the proposal title +@@ -1683,17 +1716,20 @@ * A target source */ export type Target = { @@ -333,7 +255,7 @@ xmlId?: string; name?: string; }; -@@ -1623,6 +1654,7 @@ +@@ -1702,6 +1738,7 @@ * an observation of the scientific target */ export type TargetObservation = { @@ -341,7 +263,7 @@ xmlId?: string; /** * any constraints on the observation -@@ -1651,10 +1683,12 @@ +@@ -1730,10 +1767,12 @@ */ performance?: PerformanceParameters; spectrum?: ScienceSpectralWindow[]; @@ -354,7 +276,7 @@ xmlId?: string; /** * telescope name -@@ -1674,6 +1708,7 @@ +@@ -1753,6 +1792,7 @@ * a set of telescopes that are operated together for an observation */ export type TelescopeArray = { @@ -362,7 +284,7 @@ xmlId?: string; /** * the array name -@@ -1755,6 +1790,10 @@ +@@ -1834,6 +1874,10 @@ * particular time range */ export type TimingWindow = { @@ -373,17 +295,3 @@ note?: string; isAvoidConstraint?: boolean; /** -@@ -1777,13 +1816,6 @@ - }; - - /** -- * Must conform to definition of unit in VOUnit spec. -- */ --export type Unit1 = { -- value?: string; --}; -- --/** - * @format binary - */ - export type UploadItemSchema = Blob; diff --git a/src/main/webui/src/ProposalManagerView/allocations/allocated.accordion.tsx b/src/main/webui/src/ProposalManagerView/allocations/allocated.accordion.tsx index d323d3af..5d302547 100644 --- a/src/main/webui/src/ProposalManagerView/allocations/allocated.accordion.tsx +++ b/src/main/webui/src/ProposalManagerView/allocations/allocated.accordion.tsx @@ -38,18 +38,18 @@ function AllocatedAccordionItem(props: AllocatedItemProps) : ReactElement { return ( - {allocatedProposal.data?.submitted?.proposal?.title} + {allocatedProposal.data?.submitted?.title} {allocatedProposal.data?.allocation ? : diff --git a/src/main/webui/src/ProposalManagerView/allocations/allocations.table.tsx b/src/main/webui/src/ProposalManagerView/allocations/allocations.table.tsx index 48894e12..74529cd8 100644 --- a/src/main/webui/src/ProposalManagerView/allocations/allocations.table.tsx +++ b/src/main/webui/src/ProposalManagerView/allocations/allocations.table.tsx @@ -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(){ @@ -110,7 +110,7 @@ function AllocationsTableRow(rowProps: AllocationTableRowProps) : ReactElement { return( - {submittedProposal.data?.proposal?.title} + {submittedProposal.data?.title} { submittedProposal.data?.reviews?.length! == 0 ? diff --git a/src/main/webui/src/ProposalManagerView/assignReviewers/assignReviewers.accordion.tsx b/src/main/webui/src/ProposalManagerView/assignReviewers/assignReviewers.accordion.tsx index aa7f4b1b..f0917d6e 100644 --- a/src/main/webui/src/ProposalManagerView/assignReviewers/assignReviewers.accordion.tsx +++ b/src/main/webui/src/ProposalManagerView/assignReviewers/assignReviewers.accordion.tsx @@ -33,7 +33,7 @@ function SubmittedProposalItem(props: SubmittedProposalItemProp) : ReactElement return ( - {proposal.data?.proposal?.title} + {proposal.data?.title} Assigned Reviewers: diff --git a/src/main/webui/src/ProposalManagerView/assignReviewers/assignReviewers.form.tsx b/src/main/webui/src/ProposalManagerView/assignReviewers/assignReviewers.form.tsx index da37057a..979fda3c 100644 --- a/src/main/webui/src/ProposalManagerView/assignReviewers/assignReviewers.form.tsx +++ b/src/main/webui/src/ProposalManagerView/assignReviewers/assignReviewers.form.tsx @@ -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!} )} /> : @@ -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!} )} /> } diff --git a/src/main/webui/src/ProposalManagerView/reviews/reviews.accordion.tsx b/src/main/webui/src/ProposalManagerView/reviews/reviews.accordion.tsx index 9201ed88..edee83d1 100644 --- a/src/main/webui/src/ProposalManagerView/reviews/reviews.accordion.tsx +++ b/src/main/webui/src/ProposalManagerView/reviews/reviews.accordion.tsx @@ -81,7 +81,7 @@ function ReviewsAccordion(props: ReviewsProps) : ReactElement { - {proposal.data?.proposal?.title} + {proposal.data?.title} {hasUserCompletedReview()} diff --git a/src/main/webui/src/ProposalManagerView/reviews/reviews.form.tsx b/src/main/webui/src/ProposalManagerView/reviews/reviews.form.tsx index 5a65633e..7680c0d6 100644 --- a/src/main/webui/src/ProposalManagerView/reviews/reviews.form.tsx +++ b/src/main/webui/src/ProposalManagerView/reviews/reviews.form.tsx @@ -273,7 +273,7 @@ function ReviewsForm(props: ReviewsProps) : ReactElement { : - You are currently not assigned to review '{props.proposal?.proposal?.title}'. + You are currently not assigned to review '{props.proposal?.title}'. If you wish to review this proposal please click on the "Self-Assign" button. diff --git a/src/main/webui/src/auth/Auth.tsx b/src/main/webui/src/auth/Auth.tsx index b8616bbb..3bb79582 100644 --- a/src/main/webui/src/auth/Auth.tsx +++ b/src/main/webui/src/auth/Auth.tsx @@ -62,12 +62,15 @@ export function AuthProvider({ children }: { children: ReactNode }) { setFetcherApiURL(localbaseUrl) apiURL.current=localbaseUrl - const response = await window.fetch("/pst/gui/aai/", {mode:"no-cors"}); //FIXME reintroduce CORS when keycloak is implementing it properly + const response = await window.fetch("/pst/gui/aai/", {mode:"no-cors", redirect:"manual"}); //FIXME reintroduce CORS when keycloak is implementing it properly let error; if (response.ok) { return await response.json() as AuthMapping - } else { + } else if(response.redirected) { + console.log("redirected" ) + } + else { console.log("authentication failed"); for (const entry of response.headers.entries()) { @@ -86,9 +89,9 @@ export function AuthProvider({ children }: { children: ReactNode }) { }; } - throw error; - } + } + throw error; } function logout() { diff --git a/src/main/webui/src/generated/proposalToolComponents.ts b/src/main/webui/src/generated/proposalToolComponents.ts index a898af83..e986c32c 100644 --- a/src/main/webui/src/generated/proposalToolComponents.ts +++ b/src/main/webui/src/generated/proposalToolComponents.ts @@ -1,7 +1,7 @@ /** * Generated by @openapi-codegen * - * @version 0.3 + * @version 0.4 */ import * as reactQuery from "@tanstack/react-query"; import { @@ -5910,6 +5910,11 @@ export type SubmittedProposalResourceGetSubmittedProposalsPathParams = { cycleCode: number; }; +export type SubmittedProposalResourceGetSubmittedProposalsQueryParams = { + investigatorName?: string; + title?: string; +}; + export type SubmittedProposalResourceGetSubmittedProposalsError = Fetcher.ErrorWrapper; @@ -5918,6 +5923,7 @@ export type SubmittedProposalResourceGetSubmittedProposalsResponse = export type SubmittedProposalResourceGetSubmittedProposalsVariables = { pathParams: SubmittedProposalResourceGetSubmittedProposalsPathParams; + queryParams?: SubmittedProposalResourceGetSubmittedProposalsQueryParams; } & ProposalToolContext["fetcherOptions"]; export const fetchSubmittedProposalResourceGetSubmittedProposals = ( @@ -5929,7 +5935,7 @@ export const fetchSubmittedProposalResourceGetSubmittedProposals = ( SubmittedProposalResourceGetSubmittedProposalsError, undefined, {}, - {}, + SubmittedProposalResourceGetSubmittedProposalsQueryParams, SubmittedProposalResourceGetSubmittedProposalsPathParams >({ url: "/pst/api/proposalCycles/{cycleCode}/submittedProposals", diff --git a/src/main/webui/src/generated/proposalToolSchemas.ts b/src/main/webui/src/generated/proposalToolSchemas.ts index 6937d054..8099203c 100644 --- a/src/main/webui/src/generated/proposalToolSchemas.ts +++ b/src/main/webui/src/generated/proposalToolSchemas.ts @@ -1,14 +1,64 @@ /** * Generated by @openapi-codegen * - * @version 0.3 + * @version 0.4 */ +/** + * base proposal + */ +export type AbstractProposal = { + _id?: number; + /** + * the proposal title + */ + title?: string; + /** + * a short summary/abstract of the proposal + */ + summary?: string; + kind?: ProposalKind; + /** + * The justification for the proposal. Note that the justification is for reading by humans and is not parsed to extract things like source lists - that sort of information must be entered in the correct place in the model. + */ + scientificJustification?: Justification; + /** + * The justification for the proposal. Note that the justification is for reading by humans and is not parsed to extract things like source lists - that sort of information must be entered in the correct place in the model. + */ + technicalJustification?: Justification; + /** + * the person(s) making the proposal + */ + investigators?: Investigator[]; + relatedProposals?: RelatedProposal[]; + /** + * any additional documents + */ + supportingDocuments?: SupportingDocument[]; + /** + * the targets of the proposal + */ + targets?: Target[]; + /** + * the fields observed in the proposal + */ + fields?: Field[]; + /** + * the technical goals of the proposal + */ + technicalGoals?: TechnicalGoal[]; + /** + * the proposed observations + */ + observations?: Observation[]; + xmlId?: string; +}; + /** * A block of resources that have been allocated */ export type AllocatedBlock = { _id?: number; - "@type"?: string; //proposalManagement:AllocatedBlock + "@type"?: string; /** * A resource that will be consumed by allocating an observation from a proposal */ @@ -27,7 +77,7 @@ export type AllocatedBlock = { * an instance of a proposal that is allocated observing time */ export type AllocatedProposal = { - _id?: number + _id?: number; /** * what is allocated to the proposal */ @@ -632,7 +682,7 @@ export type InvestigatorKind = "PI" | "COI"; /** * an identifier that can be used as a key to look up in an IVOA registry - see https://www.ivoa.net/documents/IVOAIdentifiers/ */ -export type Ivorn = { +export type Ivoid = { value?: string; }; @@ -708,7 +758,7 @@ export type ObjectIdentifier = { export type ObsType = "TargetObservation" | "CalibrationObservation"; /** - * An observation - occurs in a single non-overlapping time period + * 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) @@ -773,7 +823,7 @@ export type Observatory = { /** * an identifier that can be used as a key to look up in an IVOA registry - see https://www.ivoa.net/documents/IVOAIdentifiers/ */ - ivoid?: Ivorn; + ivoid?: Ivoid; /** * a WikiData identifier */ @@ -848,7 +898,8 @@ export type ObservingPlatform = { * a complete proposal */ export type ObservingProposal = { - "_id"?: number; + _id?: number; + xmlId?: string; /** * the proposal title */ @@ -858,10 +909,6 @@ export type ObservingProposal = { */ summary?: string; kind?: ProposalKind; - /** - * whether the proposal is submitted - */ - submitted?: boolean; /** * The justification for the proposal. Note that the justification is for reading by humans and is not parsed to extract things like source lists - that sort of information must be entered in the correct place in the model. */ @@ -895,7 +942,6 @@ export type ObservingProposal = { * the proposed observations */ observations?: Observation[]; - xmlId?: string; }; /** @@ -912,7 +958,7 @@ export type Organization = { /** * an identifier that can be used as a key to look up in an IVOA registry - see https://www.ivoa.net/documents/IVOAIdentifiers/ */ - ivoid?: Ivorn; + ivoid?: Ivoid; /** * a WikiData identifier */ @@ -1239,7 +1285,6 @@ export type ProposalSynopsis = { title?: string; summary?: string; kind?: ProposalKind; - submitted?: boolean; }; export type ProposalValidation = { @@ -1309,9 +1354,9 @@ export type RefLocation = Record; */ export type RelatedProposal = { /** - * a complete proposal + * base proposal */ - proposal?: ObservingProposal; + proposal?: AbstractProposal; }; /** @@ -1569,6 +1614,50 @@ export type SubmissionConfiguration = { */ export type SubmittedProposal = { _id?: number; + + xmlId?: string; + /** + * the proposal title + */ + title?: string; + /** + * a short summary/abstract of the proposal + */ + summary?: string; + kind?: ProposalKind; + /** + * The justification for the proposal. Note that the justification is for reading by humans and is not parsed to extract things like source lists - that sort of information must be entered in the correct place in the model. + */ + scientificJustification?: Justification; + /** + * The justification for the proposal. Note that the justification is for reading by humans and is not parsed to extract things like source lists - that sort of information must be entered in the correct place in the model. + */ + technicalJustification?: Justification; + /** + * the person(s) making the proposal + */ + investigators?: Investigator[]; + relatedProposals?: RelatedProposal[]; + /** + * any additional documents + */ + supportingDocuments?: SupportingDocument[]; + /** + * the targets of the proposal + */ + targets?: Target[]; + /** + * the fields observed in the proposal + */ + fields?: Field[]; + /** + * the technical goals of the proposal + */ + technicalGoals?: TechnicalGoal[]; + /** + * the proposed observations + */ + observations?: Observation[]; /** * the date that the proposal was submitted * @@ -1592,11 +1681,6 @@ export type SubmittedProposal = { * the reviews */ reviews?: ProposalReview[]; - /** - * a complete proposal - */ - proposal?: ObservingProposal; - xmlId?: string; }; /** From 2de9dfbeb8b0c509dcaf0c1a649fe23827eaee62 Mon Sep 17 00:00:00 2001 From: Allan England Date: Wed, 20 Nov 2024 12:59:09 +0000 Subject: [PATCH 2/3] Add @type key & value to fix create new proposal --- src/main/webui/src/ProposalEditorView/proposal/New.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/webui/src/ProposalEditorView/proposal/New.tsx b/src/main/webui/src/ProposalEditorView/proposal/New.tsx index 6f57ad89..029f2aaf 100644 --- a/src/main/webui/src/ProposalEditorView/proposal/New.tsx +++ b/src/main/webui/src/ProposalEditorView/proposal/New.tsx @@ -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, From 242c5c758b8e8010266d5807f8481b16201a1c72 Mon Sep 17 00:00:00 2001 From: Paul Harrison Date: Thu, 21 Nov 2024 20:41:23 +0000 Subject: [PATCH 3/3] updated the patch --- src/main/webui/Add_@types.patch | 101 +++++++++--------- .../src/generated/proposalToolSchemas.ts | 2 +- 2 files changed, 49 insertions(+), 54 deletions(-) diff --git a/src/main/webui/Add_@types.patch b/src/main/webui/Add_@types.patch index 43fd0321..4e398b00 100644 --- a/src/main/webui/Add_@types.patch +++ b/src/main/webui/Add_@types.patch @@ -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 = { @@ -9,15 +17,15 @@ /** * 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 = { @@ -25,7 +33,7 @@ /** * the name of the grade */ -@@ -130,6 +134,7 @@ +@@ -179,6 +184,7 @@ */ export type CalibrationObservation = { xmlId?: string; @@ -33,7 +41,7 @@ /** * 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 = { @@ -41,7 +49,7 @@ axis?: Axis[]; }; -@@ -189,6 +195,7 @@ +@@ -238,6 +245,7 @@ */ export type CelestialTarget = { xmlId?: string; @@ -49,7 +57,7 @@ /** * A common name for the source */ -@@ -198,7 +205,7 @@ +@@ -247,7 +255,7 @@ */ sourceCoordinates?: EquatorialPoint; /** @@ -58,7 +66,7 @@ */ positionEpoch?: Epoch; /** -@@ -289,9 +296,7 @@ +@@ -338,9 +346,7 @@ /** * Abstract head of the coordinate system object tree. */ @@ -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 = { @@ -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 = { @@ -89,8 +97,8 @@ }; export type FileUpload = Record; -@@ -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) @@ -98,7 +106,7 @@ /** * any constraints on the observation */ -@@ -750,6 +761,9 @@ +@@ -799,6 +811,9 @@ * An organisation that can perform astronomical observations */ export type Observatory = { @@ -108,7 +116,7 @@ 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 = { @@ -116,15 +124,15 @@ /** * 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 = { @@ -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 = { @@ -142,7 +150,7 @@ /** * a human readable description of the cycle */ -@@ -1183,6 +1203,7 @@ +@@ -1228,6 +1249,7 @@ * A review of a proposal */ export type ProposalReview = { @@ -150,7 +158,7 @@ /** * Description */ -@@ -1265,6 +1286,7 @@ +@@ -1309,6 +1331,7 @@ * A real value with a unit. */ export type RealQuantity = { @@ -158,7 +166,7 @@ /** * 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 = { @@ -167,7 +175,7 @@ /** * The amount of the resource * -@@ -1326,6 +1350,7 @@ +@@ -1370,6 +1395,7 @@ * a type of resource */ export type ResourceType = { @@ -175,7 +183,7 @@ /** * the name of the resource type */ -@@ -1338,6 +1363,7 @@ +@@ -1382,6 +1408,7 @@ * assigned to review the proposal */ export type Reviewer = { @@ -183,7 +191,7 @@ /** * person connected with the proposal */ -@@ -1369,6 +1395,8 @@ +@@ -1413,6 +1440,8 @@ /** * Science oriented definition of a spectral window. */ @@ -192,7 +200,7 @@ 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 = { @@ -200,7 +208,7 @@ /** * 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 = { @@ -208,7 +216,7 @@ xmlId?: string; /** * Abstract head of coordinate spaces related to physical properties. -@@ -1518,7 +1548,7 @@ +@@ -1562,7 +1593,7 @@ /** * person connected with the proposal */ @@ -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 = { @@ -246,7 +255,7 @@ xmlId?: string; name?: string; }; -@@ -1620,6 +1654,7 @@ +@@ -1702,6 +1738,7 @@ * an observation of the scientific target */ export type TargetObservation = { @@ -254,7 +263,7 @@ xmlId?: string; /** * any constraints on the observation -@@ -1648,10 +1683,12 @@ +@@ -1730,10 +1767,12 @@ */ performance?: PerformanceParameters; spectrum?: ScienceSpectralWindow[]; @@ -267,7 +276,7 @@ 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 = { @@ -275,7 +284,7 @@ xmlId?: string; /** * the array name -@@ -1752,6 +1790,10 @@ +@@ -1834,6 +1874,10 @@ * particular time range */ export type TimingWindow = { @@ -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; diff --git a/src/main/webui/src/generated/proposalToolSchemas.ts b/src/main/webui/src/generated/proposalToolSchemas.ts index 8099203c..e4d152b3 100644 --- a/src/main/webui/src/generated/proposalToolSchemas.ts +++ b/src/main/webui/src/generated/proposalToolSchemas.ts @@ -58,7 +58,7 @@ export type AbstractProposal = { */ export type AllocatedBlock = { _id?: number; - "@type"?: string; + "@type"?: string; //proposalManagement:AllocatedBlock /** * A resource that will be consumed by allocating an observation from a proposal */