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

Meeting Updates from 1/29/2024 #578

Merged
merged 13 commits into from
Jan 30, 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
19 changes: 18 additions & 1 deletion schemas/base-metadata.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ export const preprocessMetadataSchema = (schema: any = baseMetadataSchema, globa

copy.additionalProperties = false



copy.required = Object.keys(copy.properties) // Require all properties at the top level

copy.order = [ "NWBFile", "Subject" ]

// Add unit to weight
const subjectProps = copy.properties.Subject.properties
subjectProps.weight.unit = 'kg'
Expand Down Expand Up @@ -88,6 +94,8 @@ export const preprocessMetadataSchema = (schema: any = baseMetadataSchema, globa

if (ophys) {

ophys.required = Object.keys(ophys.properties)

const getProp = (name: string) => ophys.properties[name]

if (getProp("TwoPhotonSeries")) {
Expand Down Expand Up @@ -143,8 +151,17 @@ export const preprocessMetadataSchema = (schema: any = baseMetadataSchema, globa

// Remove non-global properties
if (global) {

Object.entries(copy.properties).forEach(([globalProp, schema]) => {
instanceSpecificFields[globalProp]?.forEach((prop) => delete schema.properties[prop]);

const requiredSet = new Set(schema.required)

instanceSpecificFields[globalProp]?.forEach((prop) => {
delete schema.properties[prop]
requiredSet.delete(prop)
});

schema.required = Array.from(requiredSet)
});
}

Expand Down
50 changes: 10 additions & 40 deletions src/renderer/src/stories/Accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import {

import { Chevron } from "./Chevron";

// import 'fa-icons';

const faSize = "1em";
const faColor = "#000000";

Expand All @@ -25,13 +23,11 @@ export class Accordion extends LitElement {

:host {
display: block;
overflow: hidden;
}

.header {
display: flex;
align-items: end;
padding: 20px 0px;
align-items: center;
white-space: nowrap;
}

Expand All @@ -47,14 +43,6 @@ export class Accordion extends LitElement {
margin-right: 10px;
}

.header > *:nth-child(2) {
padding-bottom: 2px;
}

nwb-chevron {
margin: 10px;
}

.guided--nav-bar-section {
display: flex;
flex-direction: column;
Expand All @@ -64,45 +52,39 @@ export class Accordion extends LitElement {
height: 100%;
}

.guided--nav-bar-section > * {
padding: 0px 10px;
}

.content {
width: 100%;
}

.guided--nav-bar-dropdown {
position: relative;
min-height: 40px;
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: nowrap;
user-select: none;
background-color: rgb(240, 240, 240);
border-bottom: 1px solid gray;
background-color: rgb(235, 235, 235);
}

.guided--nav-bar-dropdown.active {
border-bottom: none;
.guided--nav-bar-section > * {
padding: 3px 15px 3px 10px;
}

.guided--nav-bar-section:last-child > .guided--nav-bar-dropdown {
.guided--nav-bar-dropdown.active {
border-bottom: none;
}

.guided--nav-bar-dropdown.error {
border-bottom: 5px solid hsl(${errorHue}, 100%, 70%) !important;
border-bottom: 3px solid hsl(${errorHue}, 100%, 70%) !important;
}

.guided--nav-bar-dropdown.warning {
border-bottom: 5px solid hsl(${warningHue}, 100%, 70%) !important;
border-bottom: 3px solid hsl(${warningHue}, 100%, 70%) !important;
}

.guided--nav-bar-dropdown.valid {
border-bottom: 5px solid hsl(${successHue}, 100%, 70%) !important;
border-bottom: 3px solid hsl(${successHue}, 100%, 70%) !important;
}

.guided--nav-bar-dropdown {
Expand All @@ -120,21 +102,9 @@ export class Accordion extends LitElement {
right: 50px;
}

.guided--nav-bar-dropdown.error::after {
content: "${errorSymbol}";
}

.guided--nav-bar-dropdown.warning::after {
content: "${warningSymbol}";
}

.guided--nav-bar-dropdown.valid::after {
content: "${successSymbol}";
}

.guided--nav-bar-dropdown.toggleable:hover {
cursor: pointer;
background-color: lightgray;
background-color: gainsboro;
}

.guided--nav-bar-section-page {
Expand Down Expand Up @@ -268,7 +238,7 @@ export class Accordion extends LitElement {
? html`<div
id="section"
class="content hidden ${this.disabled ? "disabled" : ""}"
style="padding: ${this.contentPadding ?? "25px"}"
style="padding: ${this.contentPadding ?? "15px"}"
>
${this.content}
</div>`
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/stories/BasicTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ export class BasicTable extends LitElement {
else if (value !== "" && thisTypeOf !== type)
result = [{ message: `${col} is expected to be of type ${ogType}, not ${thisTypeOf}`, type: "error" }];
// Otherwise validate using the specified onChange function
else result = this.validateOnChange([col], parent, value, this.#itemProps[col]);
else result = this.validateOnChange(col, parent, value, this.#itemProps[col]);

// Will run synchronously if not a promise result
return promises.resolve(result, () => {
Expand Down
5 changes: 5 additions & 0 deletions src/renderer/src/stories/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ export class Button extends LitElement {
background-color: transparent;
box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;
}
.storybook-button--extra-small {
font-size: 10px;
padding: 7px 12px;
}

.storybook-button--small {
font-size: 12px;
padding: 10px 16px;
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/stories/Chevron.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class Chevron extends LitElement {

div::before {
border-style: solid;
border-width: 0.25em 0.25em 0 0;
border-width: 0.2em 0.2em 0 0;
content: "";
display: inline-block;
height: 0.45em;
Expand Down
Loading
Loading