Skip to content

Miscellaneous fixes for Preview Release - Part 2#398

Merged
tdonohue merged 15 commits intoDSpace:masterfrom
atmire:preview-misc-fixes-2
May 17, 2019
Merged

Miscellaneous fixes for Preview Release - Part 2#398
tdonohue merged 15 commits intoDSpace:masterfrom
atmire:preview-misc-fixes-2

Conversation

@LotteHofstede
Copy link
Contributor

This PR solves some small miscellaneous issues for the preview release.
It takes care of the following:

  • clean up of the pagination fix code in [DS-4236] fix issues with collection recent submissions #397
  • issue with thumbnails not showing
  • issue with in-place search pages (on for example person pages) redirecting to the search page when applying a filter or performing a search query
  • reinstated the "page not found"-code in the collection page
  • issue with the webpack build occasionally running out of heap space

@paulo-graca
Copy link
Contributor

There are still have some, minor, issues with the thumbnail.
image and
image

But the images were there.
Strangely, in OrgUnit case, the thumbnail start to be shown when the mouse was hover the person link in OrgUnit page. Let me think that might be related with CSS rendering.

Copy link
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@artlowel and @LotteHofstede Unfortunately, the changes to package.json in this PR break the yarn start and yarn run watch commands on Windows 10. I now get this error:

$> yarn start
yarn run v1.16.0
$ yarn run build:prod
$ yarn run prebuild
$ yarn run clean:dist
$ rimraf dist
$ $npm_package_config_wp_cmd --env.aot --env.server --mode production && $npm_package_config_wp_cmd --env.aot --env.client --mode production
'$npm_package_config_wp_cmd' is not recognized as an internal or external command,
operable program or batch file.
error Command failed with exit code 1.

I'm still digging around to understand this better, but as of yet, I'm not able to test this PR as I can no longer start the server.

@artlowel
Copy link
Member

@tdonohue it seems the syntax for windows is %npm_package_config_wp_cmd% instead of $npm_package_config_wp_cmd, so if you replace them for now you should be able to test. We'll replace them using something like cross-var tomorrow.

@paulo-graca We'll look in to it tomorrow. However your screenshots show the preview theme, but this PR shouldn't contain it. That's #399, was your comment supposed to go there? If not, please ensure you've run yarn run clean before building, and your browser caches are cleared.

package.json Outdated
"node": ">=8.0.0"
},
"config": {
"wp_cmd": "node --max_old_space_size=4096 ./node_modules/webpack/bin/webpack.js"
Copy link
Member

@tdonohue tdonohue May 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per my previous comment regarding errors on Windows 10. We might be able to replace this "wp_cmd" line with:
"node-options": "--max_old_space_size=4096"
See: https://docs.npmjs.com/misc/config#node-options

If we can use that node-options configuration instead, then all other changes in this file might be reverted. So, we can move back to just calling webpack in all commands. Windows seems to mostly not like the $npm_package_config_wp_cmd environment variable.

UPDATE: This seems to be working on Windows 10. I'm not exactly sure how to tell that Node allocated more memory, but the build seems faster now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized that I believe the node-options configuration (and NODE_OPTIONS env variable) are only supported in Node v8 and above. So, if we go with this route, we should change our Requirements to require Node v8 or above (I'm fine with that, as I use Node 8 always anyways): https://github.com/DSpace/dspace-angular/#requirements

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In practice node 8 has been a requirement for nearly a year: 5554d48.

I'll update the docs in this PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @artlowel! I'm using your branch - atmire:preview-misc-fixes-2 (not the one in PR399) - and a new fresh setup (for the angular side). Just to note also that I'm using Linux CentOS 7 on my tests and I didn't had any issue building the project.

@tdonohue
Copy link
Member

👍 Beyond the yarn issues (see my comment above for a possible solution), the rest of this PR seems to work fine. I was not able to reproduce the thumbnail issues locally. They seem to be working for People and OrgUnits.

@artlowel
Copy link
Member

artlowel commented May 17, 2019

@tdonohue I wasn't able to get node-options to work, also couldn't find any example of anybody using it for that purpose. cross-var was quite outdated and it added some warnings about babel so I didn't use that either. Instead I wrote a node script to call webpack as a child process with the max_old_space_size param. I verified that this works on os x, linux and windows

@paulo-graca We were able to reproduce the thumbnail issue you reported. It only happened when preboot is enabled and you went to a page with a thumbnail by entering its URL (instead of navigating to it). @LotteHofstede fixed it in this commit

Copy link
Contributor

@paulo-graca paulo-graca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've already gave my thumb up to PR399 that is this PR applied to the preview.
The only thing I noticed with this PR was that sometimes the item type Thumbnail wasn't displayed (successfully loaded but not displayed). I just move the mouse cursor over the Related Person link and the image is immediately displayed (it seems to me like a CSS render issue). I'm using Google Chrome but I've also tested this on Firefox and get the same result. This even occurred to me with Atmire's Entities demo site. It's no big deal to me, and it only occurs sometimes but I've just wanted to noticed that.

@artlowel
Copy link
Member

artlowel commented May 17, 2019

The only thing I noticed with this PR was that sometimes the item type Thumbnail wasn't displayed (successfully loaded but not displayed). I just move the mouse cursor over the Related Person link and the image is immediately displayed (it seems to me like a CSS render issue)

Yes, @paulo-graca I was able to reproduce that issue when preboot was enabled, and I navigated directly to the page with the thumbnail. However since @LotteHofstede's fix I can no longer get it to happen. It wasn't a CSS rendering issue, it had to do with Angular's change detection not triggering at the right moment. Hovering showed a tooltip and that caused it to re-render.

@paulo-graca
Copy link
Contributor

paulo-graca commented May 17, 2019

Hovering showed a tooltip and that caused it to re-render.

In my case, Persons don't have a Jobtitle, the tooltip balloon isn't displayed, instead a small dark arrow is showed on top of the Person name.

Copy link
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Retested today and this looks great to me. Everything works find on Windows 10 now, and the fixes all work.

@tdonohue tdonohue merged commit 31c9694 into DSpace:master May 17, 2019
@ghost ghost removed the needs review label May 17, 2019
@LotteHofstede LotteHofstede mentioned this pull request Jun 13, 2019
@benbosman benbosman deleted the preview-misc-fixes-2 branch September 11, 2020 07:55
@tdonohue tdonohue added this to the 7.0preview milestone Jan 26, 2021
4science-it pushed a commit to 4Science/dspace-angular that referenced this pull request Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants