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

Added Loading in tabs #3079

Merged
merged 2 commits into from Mar 14, 2020
Merged

Added Loading in tabs #3079

merged 2 commits into from Mar 14, 2020

Conversation

yashrajbothra
Copy link
Contributor

@yashrajbothra yashrajbothra commented Mar 5, 2020

Fixes #3068

Short description of what this resolves:

It will add loader while the tab gets loaded

Up For Grabs demo for this PR is here:
https://www.open-emr.org/wiki/index.php/Development_Demo#Alpha_-_Up_For_Grabs_Demo

@sjpadgett
Copy link
Sponsor Member

sjpadgett commented Mar 5, 2020 via email

@sjpadgett
Copy link
Sponsor Member

sjpadgett commented Mar 5, 2020 via email

@sjpadgett
Copy link
Sponsor Member

try fa-10x

@im-Amitto
Copy link
Member

im-Amitto commented Mar 6, 2020

@sjpadgett Current codebase fontawesome only support till fa-5x.

@yashrajbothra
Copy link
Contributor Author

try fa-10x

I looked into FA library in my local and wasn't able to find any fa-9x or 10x just upto 5x. 😕

@yashrajbothra
Copy link
Contributor Author

Can we upgrade Font awesome to the latest one?

@im-Amitto
Copy link
Member

@yashrajbothra it's not version issue, by default font-awesome comes with fa-5x though you can easily tweak the settings.
Ref: https://stackoverflow.com/a/25720069

@sjpadgett
Copy link
Sponsor Member

any fa-9x or 10x

FA skips fa-8x and fa-9x

Can we upgrade Font awesome to the latest one?

I'm not very experienced with BS4(I started at BS1 thought) so we'll let @tywrenn weigh in.
Otherwise, i'll update dependency if okay.

@yashrajbothra
Copy link
Contributor Author

@yashrajbothra it's not version issue, by default font-awesome comes with fa-5x though you can easily tweak the settings.
Ref: https://stackoverflow.com/a/25720069

Not pretty sure we can use this or not but this contains 9x and 10x aswell
https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/js/all.min.js

@im-Amitto
Copy link
Member

im-Amitto commented Mar 6, 2020

@yashrajbothra I just added that link so you can get a understanding that how it works.
You can just add fa-10x in public/assets/font-awesome/css/font-awesome.css:37 to achieve the requirment.
don't forgot to update the .min.css version because that's what we use actually

@sjpadgett
Copy link
Sponsor Member

you can easily tweak the settings.

This is not worth it and we all know my opinion using spinner here. If must leave font-size style and add appropriate fa size class. Adjust where needed.

fa-10x in public/assets/font-awesome/css/font-awesome.css:37

We don't want to do this kind of stuff.
Could just add class overrides in one of core scss.

@im-Amitto
Copy link
Member

you can easily tweak the settings.

This is not worth it and we all know my opinion using spinner here. If must leave font-size style and add appropriate fa size class. Adjust where needed.

fa-10x in public/assets/font-awesome/css/font-awesome.css:37

We don't want to do this kind of stuff.
Could just add class overrides in one of core scss.

Note Taken.

@sjpadgett
Copy link
Sponsor Member

Note Taken.
sorry @im-Amitto my post sounded short. didn't mean it that way....

@mdsupport
Copy link
Contributor

@yashrajbothra Is there any pressing need for spinners documented by community? Did anyone ask for the spinner to fill half or full screen? In fact I know we will be asked to suppress it by our users.

So without sounding like I understand the need for this PR, if you must have a huge spinner or any fa icon and built-ins are not large enough for need, preferred way to handle it would be to wrap fa-5x or whatever as
<a style="font-size:1000%"><i class="fa fa-5x fa-xyz"></i></a>
This will produce a fa-50x effect.

@sjpadgett
Copy link
Sponsor Member

I think i'll make command decision for this and say we abandon doing the spinner. We'll let Brady comment but I just know this will bite us!

I wish I could remember why I changed this the last time!!!!

@mdsupport
Copy link
Contributor

Come to think of it, I wonder if project should add a fa-50x fa-stop to Site ID is missing 😉

@sjpadgett
Copy link
Sponsor Member

Come to think of it, I wonder if project should add a fa-50x fa-stop to Site ID is missing

lol, heck, why not!

@yashrajbothra
Copy link
Contributor Author

Did anyone ask for the spinner to fill half or full screen?

No, I just copied the spinner from flow board. So its like that.

I think i'll make command decision for this and say we abandon doing the spinner. We'll let Brady comment but I just know this will bite us!

I wish I could remember why I changed this the last time!!!!

Can I Try to do what @mdsupport said rest all depends on your decision 😕

@sjpadgett
Copy link
Sponsor Member

Can I Try to do what @mdsupport said

Sure. I'll live with it for awhile:)

@im-Amitto
Copy link
Member

Come to think of it, I wonder if project should add a fa-50x fa-stop to Site ID is missing

My 2 cents are on it 🚶‍♂️

@mdsupport
Copy link
Contributor

@yashrajbothra Looks like you are really a spinner. How about leaving the body alone and setting the tab tile as :

Loading <a style="font-size:80%"><i class="fa fa-spinner"></i></a>

@yashrajbothra
Copy link
Contributor Author

yashrajbothra commented Mar 6, 2020

@yashrajbothra Looks like you are really a spinner. How about leaving the body alone and setting the tab tile as :

Loading <a style="font-size:80%"><i class="fa fa-spinner"></i></a>

i guess font size 80% would be very small for full frame.

image

If this looks good then I am in ❔

@mdsupport
Copy link
Contributor

Part 1 -
For spinner - tab title would be where you are changing the js file. It is important that spinner should not increase the size of the tab which is why I started with 80%.

Part 2 -
You could leave template unchanged. I do not recall anyone complaining about it. But if you want to learn about tab mechanism, then it should display something like :

Loading Calendar ...

  1. Display line can be h5/h6. It's targeted for new users so you want to make sure regular users are not distracted by font size or any moving elements.
  2. Should contain translated menu string. Source could be user click or system default for initial tabs.
  3. Center that string horizontally and vertically

Part 2 is purely so you get an idea how the menu mechanism works.

@bradymiller
Copy link
Sponsor Member

Considering the high activity of this PR, set up a Up For Grabs demo for this PR here:
https://www.open-emr.org/wiki/index.php/Development_Demo#Alpha_-_Up_For_Grabs_Demo
(demo uses the code from this PR and resets daily around midnight pacific time)

@bradymiller
Copy link
Sponsor Member

bradymiller commented Mar 7, 2020

Regarding direct editing of public/assets/font-awesome/css/font-awesome.css , not possible since it doesn't exist in codebase since it is brought in during OpenEMR build :)

@bradymiller
Copy link
Sponsor Member

@mdsupport , here you go:
Vanilla-1s-280px

@kchapple
Copy link
Sponsor Contributor

kchapple commented Mar 10, 2020 via email

@sjpadgett
Copy link
Sponsor Member

Or we can just fix the underlying problem. xl(init)!

@bradymiller
Copy link
Sponsor Member

you mean actually fix the issue and not design and implements workarounds... gasp 😄

@kchapple
Copy link
Sponsor Contributor

kchapple commented Mar 10, 2020 via email

@sjpadgett
Copy link
Sponsor Member

as described by Jerry

Problem is

app_view_model.application_data.tabs=new tabs_view_model();

occurs before completes

setupI18n(<?php echo js_escape($_SESSION['language_choice']); ?>).then(translationsJson => {

@sjpadgett
Copy link
Sponsor Member

The reason I say that, is because the instantiation of tabStatus() in the tabs_view_model() function can be removed (see my PR), and I think the "Loading" translation can be applied to the string using PHP in main.php around lines 254. There's no need for the javascript workaround.

@yashrajbothra I just merged Kens PR and it will help with this. PR #3124 it removes the auto instantiation of tab lists in tab_view_model where it was being instantiated anyway in main.php(I didn't even notice). So main.php is where you should be adding those spinners.

I'm guessing xl() should now work in all other places.

@sjpadgett
Copy link
Sponsor Member

if easier here is patch for PR
kens_pr3124.zip

@yashrajbothra
Copy link
Contributor Author

Great then i will resolve the conflicts and test what changed and modify the PR accordingly :)

@tywrenn
Copy link
Contributor

tywrenn commented Mar 12, 2020

Just a thought, to make it easier for GSoC going forward, we should be putting this font-size: 80% or whatever the value is inside the SCSS instead of inline.

Signed-off-by: Yash Bothra <yashrajbothra786@gmail.com>
@yashrajbothra yashrajbothra changed the title Added Loading in tabs [WIP] Added Loading in tabs Mar 12, 2020
@yashrajbothra
Copy link
Contributor Author

SCSS commit is pending will try to do it in morning. Ready to test.

Copy link
Sponsor Member

@sjpadgett sjpadgett left a comment

Choose a reason for hiding this comment

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

Hi @yashrajbothra I think we're almost there. I haven't tested my comments but i'm pretty sure they will complete this PR.

interface/main/main_screen.php Show resolved Hide resolved
interface/main/tabs/js/tabs_view_model.js Outdated Show resolved Hide resolved
interface/main/tabs/main.php Outdated Show resolved Hide resolved
interface/main/tabs/templates/tabs_template.php Outdated Show resolved Hide resolved
library/js/utility.js Outdated Show resolved Hide resolved
Signed-off-by: Yash Bothra <yashrajbothra786@gmail.com>
@sjpadgett
Copy link
Sponsor Member

just make fa-sm, fa-1x or remove completely and spinner will default to title font size. no need to mess with sizing it!!!

I can't believe we went through all these changes to just avoid adding one translated constant,'Loading' to script. Future dev's will look at this in code and say, what the heck. Why is this and why is that!!!!

@bradymiller
Copy link
Sponsor Member

hi @yashrajbothra , This is testing well and code looks good to me. Very nice work considering the 100+ posts on this PR :)
After @sjpadgett ok's this PR, then ready to come into codebase.

Copy link
Sponsor Member

@sjpadgett sjpadgett left a comment

Choose a reason for hiding this comment

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

thanks @yashrajbothra I will miss this PR:)

@sjpadgett sjpadgett merged commit 0545ff2 into openemr:master Mar 14, 2020
@yashrajbothra yashrajbothra changed the title [WIP] Added Loading in tabs Added Loading in tabs Mar 14, 2020
@yashrajbothra
Copy link
Contributor Author

yashrajbothra commented Mar 14, 2020

It feels good to see this PR merged 🎉. But don't you guys think the loading msg should be there whenever tab is reloaded and in general whenever any popup or dialogbox loads 🤔

@bradymiller
Copy link
Sponsor Member

hi @yashrajbothra , Definitely feel free to post PR(s) with more improvements on this front. You convinced us to use a spinner, so guessing you will convince us of more related improvements :)

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.

No Loading [UI - issue]
7 participants