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

Upgrade to Bootstrap 4 #3937

Merged
merged 96 commits into from
Apr 24, 2019
Merged

Upgrade to Bootstrap 4 #3937

merged 96 commits into from
Apr 24, 2019

Conversation

Souravirus
Copy link
Member

@Souravirus Souravirus commented Nov 9, 2018

Fixes #1716

Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with rake test
  • code is in uniquely-named feature branch and has no merge conflicts
  • PR is descriptively titled
  • ask @publiclab/reviewers for help, in a comment below

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If tests do fail, click on the red X to learn why by reading the logs.

Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software

Thanks!

@ghost ghost assigned Souravirus Nov 9, 2018
@ghost ghost added the in progress label Nov 9, 2018
@plotsbot
Copy link
Collaborator

plotsbot commented Nov 9, 2018

2 Messages
📖 @Souravirus Thank you for your pull request! I’m here to help with some tips and recommendations. Please take a look at the list provided and help us review and accept your contribution! And don’t be discouraged if you see errors – we’re here to help.
📖 It looks like you haven’t marked all the checkboxes. Help us review and accept your suggested changes by going through the steps one by one. If it is still a ‘Work in progress’, please include ‘[WIP]’ in the title.

Generated by 🚫 Danger

@jywarren
Copy link
Member

jywarren commented Nov 9, 2018

@edieblu take a look - @Souravirus is working on a Bootstrap 4 upgrade :-)

@jywarren
Copy link
Member

jywarren commented Nov 9, 2018

Not sure why Travis is failing. We are seeing some intermittent issues with Dangerbot in #3935 that we are looking to resolve, in the meantime we can restart travis from time to time 👍

@jywarren
Copy link
Member

jywarren commented Nov 9, 2018

OH! haha - this is actually a JS failure!


Error: Bootstrap tooltips require Tether (http://tether.io/)
  # bootstrap/dist/js/bootstrap.min.self-f0ac71a63207973b5b1ad57e55be7fdbf03e684db1ec6dfeccc294db81110ead.js:8
  # bootstrap/dist/js/bootstrap.min.self-f0ac71a63207973b5b1ad57e55be7fdbf03e684db1ec6dfeccc294db81110ead.js:8
TypeError: undefined is not a function (evaluating '$("[rel=popover]").popover({
    container: 'body',
    trigger: 'focus click'
  })')
  # setup.self-7a311c224e5c8bcfa91982d4a67f4633ac84e5da786cb857beb9812f1ec6e073.js:6
  # jquery.self-bd7ddd393353a8d2480a622e80342adf488fb6006d667e8b42e4c0073393abee.js:3233 -- fire
  # jquery.self-bd7ddd393353a8d2480a622e80342adf488fb6006d667e8b42e4c0073393abee.js:3363 -- fireWith
  # jquery.self-bd7ddd393353a8d2480a622e80342adf488fb6006d667e8b42e4c0073393abee.js:3583 -- ready
  # jquery.self-bd7ddd393353a8d2480a622e80342adf488fb6006d667e8b42e4c0073393abee.js:3618 -- completed
.FF...F
Failures:
  1) Plots2 sends a like request when like button is clicked
     Failure/Error: expected '0' to deeply equal '4'
  2) Plots2 unlikes a request if already liked
     Failure/Error: Attempted to wrap ajax which is already wrapped
  3) Wikis adds table CSS
     Failure/Error: undefined is not a function (evaluating 'element.find("[rel=tooltip]").tooltip()')
Finished in 0.07200 seconds
7 examples, 3 failures
Failed examples:
teaspoon -s default --filter="Plots2 sends a like request when like button is clicked"
teaspoon -s default --filter="Plots2 unlikes a request if already liked"
teaspoon -s default --filter="Wikis adds table CSS"

@Souravirus
Copy link
Member Author

Yeah right @jywarren

@Souravirus
Copy link
Member Author

Hi @jywarren, can you help me with the installation of bootstrap v4. I have tried updating the bootstrap package in yarn but it seems that bootstrap 4 is not working with the html elements. Thank you!!

@jywarren
Copy link
Member

jywarren commented Nov 11, 2018 via email

@Souravirus
Copy link
Member Author

The thing is that I am writing bootstrap 4 classes but it is having no effect on the HTML elements. It is appearing as there is no bootstrap installed.

@Souravirus
Copy link
Member Author

I think its working now. Thank you!!

@edieblu
Copy link
Collaborator

edieblu commented Nov 12, 2018

Hi @Souravirus nice to meet you. I'm working on a welcome landing page that is using Bootstrap 4, so really looking forward to your upgrade! :) How is it going so far?

@Souravirus
Copy link
Member Author

Hi @edieblu nice to meet you. I am currently doing with the setup of bootstrap as the classes are not working well with the public lab. Just playing with Gemfile and yarn to set the correct configuration of bootstrap 4.

@jywarren
Copy link
Member

This is awesome. Any screenshots to share? Keep up the good work - glad you got past that issue!

@Souravirus
Copy link
Member Author

Hi @jywarren currently I am busy with my tests and assignments in my college. So, I am not able to work on it. I will surely work on with it once I get time. I don't think bootstrap is working fine still. As per I have studied, I have to transfer the stylesheet assets from .css to .scss. I guess it will work fine then. Till then I can show you the screenshots of the current homepage and how it looks.

screenshot from 2018-11-14 20-59-02

@jywarren
Copy link
Member

jywarren commented Nov 14, 2018 via email

@Souravirus
Copy link
Member Author

Yeah, I tried to change the class names which according to bootstrap4 class names but there was no effect.

@jywarren
Copy link
Member

jywarren commented Nov 15, 2018 via email

@Souravirus
Copy link
Member Author

Hi @jywarren, I wanted you to show the changes in the unstable branch but there is an error coming with the yarn installation. Here is the error:
Integrity check failed for "bootstrap" (computed integrity doesn't match our records, got "sha1-ITs38caqGm3TiqX7/Mae+fuHCdo=")
Here is the link of the jenkins test:
https://jenkins.laboratoriopublico.org/job/Plots-Unstable/334/console

So now, the thing we can do is to install bootstrap 4 through gems. What do you think about this?

@jywarren
Copy link
Member

jywarren commented Nov 15, 2018 via email

@Souravirus
Copy link
Member Author

Yeah thanks for your help @jywarren.

@jywarren
Copy link
Member

Hi, i'm seeing a similar view to your screenshots above. I think the navbar structure will need to be reorganized in the new bootstrap 4 html structure. But I don't think anything is too far wrong here, besides the need to go through the checklist and upgrade all the css classes... I'd work on the navbar first as you've started to. I think there may be structural changes to the HTML as well to read through the Bootstrap docs and upgrade notes on. Once you complete the navbar, other areas will start to be easier too. See for example /wiki doesn't look too bad.

@Souravirus
Copy link
Member Author

Hi, it's really nice to see that you jumped in. So, I will try to point out where I have changed some of the classes but the bootstrap simply didn't respond.

@@ -7,15 +7,12 @@
<%= stylesheet_link_tag "I18n" %>
<% end %>

<nav id="header" class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<nav id="header" class="navbar navbar-expand-sm navbar-inverse bg-inverse">
Copy link
Member Author

Choose a reason for hiding this comment

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

Here, navbar-expand-sm should have expanded the navbar desktop view. But the navbar remained collapsed.

Copy link
Member

Choose a reason for hiding this comment

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

Looking... i see Navbars are responsive by default, but you can easily modify them to change that. Responsive behavior depends on our Collapse JavaScript plugin. -- do we need that plugin added?

https://getbootstrap.com/docs/4.1/components/navbar/

Copy link
Member

Choose a reason for hiding this comment

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

yes maybe, it also says .navbar-toggler for use with our collapse plugin and other navigation toggling behaviors.

Copy link
Member

Choose a reason for hiding this comment

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

is popper also needed? not sure for what... https://getbootstrap.com/docs/4.1/getting-started/introduction/#js

Copy link
Member

Choose a reason for hiding this comment

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

https://getbootstrap.com/docs/4.1/components/collapse/#how-it-works but i can't see where the plugin is included...

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

GOT IT!

https://github.com/publiclab/plots2/blob/master/app/assets/stylesheets/style.css#L116-L154

Overrides over the years as we've tried to customize and tweak. Just be sure we respect the behaviors shown here, or something equivalent! One complaint with the previous navbar was that it was too eager to hide things as the screen got narrower. This gif shows exactly how it was solved; hopefully the new Bootstrap just makes this much easier!!

#3491

</button>
</div>
<a class="navbar-brand" id="brand" href="<%= root_path %>">Public Lab</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#header-navbar-collapse">
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the button which should have disappeared in large screens, but it didn't.

@jywarren
Copy link
Member

I have kind of limited time today unfortunately -- have you tried feeding the navbar code through:

http://upgrade-bootstrap.bootply.com as mentioned in #1716

Also have you checked in the dev console if the styles are actually being applied?

I'm reading carefully here: https://getbootstrap.com/docs/4.1/components/navbar/

and here: http://getbootstrap.com/docs/4.0/migration/#navbar

@Souravirus
Copy link
Member Author

Hi @jywarren, I am currently seeing the navbar changes caused by the style.css. Maybe it makes the navbar looks good. Thanks for your investigation into this.

@Souravirus
Copy link
Member Author

Hi @jywarren, I think that bootstrap is not reaching to the elements in views. I tried to install bootstrap as is described in https://github.com/rails/webpacker and https://gorails.com/forum/how-do-i-install-bootstrap-v4-via-yarn. But since in our repository yarn install packages in public/lib folder. So, I can't install bootstrap in this way. Finding the other way round.

@Souravirus
Copy link
Member Author

Souravirus commented Nov 17, 2018

I tried many things but the navbar is not changing in any way I dont know why. Please take a look on it.

@jywarren
Copy link
Member

Feeling good here @Souravirus? Shall I click MERGE?

@Souravirus
Copy link
Member Author

Ok just one thing when should we correct the carousel thing as you told to dump that from the production.

@jywarren
Copy link
Member

Yes, i'll share a gist right now. We'll have time before it goes to production. Otherwise shall I merge?

@jywarren
Copy link
Member

@Souravirus
Copy link
Member Author

Yeah its fine to merge. EXCITED!!

@jywarren jywarren merged commit 7744d91 into publiclab:master Apr 24, 2019
@jywarren
Copy link
Member

THATS IT!!!!! 🙌🙌🙌🙌 ⚡️⚡️⚡️⚡️

@jywarren
Copy link
Member

i'tll build to stable now...

@jywarren
Copy link
Member

if u want to share a new version of the feature code with me i can put it up on stable for testing.

@jywarren
Copy link
Member

i mean the carousel

@Souravirus
Copy link
Member Author

Ok, I will share the updated code of the carousel in a gist in some time.
Thank you!!
Atlast it is merged. 😄

SrinandanPai pushed a commit to SrinandanPai/plots2 that referenced this pull request May 5, 2019
* Some changes in homepage related to bootstrap 4

* Removed the comments

* changes in _header.html.erb and style.css

* Removed the space on the top of the navbar

* Changed bootstrap version

* Changed the dropdowns on left side according to bootstrap 4

* Changes in navbar bootstrap for large sccreen

* Added spacing before public lab label in large screens

* Made the dropdowns look more appropriate in large and medium screens

* Added padding to body tag

* Corrected the btn-default class of social icons buttons

* Corrected the positioning of the social icons in sign up page

* Fixed the login and signup popups in the home screen

* Corrected the notes in the home page

* Modified some class

* Changes in dashboard

* Activity in dashboard sorted

* Sidebar sorted

* Some changes due to the rebase

* Some changes in wiki.html of dashboard

* Some modifications in layouts stylesheets which was missed

* Legacy editor sorted

* fixed the rich editor for asking questions

* Fixed the legacy question form

* Fixed the header of the wiki page

* Modifications in wiki show page

* Modified the comment editor accordingly

* Changes in wiki editor

* Changed the sizing style of show.html of talk

* Modified the wiki revision accordingly

* Modified the well to card in the editors

* Some changes after rebasing

* Some changes with tagging editor

* Some changes in tag editor

* modified some features in map

* made the maps modal look good

* Some modifications

* Some changes in wiki sidebar

* Some changes in questions page

* Some changes in questions page

* Corrected tag index page

* Fixed the tag page

* Corrected the methods page

* modified the users page

* Some changes due to rebase

* Some important changes after rebase

* Some changes in sidebar

* some changes in views of subscription page

* Changed the subscribe button

* Upgraded the bootstrap version to 4.1.0

* Some changes in yarn

* Some changes in package.json

* Added will_paginate_4 in Gemfile

* Removed the rails errors related to will_paginate bootstrap-4

* Some minor changes with the home page

* Added typeahead.js package to the javascript assets

* Corrected all the bootstrap classes in admin folder

* Corrected the bootstrap class in comment and dashboard folder

* Corrected bootstrap in editor folder

* Corrected the bootstrap in features, grids and home folder

* Corrected the bootstrap in notes folder

* Changed the bootstrap in questions folder and some mistakes related to img-rounded corrected

* Modified the bootstrap class in search class

* Corrected all the bootstrap class in sidebar and stats

* Initially completed correcting all the bootstrap classes

* Auto-complete worked

* Added missing </div> in dashboard.html

* Some views covered

* Some missed views covered

* Changed some views at sidebar/author.html.erb

* Some minor changes in header layout

* Prevented navbar from folding

* Some correction with the min-width of the About us link

* Corrected the tags being shown as plain text

* Corrected another instance of badge default

* Changes in cross button of the badge

* some changes in rich editor

* Corrected the notes page where there were some redundancies

* Corrected the tests

* Added some space after the search bar in the navbar

* semver patch

* Corrected the signup page

* Added spacing between or and login in sign up page

* Smoothened the side dropdown in dashboard

* Corrected the subscribe button

* Made the creation of tag possible

* Corrected the weirdness in comment form

* Made the map modal larger

* Added caret-down button in the like button group

* Corrected the nav-tabs in questions page

* Alligned the dropdowns to the right

* Corrected the well in comment edit section

* Removed the emojis from going down in comments

* Added the eye button to the password field in login modal

* Adding the eye button to password field

* corrected tests related to search button
digitaldina pushed a commit to digitaldina/plots2 that referenced this pull request May 12, 2019
* Some changes in homepage related to bootstrap 4

* Removed the comments

* changes in _header.html.erb and style.css

* Removed the space on the top of the navbar

* Changed bootstrap version

* Changed the dropdowns on left side according to bootstrap 4

* Changes in navbar bootstrap for large sccreen

* Added spacing before public lab label in large screens

* Made the dropdowns look more appropriate in large and medium screens

* Added padding to body tag

* Corrected the btn-default class of social icons buttons

* Corrected the positioning of the social icons in sign up page

* Fixed the login and signup popups in the home screen

* Corrected the notes in the home page

* Modified some class

* Changes in dashboard

* Activity in dashboard sorted

* Sidebar sorted

* Some changes due to the rebase

* Some changes in wiki.html of dashboard

* Some modifications in layouts stylesheets which was missed

* Legacy editor sorted

* fixed the rich editor for asking questions

* Fixed the legacy question form

* Fixed the header of the wiki page

* Modifications in wiki show page

* Modified the comment editor accordingly

* Changes in wiki editor

* Changed the sizing style of show.html of talk

* Modified the wiki revision accordingly

* Modified the well to card in the editors

* Some changes after rebasing

* Some changes with tagging editor

* Some changes in tag editor

* modified some features in map

* made the maps modal look good

* Some modifications

* Some changes in wiki sidebar

* Some changes in questions page

* Some changes in questions page

* Corrected tag index page

* Fixed the tag page

* Corrected the methods page

* modified the users page

* Some changes due to rebase

* Some important changes after rebase

* Some changes in sidebar

* some changes in views of subscription page

* Changed the subscribe button

* Upgraded the bootstrap version to 4.1.0

* Some changes in yarn

* Some changes in package.json

* Added will_paginate_4 in Gemfile

* Removed the rails errors related to will_paginate bootstrap-4

* Some minor changes with the home page

* Added typeahead.js package to the javascript assets

* Corrected all the bootstrap classes in admin folder

* Corrected the bootstrap class in comment and dashboard folder

* Corrected bootstrap in editor folder

* Corrected the bootstrap in features, grids and home folder

* Corrected the bootstrap in notes folder

* Changed the bootstrap in questions folder and some mistakes related to img-rounded corrected

* Modified the bootstrap class in search class

* Corrected all the bootstrap class in sidebar and stats

* Initially completed correcting all the bootstrap classes

* Auto-complete worked

* Added missing </div> in dashboard.html

* Some views covered

* Some missed views covered

* Changed some views at sidebar/author.html.erb

* Some minor changes in header layout

* Prevented navbar from folding

* Some correction with the min-width of the About us link

* Corrected the tags being shown as plain text

* Corrected another instance of badge default

* Changes in cross button of the badge

* some changes in rich editor

* Corrected the notes page where there were some redundancies

* Corrected the tests

* Added some space after the search bar in the navbar

* semver patch

* Corrected the signup page

* Added spacing between or and login in sign up page

* Smoothened the side dropdown in dashboard

* Corrected the subscribe button

* Made the creation of tag possible

* Corrected the weirdness in comment form

* Made the map modal larger

* Added caret-down button in the like button group

* Corrected the nav-tabs in questions page

* Alligned the dropdowns to the right

* Corrected the well in comment edit section

* Removed the emojis from going down in comments

* Added the eye button to the password field in login modal

* Adding the eye button to password field

* corrected tests related to search button
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade to Bootstrap 4
7 participants