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
Update success.tpl CSS (pre/post upgrade messages) #25961
Conversation
(Standard links)
|
@vingle @artfulrobot any input? |
Other than the mysterious "X" which displays an undefined variable error instead of the preupgrade message, this looks nice. +1 |
One more note: If this is merged, the hardcoded |
+1 to cleaning up this screen, and the new design looks much nicer. However the PR's markup continues many of Civi's legacy/headache patterns:
Is it possible to:
|
@mlutfy Some good feedback from @nicol and @demeritcowboy. If you can address those things I'll merge it quickly before we start swapping wheels. |
Anyone know why this page displays with the frontend theme in Drupal? The frontend themes usually don't support many of the backend themes (ex: alerts, maybe font-awesome). |
e2d155b
to
b3e5b10
Compare
@mlutfy – ah I see. It does load on WordPress and Joomla. Font Awesome loads on my Drupal 9 upgrade screen tho, so that should be safe. As you're adding that CSS just to support Drupal, what about instead adding a class that Drupal should recognise like
|
@vingle Thanks for the suggestions. I tried to implement some of the suggestions, to the extent that this is a frontend form and I think we should render as a backend form before doing more changes, but I went way too far down the rabbit hole. I'd rather not add Drupal-specific classes, I just wanted to avoid random visual results depending on the CMS. I removed as much CSS as I could, and hopefully we can remove most of it when we flip to a backend form. @demeritcowboy I removed the white link from General.php, but it's a b it difficult to test. Since I was breaking the translations for this string, I fixed the ts usage. I also decided to break/fix that "thank you" string, because it was really annoying me. Here is what it looks like on Drupal9 with the new changes (I replaced I don't know the logo will be missed, but I figure that simpler is better, and I still think that message should be simplified, and keeping that out of scope for now: This is after fixing the "Thank you" message: While grave-digging, found some possibly un-used things, but wasn't sure:
|
Something's wrong with the donation link. I think it's because it's now in single quotes - checking... re: frontend theme: https://github.com/civicrm/civicrm-drupal/blob/0ec6bf7886d03205b0f4f74533357525efecb552/modules/civicrmtheme/civicrmtheme.module#L91 |
Yeah it's the single quotes. You can either do
I think the first produces more "standard" ('standard'?) html, but the second looks nicer in the code. And yes the General.php link looks better now. The message itself is still worded incorrectly most of the time, but that's a separate issue. |
Is that a way to adjust this? Maybe it would be better to deal with the quirk of Drupal viewing a backend form as a front-end form, rather than making every CMS load styles that clash with any non-Grenwich Civi theme that's running? The hard-baked styles will also clash with whatever comes after Greenwich… |
My guess is that it was there because during an upgrade you want as little as possible code running to avoid things like chicken-and-egg situations, but if other cmses have already been running for a long time with the civi theme during upgrade then it doesn't seem a big risk. And it seems drupal 9 doesn't have that |
jenkins, test this please |
@demeritcowboy Thanks! - fixed the links, I think? There are weird test fails:
(gitlab seems to be working fine, and I checked fail2ban/firewall) And thanks for the pointer in civicrmtheme. I found this commit: which leads to: https://issues.civicrm.org/jira/browse/CRM-10612 - but not very detailed. It was on Drupal7, 4.1 to 4.2 upgrade. I was testing on Drupal9 though. And as you say, on WordPress this does not apply, and CiviCRM are less brutal than before, so I would be curious to try removing that code, but separate PR/repo. |
jenkins, test this please |
Have put merge-ready. I don't know why I didn't see it but drupal 9 does also have the check for upgrade so returns early. But can treat as a followup if desired. |
Related core PR: civicrm/civicrm-core#25961 This change was initially introduced in CiviCRM 4.2 to avoid issues when upgrading, but we could not find any reason to keep it that way today. Using the backend theme will make it easier to provide consistent theming accross CMS-es and also usually avoids some frontend CMS features to kick-in, such as Views.
Related core PR: civicrm/civicrm-core#25961 This change was initially introduced in CiviCRM 4.2 to avoid issues when upgrading, but we could not find any reason to keep it that way today. Using the backend theme will make it easier to provide consistent theming accross CMS-es and also usually avoids some frontend CMS features to kick-in, such as Views.
Thanks! I opened PRs on the Drupal repos to change that behaviour: |
@mlutfy What order did you want to do this in? I'm ok to merge the other PRs, in which case would you then update this or should we also merge this and leave further updates for now? |
Would it be possible to add a comment to success.tpl explaining why putting css in the template is acceptable in this situation? |
@eileenmcnaughton Yep, comment added. @demeritcowboy PRs Can be merged independently. I'll circle back at some point to cleanup the CSS. (the Drupal changes seem harmless to me, but who knows, maybe it'll need to be reverted). |
Is that the new Montreal theme? That looks like a typical road in downtown Montreal during construction season (i.e. summer). I'll circle back and get rid of the CSS and do more testing :) (I had only added the CSS comment, but maybe the backend theme is causing issues?) |
Removes inline CSS and replaces icons with font-awesome, and attempts to make the pre/post upgrade look a bit nicer. Updates the post-upgrade thank you message and also adds a link to encourage admin to view the System Check.
I did some minor updates and more testing on all CMSes:
I could not find suitable generic CSS classes from CiviCRM to avoid inline CSS. There are classes for alerts (that appear in the corner of the screen), but they do not apply to full-screen messages. I updated the comment to that effect. Drupal7 with Seven and Shoreditch, pre/post upgrade: WordPress pre/post-upgrade: Without Shoreditch: Drupal9: |
This is looking great. Thanks for adding FA.
and
gives (with the .tpl css commented out): and |
@vingle I'm a bit reluctant to tweak further, because I feel like the generic core classes are insufficient, and they should always be prefixed to avoid a conflict with the CMS theme (for example, "labels", but also .success/.warning/.status can be really random). Similarly, using I know this topic comes up often, but is there some sort of documentation on that? If not, can we create something from scratch using : https://github.com/civicrm/org.civicrm.styleguide ? (which was probably never adopted because shoreditch-centric) |
@mlufty fair enough - good reasons. Tho it's a pattern used pretty widely across Civi, so at the point at which we are able to replace all The current focus for myself and @artfulrobot for a replacement to the Style Guide is Theme Test. I've added an issue to add some snippets for current Alert handling. |
I gave it a last little run and it sounds like it's more or less agreed to leave more tweaking until later. I notice the donation link still has |
Overview
Initially I just wanted to add a link to the "CiviCRM System Status", because post-upgrade, I think that's the first thing people should check.
However, after adding the link, it was ugly, just felt like I was adding more clutter, so I went down a rabbit hole attempt to cleanup a bit.
Before
Before running the upgrade:
After running the upgrade:
After
Before running the upgrade:
Before running the upgrade (if there are no upgrade warnings):
After running the upgrade:
Comments
Some of the funnyness around buttons is because of Shoreditch and can be ignored.
I think the post-upgrade message should be simplified with a more clear call-to-action (donate), but it would break translations and I was not in the mood.