-
Notifications
You must be signed in to change notification settings - Fork 44
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
Hid applications that are deprecated by default #78
Conversation
Hello @wlach! This PR is ready for review. |
There was a problem hiding this 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?
src/pages/AppList.svelte
Outdated
@@ -1,4 +1,7 @@ | |||
<script> | |||
import { fade } from 'svelte/transition'; | |||
let visible = true; |
There was a problem hiding this comment.
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.
let visible = true; | |
let showDeprecated = true; |
src/pages/AppList.svelte
Outdated
@@ -1,4 +1,7 @@ | |||
<script> | |||
import { fade } from 'svelte/transition'; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this 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)
There was a problem hiding this 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.
src/pages/AppList.svelte
Outdated
<a href="/apps/{app.name}">{app.name}</a> | ||
{#if app.description}<i>{app.description}</i>{/if} | ||
</p> | ||
{#if !app.deprecated} |
There was a problem hiding this comment.
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:
{#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.
There was a problem hiding this comment.
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 . 😄
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
This PR is submitted for issue #53.
![image](https://user-images.githubusercontent.com/14244685/95587243-a159f780-0a63-11eb-97a4-843ab1c50bee.png)
![image](https://user-images.githubusercontent.com/14244685/95587270-aae35f80-0a63-11eb-9de0-0e57b57ca311.png)
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.