feat: CMD-187 autocreate search page#1129
Conversation
So that it can be loaded from CDN. Use cases are: - if search template is broken - for custom search page - for non-Core website
Compared to "cms-search", "google-search" is: - more accurate - more obvious to those not familiar with Core-CMS
So dev sees 'google-search' from CSS before seeing it in HTML `id` attr.
Caused server error.
This had create dbreadcrumsb before.
Final markup undecided, so keep it simple, and easy to understand.
* feat: logo icons inherit color * feat: organization logos inherit color * feat: core logo inherit color * feat: logos inherit size * fix: ending `<p>` tag * feat: Icon svg inherit size * fix: no empty underlined space on hover * fix: tacc formal logo fill wrong * fix: bluesky logo duplicate code * feat: color icons * fix: bust cache
Also, I am locally using newer Poetry version (2.1.4 to 2.2.1).
This reverts commit 298a6ad.
## Overview Merge v4.35.23. ## Changes - [incoming](v4.36.14...v4.35.23) - [current](v4.35.23...v4.36.14) ## Testing 1. Branch https://github.com/TACC/Texascale-CMS. 2. Use a branch with this merge: - [ ] `main--merge-v4-35.23` - [x] `taccwma/core-cms:fix-core-cms-template-gh-18--v4-36` 3. Build `taccwma/texascale-cms` image. 4. Deploy to pre-prod. 5. Verify no error & no change (compare to prod). --------- Co-authored-by: fnets <fnetscher@gmail.com>
## Overview Merge in [v4.37.0](https://github.com/TACC/Core-CMS/releases/tag/v4.37.0). ## Changes - v4.36.23...v4.37.0 ## Testing Already tested via #1075 on Texascale. --------- Co-authored-by: fnets <fnetscher@gmail.com>
Added styles to fix link UI and UX.
Added styles to fix MORE link UI and UX.
- accompanies #1089 - mirrors TACC/tup-ui@eb93d55
Review Summary by QodoAuto-create Google Search page with Django CMS integration
WalkthroughsDescription• Automatically create and manage Google Search page with minimal configuration • Add new search_page Django app with CMS integration and apphook support • Introduce SEARCH_PAGE_AUTO_SETUP and GOOGLE_SEARCH_ENGINE_ID settings • Implement search template with Google Custom Search Engine styling and fallback warning • Update search bar to use dynamically resolved search page URL via template tag Diagramflowchart LR
A["Settings<br/>SEARCH_PAGE_AUTO_SETUP<br/>GOOGLE_SEARCH_ENGINE_ID"] -->|triggers| B["SearchPageConfig.ready()"]
B -->|calls| C["create_page()"]
C -->|creates CMS Page<br/>with apphook| D["SearchPageApphook"]
D -->|routes to| E["SearchPageView"]
E -->|renders| F["search_page.html<br/>with Google CSE"]
G["nav_search.raw.html"] -->|uses| H["search_page_url tag"]
H -->|resolves to| D
File Changes1. apps/search_page/apps.py
|
Code Review by Qodo
Context used✅ Tickets:
CMD-187 1. Unused Page import
|
| @@ -0,0 +1,10 @@ | |||
| from django import template | |||
| from cms.models import Page | |||
There was a problem hiding this comment.
1. Unused page import 📘 Rule violation ⚙ Maintainability
taccsite_cms/templatetags/search_tags.py imports Page but never uses it, which triggers a Flake8 F401 unused import violation. This can fail linting for the taccsite_cms/ module.
Agent Prompt
## Issue description
`taccsite_cms/templatetags/search_tags.py` imports `Page` but does not use it, which violates Flake8 (`F401`).
## Issue Context
Compliance requires no new Flake8 violations when running `flake8 taccsite_cms/ --max-line-length=120`.
## Fix Focus Areas
- taccsite_cms/templatetags/search_tags.py[1-4]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| def ready(self): | ||
| if settings.SEARCH_PAGE_AUTO_SETUP: | ||
| from .utils import create_page | ||
| create_page() |
There was a problem hiding this comment.
2. Db write in appconfig.ready 🐞 Bug ☼ Reliability
SearchPageConfig.ready() calls create_page(), which performs ORM reads/writes during Django app initialization; this can crash server startup or management commands when CMS tables aren’t migrated/available yet. The codebase already uses post_migrate for DB bootstrapping, so this is an inconsistent and unsafe initialization mechanism.
Agent Prompt
## Issue description
`SearchPageConfig.ready()` triggers DB work (`create_page()`) during app initialization. This runs on every process start and can fail before migrations (or when DB is unavailable), preventing startup.
## Issue Context
The repository already bootstraps DB state using `post_migrate` (see `taccsite_cms/apps.py`). The search page creation should follow the same pattern and be resilient to missing tables.
## Fix Focus Areas
- apps/search_page/apps.py[1-10]
- apps/search_page/utils.py[41-64]
- taccsite_cms/apps.py[13-24]
## Implementation notes
- Replace `ready()` DB call with `post_migrate.connect(...)` (like `taccsite_cms.apps.TaccsiteCmsConfig`).
- Guard access to `settings.SEARCH_PAGE_AUTO_SETUP` via `getattr(settings, 'SEARCH_PAGE_AUTO_SETUP', False)`.
- Ensure the handler is idempotent and wraps DB errors (e.g., `OperationalError`, `ProgrammingError`) with logging instead of crashing startup.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Overview
Support a Google Search page with less effort.
What Effort?
Every Time:
code→ ID.SEARCHsettings.Previously:
/searchpage.Now, Instead:
Important
Incomplete because there is a suggestion (which I agree with) to use a custom migration.
Originally built off code from
release/v4.36.Xwhen it had beenmainbranch.Caution
Do not merge.
To Do:
mainbranch.Warning
Successful run requires two deploys. Help wanted.
Related
Instances:
Private, so no results.
Private, but has results from public LCCF.
Private still, so no results.
Changes
search_pageappSEARCH_AUTO_SETUPsettingGOOGLE_SEARCH_ENGINE_IDsettingTesting
GOOGLE_SEARCH_ENGINE_IDsetting e.g.GOOGLE_SEARCH_ENGINE_ID = 'b099996c09ebd4ece'SEARCH_AUTO_SETUP = Truesetting.GOOGLE_SEARCH_ENGINE_IDsetting.UI
GOOGLE_SEARCH_ENGINE_IDGOOGLE_SEARCH_ENGINE_ID