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

Code Cleanup and new Google Tag Manager #607

Merged
merged 15 commits into from
Jul 27, 2024
Merged

Code Cleanup and new Google Tag Manager #607

merged 15 commits into from
Jul 27, 2024

Conversation

nnunn
Copy link
Contributor

@nnunn nnunn commented Jul 24, 2024

Code Cleanup and new Google Tag Manager code from central. Deleted a number of unused layouts. Also removed the chat widget from the basic layout as this should go in the English and French main layouts in the CMS. Also added navigation to the application layout so that error pages have the new look and feel.

@nnunn nnunn changed the title Update basic.html.erb Code Cleanup and new Google Tag Manager Jul 24, 2024
@nnunn
Copy link
Contributor Author

nnunn commented Jul 24, 2024

Deleting unused layouts seem to be breaking our tests...

@nnunn nnunn requested review from murny and pgwillia July 24, 2024 18:53
@nnunn nnunn self-assigned this Jul 24, 2024
Copy link
Collaborator

Choose a reason for hiding this comment

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

These are just default Rails mailer layouts that came out of the box, they probably fine to leave?

Maybe one day we might want to send emails or something 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We've never sent emails so I thought it would be cleaner not to have these at all...

Copy link
Collaborator

Choose a reason for hiding this comment

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

If you remove them, then I'd remove the mailer class which uses them?
https://github.com/ualbertalib/library-cms/blob/master/app/mailers/application_mailer.rb

Otherwise, I would just leave them alone

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok great - I reverted those deletions!

'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-MX43PRW2');</script>
<!-- End Google Tag Manager -->
<%= stylesheet_link_tag comfy_cms_render_css_path(@cms_site.id, @cms_layout.identifier) %>
Copy link
Collaborator

@murny murny Jul 24, 2024

Choose a reason for hiding this comment

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

Profile tests that I added caught an error here. When staff/profile pages get rendered, we don't have a @cms_site.id available, and as a result it's throwing a Nil no method error here?

Might have to handle this smarter for places where we are using application.html.erb outside the CMS 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think we'll be using application.html.erb outside of the CMS anymore. The staff/profile pages are all being replaced with a springshare product tomorrow...

Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we create a new PR to remove all this code then? Once this is merged, then this PR is good to go?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah - I was thinking I would do another code release next week once we have our replacement staff directory in place.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So yes, once this is merged - I'll get Neil to deploy the new release tomorrow. Is there anything else you'd like to add?

@nnunn
Copy link
Contributor Author

nnunn commented Jul 25, 2024

@murny does this look ok to you now? I'm hoping to cut a release -- if not we can wait till Neil is back next week.

@murny
Copy link
Collaborator

murny commented Jul 25, 2024

@murny does this look ok to you now? I'm hoping to cut a release -- if not we can wait till Neil is back next week.

@nnunn the CI pipeline is red right now, so even if I approve you cannot merge this.

We need to do something about profiles code and the application layout.

If you want I can create a pull request to remove all the profiles stuff and then we can merge this. Once this is merge then we can merge this pull request.

@nnunn
Copy link
Contributor Author

nnunn commented Jul 25, 2024

@murny does this look ok to you now? I'm hoping to cut a release -- if not we can wait till Neil is back next week.

@nnunn the CI pipeline is red right now, so even if I approve you cannot merge this.

We need to do something about profiles code and the application layout.

If you want I can create a pull request to remove all the profiles stuff and then we can merge this. Once this is merge then we can merge this pull request.

That would be much appreciated!

@murny
Copy link
Collaborator

murny commented Jul 26, 2024

I rebased this pull request with the latest master (which has the profile removal code), so CI pipeline should be green now.

Will approve this now 👍

murny
murny previously approved these changes Jul 26, 2024
@murny
Copy link
Collaborator

murny commented Jul 26, 2024

Tests are now failing on missing layout of 2020. I think this because all the seed data is still using some of these layouts we just removed.

I see we using the following layouts in the CMS seed data:

  • app_layout: '2020'
  • app_layout: 'cms_french'
  • app_layout: 'cms'
  • app_layout: 'french'
  • app_layout: 'home'

Any ideas here @nnunn? Should these just be replaced with application or basic? Or should the actual pages be removed?

@nnunn
Copy link
Contributor Author

nnunn commented Jul 26, 2024

I think we should probably remove the old seed data and recreate it with the current pages. This is a pretty simple rake task comfy:cms_seeds:import & comfy:cms_seeds:export but it needs to be run directly in prod to get the latest data.

For now we could change all those layouts to "basic"

@murny
Copy link
Collaborator

murny commented Jul 26, 2024

Cool, didn't know about the import/export rake task. When I talk to Neil about doing a release next week, we can ask him to get a new export dump of the seed data in prod.

For now, I can make the changes to update them to use "basic" layout 👍

Copy link
Collaborator

Choose a reason for hiding this comment

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

I updated all the layouts in the cms seed data to use basic layout.

Unfortunately, there is a ton of spacing diffs here (trailing whitespace that my editor trims, etc). But the only real change is updating app_layout to app_layout: basic

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks good!

@murny
Copy link
Collaborator

murny commented Jul 26, 2024

Everything seem to be okay locally, but some CSS is a bit off. Think this is just due to old CMS data. We need a new CMS data dump from prod, so I added a backlog issue for this: #610

Think this is okay to merge for now, will allow to us to continue to clean up the other unused code that we have.

@murny murny merged commit e5ce961 into master Jul 27, 2024
2 checks passed
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.

2 participants