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

Add grant column into the users accounting calculation table #137

Open
tomlebl opened this issue Sep 20, 2024 · 10 comments · Fixed by #140
Open

Add grant column into the users accounting calculation table #137

tomlebl opened this issue Sep 20, 2024 · 10 comments · Fixed by #140
Assignees
Labels
enhancement New feature or request

Comments

@tomlebl
Copy link
Contributor

tomlebl commented Sep 20, 2024

We could reuse function getGrantIfo function exported from accountsUtils.js to find grant code for each user in the table.
Grants assigned to the user in the time of calculation would get listed. It should be mentioned in a tooltip!

@tomlebl tomlebl added the enhancement New feature or request label Sep 20, 2024
@tomlebl tomlebl moved this to Todo in NOMAD system Sep 20, 2024
@tomlebl
Copy link
Contributor Author

tomlebl commented Sep 26, 2024

@hunxjunedo I assume that this one could be good for you. Let me know if you would fancy to take it on.

@hunxjunedo
Copy link
Contributor

Sure, just describe it a bit. And assign it.

@tomlebl
Copy link
Contributor Author

tomlebl commented Sep 26, 2024

In the accounting tables for "Users" calculation (each entry of the table is user), we need to add a new column "Grant Code" next to "User Name" column.
You will have to adjust the controller (accounts.js , getCosts function) in the API to get the data. It should be relatively straightforward as you can reuse getGrantIfo function exported from accountsUtils.js. It should take userId as an argument and find the corresponding grant. You will just need to tweak it that you get grantCode in the output.
If it does not make sense then ask.

@tomlebl tomlebl moved this from Todo to In Progress in NOMAD system Sep 26, 2024
@hunxjunedo
Copy link
Contributor

@tomlebl is everything working good on your end ? the frontend container kept crashing, checked the logs and found this:
`✘ [ERROR] Failed to resolve entry for package "ml-gsd". The package may have incorrect main/module/exports specified in its package.json. [plugin vite:dep-pre-bundle]

node_modules/esbuild/lib/main.js:1225:21:
  1225 │         let result = await callback({
       ╵                      ^

at packageEntryFailure (file:///app/node_modules/vite/dist/node/chunks/dep-CDnG8rE7.js:46575:15)
at resolvePackageEntry (file:///app/node_modules/vite/dist/node/chunks/dep-CDnG8rE7.js:46572:3)
at tryNodeResolve (file:///app/node_modules/vite/dist/node/chunks/dep-CDnG8rE7.js:46388:16)
at ResolveIdContext.resolveId (file:///app/node_modules/vite/dist/node/chunks/dep-CDnG8rE7.js:46138:19)
at PluginContainer.resolveId (file:///app/node_modules/vite/dist/node/chunks/dep-CDnG8rE7.js:48953:17)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async file:///app/node_modules/vite/dist/node/chunks/dep-CDnG8rE7.js:66209:15
at async file:///app/node_modules/vite/dist/node/chunks/dep-CDnG8rE7.js:46889:28
at async requestCallbacks.on-resolve (/app/node_modules/esbuild/lib/main.js:1225:22)
at async handleRequest (/app/node_modules/esbuild/lib/main.js:647:11)

This error came from the "onResolve" callback registered here:

node_modules/esbuild/lib/main.js:1150:20:
  1150 │       let promise = setup({
       ╵                     ^

at setup (file:///app/node_modules/vite/dist/node/chunks/dep-CDnG8rE7.js:46872:13)
at handlePlugins (/app/node_modules/esbuild/lib/main.js:1150:21)
at buildOrContextImpl (/app/node_modules/esbuild/lib/main.js:873:5)
at Object.buildOrContext (/app/node_modules/esbuild/lib/main.js:699:5)
at /app/node_modules/esbuild/lib/main.js:2032:68
at new Promise (<anonymous>)
at Object.context (/app/node_modules/esbuild/lib/main.js:2032:27)
at Object.context (/app/node_modules/esbuild/lib/main.js:1874:58)
at prepareEsbuildOptimizerRun (file:///app/node_modules/vite/dist/node/chunks/dep-CDnG8rE7.js:50862:33)

The plugin "vite:dep-pre-bundle" was triggered by this import

node_modules/nmrium/lib/data/data1d/Spectrum1D/getReferenceShift.js:2:20:
  2 │ import { gsd } from 'ml-gsd';
    ╵                     ~~~~~~~~`

have you changed this after my last commit ?

@hunxjunedo
Copy link
Contributor

just checked, they had a publish 2 hrs ago: mljs/global-spectral-deconvolution@26a22da

@tomlebl
Copy link
Contributor Author

tomlebl commented Sep 27, 2024

@hunxjunedo all good on my end. I assume that you have pulled my main branch before you gets started. How did you start after that? Did you use docker-compose up -d --build?

@hunxjunedo
Copy link
Contributor

My bad, didn't use --build

@tomlebl
Copy link
Contributor Author

tomlebl commented Sep 27, 2024

I thought that could be the case. Remember that you need to use --build flag every time you change dependencies.

@hunxjunedo
Copy link
Contributor

I dived into it and still the issue is with this package ml-gsd:

image

its working on your end as it might be using an older version, try running npm i in the container and see what happens.

mljs/global-spectral-deconvolution#124

@tomlebl
Copy link
Contributor Author

tomlebl commented Sep 30, 2024

@hunxjunedo All good on my computer. I have just started the project with the --build flag.
If you use Docker setup correctly it should work for you as well. Avoiding issues with dependencies is the whole point of Docker.
You don't need to do npm i in your environment neither in the Docker container. npm i is run when you build the image from the scratch using package.json copied over from repo and node.js defined in the Dockerfile. That way you should built exactly same image that I have got here.
The only thing I can recommend at this stage is to clone the repo again, copy over your env variables and then build new images with docker-compose up -d --build. You might also want delete all old images with docker rmi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants