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

Feature component #1352

Merged

Conversation

atrovato
Copy link
Contributor

@atrovato atrovato commented Nov 9, 2021

Pull Request check-list

To ensure your Pull Request can be accepted as fast as possible, make sure to review and check all of these items:

  • [ ] If your changes affects code, did your write the tests?
  • Are tests passing? (npm test on both front/server)
  • Is the linter passing? (npm run eslint on both front/server)
  • Did you run prettier? (npm run prettier on both front/server)
  • If you are adding a new features/services, did you run integration comparator? (npm run compare-translations on front)
  • Did you test this pull request in real life? With real devices? If this development is a big feature or a new service, we recommend that you provide a Docker image to the community for testing before merging.
  • [ ] If your changes modify the API (REST or Node.js), did you modify the API documentation? (Documentation is based on comments in code)
  • [ ] If you are adding a new features/services which needs explanation, did you modify the user documentation? See the GitHub repo and the website.
  • Did you add fake requests data for the demo mode (front/src/config/demo.js) so that the demo website is working without a backend? (if needed) See https://demo.gladysassistant.com.

NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open.

Description of change

Introduce common "DeviceFeatures" and "BatteryLevelFeature" components.


Battery Level Component

Use same component for battery level display.
Add color according to battery level:

  • level < 10
    image

  • 10 <= level < 25
    image

  • level >= 25
    image


Device feature components

  • Use same component for single feature with icon and text
  • Use same component for feature list
    • Unify height (70px min)
    • Add common "no feature" message (maybe we want to change display)

image

@atrovato atrovato force-pushed the refactor-common-components branch 3 times, most recently from 2457f79 to 94b014d Compare November 10, 2021 18:05
@codecov
Copy link

codecov bot commented Nov 10, 2021

Codecov Report

Merging #1352 (a24d528) into master (b3fa509) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1352   +/-   ##
=======================================
  Coverage   96.54%   96.54%           
=======================================
  Files         613      613           
  Lines        8729     8729           
=======================================
  Hits         8427     8427           
  Misses        302      302           

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 b3fa509...a24d528. Read the comment docs.

@atrovato atrovato force-pushed the refactor-common-components branch from 94b014d to 6e8466a Compare November 10, 2021 19:18
@Pierre-Gilles
Copy link
Contributor

It looks super clean! 😍 Thanks for those littles things, it's really nice :)

@atrovato atrovato force-pushed the refactor-common-components branch 2 times, most recently from 038b121 to 49a3e9f Compare November 11, 2021 09:06
@atrovato atrovato marked this pull request as ready for review November 11, 2021 09:11
@atrovato atrovato force-pushed the refactor-common-components branch from 49a3e9f to 1d1fe0e Compare November 11, 2021 09:31
Copy link
Contributor

@Pierre-Gilles Pierre-Gilles 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 to me! It's way better with all code centralized in one place :)

Good job 👏

@atrovato atrovato force-pushed the refactor-common-components branch from 1d1fe0e to a24d528 Compare November 11, 2021 10:00
@Pierre-Gilles Pierre-Gilles merged commit 157c2aa into GladysAssistant:master Nov 12, 2021
@relativeci
Copy link

relativeci bot commented Nov 12, 2021

Job #146: Bundle Size — 6.67MB (-0.12%).

157c2aa vs b3fa509

Changed metrics (4/8)
Metric Current Baseline
Initial JS 2.86MB(-0.27%) 2.87MB
Initial CSS 310.94KB(-0.02%) 310.99KB
Cache Invalidation 51.26% 59.37%
Modules 1042(+0.29%) 1039
Changed assets by type (2/7)
            Current     Baseline
CSS 329.74KB (-0.02%) 329.79KB
JS 4.76MB (-0.16%) 4.77MB

View Job #146 report on app.relative-ci.com

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.

2 participants