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

Frontend Improvements #85

Merged
merged 30 commits into from
Jan 15, 2020
Merged

Frontend Improvements #85

merged 30 commits into from
Jan 15, 2020

Conversation

JakeUrban
Copy link
Contributor

@JakeUrban JakeUrban commented Jan 15, 2020

Major Changes:

  • Added SCSS and custom widget templates in place of django defaults
    • requires several new python packages, additional configuration options, and setup commands
  • Changed form_for_transaction() return type

@codecov-io
Copy link

codecov-io commented Jan 15, 2020

Codecov Report

Merging #85 into master will decrease coverage by 0.99%.
The diff coverage is 65.45%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #85   +/-   ##
=======================================
- Coverage   80.31%   79.31%   -1%     
=======================================
  Files          22       22           
  Lines        1011     1054   +43     
=======================================
+ Hits          812      836   +24     
- Misses        199      218   +19
Impacted Files Coverage Δ
polaris/polaris/integrations/transactions.py 94.23% <100%> (ø) ⬆️
polaris/polaris/integrations/forms.py 62.22% <54.54%> (-21.12%) ⬇️
polaris/polaris/withdraw/views.py 85.05% <77.77%> (-1.53%) ⬇️
polaris/polaris/deposit/views.py 80.46% <80%> (-0.84%) ⬇️

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 f23adcc...d45b7f8. Read the comment docs.

@@ -33,6 +33,7 @@ MANIFEST
# Static files
polaris/polaris/collectstatic/*
!polaris/polaris/collectstatic/__init__.py
polaris/polaris/static/base.css
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file is now created via python manage.py compilescss so we don't want to check it into version control

@@ -29,6 +29,9 @@ django-cors-headers = "*"
toml = "*"
pyjwt = "*"
django-sslserver = "*"
libsass = "*"
django-compressor = "*"
django-sass-processor = "*"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Packages needed to compile SCSS

@@ -74,7 +74,7 @@ def after_deposit(cls, transaction: Transaction):
@classmethod
def form_for_transaction(
cls, transaction: Transaction
) -> Optional[Type[forms.Form]]:
) -> Optional[Tuple[Type[forms.Form], Dict]]:
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any way to make this Dict a class so we can get intellisense in vscode or something?

Copy link
Contributor

Choose a reason for hiding this comment

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

not a big deal at all more just curious about python

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could do something like this:

class PolarisFormContext:
    def __init__(self, form: forms.Form, context: Dict):
        self.form = form
        self.context = context

Or we can remove self.context and just make self.title, self.guidance, self.icon_label, etc.

But personally I'd rather not require the user to use this object. Logically its the same, but if you think the mutli-return-value-or-none thing weird we can do this.

Copy link
Contributor

Choose a reason for hiding this comment

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

no its not weird, i was thinking more about how to autocomplete what values of Dict are allowed. Definitely not something we need for this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh I see. Any keys that aren't used are simply ignored

<link rel="stylesheet" href="{% sass_src 'base.scss' %}" />
<script
async
src="https://unpkg.com/flatpickr@4.6.3/dist/flatpickr.min.js"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to bundle these resources up so we don't have to make so many network requests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thats probably a question for Carl. I can't seem to be able to tag him though

Copy link
Member

@ire-and-curses ire-and-curses Jan 15, 2020

Choose a reason for hiding this comment

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

The autocomplete results are restricted to repository collaborators and any other participants on the thread.

(https://help.github.com/en/github/writing-on-github/basic-writing-and-formatting-syntax#mentioning-people-and-teams)

But you can still do @vcarl

@JakeUrban JakeUrban merged commit 906c8b6 into stellar:master Jan 15, 2020
@JakeUrban JakeUrban deleted the frontend-dev branch January 15, 2020 22:30
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

5 participants