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

Record view / Use location when setting a formatter #3909

Merged

Conversation

fxprunayre
Copy link
Member

@fxprunayre fxprunayre commented Jul 8, 2019

The main idea here is to set the formatter (and params) in the location path in order to:

  • have a default view not using the Angular view
  • make permalink to formatter page
  • create an app based on the JS API using a custom view

image

Changes:

  • Add formatter in location path eg. #/metadata/da165110-88fd-11da-a88f-000d939bc5d8/formatters/xsl-view?root=div&view=advanced. We can now have permalink to a specific formatter
  • Add Angular view as a default view with no formatter option (used as default)
'formatter': {
            'list': [{
              'label': 'defaultView',
              'url' : ''
            }, {
              'label': 'full',
              'url' : '/formatters/xsl-view?root=div&view=advanced'
            }],
            defaultUrl: ''
          },
  • Add same URL pattern for both catalog.search and display pages eg. http://localhost:8080/geonetwork/srv/eng/display#/metadata/26e4f7057927fc2e625f1ad57fdf3fb7ab7dbc08
  • Fix missing translation on formatter load error.
  • Fix back to home label

When embedding the JS client in a third party app. User may not want to
use the Angular view as default.

* Add formatter in location path eg. #/metadata/da165110-88fd-11da-a88f-000d939bc5d8/formatters/xsl-view?root=div&view=advanced. We can now have permalink to a specific formatter
* Add Angular view as a default view with no formatter option (used as
default)
* Add same URL pattern for both catalog.search and display pages
* Fix missing translation on formatter load error.
* Fix back to home label
* Cleaning
* Add click event for non a element
@fxprunayre fxprunayre added this to the 3.8.0 milestone Jul 8, 2019
@MichelGabriel
Copy link
Contributor

I'm not really sure how to test/review this. Do I have to add the parameters myself? Or is this done automatically?

@fxprunayre
Copy link
Member Author

I'm not really sure how to test/review this. Do I have to add the parameters myself? Or is this done automatically?

When you open a record with a formatter view (eg. advanced view) then it sets it in the URL. So copy/paste in a new tab will restore the proper view.

@MichelGabriel
Copy link
Contributor

I noticed 2 things. Maybe because I still have to change something?

  1. when I wanted to change the display mode I saw 2 menu items for the full view
    gn-double-menu

  2. when I copy/paste the url in a new tab the content is not displayed
    gn-content-not-displayed

@fxprunayre
Copy link
Member Author

when I wanted to change the display mode I saw 2 menu items for the full view

Could you check or reset your UI config ? The menu is built from formatter.list config https://github.com/geonetwork/core-geonetwork/pull/3909/files#diff-f352dd8a7c36d320206f126614de6453R151

@fxprunayre
Copy link
Member Author

when I copy/paste the url in a new tab the content is not displayed

Fixed.

@MichelGabriel
Copy link
Contributor

Could you check or reset your UI config

Yes, that did the trick. The menu is correct again.

@MichelGabriel
Copy link
Contributor

Fixed.

What do I need to do to get this working?

@fxprunayre
Copy link
Member Author

What do I need to do to get this working?

Should work - clear Wro4j cache is needed. At least it works for me now.

@MichelGabriel
Copy link
Contributor

I've cleared the cache, but when I copy paste the URL of the advanced view in a new browser or incognito window it's still not showing the content. Sorry.

@fxprunayre
Copy link
Member Author

It works for me. And @josegar74 is seeing that it works ;) So I let him decide to merge or not.

Copy link
Contributor

@MichelGabriel MichelGabriel left a comment

Choose a reason for hiding this comment

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

If it's just me not being able to copy/paste it's ok by me

@fxprunayre fxprunayre merged commit 8886a14 into geonetwork:master Jul 25, 2019
julsbreakdown pushed a commit to julsbreakdown/core-geonetwork that referenced this pull request Feb 7, 2020
* Record view / Add support for having a formatter as default view.

When embedding the JS client in a third party app. User may not want to
use the Angular view as default.

* Add formatter in location path eg. #/metadata/da165110-88fd-11da-a88f-000d939bc5d8/formatters/xsl-view?root=div&view=advanced. We can now have permalink to a specific formatter
* Add Angular view as a default view with no formatter option (used as
default)

* Record view / Add support for having a formatter as default view.

* Add same URL pattern for both catalog.search and display pages
* Fix missing translation on formatter load error.

* Record view / Add support for having a formatter as default view.

* Fix back to home label
* Cleaning
* Add click event for non a element

* Record view / Add support for having a formatter as default view. Fix on page load.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants