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

sweetalert: ported to sweetalert2 and simplified code. #465

Merged
merged 1 commit into from Mar 2, 2020

Conversation

@MartB
Copy link
Contributor

@MartB MartB commented Feb 21, 2020

This replaces the sweetalert library with sweetalert2.

Functionality does not change, close to no visible styling changes, verified and tested working on my instance.
This fixed at least one compile issue on NodeJS 12.X for me

This goes in-line with bitwarden/desktop#388

@MartB MartB requested a review from kspearrin Feb 21, 2020
@kspearrin
Copy link
Member

@kspearrin kspearrin commented Feb 21, 2020

Some screenshots would be helpful to see. You removed a lot of our customized styling.

@MartB
Copy link
Contributor Author

@MartB MartB commented Feb 21, 2020

The new one looks like this:
image

The stylesheet is coming from within sweetalert2 now, thats why its gone.

@kspearrin
Copy link
Member

@kspearrin kspearrin commented Feb 21, 2020

Yes, but this doesn't match our theming at all. It needs to look similar to before.

@MartB
Copy link
Contributor Author

@MartB MartB commented Feb 21, 2020

What do i need to adjust further to meet the theme standards you guys have in mind?

image


old:
image

Do you guys need the fa icons or are the sweetalert2 css icons also okay?

@MartB MartB force-pushed the MartB:master branch from 10a615b to f1686f4 Feb 21, 2020
@MartB
Copy link
Contributor Author

@MartB MartB commented Feb 21, 2020

I opted for the fa icons for now.

Screenshot:
image

@MartB MartB force-pushed the MartB:master branch from f1686f4 to 6fe9f3e Feb 21, 2020
@Techassi
Copy link

@Techassi Techassi commented Feb 21, 2020

Looks good to me! Great improvement going from Sweetalert v1 to v2.

@MartB MartB changed the title sweetalert: ported to sweetalert2 and simplified code. WIP: sweetalert: ported to sweetalert2 and simplified code. Feb 21, 2020
@MartB
Copy link
Contributor Author

@MartB MartB commented Feb 21, 2020

Something funky is going on with the module declaration of sweetalert2 when the explicit import is used i need to figure out why that happens.

@MartB MartB force-pushed the MartB:master branch 2 times, most recently from b9d7cc5 to aabd05f Feb 21, 2020
@MartB MartB changed the title WIP: sweetalert: ported to sweetalert2 and simplified code. sweetalert: ported to sweetalert2 and simplified code. Feb 21, 2020
@MartB MartB force-pushed the MartB:master branch from aabd05f to 167f9bd Feb 21, 2020
@MartB
Copy link
Contributor Author

@MartB MartB commented Feb 21, 2020

The tsconfig change was nescessary to get the module definition to load with the non-auto css injecting version of the code.
I assume adding this type is better than changing noImplicitAny to False.

But feel free to correct me as this is my first time working with nodejs.

src/services/webPlatformUtils.service.ts Outdated Show resolved Hide resolved
src/services/webPlatformUtils.service.ts Outdated Show resolved Hide resolved
src/app/app.component.ts Show resolved Hide resolved
@kspearrin
Copy link
Member

@kspearrin kspearrin commented Feb 24, 2020

Please see the tweaks I had to make to desktop app after merging here: bitwarden/desktop@663a84a

We'll also need this PR in browser repo as well.

@MartB
Copy link
Contributor Author

@MartB MartB commented Feb 24, 2020

Your changes look decent, I will include them where they apply.

I will most likely tackle the browser by the end of this week.

@MartB MartB force-pushed the MartB:master branch 2 times, most recently from cec2943 to 5af981a Feb 24, 2020
@MartB
Copy link
Contributor Author

@MartB MartB commented Feb 27, 2020

This is done from my side btw if you want any changes please tell me.

No styling changes besides making the "primary" button-text bold (aligned with desktop app)
@MartB MartB force-pushed the MartB:master branch from 5af981a to 53dbda3 Feb 28, 2020
@MartB
Copy link
Contributor Author

@MartB MartB commented Feb 28, 2020

Rebased both with latest master.

@MartB MartB requested a review from kspearrin Feb 28, 2020
@kspearrin kspearrin merged commit 0b5a74a into bitwarden:master Mar 2, 2020
1 check passed
1 check passed
license/cla Contributor License Agreement is signed.
Details
@kspearrin
Copy link
Member

@kspearrin kspearrin commented Mar 2, 2020

@MartB Testing this out now, it doesn't appear to auto-focus any of the buttons in the alert, nor can you tab into them. How do we fix that? The desktop app change seems to.

@MartB
Copy link
Contributor Author

@MartB MartB commented Mar 2, 2020

@kspearrin what do you mean with auto-focus?

I tested on desktop and can tab between the buttons just fine, and hitting enter submits the pin dialog just fine.

Maybe try playing around with:
https://github.com/sweetalert2/sweetalert2/blob/e48ab4840e18eb7d0b87c691ad18403ea39e19e7/sweetalert2.d.ts#L710-L722

@kspearrin
Copy link
Member

@kspearrin kspearrin commented Mar 2, 2020

Yes, desktop works fine, but web vault does not seem to behave the same way.

@MartB
Copy link
Contributor Author

@MartB MartB commented Mar 2, 2020

Ah got ya, I misread this.
I will check this out tomorrow!
In case you already figured out something, feel free to take it.

@kspearrin
Copy link
Member

@kspearrin kspearrin commented Mar 4, 2020

@MartB Seems to be working now. Not sure what changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants