Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update styling [PT-187736835] #146

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading