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

Fixes #6705 , added icon for multiple identifiers #6809

Merged
merged 5 commits into from
Sep 1, 2020

Conversation

hemantgs
Copy link
Contributor

Added icon for multiple identifiers
and modified behaviour to open eprint when clicked without opening menu

Issue 1 : Icon for linked identifiers does not change when more than one entry is linked
The WEB Material design glyphicon did not have a "plural" variant so thought will change to this for singular variant

Screenshot from 2020-08-30 11-34-19

And for the plural variant used this 😄 Can change this to something else too

Screenshot from 2020-08-30 11-34-46

Issue 2 :
Made changes so that when only one entry is available the link is opened immediately without the menu

  • Change in CHANGELOG.md described (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked documentation: Is the information available and up to date? If not created an issue at https://github.com/JabRef/user-documentation/issues or, even better, submitted a pull request to the documentation repository.

@Siedlerchr Siedlerchr added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Aug 30, 2020
@calixtus
Copy link
Member

Hi @hemantgs , thanks for your work. I will look at it the next days.

Copy link
Member

@tobiasdiez tobiasdiez left a comment

Choose a reason for hiding this comment

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

Thanks a lot for your contribution!

The code looks good to me, and I've only a few very minor remarks. Concerning the icon, I'm also not sure what to choose. There doesn't seem to be a good icon for multiple links. The database icon is already used in a few places (groups and shared database), so I'm a bit hesitant to use it here as well. What about using the link and link-variant? Other solution would be to keep the current www, and use earth for multiple links?

@@ -94,6 +98,7 @@ public CellFactory(ExternalFileTypes externalFileTypes, UndoManager undoManager)
icon = printedViewModel.getIcon();
// icon.setToolTipText(printedViewModel.getLocalization());
TABLE_ICONS.put(SpecialField.PRINTED, icon);

Copy link
Member

Choose a reason for hiding this comment

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

please remove this newline

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed this line

@@ -49,17 +50,31 @@ public LinkedIdentifierColumn(MainTableColumnModel model,
this.setResizable(false);
this.setCellValueFactory(cellData -> cellData.getValue().getLinkedIdentifiers());
new ValueTableCellFactory<BibEntryTableViewModel, Map<Field, String>>()
.withGraphic(this::createIdentifierGraphic)
.withGraphic(values -> createIdentifierGraphic(values))
Copy link
Member

Choose a reason for hiding this comment

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

The old code .withGraphic(this::createIdentifierGraphic) should still work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

reverted this

@hemantgs
Copy link
Contributor Author

Thanks a lot for your contribution!

@tobiasdiez 👍 Glad to help

The code looks good to me, and I've only a few very minor remarks. Concerning the icon, I'm also not sure what to choose. There doesn't seem to be a good icon for multiple links. The database icon is already used in a few places (groups and shared database), so I'm a bit hesitant to use it here as well. What about using the link and link-variant? Other solution would be to keep the current www, and use earth for multiple links?

Yeah my initial thoughts too , Database icon is common
This is link
Screenshot from 2020-08-31 21-55-10

And this is link-variant
Screenshot from 2020-08-31 21-55-32

And earth below does not look like indicating multiple entries , I feel
Screenshot from 2020-08-31 22-02-15

Copy link
Member

@calixtus calixtus left a comment

Choose a reason for hiding this comment

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

Hi @hemantgs , we looked into your work and would like to thank you for your work, which looks mostly very good.
We have an important remark about the cellfactory. Please also pay attention to the remarks of @tobiasdiez .
About the icon graphic: I personally prefer the chain for the links. But of course the question is, how to show the difference to multiple links...
Greetings from the JabCon2020!

Comment on lines 72 to 77
if (values.size() > 1) {
return cellFactory.getTableIcon(StandardField.URLS);
} else if (values.size() == 1) {
return cellFactory.getTableIcon(StandardField.URL);
} else {
return null;
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (values.size() > 1) {
return cellFactory.getTableIcon(StandardField.URLS);
} else if (values.size() == 1) {
return cellFactory.getTableIcon(StandardField.URL);
} else {
return null;
}
if (values.size() > 1) {
return IconTheme.JabRefIcons.MULTIPLE_LINKS.getGraphicNode();
} else if (values.size() == 1) {
return IconTheme.JabRefIcons.LINK.getGraphicNode();
} else {
return null;
}

We talked in JabCon2020 a bit about this and we think that it would be better to directly load the icons here instead of introducing a new field URLS in StandardFields in the model package for a ui feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@calixtus Yeah , that makes sense too , I have changed it to use JabRefIcons directly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I could not find a multiple links icon , so for now I have left it as a such , with link and link-variant
some other alternatives are
for single link
Screenshot from 2020-09-01 14-53-30

for multiple
Screenshot from 2020-09-01 14-53-41

@@ -123,6 +123,7 @@
TYPE("type", FieldProperty.TYPE),
URI("uri", "URI"),
URL("url", "URL", FieldProperty.EXTERNAL, FieldProperty.VERBATIM),
URLS("urls", "URLS", FieldProperty.VERBATIM),
Copy link
Member

Choose a reason for hiding this comment

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

See above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed this

CHANGELOG.md Outdated
@@ -108,7 +109,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We fixed an issue with the Science Direct fetcher where PDFs could not be downloaded. Fixes [#5860](https://github.com/JabRef/jabref/issues/5860)
- We fixed an issue with the Library of Congress importer.
- We fixed the [link to the external libraries listing](https://github.com/JabRef/jabref/blob/master/external-libraries.md) in the about dialog

- We fixed linked identifier icon inconsistency[#6705](https://github.com/JabRef/jabref/issues/6705)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- We fixed linked identifier icon inconsistency[#6705](https://github.com/JabRef/jabref/issues/6705)
- We fixed the linked identifier icon inconsistency[#6705](https://github.com/JabRef/jabref/issues/6705)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

and modified behaviour to open eprint when clicked without opening menu

Added change log

Changed name for enum

Fixed checkstyle errors
@hemantgs
Copy link
Contributor Author

hemantgs commented Sep 1, 2020

Greetings from the JabCon2020!

Was wondering what this was 😄 ,
Google was not helpful

Fixed checkstyle errors
@calixtus calixtus merged commit 4ade000 into JabRef:master Sep 1, 2020
@calixtus
Copy link
Member

calixtus commented Sep 1, 2020

Thanks for your work @hemantgs , we took the liberty to fix some small merge errors.

Siedlerchr added a commit that referenced this pull request Sep 1, 2020
* upstream/master:
  Enable Merging of BibDatabases (#6689)
  Refactor file preferences (#6779)
  Interrupt all running tasks during shutdown (#6118)
  Fixes #6705 , added icon for multiple identifiers (#6809)
  Apply css files correctly to dialogs (#6828)
  Fix link
  Make template more explicit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants