From 4620de863b0665b3d937fd5466f6525f288245ae Mon Sep 17 00:00:00 2001 From: Hadley King Date: Tue, 28 Dec 2021 12:29:31 -0500 Subject: [PATCH] 4.0.0 (#87) * Fix account page Updated the react on the account page to parse the new user object correctly. Changes to be committed: modified: views/account/AccountView/Permissions.js modified: views/account/AccountView/ServerInfo.js * 1st fix for account page Account page will now load. it is still not functional for account details or groups and permissions Changes to be committed: modified: views/account/AccountView/AddServer.js modified: views/account/AccountView/Permissions.js modified: views/account/AccountView/Profile.js modified: views/account/AccountView/ServerInfo.js * Commit before re-factoring the object listing page. * Some more fixes. * update (#46) * Add versioning to bottom bar App.js now has a version object to indicate the version for each of the repositories associated with BCO portal and db Changes to be committed: modified: App.js deleted: layouts/DashboardLayout/index.js deleted: layouts/ObjectViewLayout/BottomBar.js modified: layouts/shared/BottomBar.js modified: routes.js * fix bad url Changes to be committed: modified: layouts/shared/BottomBar.js * Initialize 4.0.0 On branch 4.0.0 Changes to be committed: modified: src/App.js * Prefix int (#57) * bottom bar (#49) * Add versioning to bottom bar App.js now has a version object to indicate the version for each of the repositories associated with BCO portal and db Changes to be committed: modified: App.js deleted: layouts/DashboardLayout/index.js deleted: layouts/ObjectViewLayout/BottomBar.js modified: layouts/shared/BottomBar.js modified: routes.js * fix bad url Changes to be committed: modified: layouts/shared/BottomBar.js * Fix Published object page Changes to be committed: modified: .env.example modified: src/layouts/shared/BottomBar.js modified: src/views/builder/BuilderView/Tools/ServerList.js modified: src/views/builder/BuilderView/index.js modified: src/views/objects/ObjectView/Views.js * Object View page Changes to be committed: modified: src/App.js new file: src/components/API/ModifyDraftObject.js new file: src/components/API/RetrieveDraftObject.js new file: src/components/API/RetrieveDraftObjectPermissions.js new file: src/components/API/RetrieveObjectsFromToken.js new file: src/components/API/untitled.txt renamed: src/views/objects/ObjectsListView/Linker.js -> src/components/Linker.js renamed: src/views/objects/ObjectsListView/Toolbar.js -> src/components/ObjectsListViewToolbar.js new file: src/components/PermissionTools.js modified: src/routes.js new file: src/utils/AddCondition.js new file: src/utils/Groups.js new file: src/utils/LogicField.js new file: src/utils/PublishDialog.js new file: src/utils/RegexBox.js new file: src/utils/SearchField.js new file: src/utils/ServerList.js new file: src/utils/Sharing.js modified: src/views/builder/BuilderView/Tools.js modified: src/views/builder/BuilderView/index.js deleted: src/views/objects/ObjectView/ProductCard.js modified: src/views/objects/ObjectsListView/Results.js modified: src/views/objects/ObjectsListView/index.js new file: src/views/permissions/PermissionView/index.js * Update to API calls for User accounts Separate API components created for new accounts, login, and profile. Changes to be committed: new file: src/components/API/ApiNewAccount.js new file: src/components/API/TokenAuthentication.js new file: src/components/API/UserdbNewAccount.js new file: src/components/API/UserdbTokenAuth.js modified: src/components/PermissionTools.js modified: src/views/account/AccountView/AccountDetails.js modified: src/views/account/AccountView/ProfileDetails.js modified: src/views/account/AccountView/index.js modified: src/views/auth/LoginView.js modified: src/views/auth/RegisterView.js * Account updates Changes to be committed: modified: package.json modified: src/App.js new file: src/components/API/CreateDraftObject.js modified: src/components/API/RetrieveObjectsFromToken.js modified: src/components/API/UserdbNewAccount.js new file: src/components/API/UserdbUpdateAccount.js modified: src/components/Linker.js modified: src/components/PermissionTools.js modified: src/views/account/AccountView/AccountDetails.js modified: src/views/account/AccountView/Profile.js deleted: src/views/account/AccountView/ProfileDetails.js modified: src/views/account/AccountView/index.js modified: src/views/auth/RegisterView.js modified: src/views/builder/BuilderView/ColorCoded/DescriptionDomain.js modified: src/views/builder/BuilderView/ColorCoded/ProvenanceDomain.js new file: src/views/builder/BuilderView/Raw/RawOld/index.js renamed: src/views/builder/BuilderView/Raw/json2.js -> src/views/builder/BuilderView/Raw/RawOld/json2.js renamed: src/views/builder/BuilderView/Raw/jsonlint.js -> src/views/builder/BuilderView/Raw/RawOld/jsonlint.js modified: src/views/builder/BuilderView/Raw/index.js new file: src/views/builder/BuilderView/SaveDraft.js modified: src/views/builder/BuilderView/Tools/Sharing.js modified: src/views/builder/BuilderView/Views.js new file: src/views/builder/BuilderView/index copy.js modified: src/views/builder/BuilderView/index.js modified: src/views/objects/ObjectsListView/index.js * Updates to Provenance Domain Fixed Reviewer fields Added local storage on changes Changes to be committed: modified: package.json modified: src/App.js modified: src/views/builder/BuilderView/ColorCoded/DescriptionDomain.js modified: src/views/builder/BuilderView/ColorCoded/ProvenanceDomain.js modified: src/views/builder/BuilderView/ColorCoded/index.js modified: src/views/builder/BuilderView/index.js modified: src/views/objects/ObjectView/ColorCoded/index.js modified: src/views/objects/ObjectsListView/index.js * Prefix int (#58) * bottom bar (#49) * Add versioning to bottom bar App.js now has a version object to indicate the version for each of the repositories associated with BCO portal and db Changes to be committed: modified: App.js deleted: layouts/DashboardLayout/index.js deleted: layouts/ObjectViewLayout/BottomBar.js modified: layouts/shared/BottomBar.js modified: routes.js * fix bad url Changes to be committed: modified: layouts/shared/BottomBar.js * Fix Published object page Changes to be committed: modified: .env.example modified: src/layouts/shared/BottomBar.js modified: src/views/builder/BuilderView/Tools/ServerList.js modified: src/views/builder/BuilderView/index.js modified: src/views/objects/ObjectView/Views.js * Object View page Changes to be committed: modified: src/App.js new file: src/components/API/ModifyDraftObject.js new file: src/components/API/RetrieveDraftObject.js new file: src/components/API/RetrieveDraftObjectPermissions.js new file: src/components/API/RetrieveObjectsFromToken.js new file: src/components/API/untitled.txt renamed: src/views/objects/ObjectsListView/Linker.js -> src/components/Linker.js renamed: src/views/objects/ObjectsListView/Toolbar.js -> src/components/ObjectsListViewToolbar.js new file: src/components/PermissionTools.js modified: src/routes.js new file: src/utils/AddCondition.js new file: src/utils/Groups.js new file: src/utils/LogicField.js new file: src/utils/PublishDialog.js new file: src/utils/RegexBox.js new file: src/utils/SearchField.js new file: src/utils/ServerList.js new file: src/utils/Sharing.js modified: src/views/builder/BuilderView/Tools.js modified: src/views/builder/BuilderView/index.js deleted: src/views/objects/ObjectView/ProductCard.js modified: src/views/objects/ObjectsListView/Results.js modified: src/views/objects/ObjectsListView/index.js new file: src/views/permissions/PermissionView/index.js * Update to API calls for User accounts Separate API components created for new accounts, login, and profile. Changes to be committed: new file: src/components/API/ApiNewAccount.js new file: src/components/API/TokenAuthentication.js new file: src/components/API/UserdbNewAccount.js new file: src/components/API/UserdbTokenAuth.js modified: src/components/PermissionTools.js modified: src/views/account/AccountView/AccountDetails.js modified: src/views/account/AccountView/ProfileDetails.js modified: src/views/account/AccountView/index.js modified: src/views/auth/LoginView.js modified: src/views/auth/RegisterView.js * Account updates Changes to be committed: modified: package.json modified: src/App.js new file: src/components/API/CreateDraftObject.js modified: src/components/API/RetrieveObjectsFromToken.js modified: src/components/API/UserdbNewAccount.js new file: src/components/API/UserdbUpdateAccount.js modified: src/components/Linker.js modified: src/components/PermissionTools.js modified: src/views/account/AccountView/AccountDetails.js modified: src/views/account/AccountView/Profile.js deleted: src/views/account/AccountView/ProfileDetails.js modified: src/views/account/AccountView/index.js modified: src/views/auth/RegisterView.js modified: src/views/builder/BuilderView/ColorCoded/DescriptionDomain.js modified: src/views/builder/BuilderView/ColorCoded/ProvenanceDomain.js new file: src/views/builder/BuilderView/Raw/RawOld/index.js renamed: src/views/builder/BuilderView/Raw/json2.js -> src/views/builder/BuilderView/Raw/RawOld/json2.js renamed: src/views/builder/BuilderView/Raw/jsonlint.js -> src/views/builder/BuilderView/Raw/RawOld/jsonlint.js modified: src/views/builder/BuilderView/Raw/index.js new file: src/views/builder/BuilderView/SaveDraft.js modified: src/views/builder/BuilderView/Tools/Sharing.js modified: src/views/builder/BuilderView/Views.js new file: src/views/builder/BuilderView/index copy.js modified: src/views/builder/BuilderView/index.js modified: src/views/objects/ObjectsListView/index.js * Updates to Provenance Domain Fixed Reviewer fields Added local storage on changes Changes to be committed: modified: package.json modified: src/App.js modified: src/views/builder/BuilderView/ColorCoded/DescriptionDomain.js modified: src/views/builder/BuilderView/ColorCoded/ProvenanceDomain.js modified: src/views/builder/BuilderView/ColorCoded/index.js modified: src/views/builder/BuilderView/index.js modified: src/views/objects/ObjectView/ColorCoded/index.js modified: src/views/objects/ObjectsListView/index.js * Docs Changes to be committed: new file: docs/App.js.html new file: docs/FetchContext.html new file: docs/fonts/OpenSans-Bold-webfont.eot new file: docs/fonts/OpenSans-Bold-webfont.svg new file: docs/fonts/OpenSans-Bold-webfont.woff new file: docs/fonts/OpenSans-BoldItalic-webfont.eot new file: docs/fonts/OpenSans-BoldItalic-webfont.svg new file: docs/fonts/OpenSans-BoldItalic-webfont.woff new file: docs/fonts/OpenSans-Italic-webfont.eot new file: docs/fonts/OpenSans-Italic-webfont.svg new file: docs/fonts/OpenSans-Italic-webfont.woff new file: docs/fonts/OpenSans-Light-webfont.eot new file: docs/fonts/OpenSans-Light-webfont.svg new file: docs/fonts/OpenSans-Light-webfont.woff new file: docs/fonts/OpenSans-LightItalic-webfont.eot new file: docs/fonts/OpenSans-LightItalic-webfont.svg new file: docs/fonts/OpenSans-LightItalic-webfont.woff new file: docs/fonts/OpenSans-Regular-webfont.eot new file: docs/fonts/OpenSans-Regular-webfont.svg new file: docs/fonts/OpenSans-Regular-webfont.woff new file: docs/global.html new file: docs/index.html new file: docs/scripts/linenumber.js new file: docs/scripts/prettify/Apache-License-2.0.txt new file: docs/scripts/prettify/lang-css.js new file: docs/scripts/prettify/prettify.js new file: docs/styles/jsdoc-default.css new file: docs/styles/prettify-jsdoc.css new file: docs/styles/prettify-tomorrow.css new file: jsdoc.conf.json modified: src/App.js modified: src/views/builder/BuilderView/ColorCoded/index.js * Fix issue with public state (#72) * fix issue with public state * Return proper message when retrieving token and failed. * Cleanup * Make biocompute ojbect servers update on close of window to add server. * Clean the hostname, email, server info, token on closing of the add server popover. Write out failed message to log; update timeout to be a little quicker. * Set success or error handle properly. * Cleanup of result parsing, update state variable properly for changing information. Add new API Account call for requesting a Token. * Support for deleting API servers. * Remove erroneous todo Co-authored-by: John Torcivia Co-authored-by: John Torcivia <13190702+syntheticgio@users.noreply.github.com> Co-authored-by: John Torcivia * Added UI fixes from 3.96.3 to 4.0.0 Changes to be committed: modified: src/views/account/AccountView/ServerInfo.js modified: src/views/builder/BuilderView/ColorCoded/DescriptionDomain.js modified: src/views/builder/BuilderView/ColorCoded/ProvenanceDomain.js modified: src/views/builder/BuilderView/ColorCoded/index.js modified: src/views/builder/BuilderView/index.js renamed: src/views/builder/BuilderView/index copy.js -> src/views/builder/BuilderView/index_bk.js modified: src/views/objects/ObjectView/ColorCoded/DescriptionDomain.js modified: src/views/objects/ObjectView/ColorCoded/ProvenanceDomain.js modified: src/views/objects/ObjectsListView/index.js * added dockerfile to cover build of web server in a container * readme with some basic build instructions for docker * Small tweaks to dockerfile * support multiple different servers to return biocompute objects from * Fix Add server button Changes to be committed: modified: src/views/account/AccountView/AddServer.js * Some cleanup * Updates to saving Builder View Changes to be committed: modified: src/components/API/CreateDraftObject.js modified: src/components/API/ModifyDraftObject.js modified: src/components/PermissionTools.js modified: src/utils/Groups.js modified: src/utils/ServerList.js modified: src/views/builder/BuilderView/ColorCoded/index.js renamed: src/views/builder/BuilderView/SaveDraft.js -> src/views/builder/BuilderView/JsonView.js deleted: src/views/builder/BuilderView/Tools.js modified: src/views/builder/BuilderView/Views.js modified: src/views/builder/BuilderView/index.js deleted: src/views/builder/BuilderView/index_bk.js * Updating and Creating drafts now work Changes to be committed: modified: src/components/API/ModifyDraftObject.js modified: src/components/PermissionTools.js modified: src/views/builder/BuilderView/ColorCoded/UsabilityDomain.js modified: src/views/builder/BuilderView/JsonView.js modified: src/views/builder/BuilderView/Views.js modified: src/views/builder/BuilderView/index.js * fix issue where re-direct wasn't happening to login page, and token wasn't being set for the account settings from the BCO API * Publishing, Styling, and Help Documentation Fix #44, Fix #23, Fix #43, fix #82, Fix #15 Changes to be committed: modified: package.json modified: src/components/API/CreateDraftObject.js modified: src/components/API/ModifyDraftObject.js new file: src/components/API/PublishDraftObject.js modified: src/components/PermissionTools.js new file: src/components/ValidateSchema.js modified: src/utils/ServerList.js new file: src/utils/ieee2791/2791object.json new file: src/utils/ieee2791/README.md new file: src/utils/ieee2791/alt2791object.json new file: src/utils/ieee2791/description_domain.json new file: src/utils/ieee2791/error_domain.json new file: src/utils/ieee2791/execution_domain.json new file: src/utils/ieee2791/io_domain.json new file: src/utils/ieee2791/parametric_domain.json new file: src/utils/ieee2791/provenance_domain.json new file: src/utils/ieee2791/usability_domain.json modified: src/views/builder/BuilderView/ColorCoded/DescriptionDomain.js modified: src/views/builder/BuilderView/ColorCoded/ErrorDomain.js modified: src/views/builder/BuilderView/ColorCoded/ExecutionDomain.js modified: src/views/builder/BuilderView/ColorCoded/ExtensionDomain.js modified: src/views/builder/BuilderView/ColorCoded/IoDomain.js modified: src/views/builder/BuilderView/ColorCoded/Meta.js modified: src/views/builder/BuilderView/ColorCoded/ParametricDomain.js modified: src/views/builder/BuilderView/ColorCoded/ProvenanceDomain.js modified: src/views/builder/BuilderView/ColorCoded/UsabilityDomain.js modified: src/views/builder/BuilderView/ColorCoded/index.js modified: src/views/builder/BuilderView/Views.js modified: src/views/builder/BuilderView/index.js * Add FDA card on home page Changes to be committed: modified: package.json modified: src/components/API/ApiNewAccount.js modified: src/components/API/UserdbNewAccount.js modified: src/utils/ieee2791/alt2791object.json new file: src/views/home/HomeView/FdaBar.js modified: src/views/home/HomeView/index.js * Update App.js Fix bad URLs * Cosmetic changes on FrontEnd Changes to be committed: modified: src/layouts/shared/TopBar.js modified: src/routes.js modified: src/views/community/Community/TechnicalSteeringCommittee.js modified: src/views/home/HomeView/BioComputeResources.js modified: src/views/home/HomeView/Builder.js renamed: src/views/home/HomeView/FdaBar.js -> src/views/home/HomeView/FdaBox.js renamed: src/views/home/HomeView/Community.js -> src/views/home/HomeView/Tsc.js modified: src/views/home/HomeView/index.js modified: src/views/resources/Resources/Registry.js * Fixes and removed old content. Fix #14 Fix #18 Fix #24 * Update routes.js Remove ValidatorView * Update routes.js * Fixes for 4.0.0 push to production Changes to be committed: modified: src/components/API/ModifyDraftObject.js modified: src/components/API/PublishDraftObject.js modified: src/components/API/UserdbNewAccount.js modified: src/components/PermissionTools.js modified: src/views/builder/BuilderView/ColorCoded/DescriptionDomain.js modified: src/views/builder/BuilderView/ColorCoded/HelpBar.js modified: src/views/builder/BuilderView/ColorCoded/ProvenanceDomain.js deleted: src/views/builder/BuilderView/Raw/RawOld/index.js deleted: src/views/builder/BuilderView/Raw/RawOld/json2.js deleted: src/views/builder/BuilderView/Raw/RawOld/jsonlint.js deleted: src/views/builder/BuilderView/Tools/AddCondition.js deleted: src/views/builder/BuilderView/Tools/Groups.js deleted: src/views/builder/BuilderView/Tools/LogicField.js deleted: src/views/builder/BuilderView/Tools/PublishDialog.js deleted: src/views/builder/BuilderView/Tools/RegexBox.js deleted: src/views/builder/BuilderView/Tools/SearchField.js deleted: src/views/builder/BuilderView/Tools/ServerList.js deleted: src/views/builder/BuilderView/Tools/Sharing.js renamed: src/views/builder/BuilderView/Raw/index.js -> src/views/builder/BuilderView/TreeView.js modified: src/views/builder/BuilderView/Views.js modified: src/views/builder/BuilderView/index.js * Disable Verify and Fix !Review for Object View Changes to be committed: modified: src/components/PermissionTools.js modified: src/views/objects/ObjectView/ColorCoded/ProvenanceDomain.js modified: src/views/objects/ObjectView/ColorCoded/index.js * update messaging for registration Changes to be committed: modified: src/components/API/ApiNewAccount.js modified: src/components/API/CreateDraftObject.js modified: src/components/API/PublishDraftObject.js modified: src/components/API/UserdbNewAccount.js modified: src/components/Linker.js modified: src/components/PermissionTools.js modified: src/views/builder/BuilderView/Views.js * update account creation message Changes to be committed: modified: src/components/API/ApiNewAccount.js * Update API messages Changes to be committed: modified: src/components/API/ApiNewAccount.js modified: src/components/API/ModifyDraftObject.js modified: src/components/API/UserdbTokenAuth.js modified: src/components/ValidateSchema.js modified: src/views/auth/LoginView.js * Added conditional rendering for Parametric Domain and minor formatting updates Changes to be committed: modified: src/views/builder/BuilderView/ColorCoded/IoDomain.js modified: src/views/builder/BuilderView/ColorCoded/ParametricDomain.js modified: src/views/builder/BuilderView/ColorCoded/components/Contribution.js modified: src/views/builder/BuilderView/ColorCoded/components/ContributionReviewer.js modified: src/views/builder/BuilderView/Views.js * Fix account update with no API Add methods for token verification Changes to be committed: modified: src/App.js modified: src/components/API/ApiNewAccount.js deleted: src/components/API/TokenAuthentication.js new file: src/components/API/TokenVerify.js modified: src/components/API/UserdbTokenAuth.js modified: src/components/API/UserdbUpdateAccount.js modified: src/layouts/shared/TopBar.js modified: src/views/account/AccountView/AccountDetails.js modified: src/views/account/AccountView/AddServer.js modified: src/views/account/AccountView/Profile.js modified: src/views/account/AccountView/ServerInfo.js * Fix for 'failed to fetch' on object listing Changes to be committed: modified: src/views/objects/ObjectsListView/index.js * Added "derive" feature to published objects. Changes to be committed: new file: .jshintrc modified: package.json modified: src/components/API/CreateDraftObject.js new file: src/components/API/DeriveDraftObject.js modified: src/components/API/TokenVerify.js modified: src/components/PermissionTools.js modified: src/utils/ServerList.js modified: src/views/account/AccountView/AddServer.js modified: src/views/account/AccountView/ServerInfo.js modified: src/views/builder/BuilderView/ColorCoded/DescriptionDomain.js modified: src/views/builder/BuilderView/ColorCoded/index.js modified: src/views/objects/ObjectView/ColorCoded/ProvenanceDomain.js modified: src/views/objects/ObjectView/ColorCoded/index.js modified: src/views/objects/ObjectView/Tools.js modified: src/views/objects/ObjectView/Views.js modified: src/views/objects/ObjectView/index.js modified: src/views/objects/ObjectsListView/index.js * Fixed account page error: TypeError: Cannot use 'in' operator to search for 'public' in null Changes to be committed: modified: src/views/account/AccountView/Profile.js * Fix for object listing page user without a user.apiinfo was not getting published BCOs Changes to be committed: modified: src/views/objects/ObjectsListView/index.js * Added password reset functionality Changes to be committed: modified: src/App.js modified: src/components/API/RetrieveDraftObject.js new file: src/components/API/UserdbConfirmPasswordReset.js new file: src/components/API/UserdbPasswordReset.js deleted: src/components/API/untitled.txt modified: src/routes.js modified: src/views/auth/LoginView.js new file: src/views/auth/ResetPassword.js modified: src/views/builder/BuilderView/ColorCoded/index.js modified: src/views/builder/BuilderView/index.js deleted: src/views/objects/ObjectView/Tools/AddCondition.js deleted: src/views/objects/ObjectView/Tools/LogicField.js deleted: src/views/objects/ObjectView/Tools/RegexBox.js deleted: src/views/objects/ObjectView/Tools/SearchField.js modified: src/views/objects/ObjectView/index.js * Add Password Change to account page Changes to be committed: new file: src/components/API/UserdbChangePassword.js new file: src/components/ResetPassword.js new file: src/views/account/AccountView/Password.js modified: src/views/account/AccountView/index.js * missing key warning * bordered, missingheader, missingheaderoptional not supported properties for this * can't have table etc., as nested under

, changed default to span instead of p for Typography * color not valid on button here * no activeClassName for this element since it is created by Link not NavLink * noGutter not valid here * color not valid for this button * missing key values * color not valid here * color has to be primary, etc., here * activeclassname not supported here * color not supported here * Fix duplicate 0 key * unique key, and color not able to be set by hex value here * color can't be set by hex here * not quite removed out themissing unique key issue, but some cleanup Co-authored-by: Chris Armstrong Co-authored-by: John Torcivia <13190702+syntheticgio@users.noreply.github.com> Co-authored-by: John Torcivia --- src/App.js | 7 +- src/components/API/RetrieveDraftObject.js | 6 +- src/components/API/UserdbChangePassword.js | 37 +++ .../API/UserdbConfirmPasswordReset.js | 34 +++ src/components/API/UserdbPasswordReset.js | 33 +++ src/components/API/untitled.txt | 33 --- src/components/ResetPassword.js | 215 ++++++++++++++++++ src/layouts/shared/NavItem.js | 2 +- src/layouts/shared/TopBar.js | 4 +- src/routes.js | 5 +- src/views/account/AccountView/Password.js | 123 ++++++++++ src/views/account/AccountView/index.js | 81 ++++--- src/views/auth/LoginView.js | 5 + src/views/auth/ResetPassword.js | 215 ++++++++++++++++++ .../ColorCoded/DescriptionDomain.js | 190 ++++++++-------- .../BuilderView/ColorCoded/ErrorDomain.js | 2 +- .../BuilderView/ColorCoded/ExecutionDomain.js | 8 +- .../BuilderView/ColorCoded/ExtensionDomain.js | 2 +- .../builder/BuilderView/ColorCoded/HelpBar.js | 26 +-- .../BuilderView/ColorCoded/IoDomain.js | 6 +- .../ColorCoded/ParametricDomain.js | 5 +- .../ColorCoded/ProvenanceDomain.js | 20 +- .../BuilderView/ColorCoded/RecursiveRows.js | 2 +- .../BuilderView/ColorCoded/UsabilityDomain.js | 2 +- .../ColorCoded/components/LinkerInList.js | 6 +- .../builder/BuilderView/ColorCoded/index.js | 14 +- src/views/builder/BuilderView/JsonView.js | 8 +- src/views/builder/BuilderView/Views.js | 2 +- src/views/builder/BuilderView/index.js | 6 +- .../ColorCoded/DescriptionDomain.js | 2 +- .../ColorCoded/components/LinkerInList.js | 8 +- .../objects/ObjectView/Tools/AddCondition.js | 27 --- .../objects/ObjectView/Tools/LogicField.js | 47 ---- .../objects/ObjectView/Tools/RegexBox.js | 30 --- .../objects/ObjectView/Tools/SearchField.js | 23 -- src/views/objects/ObjectView/index.js | 25 +- 36 files changed, 898 insertions(+), 363 deletions(-) create mode 100644 src/components/API/UserdbChangePassword.js create mode 100644 src/components/API/UserdbConfirmPasswordReset.js create mode 100644 src/components/API/UserdbPasswordReset.js delete mode 100644 src/components/API/untitled.txt create mode 100644 src/components/ResetPassword.js create mode 100644 src/views/account/AccountView/Password.js create mode 100644 src/views/auth/ResetPassword.js delete mode 100644 src/views/objects/ObjectView/Tools/AddCondition.js delete mode 100644 src/views/objects/ObjectView/Tools/LogicField.js delete mode 100644 src/views/objects/ObjectView/Tools/RegexBox.js delete mode 100644 src/views/objects/ObjectView/Tools/SearchField.js diff --git a/src/App.js b/src/App.js index 1e0aee5a..110d3567 100644 --- a/src/App.js +++ b/src/App.js @@ -25,8 +25,9 @@ function App() { // TODO: This is assuming a host at 8000 and 8080 - should probably be set more dynamically const hostnames = { local: { + userdb: 'http://127.0.0.1:8080/users/', + bcoapi: 'http://127.0.0.1:8000/api/', bcoapi_accounts_new: 'http://127.0.0.1:8000/api/accounts/new/', - // TODO: this v is not listed in the URLS for the bco API bcoapi_description_permissions: 'http://127.0.0.1:8000/api/description/permissions/', bcoapi_objects_create: 'http://127.0.0.1:8000/api/objects/create/', bcoapi_objects_list: 'http://127.0.0.1:8000/api/objects/token/', @@ -46,6 +47,8 @@ function App() { ] }, test: { + userdb: 'https://test.portal.biochemistry.gwu.edu/users/', + bcoapi: 'https://test.portal.biochemistry.gwu.edu/api/', bcoapi_accounts_new: 'https://test.portal.biochemistry.gwu.edu/api/accounts/new/', bcoapi_description_permissions: 'https://test.portal.biochemistry.gwu.edu/api/description/permissions/', bcoapi_objects_create: 'https://test.portal.biochemistry.gwu.edu/api/objects/create/', @@ -66,6 +69,8 @@ function App() { ] }, production: { + userdb: 'https://biocomputeobject.org/users/', + bcoapi: 'https://biocomputeobject.org/api/', bcoapi_accounts_new: 'https://biocomputeobject.org/api/accounts/new/', bcoapi_description_permissions: 'https://biocomputeobject.org/api/description/permissions/', bcoapi_objects_create: 'https://biocomputeobject.org/api/objects/create/', diff --git a/src/components/API/RetrieveDraftObject.js b/src/components/API/RetrieveDraftObject.js index f8d38a67..35344745 100644 --- a/src/components/API/RetrieveDraftObject.js +++ b/src/components/API/RetrieveDraftObject.js @@ -3,7 +3,7 @@ /* Retrievs a draft object using the current user's token and an object's draft id */ -export default function RetrieveDraftObject(objectId) { +export default function RetrieveDraftObject(objectId, setObjectContents) { let objectContents = ''; let userToken = ''; @@ -11,7 +11,7 @@ export default function RetrieveDraftObject(objectId) { userToken = item.token; }); - fetch(objectId, { + fetch(`DRAFT/${objectId}`, { method: 'GET', headers: { Authorization: `Token ${userToken}`, @@ -25,7 +25,7 @@ export default function RetrieveDraftObject(objectId) { })) .then((response) => { if (response.status === 200) { - objectContents = response.data; + setObjectContents(response.data); console.log('Server return contents33: ', objectContents); localStorage.setItem('bco', JSON.stringify(objectContents)); } diff --git a/src/components/API/UserdbChangePassword.js b/src/components/API/UserdbChangePassword.js new file mode 100644 index 00000000..bd3ad292 --- /dev/null +++ b/src/components/API/UserdbChangePassword.js @@ -0,0 +1,37 @@ +// /src/components/API/UserdbChangePassword.js + +/* Returns a JSON Web Token that can be used for authenticated requests. */ + +export default function UserdbChangePassword(values) { + fetch(`${values.userdb}change_password/`, { + method: 'PUT', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + old_password: values.old_password, + new_password: values.new_password, + }), + headers: { + Authorization: `JWT ${localStorage.getItem('token')}`, + 'Content-Type': 'application/json' + }, + }) + .then((response) => { + if (!response.ok) { + throw new Error(response.status); + } else { + return response.json() + .then((data) => { + alert('Your password has been updated.'); + console.log('data', ); + }); + } + }) + .catch((error) => { + // TODO: This needs to be fleshed out to get all errors and deal with them + alert(`The provided OLD PASSWORD was not correct. ${error}`); + console.log('error', error); + // return error; + }); +} diff --git a/src/components/API/UserdbConfirmPasswordReset.js b/src/components/API/UserdbConfirmPasswordReset.js new file mode 100644 index 00000000..9b72164d --- /dev/null +++ b/src/components/API/UserdbConfirmPasswordReset.js @@ -0,0 +1,34 @@ +// /src/components/API/UserdbConfirmPasswordReset.js + +/* Returns a JSON Web Token that can be used for authenticated requests. */ + +export default function UserdbConfirmPasswordReset(values) { + fetch(`${values.userdb}password_reset/confirm/`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + password: values.password, + token: values.token + }) + }) + .then((response) => { + if (!response.ok) { + throw new Error(response.status); + } else { + return response.json() + .then((data) => { + alert('Your password has been reset.'); + console.log('data', data); + window.location.href = '/login'; + }); + } + }) + .catch((error) => { + // TODO: This needs to be fleshed out to get all errors and deal with them + alert(`Unable to locate an account with those provided credentials. ${error}`); + console.log('error', error); + // return error; + }); +} diff --git a/src/components/API/UserdbPasswordReset.js b/src/components/API/UserdbPasswordReset.js new file mode 100644 index 00000000..fe99ae2b --- /dev/null +++ b/src/components/API/UserdbPasswordReset.js @@ -0,0 +1,33 @@ +// /src/components/API/UserdbPasswordReset.js + +/* Returns a JSON Web Token that can be used for authenticated requests. */ + +export default function UserdbPasswordReset(values, setAlternateView, alternateView) { + fetch(`${values.userdb}password_reset/`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + email: values.email + }) + }) + .then((response) => { + if (!response.ok) { + throw new Error(response.status); + } else { + return response.json() + .then((data) => { + alert('A password reset email has been sent to the provided email address.'); + console.log('data', alternateView); + setAlternateView(true); + }); + } + }) + .catch((error) => { + // TODO: This needs to be fleshed out to get all errors and deal with them + alert(`Unable to locate an account with those provided credentials. ${error}`); + console.log('error', error); + // return error; + }); +} diff --git a/src/components/API/untitled.txt b/src/components/API/untitled.txt deleted file mode 100644 index 82b9c188..00000000 --- a/src/components/API/untitled.txt +++ /dev/null @@ -1,33 +0,0 @@ -// /src/components/API/RetrieveDraftObjectPermissions.js - -/* Retrievs a draft object using the current user's token and an object's -draft id */ - -export default function RetrieveDraftObject(objectId) { - let objectContents = ''; - let userToken = ''; - - JSON.parse(localStorage.getItem('user')).apiinfo.forEach((item) => { - userToken = item.token; - }); - - fetch(objectId, { - method: 'GET', - headers: { - Authorization: `Token ${userToken}`, - 'Content-type': 'application/json; charset=UTF-8' - } - }) - .then((res) => res.json() - .then((data) => ({ - data, - status: res.status - })) - .then((response) => { - if (response.status === 200) { - objectContents = response.data; - console.log('Server return contents33: ', objectContents); - localStorage.setItem('bco', JSON.stringify(objectContents)); - } - })); -} diff --git a/src/components/ResetPassword.js b/src/components/ResetPassword.js new file mode 100644 index 00000000..45b5ab0e --- /dev/null +++ b/src/components/ResetPassword.js @@ -0,0 +1,215 @@ +// src/views/auth/ResetPassword.js + +import React, { useContext, useState } from 'react'; +import { Link as RouterLink } from 'react-router-dom'; +import * as Yup from 'yup'; +import { Formik } from 'formik'; +import { + Box, + Button, + Container, + Link, + TextField, + Typography, + makeStyles +} from '@material-ui/core'; +import Page from 'src/components/Page'; + +import UserdbPasswordReset from 'src/components/API/UserdbPasswordReset'; +import UserdbConfirmPasswordReset from 'src/components/API/UserdbConfirmPasswordReset'; +import { FetchContext } from 'src/App'; + +const useStyles = makeStyles((theme) => ({ + alertSpec: { + width: '100%', + '& > * + *': { + marginTop: theme.spacing(2), + } + }, + root: { + backgroundColor: theme.palette.background.dark, + height: '100%', + paddingBottom: theme.spacing(3), + paddingTop: theme.spacing(3) + } +})); + +const ResetPassword = () => { + const [alternateView, setAlternateView] = useState(false); + const classes = useStyles(); + const fc = useContext(FetchContext); + console.log('fc', fc.sending.userdb); + return ( + + {(alternateView === true) + ? ( + + + { + // Determine whether or not our login was legitimate. + console.log('values', values); + UserdbConfirmPasswordReset(values); + }} + > + {({ + errors, handleBlur, handleChange, handleSubmit, touched, values + }) => ( +

+ + + Create New Password + + + Enter the token you recieved in your email, and your new password. + + + + + + + + + + Don't have an account? + {' '} + + Sign up + + + + )} + + + + ) + : ( + + + { + // Determine whether or not our login was legitimate. + console.log('values', values); + UserdbPasswordReset(values, setAlternateView, alternateView); + }} + > + {({ + errors, handleBlur, handleChange, handleSubmit, touched, values + }) => ( +
+ + + Reset Password + + + Enter your email address. If there is an account associated with that address + we will provide you a link to reset your password + + + + + + + + Don't have an account? + {' '} + + Sign up + + + + )} +
+
+
+ )} + + ); +}; + +export default ResetPassword; diff --git a/src/layouts/shared/NavItem.js b/src/layouts/shared/NavItem.js index 0691e965..ccbd6ef3 100644 --- a/src/layouts/shared/NavItem.js +++ b/src/layouts/shared/NavItem.js @@ -59,7 +59,7 @@ const NavItem = ({ {...rest} > + + + + )} + + ); +}; + +Password.propTypes = { + className: PropTypes.string +}; + +export default Password; diff --git a/src/views/account/AccountView/index.js b/src/views/account/AccountView/index.js index 6b27f517..ddaf814d 100644 --- a/src/views/account/AccountView/index.js +++ b/src/views/account/AccountView/index.js @@ -2,14 +2,21 @@ import React, { useEffect } from 'react'; import { + Accordion, + AccordionSummary, + AccordionDetails, Container, Grid, - makeStyles + makeStyles, + Typography, } from '@material-ui/core'; -import AddServer from './AddServer' + +import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; import Page from 'src/components/Page'; +import AddServer from './AddServer'; import Profile from './Profile'; import ServerInfo from './ServerInfo'; +import Password from './Password'; const useStyles = makeStyles((theme) => ({ root: { @@ -25,7 +32,6 @@ const useStyles = makeStyles((theme) => ({ export const ParentContext = React.createContext(); const AccountView = () => { - const classes = useStyles(); // State for the add server and group dialogs. @@ -37,38 +43,57 @@ const AccountView = () => { // On page load, load the user's information. useEffect(() => { - // "Fake" that a server has been added. setServerAdded(true); - - }, []) + }, []); return ( - - - - - - + + + + + + + - - - - - - + + } + aria-controls="panel1a-content" + id="panel1a-header" + > + + Change Password (click to expand) + + + + + + + + + + + + + + + + - - - - - - + + + + + + - - - - + + + ); }; diff --git a/src/views/auth/LoginView.js b/src/views/auth/LoginView.js index 337511d5..ee15c195 100644 --- a/src/views/auth/LoginView.js +++ b/src/views/auth/LoginView.js @@ -78,6 +78,11 @@ const LoginView = () => { Sign in using your Portal credentials. + + + Forgot Password? Reset it here. + + diff --git a/src/views/auth/ResetPassword.js b/src/views/auth/ResetPassword.js new file mode 100644 index 00000000..45b5ab0e --- /dev/null +++ b/src/views/auth/ResetPassword.js @@ -0,0 +1,215 @@ +// src/views/auth/ResetPassword.js + +import React, { useContext, useState } from 'react'; +import { Link as RouterLink } from 'react-router-dom'; +import * as Yup from 'yup'; +import { Formik } from 'formik'; +import { + Box, + Button, + Container, + Link, + TextField, + Typography, + makeStyles +} from '@material-ui/core'; +import Page from 'src/components/Page'; + +import UserdbPasswordReset from 'src/components/API/UserdbPasswordReset'; +import UserdbConfirmPasswordReset from 'src/components/API/UserdbConfirmPasswordReset'; +import { FetchContext } from 'src/App'; + +const useStyles = makeStyles((theme) => ({ + alertSpec: { + width: '100%', + '& > * + *': { + marginTop: theme.spacing(2), + } + }, + root: { + backgroundColor: theme.palette.background.dark, + height: '100%', + paddingBottom: theme.spacing(3), + paddingTop: theme.spacing(3) + } +})); + +const ResetPassword = () => { + const [alternateView, setAlternateView] = useState(false); + const classes = useStyles(); + const fc = useContext(FetchContext); + console.log('fc', fc.sending.userdb); + return ( + + {(alternateView === true) + ? ( + + + { + // Determine whether or not our login was legitimate. + console.log('values', values); + UserdbConfirmPasswordReset(values); + }} + > + {({ + errors, handleBlur, handleChange, handleSubmit, touched, values + }) => ( +
+ + + Create New Password + + + Enter the token you recieved in your email, and your new password. + + + + + + + + + + Don't have an account? + {' '} + + Sign up + + + + )} +
+
+
+ ) + : ( + + + { + // Determine whether or not our login was legitimate. + console.log('values', values); + UserdbPasswordReset(values, setAlternateView, alternateView); + }} + > + {({ + errors, handleBlur, handleChange, handleSubmit, touched, values + }) => ( +
+ + + Reset Password + + + Enter your email address. If there is an account associated with that address + we will provide you a link to reset your password + + + + + + + + Don't have an account? + {' '} + + Sign up + + + + )} +
+
+
+ )} +
+ ); +}; + +export default ResetPassword; diff --git a/src/views/builder/BuilderView/ColorCoded/DescriptionDomain.js b/src/views/builder/BuilderView/ColorCoded/DescriptionDomain.js index ee611b92..e607c4bc 100644 --- a/src/views/builder/BuilderView/ColorCoded/DescriptionDomain.js +++ b/src/views/builder/BuilderView/ColorCoded/DescriptionDomain.js @@ -612,7 +612,7 @@ export default function DescriptionDomain({ ) : ( - + @@ -721,7 +721,7 @@ export default function DescriptionDomain({ } ))} - + @@ -782,7 +782,7 @@ export default function DescriptionDomain({ { items.ddPipelineSteps.map((item, index) => ( <> - + {compCheck} @@ -802,7 +802,7 @@ export default function DescriptionDomain({ - + { - item.prerequisite !== undefined ? ( item.prerequisite.map((subitem, subindex) => ( - <> - + + setPrerequisiteInput(e, index, 'prerequisite', subindex, 'name')} /> - + setPrerequisiteInput(e, index, 'prerequisite', subindex, 'filename')} /> - + setPrerequisiteInput(e, index, 'prerequisite', subindex, 'uri')} /> - + setPrerequisiteInput(e, index, 'prerequisite', subindex, 'access_time')} /> - + setPrerequisiteInput(e, index, 'prerequisite', subindex, 'sha1_checksum')} /> { subindex !== item.prerequisite.length - 1 ? ( - + ) : ( - + ) } - + )) - ) - - : () + : () } - + @@ -884,42 +881,44 @@ export default function DescriptionDomain({ { - item.input_list.map((subitem, subindex) => ( - <> - - - setListInput(e, index, 'input_list', subindex, 'filename')} /> - - - setListInput(e, index, 'input_list', subindex, 'uri')} /> - - - setListInput(e, index, 'input_list', subindex, 'access_time')} /> - - - setListInput(e, index, 'input_list', subindex, 'sha1_checksum')} /> - - { - subindex !== item.input_list.length - 1 - ? ( - - - - ) - : ( - - - - ) - } - - )) + item.input_list !== undefined + ? ( + item.input_list.map((subitem, subindex) => ( + + + setListInput(e, index, 'input_list', subindex, 'filename')} /> + + + setListInput(e, index, 'input_list', subindex, 'uri')} /> + + + setListInput(e, index, 'input_list', subindex, 'access_time')} /> + + + setListInput(e, index, 'input_list', subindex, 'sha1_checksum')} /> + + { + subindex !== item.input_list.length - 1 + ? ( + + + + ) + : ( + + + + ) + } + + ))) + : () } - + @@ -942,41 +941,44 @@ export default function DescriptionDomain({ { - item.output_list.map((subitem, subindex) => ( - <> - - setListInput(e, index, 'output_list', subindex, 'filename')} /> - - - setListInput(e, index, 'output_list', subindex, 'uri')} /> - - - setListInput(e, index, 'output_list', subindex, 'access_time')} /> - - - setListInput(e, index, 'output_list', subindex, 'sha1_checksum')} /> - - { - subindex !== item.output_list.length - 1 - ? ( - - - - ) - : ( - - - - ) - } - - )) + item.output_list !== undefined + ? ( + item.output_list.map((subitem, subindex) => ( + + + setListInput(e, index, 'output_list', subindex, 'filename')} /> + + + setListInput(e, index, 'output_list', subindex, 'uri')} /> + + + setListInput(e, index, 'output_list', subindex, 'access_time')} /> + + + setListInput(e, index, 'output_list', subindex, 'sha1_checksum')} /> + + { + subindex !== item.output_list.length - 1 + ? ( + + + + ) + : ( + + + + ) + } + + ))) + : () } - + @@ -989,7 +991,7 @@ export default function DescriptionDomain({ )) - } + } - - ); -} diff --git a/src/views/objects/ObjectView/Tools/LogicField.js b/src/views/objects/ObjectView/Tools/LogicField.js deleted file mode 100644 index 163eea99..00000000 --- a/src/views/objects/ObjectView/Tools/LogicField.js +++ /dev/null @@ -1,47 +0,0 @@ -import React from 'react'; -import { makeStyles } from '@material-ui/core/styles'; -import InputLabel from '@material-ui/core/InputLabel'; -import MenuItem from '@material-ui/core/MenuItem'; -import FormHelperText from '@material-ui/core/FormHelperText'; -import FormControl from '@material-ui/core/FormControl'; -import Select from '@material-ui/core/Select'; - -const useStyles = makeStyles((theme) => ({ - formControl: { - margin: theme.spacing(1), - marginLeft: '0', - marginRight: '0', - minWidth: 90, - }, - selectEmpty: { - marginTop: theme.spacing(2), - }, -})); - -export default function LogicField() { - const classes = useStyles(); - const [age, setAge] = React.useState(''); - - const handleChange = (event) => { - setAge(event.target.value); - }; - - return ( -
- - Operator - - -
- ); -} diff --git a/src/views/objects/ObjectView/Tools/RegexBox.js b/src/views/objects/ObjectView/Tools/RegexBox.js deleted file mode 100644 index 2258b89d..00000000 --- a/src/views/objects/ObjectView/Tools/RegexBox.js +++ /dev/null @@ -1,30 +0,0 @@ -import React from 'react'; -import FormGroup from '@material-ui/core/FormGroup'; -import FormControlLabel from '@material-ui/core/FormControlLabel'; -import Checkbox from '@material-ui/core/Checkbox'; - -export default function RegexBox() { - const [state, setState] = React.useState({ - checkedB: true - }); - - const handleChange = (event) => { - setState({ ...state, [event.target.name]: event.target.checked }); - }; - - return ( - - - } - label="REGEX" - /> - - ); -} diff --git a/src/views/objects/ObjectView/Tools/SearchField.js b/src/views/objects/ObjectView/Tools/SearchField.js deleted file mode 100644 index 7d441b7e..00000000 --- a/src/views/objects/ObjectView/Tools/SearchField.js +++ /dev/null @@ -1,23 +0,0 @@ -import React from 'react'; -import { makeStyles } from '@material-ui/core/styles'; -import TextField from '@material-ui/core/TextField'; - -const useStyles = makeStyles((theme) => ({ - root: { - '& > *': { - margin: theme.spacing(1), - marginLeft: '0', - marginRight: '0' - }, - }, -})); - -export default function SearchField() { - const classes = useStyles(); - - return ( -
- - - ); -} \ No newline at end of file diff --git a/src/views/objects/ObjectView/index.js b/src/views/objects/ObjectView/index.js index 4339c041..ddb742e6 100644 --- a/src/views/objects/ObjectView/index.js +++ b/src/views/objects/ObjectView/index.js @@ -1,22 +1,27 @@ // src/views/objects/ObjectView/index.js -import React from 'react'; - -// Tools +import React, { useContext } from 'react'; +import { FetchContext } from 'src/App'; import Tools from './Tools'; - -// Views import Views from './Views'; - // This is the parent for the object views. // The state model is based on https://reactjs.org/docs/lifting-state-up.html export default function ObjectView() { + const fc = useContext(FetchContext); // Split to get a real URI, then ask for the object. return ( -
- - -
+ (fc.isLoggedIn === false) + ? ( +
+ +
+ ) + : ( +
+ + +
+ ) ); }