scientist-softserv / louisville-hyku

Other
0 stars 0 forks source link

Docker: Uncaught Error: See almond README #103

Closed orangewolf closed 1 year ago

orangewolf commented 1 year ago

Summary

Running the app in Docker leads to an almond error. It may be the cause prohibiting assigning default admin set roles to users.

Acceptance Criteria

Screenshots or Video

Testing Instructions

Url: *

Notes

Further Information

Engineering Notes

Confused how to fill this out? Check out the playbook

orangewolf commented 1 year ago

Engineering Notes

Image

orangewolf commented 1 year ago

Shana March 2022

@rtkuehn

When I look on our staging and open the dev tools' console, I see that error as well. However it's not impacting us from functionality.

Not saying that it's ok but just adding context!

http://lv-hyku-staging.notch8.cloud/dashboard/works?locale=en&page=2[@rtkuehn](https://github.com/rtkuehn) When I look on our staging and open the dev tools' console, I see that error as well. However it's not impacting us from functionality. Not saying that it's ok but just adding context! http://lv-hyku-staging.notch8.cloud/dashboard/works?locale=en&page=2

Image

orangewolf commented 1 year ago

Shana March 2022

it's likely coming from a dependency.

Almond ReadMe: https://github.com/requirejs/almond/blob/master/README.md#incorrect-module-build-no-module-name

orangewolf commented 1 year ago

Diem March 2022

Running the app on docker and ran into an almond error as well. I was still able to create a work, as shown in the screenshot. Will test if I can assign default admin set roles to users.

Image

orangewolf commented 1 year ago

Diem March 2022

Was able to assign default admin set roles to users.

1. Was able to assign user@example.com as a manager of Default Admin Set![Edit_Admin_Set_Hyku_2022-03-17_at_1.54.57_PM](/uploads/221671868814c1daa8635c4564afd7c2/Edit_Admin_Set_Hyku_2022-03-17_at_1.54.57_PM.jpg)
2. user@example.com was able to assign user@notch8.com as a depositor of Default Admin Set. This ability is congruent its manager role ![Edit_Admin_Set_Hyku_2022-03-17_at_2.02.27_PM](/uploads/9e1372e6bb732b50a6accf7f1ff83d6a/Edit_Admin_Set_Hyku_2022-03-17_at_2.02.27_PM.jpg)
3. user@notch8.com was NOT able to edit Default Admin Set. This ability is congruent its depositor role ![Collections_2022-03-17_at_2.03.27_PM](/uploads/8e6d16abf201ee3ac6aca8e3d7af3f3c/Collections_2022-03-17_at_2.03.27_PM.jpg)
orangewolf commented 1 year ago

Shana March 2022

@rtkuehn Just curious... Why do you think it's connected to your inability to set roles?@rtkuehn Just curious... Why do you think it's connected to your inability to set roles?

orangewolf commented 1 year ago

Randy March 2022

@ShanaLMoore I reckon if y'all are seeing it and are still able to access the default admin set (create works, assign roles, etc.), we probably have two separate problems@ShanaLMoore I reckon if y'all are seeing it and are still able to access the default admin set (create works, assign roles, etc.), we probably have two separate problems

orangewolf commented 1 year ago

Randy March 2022

Sorry...had to step away. I was hoping we were seeing some javascript interference when loading the admin set. But, that was just a guess. Regarding the almond error... I seem to recall seeing an almond error appearing a year or two ago due to some blacklight (and possibly other) javascript files having a js extension rather than es6.

orangewolf commented 1 year ago

Shana March 2022

@rtkuehn I may have a solution for your default admin set issues. I ironically just ran into the issue and was able to solve it. I'd be happy to walk you through it in you are available. Otherwise, try the following:

Be sure to run seeds first to create the admin set.

  1. Get inside of rails console
  2. Do not switch into a tenant
  3. user = User.find_by(email: 'client@example.com') <-- or whatever user email you have
  4. user.add_role(:registered)
  5. user.add_role(:admin)
  6. refresh your browser and/or login/out/in again.
orangewolf commented 1 year ago

Randy March 2022

I tried the steps above with client@example.com and a new user...no luck

Uncaught Error: See almond README: incorrect module build, no module name
    at define (application-229cfa9bcf78012292030c1e6819b25aa50920206f9d9631e664956f0e684c40.js:506:3517)
    at jQuery.fn.BlacklightMasonry (application-229cfa9bcf78012292030c1e6819b25aa50920206f9d9631e664956f0e684c40.js:613:3559)
    at application-229cfa9bcf78012292030c1e6819b25aa50920206f9d9631e664956f0e684c40.js:613:3787
define @ application-229cfa9bcf78012292030c1e6819b25aa50920206f9d9631e664956f0e684c40.js:506
jQuery.fn.BlacklightMasonry @ application-229cfa9bcf78012292030c1e6819b25aa50920206f9d9631e664956f0e684c40.js:613
(anonymous) @ application-229cfa9bcf78012292030c1e6819b25aa50920206f9d9631e664956f0e684c40.js:613
orangewolf commented 1 year ago

Randy March 2022

Adding masonry.min.es6 & imagesloaded.min.es6 to hyku/vendor/assets/javascripts/ corrected the almond error for me. There's probably a more elegant solution, but I just pulled the js files from the blacklight-gallery-0.12.0 gem, tossed them in vendor and modified the extension to es6.