Skip to content

Commit

Permalink
feat: Update styling [PT-187736835]
Browse files Browse the repository at this point in the history
- Moved Data Trial experiment to the first experiment in the list
- Changed experiment colors so that the icon colors are specified in the experiment and not in the code
- Added permanent border around experiment name in header
- Update time series sensor header to use svg sparkgraph
- Added input borders in tables
- Added (optional) placeholders with simple variable substitution for inputs
  • Loading branch information
dougmartin committed Jun 20, 2024
1 parent cacc372 commit e474919
Show file tree
Hide file tree
Showing 26 changed files with 421 additions and 339 deletions.
6 changes: 3 additions & 3 deletions cypress/supports/elements/ExperimentSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ class ExperimentSetup {
}

getNameInput() {
return cy.get('.experiment-wrapper-module-editing-vortex input').focus()
return cy.get('.experiment-wrapper-module-name-vortex input').focus()
}

getExperimentNameSpan() {
return cy.get('.experiment-wrapper-module-nameDisplay-vortex')
return cy.get('.experiment-wrapper-module-name-vortex')
}

getExperimentName(name) {
return cy.get('.experiment-wrapper-module-nameDisplay-vortex').contains(name)
return cy.get('.experiment-wrapper-module-name-vortex').contains(name)
}

getStudySiteDropDown() {
Expand Down
20 changes: 20 additions & 0 deletions src/authoring-app/utils/experiment-authoring-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,26 @@
"examples": [
"SI"
]
},
"iconColor": {
"$id": "#/properties/metadata/properties/iconColor",
"type": "string",
"title": "The IconColor Schema",
"description": "Icon color for this template.",
"default": "",
"examples": [
"#0f73b8"
]
},
"iconHoverColor": {
"$id": "#/properties/metadata/properties/iconHoverColor",
"type": "string",
"title": "The IconHoverColor Schema",
"description": "Icon hover color for this template.",
"default": "",
"examples": [
"#4b96ca"
]
}
}
},
Expand Down
257 changes: 133 additions & 124 deletions src/data/experiments.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,136 @@
[
{
"version": "1.0.0",
"metadata": {
"uuid": "aefb5299-c127-4d84-b7f0-78da389ebecd",
"name": "Data Trial",
"initials": "DT",
"iconColor": "#008a09",
"iconHoverColor": "#40a847"
},
"schema": {
"sections": [
{
"title": "Collect",
"icon": "collect",
"formFields": [
"experimentData"
]
},
{
"title": "Note & Photo",
"icon": "note_and_photo",
"formFields": [
"photo"
]
}
],
"dataSchema": {
"type": "object",
"required": [],
"properties": {
"experimentData": {
"type": "array",
"items": {
"type": "object",
"required": [
"timeSeries"
],
"properties": {
"timeSeries": {
"title": "Readout",
"type": "array"
},
"label": {
"title": "Label",
"type": "string",
"placeholder": "Label #$N"
}
}
}
},
"photo": {
"title": "Photos",
"type": "array",
"items": {
"type": "object",
"properties": {
"isPhoto": {
"type": "boolean"
},
"localPhotoUrl": {
"type": "string"
},
"remotePhotoUrl": {
"type": "string"
},
"note": {
"type": "string"
},
"timestamp": {
"type": "string",
"format": "date-time"
}
}
}
}
}
},
"formUiSchema": {
"customName": {
"ui:icon": "label",
"ui:placeholder": "Time Series Investigation"
},
"note": {
"items": {
"ui:widget": "textarea"
}
},
"experimentData": {
"ui:field": "dataTable",
"ui:dataTableOptions": {
"sensorFields": [
"timeSeries"
],
"filters": [{
"namePrefix": "GDX-"
}]
}
},
"photo": {
"ui:field": "photo"
}
}
},
"data": {
"experimentData": [
{
"label": ""
},
{
"label": ""
},
{
"label": ""
},
{
"label": ""
},
{
"label": ""
}
],
"photo": []
}
},
{
"version": "1.0.0",
"metadata": {
"uuid": "e431af00-5ef9-44f8-a887-c76caa6ddde1",
"name": "Schoolyard Investigation",
"initials": "SI"
"initials": "SI",
"iconColor": "#e0007f",
"iconHoverColor": "#e8409f"
},
"schema": {
"titleField": "studySite",
Expand Down Expand Up @@ -184,7 +310,9 @@
"metadata": {
"uuid": "d27df06a-0997-4c53-8afd-d5dcc627d44f",
"name": "Stream Study",
"initials": "SS"
"initials": "SS",
"iconColor": "#0f73b8",
"iconHoverColor": "#4b96ca"
},
"schema": {
"titleField": "studySite",
Expand Down Expand Up @@ -347,7 +475,9 @@
"metadata": {
"uuid": "df02396f-a3d6-4dc5-bc10-fac4007fb6de",
"name": "Pond Study",
"initials": "PS"
"initials": "PS",
"iconColor": "#d04a06",
"iconHoverColor": "#dc7744"
},
"schema": {
"titleField": "Collect",
Expand Down Expand Up @@ -509,126 +639,5 @@
],
"photo": []
}
},
{
"version": "1.0.0",
"metadata": {
"uuid": "aefb5299-c127-4d84-b7f0-78da389ebecd",
"name": "Record Data Trials",
"initials": "RD"
},
"schema": {
"sections": [
{
"title": "Collect",
"icon": "collect",
"formFields": [
"experimentData"
]
},
{
"title": "Note & Photo",
"icon": "note_and_photo",
"formFields": [
"photo"
]
}
],
"dataSchema": {
"type": "object",
"required": [],
"properties": {
"experimentData": {
"type": "array",
"items": {
"type": "object",
"required": [
"timeSeries"
],
"properties": {
"timeSeries": {
"title": "Readout",
"type": "array"
},
"label": {
"title": "Label",
"type": "string"
}
}
}
},
"photo": {
"title": "Photos",
"type": "array",
"items": {
"type": "object",
"properties": {
"isPhoto": {
"type": "boolean"
},
"localPhotoUrl": {
"type": "string"
},
"remotePhotoUrl": {
"type": "string"
},
"note": {
"type": "string"
},
"timestamp": {
"type": "string",
"format": "date-time"
}
}
}
}
}
},
"formUiSchema": {
"customName": {
"ui:icon": "label",
"ui:placeholder": "Time Series Investigation"
},
"note": {
"items": {
"ui:widget": "textarea"
}
},
"experimentData": {
"ui:field": "dataTable",
"ui:dataTableOptions": {
"sensorFields": [
"timeSeries"
],
"filters": [{
"namePrefix": "GDX-"
}]
}
},
"photo": {
"ui:field": "photo"
}
}
},
"data": {
"experimentData": [
{
"label": ""
},
{
"label": ""
},
{
"label": ""
},
{
"label": ""
},
{
"label": ""
}
],
"photo": []
}
}
]
19 changes: 1 addition & 18 deletions src/mobile-app/components/experiment-picker-item.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
justify-content: flex-start;
}

.icon {
Expand All @@ -26,23 +26,6 @@
background-color: $sensorGreenLight1;
cursor: pointer;
}

&.SS{
background-color: $streamBlue;
&:hover {
background-color: $streamBlueLight1;
cursor: pointer;
}

}
&.SI{
background-color: $sensorGreen;
&:hover {
background-color: $sensorGreenLight1;
cursor: pointer;
}
}

}

.title {
Expand Down
16 changes: 4 additions & 12 deletions src/mobile-app/components/experiment-picker-item.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from "react";
import { IExperiment } from "../../shared/experiment-types";
import { useIconStyle } from "../hooks/use-icon-style";

import css from "./experiment-picker-item.module.scss";

Expand All @@ -10,20 +11,11 @@ interface IProps {

export const ExperimentPickerItem: React.FC<IProps> = ({experiment, setExperiment}) => {
const {name} = experiment.metadata;
const buttonColor = (initials: string) => {
switch (initials) {
case "SS":
return css.SS;
case "SI":
return css.SI;
default:
return;
}
};
const {style, handleMouseOut, handleMouseOver} = useIconStyle(experiment.metadata);

return (
<div className={css.item} onClick={setExperiment.bind(null, experiment)}>
<div className={`${css.icon} ${buttonColor(experiment.metadata.initials)}`}>+</div>
<div className={css.item} onClick={setExperiment.bind(null, experiment)} onMouseOver={handleMouseOver} onMouseOut={handleMouseOut}>
<div className={css.icon} style={style}>+</div>
<div className={css.title}>
{name}
</div>
Expand Down
Loading

0 comments on commit e474919

Please sign in to comment.