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

Update Tutorial Documentation for 1.0.0 Release #835

Merged
merged 25 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
185b72c
Update screenshots + related docs
garrettmflynn Jun 5, 2024
4a15fdb
Ensure only one modal at the end of the pipeline
garrettmflynn Jun 5, 2024
6818831
Update SettingsPage.js
garrettmflynn Jun 5, 2024
1721068
Merge branch 'remove-modals' into improve-screenshots
garrettmflynn Jun 5, 2024
d7ddf08
Regenerate dataset. Fix future time issue
garrettmflynn Jun 5, 2024
6fbdd18
Access modal synchronously before creation is completed
garrettmflynn Jun 5, 2024
f80e6f6
Merge branch 'main' into improve-screenshots
garrettmflynn Jun 5, 2024
3d6381b
Update with backend configuration and notification dismissal
garrettmflynn Jun 5, 2024
0ab0f74
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 5, 2024
638e0e8
Update src/pyflask/manageNeuroconv/manage_neuroconv.py
CodyCBakerPhD Jun 5, 2024
149a838
Update developer_guide.rst
garrettmflynn Jun 5, 2024
8af2136
Merge branch 'improve-screenshots' of https://github.com/NeurodataWit…
garrettmflynn Jun 5, 2024
122150e
Merge branch 'main' into improve-screenshots
CodyCBakerPhD Jun 5, 2024
b946514
Update info-page.png
garrettmflynn Jun 5, 2024
a001af7
Update workflow.ts
garrettmflynn Jun 5, 2024
72f489e
Merge branch 'improve-screenshots' of https://github.com/NeurodataWit…
garrettmflynn Jun 5, 2024
703a640
update data locations and fix indent
garrettmflynn Jun 5, 2024
895307d
Swap order of dandi upload workflow option
garrettmflynn Jun 5, 2024
12c4647
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 5, 2024
3446ee3
Merge branch 'improve-screenshots' into improve-tutorial-text
garrettmflynn Jun 5, 2024
3a5ca3b
Merge branch 'main' into improve-screenshots
CodyCBakerPhD Jun 5, 2024
2665215
Replace all mention of the DANDI staging server with "Development ser…
garrettmflynn Jun 5, 2024
b7c5dc7
Update ordering of SpikeGLX and Phy
garrettmflynn Jun 5, 2024
03dd645
Merge branch 'improve-tutorial-text' into improve-screenshots
garrettmflynn Jun 5, 2024
b28edf0
Update screenshots with DANDI staging rename
garrettmflynn Jun 5, 2024
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
Binary file modified docs/assets/tutorials/dandi/api-token-added.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/tutorials/dandi/api-tokens.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/tutorials/dandi/create-dandiset.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/tutorials/dandi/dandiset-id.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/tutorials/dandi/review-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/tutorials/dataset-created.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/tutorials/dataset-creation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/tutorials/home-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/tutorials/multiple/all-interfaces-added.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/tutorials/multiple/conversion-results-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/tutorials/multiple/fail-name.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/tutorials/multiple/format-options.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/tutorials/multiple/formats-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/tutorials/multiple/home-page-complete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/tutorials/multiple/info-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/tutorials/multiple/inspect-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/tutorials/multiple/interface-added.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/tutorials/multiple/metadata-ecephys.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/tutorials/multiple/metadata-nwbfile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/tutorials/multiple/metadata-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/tutorials/multiple/metadata-subject-complete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified docs/assets/tutorials/multiple/pathexpansion-completed.png
Binary file modified docs/assets/tutorials/multiple/pathexpansion-page.png
Binary file modified docs/assets/tutorials/multiple/preview-page.png
Binary file modified docs/assets/tutorials/multiple/search-behavior.png
Binary file modified docs/assets/tutorials/multiple/sourcedata-page.png
Binary file modified docs/assets/tutorials/multiple/subject-complete.png
Binary file modified docs/assets/tutorials/multiple/subject-error.png
Binary file modified docs/assets/tutorials/multiple/subject-invalid.png
Binary file modified docs/assets/tutorials/multiple/subject-page.png
Binary file modified docs/assets/tutorials/multiple/valid-name.png
Binary file modified docs/assets/tutorials/multiple/workflow-page.png
Binary file removed docs/assets/tutorials/pipelines/created.png
Diff not rendered.
Binary file removed docs/assets/tutorials/pipelines/list.png
Diff not rendered.
Binary file modified docs/assets/tutorials/single/all-interfaces-added.png
Binary file modified docs/assets/tutorials/single/conversion-results-page.png
Binary file modified docs/assets/tutorials/single/fail-name.png
Binary file modified docs/assets/tutorials/single/format-options.png
Binary file modified docs/assets/tutorials/single/formats-page.png
Binary file modified docs/assets/tutorials/single/home-page-complete.png
Binary file modified docs/assets/tutorials/single/info-page.png
Binary file modified docs/assets/tutorials/single/inspect-page.png
Binary file modified docs/assets/tutorials/single/interface-added.png
Binary file modified docs/assets/tutorials/single/metadata-ecephys.png
Binary file modified docs/assets/tutorials/single/metadata-nwbfile.png
Binary file modified docs/assets/tutorials/single/metadata-page.png
Binary file modified docs/assets/tutorials/single/metadata-subject-complete.png
Binary file modified docs/assets/tutorials/single/preview-page.png
Binary file modified docs/assets/tutorials/single/search-behavior.png
Binary file modified docs/assets/tutorials/single/sourcedata-page-specified.png
Binary file modified docs/assets/tutorials/single/sourcedata-page.png
Binary file modified docs/assets/tutorials/single/valid-name.png
Binary file modified docs/assets/tutorials/single/workflow-page.png
13 changes: 13 additions & 0 deletions docs/developer_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,19 @@ To see if someone else has developed a third-party component to fit your needs,
useful to search for third-party packages (e.g. Handsontable) that implement the feature you need.


.. _documentation:
Documentation
-------------

Updating Tutorial Screenshots
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Before a release, you'll want to update the tutorial screenshots to reflect the latest changes in the application.

0. To regenerate the dataset, you'll need to change ``regenerateTestData`` in the ``tests/e2e/config.ts`` to ``true``.
1. Run the End-to-End Tests locally using ``npm test:app``.
- This will generate new screenshots in the ``docs/assets/tutorials`` directory.
2. Review the new screenshots to ensure they are accurate.
3. If the screenshots are accurate, commit the new screenshots to the repository.

.. _testing:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ export function createFormModal ({
formProps,
hasInstances = false
}: BaseFormModalOptions & { onSave: Function }) {

const modal = new Modal({
header
header,
onClose: () => modal.remove()
})

const content = document.createElement("div")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export async function autocompleteFormatString(path) {

const modal = new Modal({
header: `${interfaceName} — Autocomplete Format String`,
onClose: () => modal.remove(),
});

const content = document.createElement("div");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,10 @@ export class GuidedSourceDataPage extends ManagedPage {

header.append(h2, small);

const modal = new Modal({ header });
const modal = new Modal({
header,
onClose: () => modal.remove(),
});

let alignment;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export class GuidedUploadPage extends Page {
icon: keyIcon,
label: "API Keys",
onClick: () => {
document.body.append(this.globalModal);
this.globalModal.form.results = structuredClone(global.data.DANDI?.api_keys ?? {});
this.globalModal.open = true;
},
Expand All @@ -61,9 +62,10 @@ export class GuidedUploadPage extends Page {
connectedCallback() {
super.connectedCallback();

const modal = (this.globalModal = createFormModal.call(this, {
this.globalModal = createFormModal.call(this, {
header: "DANDI API Keys",
schema: dandiGlobalSchema.properties.api_keys,
onClose: () => this.globalModal.remove(),
onSave: async (form) => {
const apiKeys = form.resolved;

Expand All @@ -90,8 +92,7 @@ export class GuidedUploadPage extends Page {
if (name.includes("api_key")) return await validateDANDIApiKey(value, name.includes("staging"));
},
},
}));
document.body.append(modal);
});
}

disconnectedCallback() {
Expand Down Expand Up @@ -170,9 +171,11 @@ export class GuidedUploadPage extends Page {
buttonStyles: {
width: "max-content",
},
onClick: async () => {
await createDandiset.call(this, { title: this.form.resolved.dandiset });
this.requestUpdate();
onClick: () => {
const result = createDandiset.call(this, { title: this.form.resolved.dandiset });
const { modal, done } = result;
done.then(() => this.requestUpdate());
return modal;
},
}),
],
Expand All @@ -187,7 +190,7 @@ export class GuidedUploadPage extends Page {
// Confirm that one api key exists
promise.then(() => {
const api_keys = global.data.DANDI?.api_keys;
if (!api_keys || !Object.keys(api_keys).length) this.globalModal.open = true;
if (!api_keys || !Object.keys(api_keys).length) this.header.controls[0].onClick(); // Add modal and open it
});

const untilResult = until(promise, html`Loading form contents...`);
Expand Down
17 changes: 12 additions & 5 deletions src/electron/frontend/core/components/pages/inspect/InspectPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ export class InspectPage extends Page {
return result;
};

#modal;

disconnectedCallback() {
super.disconnectedCallback();
if (this.#modal) this.#modal.remove();
}

showReport = async (value) => {
if (!value) {
const message = "Please provide filesystem entries to inspect.";
Expand Down Expand Up @@ -92,10 +99,11 @@ export class InspectPage extends Page {
},
});

const modal = new Modal({
this.#modal = new Modal({
header: value.length === 1 ? value : `Selected Filesystem Entries`,
controls: [downloadJSONButton, downloadTextButton],
footer: legend,
onClose: () => this.#modal.remove(),
});

const container = document.createElement("div");
Expand All @@ -108,10 +116,9 @@ export class InspectPage extends Page {

container.append(list);

modal.append(container);
document.body.append(modal);

modal.toggle(true);
this.#modal.append(container);
document.body.append(this.#modal);
this.#modal.toggle(true);
};

form = new JSONSchemaForm({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,14 @@ export class SettingsPage extends Page {

#releaseNotesModal;

disconnectedCallback() {
super.disconnectedCallback();
if (this.#releaseNotesModal) {
this.#releaseNotesModal.remove();
this.#releaseNotesModal = null;
}
}

// Populate the Update Available display
updated() {
const updateDiv = this.querySelector("#update-available");
Expand All @@ -255,6 +263,7 @@ export class SettingsPage extends Page {

const modal = (this.#releaseNotesModal = new Modal({
header: `Release Notes`,
onClose: () => modal.remove(),
}));

const releaseNotes = document.createElement("div");
Expand Down
25 changes: 19 additions & 6 deletions src/electron/frontend/core/components/pages/uploads/UploadsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import keyIcon from "../../../../assets/icons/key.svg?raw";
import { AWARD_VALIDATION_FAIL_MESSAGE, awardNumberValidator, isStaging, validate } from "./utils";
import { createFormModal } from "../../forms/GlobalFormModal";

export async function createDandiset(results = {}) {
export function createDandiset(results = {}) {
let notification;

const notify = (message, type) => {
Expand All @@ -47,6 +47,7 @@ export async function createDandiset(results = {}) {

const modal = new Modal({
header: "Create a Dandiset",
onClose: () => modal.remove(),
});

const content = document.createElement("div");
Expand Down Expand Up @@ -101,7 +102,7 @@ export async function createDandiset(results = {}) {

modal.onClose = async () => notify("Dandiset was not created.", "error");

return new Promise((resolve) => {
const promise = new Promise((resolve) => {
const button = new Button({
label: "Create",
primary: true,
Expand Down Expand Up @@ -165,6 +166,11 @@ export async function createDandiset(results = {}) {
}).finally(() => {
modal.remove();
});

return {
modal,
done: promise,
};
}

async function getAPIKey(staging = false) {
Expand All @@ -180,6 +186,7 @@ async function getAPIKey(staging = false) {
const modal = new Modal({
header: `${api_key ? "Update" : "Provide"} your ${header(whichAPIKey)}`,
open: true,
onClose: () => modal.remove(),
});

const input = new JSONSchemaInput({
Expand Down Expand Up @@ -357,7 +364,10 @@ export class UploadsPage extends Page {
global.data.uploads = {};
global.save();

const modal = new Modal({ open: true });
const modal = new Modal({
open: true,
onClose: () => modal.remove(),
});
modal.header = "DANDI Upload Summary";
const summary = new DandiResults({
id: globalState.dandiset,
Expand Down Expand Up @@ -391,11 +401,14 @@ export class UploadsPage extends Page {
buttonStyles: {
width: "max-content",
},
onClick: async () => {
await createDandiset.call(this, {
onClick: () => {
const { modal, done } = createDandiset.call(this, {
title: this.form.resolved.dandiset,
});
this.requestUpdate();

done.then(() => this.requestUpdate());

return modal;
},
}),
],
Expand Down
4 changes: 2 additions & 2 deletions src/pyflask/manageNeuroconv/manage_neuroconv.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import re
import traceback
import zoneinfo
from datetime import datetime
from datetime import datetime, timedelta
from pathlib import Path
from shutil import copytree, rmtree
from typing import Any, Dict, List, Optional, Union
Expand Down Expand Up @@ -1565,7 +1565,7 @@ def _format_spikeglx_meta_file(bin_file_path: str) -> str:

meta_structure = f"""acqApLfSy=384,384,1
appVersion=20190327
fileCreateTime={datetime.now().isoformat(timespec='seconds')}
fileCreateTime={(datetime.now() - timedelta(hours=1)).isoformat(timespec='seconds')}
CodyCBakerPhD marked this conversation as resolved.
Show resolved Hide resolved
fileName={bin_file_path}
fileSHA1={file_sha1}
fileSizeBytes={file_size}
Expand Down
19 changes: 13 additions & 6 deletions tests/e2e/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,29 @@ export const uploadToDandi = (subdirectory, forceSkip = false) => {
await takeScreenshot(join(subdirectory, 'api-token-added'), 100)


const modalId = 'dandiset-creation-modal-for-test'

// Open dandiset creation modal
await evaluate(() => {
await evaluate(( modalId: string ) => {
const dashboard = document.querySelector('nwb-dashboard')
const form = dashboard.page.form
const dandisetInput = form.getFormElement(['dandiset'])
const createDandiset = dandisetInput.controls[0]
createDandiset.onClick()
})
const modal = createDandiset.onClick()
modal.setAttribute('id', modalId)
}, modalId)

await takeScreenshot(join(subdirectory, 'create-dandiset'), 100)

// Close modal
await evaluate(() => {
const modal = document.querySelector('nwb-modal') as any
await evaluate(( modalId: string ) => {
const modal = document.getElementById(modalId) as any
modal.toggle(false)
})

const page = document.querySelector('nwb-dashboard').page
page.dismiss() // Dismiss all internal notifications

}, modalId)

await evaluate(async (dandisetId) => {
const dashboard = document.querySelector('nwb-dashboard')
Expand Down
Loading