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

Use bootstrap4 #234

Merged
merged 2 commits into from
Nov 8, 2020
Merged

Use bootstrap4 #234

merged 2 commits into from
Nov 8, 2020

Conversation

OGAWAHirofumi
Copy link
Contributor

This migrate bootstrap3 to bootstrap4. With this, IMO, becomes better views (but im not a web developer).

however, testing and checking UI is hard (no auto test, and people has own favorite), so this PR would be needed carefully review more or less.

@ThomasWaldmann
Copy link
Contributor

Can you do a minimal change please to upgrade to bs4?

@codecov-io
Copy link

codecov-io commented Nov 3, 2020

Codecov Report

Merging #234 (36ed08d) into master (63a3115) will decrease coverage by 3.75%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #234      +/-   ##
==========================================
- Coverage   74.61%   70.86%   -3.76%     
==========================================
  Files          42       43       +1     
  Lines        2226     2344     +118     
==========================================
  Hits         1661     1661              
- Misses        565      683     +118     
Impacted Files Coverage Δ
src/bepasty/tests/screenshots.py 0.00% <0.00%> (ø)

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 63a3115...7d3c7b6. Read the comment docs.

@OGAWAHirofumi
Copy link
Contributor Author

OGAWAHirofumi commented Nov 3, 2020

Can you do a minimal change please to upgrade to bs4?

minimal means, doesn't care bad view by convert? e.g. looks like some css class (e.g. page-header) was removed from bootstrap4, so without implementing replacement of page-header, it becomes plain text.

@ThomasWaldmann
Copy link
Contributor

Well, I see some changes that do not look minimal, like:

Size changes sm -> md (small to medium)?

Colours are being added here and there, why?

Some stuff looks like new features, like:

  • Use shorter name for "Create List Item"
  • Use full width for navbar like bootstrap4 examples

In a pull request that upgrades bootstrap to a new version, there should be only changes that make the UI work with bootstrap 4.

Regression fixes related to that upgrade are also ok (so it does not look obviously bad / wrong if it looked ok with bs3).

But other than that, there should be no other changes within this PR.

Improvements on looks and usability are welcome in general, but should be separate.

@OGAWAHirofumi
Copy link
Contributor Author

OGAWAHirofumi commented Nov 4, 2020

Well, I see some changes that do not look minimal, like:

Size changes sm -> md (small to medium)?

col-<size> were changed in bootstrap4. like xs => default, sm => md.

Colours are being added here and there, why?

<component>-default was removed.

Some stuff looks like new features, like:

* Use shorter name for "Create List Item"

* Use full width for navbar like bootstrap4 examples

In a pull request that upgrades bootstrap to a new version, there should be only changes that make the UI work with bootstrap 4.

Regression fixes related to that upgrade are also ok (so it does not look obviously bad / wrong if it looked ok with bs3).

But other than that, there should be no other changes within this PR.

Improvements on looks and usability are welcome in general, but should be separate.

ah, it was why separated patches (can revert easily). but you wanted separated PR somewhat. ok, will separate.

@OGAWAHirofumi
Copy link
Contributor Author

Added screen shot script to see UI changes.

screenshots-before.tar.gz
screenshots-after.tar.gz

screenshots-before == bootstrap3
screenshots-after == bootstrap4

those should make easier to review.

with result of screenshots, adjusted button wrap in display view, and tweaked QR view to be more bootstrap3

Comment on lines 113 to 114
raise ValueError("Can't login!!! Create a user 'foo' with the permissions"
"'read' and 'create' in your PERMISSIONS in the config")
Copy link
Contributor

Choose a reason for hiding this comment

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

not "user", it is a "secret".

So it becomes:

Can't login! Please edit your config, go to PERMISSIONS setting and add a new secret 'screenshots' with 'read' and 'create' permissions.

@ThomasWaldmann
Copy link
Contributor

Looks good! One minor issue to fix and it's ready to merge!

@ThomasWaldmann
Copy link
Contributor

ThomasWaldmann commented Nov 7, 2020

I just packaged and uploaded xstatic-bootstrap 4.5.3.1 to pypi (and also updated all other dependencies, see #235 ).

Can you please test it and check again if bepasty looks ok?

@ThomasWaldmann ThomasWaldmann mentioned this pull request Nov 7, 2020
@OGAWAHirofumi
Copy link
Contributor Author

changed

  • tweaked screenshots.py error message to say for 'foo' and all permissions
  • use xstatic-bootstrap>=4.0.0.0,<5.0.0.0
  • screenshots.tar.gz with bootstrap 4.5.1 (Create List Item button wrap now, this will fix separatedly)

screenshots.tar.gz

@OGAWAHirofumi
Copy link
Contributor Author

OGAWAHirofumi commented Nov 8, 2020

tested with latest xstatic stuff. only noticed change looks like <pre> color in pygment (background color for line number)

screenshots.tar.gz

changed

  • tweaked screen height for screenshots.py
  • improved screenshots.py to take screen shot for bootbox
  • added line highlight for display view screen shot

previous

  • tweaked screenshots.py error message to say for 'foo' and all permissions
  • use xstatic-bootstrap>=4.0.0.0,<5.0.0.0
  • screenshots.tar.gz with bootstrap 4.5.1 (Create List Item button wrap now, this will fix separatedly)

setup.py Outdated Show resolved Hide resolved
Comment on lines +113 to +114
raise ValueError("Can't login! Please edit your config, go to PERMISSIONS setting "
"and add a new secret 'foo' with all permissions.")
Copy link
Contributor

Choose a reason for hiding this comment

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

can you use a better secret than 'foo' here? maybe 'for-screenshots'?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

'foo' is default entry in config.py. and it is what test_website.py uses too.
changing from 'foo', just will make inconvenient to test.

Copy link
Contributor

Choose a reason for hiding this comment

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

oh, ok. so keep it for now.

This tried to be similar with current look with bootstrap4.
To use this, for example

bepasty.conf should include this PERMISSIONS config.

	PERMISSIONS = {
	    'foo': 'admin,list,create,read,delete',
	}

run,

	$ BEPASTY_CONFIG=$(pwd)/bepasty.conf bepasty-server
	$ cd bepasty-server/src/bepasty/tests
	$ pytest -s -vv screenshots.py

this makes "screenshots/" directory for screenshot images.
@OGAWAHirofumi
Copy link
Contributor Author

tested with latest xstatic stuff. only noticed change looks like <pre> color in pygment (background color for line number)

screenshots.tar.gz

changed

  • use 5.0.0.0

previous

  • tweaked screen height for screenshots.py
  • improved screenshots.py to take screen shot for bootbox
  • added line highlight for display view screen shot
  • tweaked screenshots.py error message to say for 'foo' and all permissions
  • use xstatic-bootstrap>=4.0.0.0,<5.0.0.0
  • screenshots.tar.gz with bootstrap 4.5.1 (Create List Item button wrap now, this will fix separatedly)

@ThomasWaldmann
Copy link
Contributor

OK, looks like this is finished! Will merge...

@ThomasWaldmann ThomasWaldmann merged commit 8174633 into bepasty:master Nov 8, 2020
@OGAWAHirofumi OGAWAHirofumi deleted the use-bootstrap4 branch November 8, 2020 20:52
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.

3 participants