Skip to content

Commit

Permalink
Merge branch 'master' into 200-contextual-help
Browse files Browse the repository at this point in the history
  • Loading branch information
mwapst authored Aug 6, 2024
2 parents 38fb055 + de6c169 commit 87b1c91
Show file tree
Hide file tree
Showing 16 changed files with 241 additions and 134 deletions.
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
7 changes: 5 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
22 changes: 12 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down Expand Up @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
49 changes: 25 additions & 24 deletions src/main/webui/[email protected]
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
+++ proposalToolSchemas.ts 2024-06-24 16:25:18
--- proposalToolSchemas.ts.orig 2024-07-16 09:51:55
+++ proposalToolSchemas.ts 2024-07-18 11:53:22
@@ -7,6 +7,8 @@
* A block of resources that have been allocated
*/
Expand Down Expand Up @@ -88,16 +89,16 @@
};

export type FileUpload = Record<string, any>;
@@ -684,6 +693,8 @@
export type ObsType = "TargetObservation" | "CalibrationObservation";

@@ -687,6 +696,8 @@
* An observation - occurs in a single non-overlapping time period
*/
export type Observation = {
+ "@type"?: string; //ObsType (see above)
+ _id?: number;
/**
* any constraints on the observation
*/
@@ -706,6 +717,9 @@
@@ -709,6 +720,9 @@
* An organisation that can perform astronomical observations
*/
export type Observatory = {
Expand All @@ -107,23 +108,23 @@
xmlId?: string;
/**
* The name of the organization
@@ -762,6 +776,7 @@
@@ -765,6 +779,7 @@
* a collection of configs that can be chosen to observe with.
*/
export type ObservingMode = {
+ _id?: number;
name?: string;
description?: string;
configurations?: ObservingConfiguration[];
@@ -772,6 +787,7 @@
@@ -775,6 +790,7 @@
* a complete proposal
*/
export type ObservingProposal = {
+ "_id"?: number;
/**
* the proposal title
*/
@@ -829,6 +845,8 @@
@@ -832,6 +848,8 @@
* An institution that is a collection of people
*/
export type Organization = {
Expand All @@ -132,7 +133,7 @@
/**
* The name of the organization
*/
@@ -1053,6 +1071,8 @@
@@ -1056,6 +1074,8 @@
* Defines collection of resources and proposals for a particular observing season
*/
export type ProposalCycle = {
Expand All @@ -141,23 +142,23 @@
/**
* a human readable description of the cycle
*/
@@ -1121,6 +1141,7 @@
@@ -1124,6 +1144,7 @@
* A review of a proposal
*/
export type ProposalReview = {
+ _id?: number;
/**
* Description
*/
@@ -1203,6 +1224,7 @@
@@ -1206,6 +1227,7 @@
* A real value with a unit.
*/
export type RealQuantity = {
+ "@type"?: string; // ivoa:RealQuantity
/**
* Must conform to definition of unit in VOUnit spec.
*/
@@ -1234,6 +1256,8 @@
@@ -1237,6 +1259,8 @@
* A resource that will be consumed by allocating an observation from a proposal
*/
export type Resource = {
Expand All @@ -166,23 +167,23 @@
/**
* The amount of the resource
*
@@ -1264,6 +1288,7 @@
@@ -1267,6 +1291,7 @@
* a type of resource
*/
export type ResourceType = {
+ _id?: number;
/**
* the name of the resource type
*/
@@ -1276,6 +1301,7 @@
@@ -1279,6 +1304,7 @@
* assigned to review the proposal
*/
export type Reviewer = {
+ _id?: number;
/**
* person connected with the proposal
*/
@@ -1307,6 +1333,8 @@
@@ -1310,6 +1336,8 @@
/**
* Science oriented definition of a spectral window.
*/
Expand All @@ -191,23 +192,23 @@
spectralWindowSetup?: SpectralWindowSetup;
expectedSpectralLine?: ExpectedSpectralLine[];
};
@@ -1351,6 +1379,7 @@
@@ -1354,6 +1382,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.
*/
@@ -1373,6 +1402,7 @@
@@ -1376,6 +1405,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.
@@ -1456,7 +1486,7 @@
@@ -1459,7 +1489,7 @@
/**
* person connected with the proposal
*/
Expand All @@ -216,15 +217,15 @@
uid?: string;
inKeycloakRealm?: boolean;
};
@@ -1465,6 +1495,7 @@
@@ -1468,6 +1498,7 @@
* an instance of a proposal that has been submitted
*/
export type SubmittedProposal = {
+ _id?: number;
/**
* the date that the proposal was submitted
*
@@ -1527,17 +1558,20 @@
@@ -1530,17 +1561,20 @@
* A target source
*/
export type Target = {
Expand All @@ -245,23 +246,23 @@
xmlId?: string;
name?: string;
};
@@ -1546,6 +1580,7 @@
@@ -1549,6 +1583,7 @@
* an observation of the scientific target
*/
export type TargetObservation = {
+ "@type"?: string;
/**
* any constraints on the observation
*/
@@ -1573,6 +1608,7 @@
@@ -1576,6 +1611,7 @@
*/
performance?: PerformanceParameters;
spectrum?: ScienceSpectralWindow[];
+ _id?: number;
xmlId?: string;
};

@@ -1676,6 +1712,10 @@
@@ -1679,6 +1715,10 @@
* particular time range
*/
export type TimingWindow = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,15 @@ function ObservationFieldsRow(props: ObservationFieldRowProps): ReactElement {

if (field.isError) {
return (
<Table.Tr key={props.fieldId}>
Error: {getErrorMessage(field.error)}
<Table.Tr key={props.fieldId}><Table.Td>Error: {getErrorMessage(field.error)}</Table.Td>

</Table.Tr>
)
}

if (field.isLoading) {
return (
<Table.Tr key={props.fieldId}>
Loading...
<Table.Tr key={props.fieldId}><Table.Td>Loading...</Table.Td>
</Table.Tr>
)
}
Expand Down
42 changes: 27 additions & 15 deletions src/main/webui/src/ProposalEditorView/observations/edit.group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import {ObservationProps} from "./observationPanel.tsx";
import { Fieldset, Grid, Text, Stack, Space } from '@mantine/core';
import {
CalibrationObservation,
CalibrationTargetIntendedUse, Observation, TargetObservation,
CalibrationTargetIntendedUse, Observation, Target, TargetObservation,
TimingWindow
} from 'src/generated/proposalToolSchemas.ts';
import { useForm, UseFormReturnType } from '@mantine/form';
import {
fetchObservationResourceAddNewConstraint,
fetchObservationResourceAddNewObservation, fetchObservationResourceReplaceField,
fetchObservationResourceReplaceTarget, fetchObservationResourceReplaceTechnicalGoal,
fetchObservationResourceReplaceTargets, fetchObservationResourceReplaceTechnicalGoal,
fetchObservationResourceReplaceTimingWindow
} from 'src/generated/proposalToolComponents.ts';
import {FormSubmitButton} from 'src/commonButtons/save.tsx';
Expand All @@ -35,7 +35,7 @@ export interface ObservationFormValues {
observationId: number | undefined,
observationType: ObservationType,
calibrationUse: CalibrationTargetIntendedUse | undefined,
targetDBId: number | undefined,
targetDBId: number[] | undefined,
techGoalId: number | undefined,
fieldId: string | undefined, //string for Select to show existing value in edit-form
timingWindows: TimingWindowGui[],
Expand Down Expand Up @@ -101,15 +101,15 @@ export default function ObservationEditGroup(
observationId: props.observation?._id, //required for deletion of timing windows
observationType: observationType,
calibrationUse: calibrationUse,
targetDBId: props.observation?.target?._id,
targetDBId: props.observation?.target! as number[],
techGoalId: props.observation?.technicalGoal?._id,
fieldId: props.observation?.field?._id ? String(props.observation?.field?._id) : undefined,
timingWindows: initialTimingWindows
},

validate: {
targetDBId: (value: number | undefined | string ) =>
(value === undefined ? 'Please select a target' : null),
// targetDBId: (value: number | undefined | string ) =>
// (value === undefined ? 'Please select a target' : null),
techGoalId: (value: number | undefined | string) =>
(value === undefined ? 'Please select a technical goal' : null),
fieldId: (value: string | undefined) =>
Expand Down Expand Up @@ -138,11 +138,17 @@ export default function ObservationEditGroup(
form.onSubmit((values) => {
if (newObservation) {
//Creating new observation
let baseObservation : Observation = {
target: {
let targetList: Target[] = [];

form.values.targetDBId?.map((thisTarget) =>{
targetList.push({
"@type": "proposal:CelestialTarget",
"_id": values.targetDBId
},
"_id": thisTarget
})
})

let baseObservation : Observation = {
target: targetList,
technicalGoal: {
"_id": values.techGoalId
},
Expand Down Expand Up @@ -221,15 +227,21 @@ export default function ObservationEditGroup(
})

if (form.isDirty('targetDBId')) {
fetchObservationResourceReplaceTarget({
let body: Target[] = [];

form.values.targetDBId?.map((thisTarget) =>{
body.push({
"@type": "proposal:CelestialTarget",
"_id": thisTarget
})
})

fetchObservationResourceReplaceTargets({
pathParams: {
proposalCode: Number(selectedProposalCode),
observationId: props.observation?._id!
},
body: {
"@type": "proposal:CelestialTarget",
"_id": form.values.targetDBId
}
body: body
})
.then(()=>queryClient.invalidateQueries())
.catch(console.error)
Expand Down
Loading

0 comments on commit 87b1c91

Please sign in to comment.