Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
4.0.0 (#80)
Browse files Browse the repository at this point in the history
Fix #48, Fix #35 Fix #29 , 

* 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 <[email protected]>

Co-authored-by: John Torcivia <[email protected]>
Co-authored-by: John Torcivia <[email protected]>

* 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

Co-authored-by: Chris Armstrong <[email protected]>
Co-authored-by: John Torcivia <[email protected]>
Co-authored-by: John Torcivia <[email protected]>
  • Loading branch information
4 people authored Nov 11, 2021
1 parent 73bd869 commit 28bd043
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 45 deletions.
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM ubuntu:21.04
LABEL org.opencontainers.image.source https://github.com/biocompute-objects/portal
ENV DEBIAN_FRONTEND=noninteractive

EXPOSE 3000

RUN apt-get update && apt-get install -y nodejs npm vim

WORKDIR /portal

COPY src ./src
COPY package.json .
COPY jsconfig.json .
COPY public public
COPY docs docs

RUN npm install --quiet --legacy-peer-deps
#RUN npm audit fix --legacy-peer-deps

CMD ["npm", "run", "start"]
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,20 @@ The git folder (application) that contains all of the user information for the p

1. python3 manage.py runserver 8000

## Containerization

The web portal can be containerized for easier development and deployment.

### Building in a container with docker

You can build the container by running the build command:

`docker build -t bco_portal .`

### Running the container with docker

You can run the container via docker through the following command:

`docker run --network host --rm -t bco_portal`

This will set the portal to be available at `localhost:3000` on the host machine.
2 changes: 1 addition & 1 deletion src/views/account/AccountView/ServerInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ const EnhancedTableToolbar = (props) => {
// This will allow the background to update with
// the updated server list.
setServerAdded(true);

// setSelected(false);
} else {
// Display whatever the server said.
console.log('Failed to remove the API server because: ', result.data.detail);
Expand Down
2 changes: 1 addition & 1 deletion src/views/objects/ObjectsListView/Results.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,5 +370,5 @@ export default function Results({ rowInfo }) {
}

Results.propTypes = {
rowInfo: PropTypes.object.isRequired,
rowInfo: PropTypes.array.isRequired,
};
96 changes: 53 additions & 43 deletions src/views/objects/ObjectsListView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,24 @@ const ObjectsListView = () => {
// Row data
const rowData = [];

const getObjs = function getObjects(item) {
return fetch(`${item.public_hostname}/api/objects/token/`, {
method: 'POST',
body: JSON.stringify({
POST_api_objects_token: {}
}),
headers: {
Authorization: `Token ${item.token}`,
'Content-type': 'application/json; charset=UTF-8'
}
}).then((response) => {
return [item.public_hostname, response.json()];
});
};

const getObjectsListing = () => {
// First get the API info.
let ApiInfo = JSON.parse(localStorage.getItem('user'));

// If there is no user info stored, assume we're the anonymous user.
if (ApiInfo === null) {
// Use the anon token, which is publicly available.
Expand All @@ -69,51 +83,47 @@ const ObjectsListView = () => {
// There was a user.
ApiInfo = ApiInfo.apiinfo;
}

console.log('ApiInfo', ApiInfo);

// console.log(ApiInfo);
// Get the info for each API.
ApiInfo.forEach((item) => {
// Call the API using the server information
// associated with the user.
fetch(`${item.public_hostname}/api/objects/token/`, {
method: 'POST',
body: JSON.stringify({
POST_api_objects_token: {}
}),
headers: {
Authorization: `Token ${item.token}`,
'Content-type': 'application/json; charset=UTF-8'
const results = Promise.all(ApiInfo.map(getObjs));
results.then((data) => {
console.log('Output ', data);
// data.forEach((d) => {
const promises = data.map((apiAndPromise) => {
// The provenance domain name may not be defined.
if (apiAndPromise.length !== 2) {
console.log("ERROR: This shouldn't ever be hit.");
}
}).then((response) => response.json()).then((data) => {
console.log('data: ',item.public_hostname, data);

data.map((d_item) => {
// The provenance domain name may not be defined.
try {
d_item.name = d_item.contents.provenance_domain.name;
} catch (TypeError) {
d_item.name = 'N/A';
}

rowData.push(
createData(
d_item.name,
item.public_hostname,
d_item.contents,
d_item.last_update,
d_item.object_class,
d_item.object_id,
d_item.owner_group,
d_item.owner_user,
d_item.prefix,
d_item.schema,
d_item.state,
)
);
const apiServer = apiAndPromise[0];
return apiAndPromise[1].then((dItems) => {
dItems.forEach((dItem) => {
try {
dItem.name = dItem.contents.provenance_domain.name;
} catch (TypeError) {
dItem.name = 'N/A';
}

rowData.push(
createData(
dItem.name,
apiServer,
dItem.contents,
dItem.last_update,
dItem.object_class,
dItem.object_id,
dItem.owner_group,
dItem.owner_user,
dItem.prefix,
dItem.schema,
dItem.state,
)
);
});
});

// We're no longer loading.
});
// We should have all of the promises for the various servers now
// wait for them all to finish and then populate the table.
Promise.all(promises).then((r) => {
setRows(rowData);
setLoading(false);
});
Expand Down

0 comments on commit 28bd043

Please sign in to comment.