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

feat: favourite ui feature #8210

Merged
merged 3 commits into from
Jan 28, 2022
Merged

feat: favourite ui feature #8210

merged 3 commits into from
Jan 28, 2022

Conversation

saumeya
Copy link
Contributor

@saumeya saumeya commented Jan 18, 2022

Signed-off-by: saumeya [email protected]

closes #5936

54886c83-7e66-4a2f-9899-f4ec865fce2a.mp4

Signed-off-by: saumeya [email protected]

Note on DCO:

If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).

@codecov
Copy link

codecov bot commented Jan 18, 2022

Codecov Report

Merging #8210 (02656bc) into master (f387ab8) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #8210   +/-   ##
=======================================
  Coverage   41.93%   41.93%           
=======================================
  Files         176      176           
  Lines       22992    22992           
=======================================
  Hits         9641     9641           
  Misses      11966    11966           
  Partials     1385     1385           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f387ab8...02656bc. Read the comment docs.

@saumeya saumeya requested a review from ciiay January 18, 2022 15:23
Copy link
Contributor

@ciiay ciiay left a comment

Choose a reason for hiding this comment

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

Looks good on the Tiles View. How about List View?

Copy link
Member

@rbreeze rbreeze left a comment

Choose a reason for hiding this comment

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

One minor comment. This is a great feature!

: favlist.push(app.metadata.name);
services.viewPreferences.updatePreferences({appList: {...pref.appList, favouritesApplist: favlist}});
}}>
<i
Copy link
Member

Choose a reason for hiding this comment

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

Can we right justify the star all the way? The easiest way to accomplish this is to wrap the application title and star button in a flexbox (display: flex), and set margin-left to auto for the star.

Copy link
Member

Choose a reason for hiding this comment

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

Either right-justified, or a little right-padded next to the application name would be my ask as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, definitely - trying to understand where this routes get added, so that the icons are placed properly
rotue-app

Copy link
Contributor

@ciiay ciiay left a comment

Choose a reason for hiding this comment

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

Minor comments on code improvement. And maybe rename the filter with something like "Favourites Only"? Because without the check, it already shows favorites, just mixed with non-favorites.

Btw, Favourites seems British English, maybe we want to keep it US English^^;;?

@@ -28,6 +31,7 @@ export function getFilterResults(applications: Application[], pref: AppsListPref
sync: pref.syncFilter.length === 0 || pref.syncFilter.includes(app.status.sync.status),
health: pref.healthFilter.length === 0 || pref.healthFilter.includes(app.status.health.status),
namespaces: pref.namespacesFilter.length === 0 || pref.namespacesFilter.some(ns => app.spec.destination.namespace && minimatch(app.spec.destination.namespace, ns)),
favourite: !pref.showFavourites || pref.favouritesApplist.includes(app.metadata.name),
Copy link
Contributor

Choose a reason for hiding this comment

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

favouritesApplist should follow camelcase naming rule, like favouritesAppList.

ctx.navigation.goto('.', {showFavourites: val}, {replace: true});
services.viewPreferences.updatePreferences({appList: {...props.pref, showFavourites: val}});
}}
/>{' '}
Copy link
Contributor

Choose a reason for hiding this comment

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

Good use of {' '} 👍 , better practice than &nbsp;.

<i className={'icon argo-icon-' + (app.spec.source.chart != null ? 'helm' : 'git')} />
<span className='applications-list__title'>{app.metadata.name}</span>
{pref => {
let favlist = pref.appList.favouritesApplist || [];
Copy link
Contributor

Choose a reason for hiding this comment

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

favlist should be favList.

@jannfis
Copy link
Member

jannfis commented Jan 19, 2022

Since favorites should be able to be quickly accessed, how about moving the filter "Favorites only" to the top of the filter list? What do people think about this?

@saumeya saumeya requested a review from alexmt January 19, 2022 11:00
@saumeya
Copy link
Contributor Author

saumeya commented Jan 19, 2022

Minor comments on code improvement. And maybe rename the filter with something like "Favourites Only"? Because without the check, it already shows favorites, just mixed with non-favorites.

Btw, Favourites seems British English, maybe we want to keep it US English^^;;?

haha, school taught me british english - I am ok with any spelling - what do you suggest @rbreeze , @jannfis

@rbreeze
Copy link
Member

rbreeze commented Jan 19, 2022

I agree it should probably be "Favorites" to match the American English in the rest of the UI. Also I agree with the change to "Favorites Only"

@saumeya
Copy link
Contributor Author

saumeya commented Jan 21, 2022

@rbreeze - which is preferred?

  1. same size icons
    same-size-icon
  2. star bigger than url icon
    ingress-big-small

@saumeya saumeya requested review from rbreeze and keithchong January 21, 2022 11:14
@rbreeze
Copy link
Member

rbreeze commented Jan 21, 2022

I prefer the latter with the larger star.

@saumeya saumeya requested review from ciiay and jannfis January 27, 2022 13:00
@leoluz leoluz added this to the v2.3 milestone Jan 27, 2022
Signed-off-by: saumeya <[email protected]>

lint fix

Signed-off-by: saumeya <[email protected]>
@jannfis
Copy link
Member

jannfis commented Jan 28, 2022

@saumeya Can you please resolve the merge conflicts?

Signed-off-by: saumeya <[email protected]>

use splice instead of filter

Signed-off-by: saumeya <[email protected]>
@saumeya
Copy link
Contributor Author

saumeya commented Jan 28, 2022

@saumeya Can you please resolve the merge conflicts?
done

Copy link
Collaborator

@alexmt alexmt left a comment

Choose a reason for hiding this comment

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

Thanks for the thorough review, everyone!

@alexmt
Copy link
Collaborator

alexmt commented Jan 28, 2022

@rbreeze can you please approve as well so I can merge ( unless you want to request some changes )

Copy link
Member

@rbreeze rbreeze left a comment

Choose a reason for hiding this comment

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

LGTM!

@alexmt alexmt merged commit 85c114d into argoproj:master Jan 28, 2022
alexmt pushed a commit that referenced this pull request Jan 28, 2022
* feat: favourite ui feature (#8210)

Signed-off-by: saumeya <[email protected]>
pasha-codefresh pushed a commit to pasha-codefresh/argo-cd that referenced this pull request Feb 2, 2022
* feat: favourite ui feature (argoproj#8210)

Signed-off-by: saumeya <[email protected]>
Signed-off-by: pashavictorovich <[email protected]>
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.

Feature request: Favorites
6 participants