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

Hid applications that are deprecated by default #78

Merged

Conversation

mhmohona
Copy link
Contributor

@mhmohona mhmohona commented Oct 9, 2020

This PR is submitted for issue #53.
Here I have added a checkbox and if the check box is unchecked, deprecated apps will be hidden. If it is checked, all applications will appear.
image
image

@mhmohona
Copy link
Contributor Author

mhmohona commented Oct 9, 2020

Hello @wlach! This PR is ready for review.

@wlach wlach self-requested a review October 9, 2020 13:40
Copy link
Contributor

@wlach wlach left a comment

Choose a reason for hiding this comment

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

The logic looks good! Aside from the review comments, it looks like there are some minor formatting issues (which you can fix by running npm run format) and there is a minor merge conflict with a PR that just landed. Can you take a look?

@@ -1,4 +1,7 @@
<script>
import { fade } from 'svelte/transition';
let visible = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

We should use a more descriptive variable name here.

Suggested change
let visible = true;
let showDeprecated = true;

@@ -1,4 +1,7 @@
<script>
import { fade } from 'svelte/transition';
Copy link
Contributor

Choose a reason for hiding this comment

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

I appreciate the enthusiasm and desire to experiment, but let's leave the animated transitions to a seperate PR / issue. :) This helps describe why: https://homes.cs.washington.edu/~mernst/advice/version-control.html#logical-unit

For now I'd like to mostly concentrate on making sure that all the required UI elements are there, rather than on how they look.

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 thought it would make the boring UI looks nicer 😅
Will be careful about it in future.

@mhmohona
Copy link
Contributor Author

mhmohona commented Oct 9, 2020

This is the updated UI.

image

@mhmohona mhmohona requested a review from wlach October 9, 2020 14:59
Copy link
Contributor

@wlach wlach left a comment

Choose a reason for hiding this comment

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

Hi! Will take a closer look later, however in the mean time can you fix the merge conflict with upstream? You'll need to pull from the upstream repository and fix the conflicts (should not be too hard, let us know if you run into problems)

@mhmohona mhmohona changed the title Hided applications that are deprecated by default Hid applications that are deprecated by default Oct 9, 2020
@mhmohona mhmohona requested a review from wlach October 9, 2020 17:40
Copy link
Contributor

@wlach wlach left a comment

Choose a reason for hiding this comment

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

Getting close! Have some more feedback that I'd like to see addressed before this lands.

<a href="/apps/{app.name}">{app.name}</a>
{#if app.description}<i>{app.description}</i>{/if}
</p>
{#if !app.deprecated}
Copy link
Contributor

Choose a reason for hiding this comment

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

You can skip the if/else (and the duplicated logic for display which violates the DRY principle) by doing the following on display:

Suggested change
{#if !app.deprecated}
{#if showDeprecated || !app.deprecated}

Alternately, we could probably filter the applications in the filterApps function above. I'd accept either solution for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Edited as per your suggestion @wlach . 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @mhmohona -- it looks like the logic is still duplicated unfortunately. To be clear, you should only one block that iterates through the app list and no higher level if/else (i.e. the logic should be substantially the same as before, just with that extra piece of logic that I showed 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.

Sorry sorry @wlach, at that time I was confused. 😅
I hope now I could do what you asked.

I did not know about DRY principle before. I really appriciate the way you are helping to learn, to improve.

Copy link
Contributor

@wlach wlach left a comment

Choose a reason for hiding this comment

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

Code looks good minus one suggestion. It looks like there's also a minor conflict still -- can you resolve it? You can probably do this entirely from the GitHub UI.

src/pages/AppList.svelte Outdated Show resolved Hide resolved
@mhmohona mhmohona requested a review from wlach October 13, 2020 00:17
Copy link
Contributor

@wlach wlach left a comment

Choose a reason for hiding this comment

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

Thank you!

@wlach wlach merged commit b25e528 into mozilla:main Oct 13, 2020
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.

None yet

2 participants