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

Create UI for clearing cache #84

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
11 changes: 11 additions & 0 deletions app/components/self-clear-cache.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<div class="self-clear-cache-container">
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: Can we please follow BEM rule for class naming?

<div class="last-request">
Last Request: {{@time}}
</div>
<div class="clear-cache-button">
<button class="button" type="submit" disableb={{false}}>Clear cache</button>
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: disabled

</div>
<div class="remaining-requests">
{{@totalTimes}} / 3 requests remaining for today
</div>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

Please read about Ember Test Selectors here

And name those selectors according to the tests written by Sagar in PR #79

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay! I will make the changes.

1 change: 1 addition & 0 deletions app/styles/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@import "image-upload.css";
@import "tasks.css";
@import "sidebar.css";
@import "self-clear-cache.css";

body {
font-family: "Roboto", sans-serif, serif;
Expand Down
28 changes: 28 additions & 0 deletions app/styles/self-clear-cache.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.last-request {
padding: 40px 4px 20px;
color:#041187;
font-family: Helvetica Neue;
font-weight: bold;
font-size: 2rem
}

.button {
top: 335%;
Copy link
Contributor

Choose a reason for hiding this comment

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

335%?! 😱

border-radius:10px;
padding: 16px 60px;
border: 2px solid #FF8C00;
color: #FF8C00;
background-color: white;
font-family: Helvetica Neue;
font-weight:bold;
font-size: 1.5rem;
cursor: pointer;
}

.remaining-requests {
padding-top:30px;
color:#041187;
font-family: Helvetica Neue;
font-weight: bold;
font-size: 1.3rem
}
2 changes: 1 addition & 1 deletion app/templates/index.hbs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Index page works!
<SelfClearCache @time="23 March 1:23 pm IST" @totalTimes="1"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Once we have the API ready:

  1. We would be calling that API from routes file
  2. Pass that response in model
  3. Get the data from model in controller (for this template)
  4. Mark it as @tracked (state variable)
  5. Then finally use that tracked variable here (in template) as props.

If this sounds confusing, please read that again and refer this PR to get an idea of what I'm trying to say: https://github.com/Real-Dev-Squad/website-my/pull/82/files

I know we don't have the API yet, so we could create a mock object in controller file and get that mock data from controller to template, so we can remove the hardcoding and our way to integrating API (when it's ready) will become easier, less work to do then.

Let me know if there are any doubts 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review and the explanation! It will surely help a lot. 💯