diff --git a/apps/tup-cms/Dockerfile b/apps/tup-cms/Dockerfile index 35b0a7dfc..17ba7d02e 100644 --- a/apps/tup-cms/Dockerfile +++ b/apps/tup-cms/Dockerfile @@ -1,5 +1,5 @@ -# TACC/Core-CMS#707 (sans commits irrelevant to TACC) (v3.12.0-beta.4 candidate) -FROM taccwma/core-cms:1f7b95d +# TACC/Core-CMS#742 (core-styles v2.11 to v2.19) +FROM taccwma/core-cms:7975138 WORKDIR /code diff --git a/apps/tup-cms/src/apps/portal/backend.py b/apps/tup-cms/src/apps/portal/backend.py index acbe973ba..e8a1a13f0 100644 --- a/apps/tup-cms/src/apps/portal/backend.py +++ b/apps/tup-cms/src/apps/portal/backend.py @@ -15,7 +15,7 @@ def authenticate(self, request): headers = {"x-tup-token": token} try: - req = requests.get(profile_url, headers=headers, timeout=10) + req = requests.get(profile_url, headers=headers, timeout=15) req.raise_for_status() except Exception as exc: raise PermissionDenied from exc diff --git a/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-cms/components/c-footer.css b/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-cms/components/c-footer.css deleted file mode 100644 index 3460761c0..000000000 --- a/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-cms/components/c-footer.css +++ /dev/null @@ -1,9 +0,0 @@ -/* !!!: Some or all of this may be moot since TACC/Core-Styles/pull/215 */ -.c-footer { - /* TODO: Remove padding-top from core-styles.cms.css (then remove this) */ - padding-top: 0; - - /* TODO: Add comment+style below to core-styles.cms.css (then remove this) */ - /* To prevent margin-collapse of children (

) with minimal side effects */ - display: flow-root; -} diff --git a/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-cms/components/django.cms.blog.app.item.css b/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-cms/components/django.cms.blog.app.item.css deleted file mode 100644 index a395214e8..000000000 --- a/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-cms/components/django.cms.blog.app.item.css +++ /dev/null @@ -1,6 +0,0 @@ -/* TODO: Share styles between c-news and c-feed-list (`time:not(…)`) */ -.blog-list article time:not(:is(h1, h2, h3, h4, h5, h6) *) { - color: var(--global-color-accent--secondary); - font-weight: var(--medium); - text-transform: uppercase; -} diff --git a/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-cms/components/django.cms.picture.css b/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-cms/components/django.cms.picture.css deleted file mode 100644 index 4fb6ee0c5..000000000 --- a/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-cms/components/django.cms.picture.css +++ /dev/null @@ -1,8 +0,0 @@ -/* HELP: Why/How do I need to add these styles? */ -/* NOTE: There are Core Styles and Core CMS styles for image alignment. */ -/* SEE: https://www.tacc.utexas.edu/news/latest-news/2025/11/11/basic-news-template/?edit (styles below are not needed for figures) */ -/* SEE: https://www.tacc.utexas.edu/education/k-12-students/high-school-camps/gencyber-level-up/ (styles below are needed for images) */ -/* SEE: https://matcssi.tacc.utexas.edu/ (v3.11.1) (styles below not needed for image) */ -img.align-center { - display: block; -} diff --git a/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-cms/components/lightgallery.css b/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-cms/components/lightgallery.css deleted file mode 100644 index 3a4330b0c..000000000 --- a/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-cms/components/lightgallery.css +++ /dev/null @@ -1,5 +0,0 @@ - -.lg-sub-html a { - /* FAQ: The `!important` overrides styles from plugin, in layer */ - color: var(--global-color-link-on-dark--normal) !important; -} diff --git a/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-cms/generics/pseudo-elements.css b/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-cms/generics/pseudo-elements.css deleted file mode 100644 index d2a5d9118..000000000 --- a/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-cms/generics/pseudo-elements.css +++ /dev/null @@ -1,11 +0,0 @@ -/* To highlight targeted content */ -:target { - outline: var(--global-border-width--x-thick) solid transparent; - outline-offset: var(--global-border-width--xx-thick); - animation: focus 2s; -} -@keyframes focus { - from { - outline-color: var(--global-color-accent--tertiary); - } -} diff --git a/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-styles/components/c-card--frontera-about-page.css b/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-styles/components/c-card--frontera-about-page.css deleted file mode 100644 index 60637ad90..000000000 --- a/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-styles/components/c-card--frontera-about-page.css +++ /dev/null @@ -1,4 +0,0 @@ -/* To add font-weight that (before Core-Styles v1) was assummed */ -.c-card--frontera-about-page img+h3 { - font-weight: var(--bold); -} diff --git a/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-styles/components/c-card.css b/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-styles/components/c-card.css index 5f8ccb54c..e69de29bb 100644 --- a/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-styles/components/c-card.css +++ b/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-styles/components/c-card.css @@ -1,158 +0,0 @@ -/* FIX CARD */ - -/* !!!: When migrated: - 1. Remove `:where(:not(…` (e.g. "not in portal"). - 2. Prevent these styles in apps/tup-ui TicketHistory CSS */ -:is(.card, .c-card, [class*="card--"]) p:last-child:where(:not(#page-portal *)) { - margin-bottom: 2rem; /* restore

`margin-bottom `*/ -} - -/* To more specifically control c-card link font weight */ -/* !!!: When migrated: - 1. Remove `:where(:not(…` (e.g. "not in portal"). - 2. Prevent these styles in apps/tup-ui TicketHistory CSS */ -:is(.card, .c-card, [class*="card--"]) a.c-button:where(:not(#page-portal *)) { - font-weight: var(--bold); -} - -/* FAQ: Used on image cards for staff like on /education/k-12-students/ */ -:is(.card, .c-card, [class*="card--"]) h4 { - margin-bottom: 0.375em; -} - - - - - -/* SUPPORT LIST IN CARD */ - -/* FAQ: The Portal uses Bootstrap ".card" for ticket modal */ -:is(.card, .c-card, [class*="card--"]) ul { - /* list-style: none; *//* H.P. restored bullets, M.S. does not know */ - padding-left: 1em; /* overwrite core-styles.cms */ -} -/* To add space between line items */ -/* FAQ: Using margin and li:not(:first-of-type) because of multi-line items */ -:is(.card, .c-card, [class*="card--"]) li:not(:first-of-type) { - margin-top: 0.5em; -} -/* TODO: Consider changing this site wide; SEE: -:where([role=main],main) li:not(td li) { line-height: 1.6; } */ -:is(.card, .c-card, [class*="card--"]) ul:last-child:where(:not(#page-portal *)) { - margin-bottom: 2rem; -} - - - - - -/* ADD CARD--IMAGE */ - -/* Image */ - -[class*="card--image-"] { - display: grid; -} - -.card--image-top { - padding-top: 0; -} -.card--image-left { - padding-left: 0; - padding-bottom: var(--global-space--pattern-pad); -} -.card--image-right { - padding-right: 0; - padding-bottom: var(--global-space--pattern-pad); -} -.card--image-bottom { - padding-bottom: 0; -} - - - -/* Image: Left & Right */ - -.card--image-left, -.card--image-right { - --image-width: 50%; - - grid-column-gap: var(--global-space--pattern-pad); - - /* Repeat many times, because element count is unknown */ - grid-template-rows: repeat(10, min-content); -} -.card--image-left > img, -.card--image-right > img { - grid-row-start: 1; - grid-row-end: -1; - - /* To remove card padding */ - margin-block: calc( -1 * var(--global-space--pattern-pad) ); -} - -.card--image-left { - grid-template-columns: var(--image-width) 1fr; /* to overwrite `.c-card` */ -} -.card--image-left > img { - grid-column-start: 1; - grid-column-end: span 1; -} - -.card--image-right { - grid-template-columns: 1fr var(--image-width); /* to overwrite `.c-card` */ -} -.card--image-right > img { - grid-column-start: 2; - grid-column-end: span 1; -} - - - -/* Image: Top & Bottom */ - -.card--image-top, -.card--image-bottom { - --image-height: auto; - --global-space--pattern-pad: 15px; - - /* Use extra columns to add horizontal padding */ - grid-template-columns: var(--global-space--pattern-pad) 1fr var(--global-space--pattern-pad); - padding-inline: unset; -} -.card--image-top > :not(img), -.card--image-bottom > :not(img) { - /* Span only columns for content */ - grid-column-start: 2; - grid-column-end: -2; -} -.card--image-top > img, -.card--image-bottom > img { - /* Span all columns, padding and content */ - grid-column-start: 1; - grid-column-end: -1; -} - -.card--image-top { - /* Repeat many times, because element count is unknown */ - grid-template-rows: repeat(10, min-content) var(--image-height); -} -.card--image-top > img { - grid-row-start: 1; - margin-bottom: var(--global-space--pattern-pad); -} -.card--image-bottom > :is(h1, h2, h3, h4, h5):first-of-type { - margin-top: unset; /* to avoid combining margin with image */ -} - -.card--image-bottom { - /* Repeat many times, because element count is unknown */ - grid-template-rows: var(--image-height) repeat(10, min-content); -} -.card--image-bottom > img { - grid-row-end: -1; - margin-top: var(--global-space--pattern-pad); -} -.card--image-bottom > p:last-of-type { - margin-bottom: unset; /* to avoid combining margin with image */ -} diff --git a/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-styles/objects/o-heading-steps.css b/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-styles/objects/o-heading-steps.css deleted file mode 100644 index 7eaa35853..000000000 --- a/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-styles/objects/o-heading-steps.css +++ /dev/null @@ -1,15 +0,0 @@ -/* To add numbers to steps */ -.heading-steps, -[class*="heading-steps--"] { - counter-reset: step; -} -.heading-steps :is(h1, h2, h3, h4, h5, h6), -[class*="heading-steps--"] :is(h1, h2, h3, h4, h5, h6) { - counter-increment: step; -} -.heading-steps--root :is(h1, h2, h3, h4, h5, h6)::before, -.heading-steps__item :is(h1, h2, h3, h4, h5, h6)::before { - content: counter(step) '. '; - color: var(--global-color-accent--secondary); - font-weight: var(--medium); -} diff --git a/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-styles/objects/o-section.css b/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-styles/objects/o-section.css deleted file mode 100644 index 0b6317fca..000000000 --- a/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-styles/objects/o-section.css +++ /dev/null @@ -1,14 +0,0 @@ -/* Remove double space */ -/* TODO: Integrate this into Core-Styles using less verbose solution */ -.section--light + .section--light, -.section--muted + .section--muted, -.section--dark + .section--dark, -.o-section--style-light + .o-section--style-light, -.o-section--style-muted + .o-section--style-muted, -.o-section--style-dark + .o-section--style-dark { - padding-top: unset; -} -.section:not([class*="section-"]) + .section:not([class*="section-"]), -.o-section:not([class*="section--"]) + .o-section:not([class*="section--"]) { - margin-top: unset; -} diff --git a/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-styles/trumps/s-header.css b/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-styles/trumps/s-header.css deleted file mode 100644 index 821245264..000000000 --- a/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-styles/trumps/s-header.css +++ /dev/null @@ -1,49 +0,0 @@ -/* NOTE: Minimal tweaks from Designer (in lieu of TACC/Core-CMS#222) */ -/* WARNING: Might conflict with TACC/Core-CMS#222 */ -.s-header { - font-size: var(--global-font-size--medium); - font-weight: var(--bold); - letter-spacing: 0.025px; /* 14px * 0.025em equals design-requested 0.35px */ -} - -/* To enlarge height for all screen widths */ -/* TODO: Change in Core-Styles */ -@media only screen and (min-width: 992px) { - .s-header { - height: 60px; - } -} - -/* To stretch nav items to header height (while retaining vertical centering) */ -/* TODO: Change in Core-Styles */ -.s-header, -.s-header .navbar-collapse { - align-items: stretch; -} -@media only screen and (min-width: 992px) { - .s-header .nav-item { - display: flex; - } -} -.s-header .nav-link { - display: flex; - align-items: center; -} -@media only screen and (min-width: 992px) { - .s-header[class*="navbar-expand-"] .navbar-nav .nav-link { - padding-block: 0; /* overwrite core-styles.header.css */ - } -} -.s-header .navbar-brand { - display: grid; - align-content: center; -} - -.s-header .dropdown-item:focus, -.s-header .dropdown-item:hover { - background-color: rgba(var(--global-color-primary--light-rgb), 0.3); -} -.s-header .dropdown-item.active, -.s-header .dropdown-item:active { - background-color: var(--global-color-accent--normal); -} diff --git a/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-styles/trumps/u-highlight.css b/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-styles/trumps/u-highlight.css deleted file mode 100644 index ae6822c31..000000000 --- a/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/for-core-styles/trumps/u-highlight.css +++ /dev/null @@ -1,16 +0,0 @@ -/* Highlight */ -/* TODO: Create an .x-highlight used to extend a and a .u-highlight */ - -/* TODO: Consider whether should be in Core-Styles… - Perhaps the client should decide what tag to use. */ -/* SEE: https://tacc-team.slack.com/archives/CQUA4D5KJ/p1696285622741979 */ -mark, -.x-highlight, -:is(.u-highlight, .highlight) { - /* So wrapped inline text has consistent padding */ - -webkit-box-decoration-break: clone; - box-decoration-break: clone; -} -:is(h1, h2, h3, h4):is(.u-highlight, .highlight) { - display: inline; -} diff --git a/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/tup-cms.for-core-cms.css b/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/tup-cms.for-core-cms.css index abb78176a..3054dfcae 100644 --- a/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/tup-cms.for-core-cms.css +++ b/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/tup-cms.for-core-cms.css @@ -5,7 +5,6 @@ /* ... */ /* GENERICS */ -@import url("./for-core-cms/generics/pseudo-elements.css") layer(project); /* ELEMENTS */ /* … */ @@ -14,11 +13,7 @@ /* … */ /* COMPONENTS */ -@import url("./for-core-cms/components/c-footer.css") layer(project); -@import url("./for-core-cms/components/django.cms.blog.app.item.css") layer(project); @import url("./for-core-cms/components/django.cms.blog.app.page.css") layer(project); -@import url("./for-core-cms/components/django.cms.picture.css") layer(project); -@import url("./for-core-cms/components/lightgallery.css") layer(project); /* TRUMPS */ /* … */ diff --git a/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/tup-cms.for-core-styles.css b/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/tup-cms.for-core-styles.css index c92286b57..02247194c 100644 --- a/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/tup-cms.for-core-styles.css +++ b/apps/tup-cms/src/taccsite_custom/tup_cms/static/tup_cms/css/tup-cms.for-core-styles.css @@ -11,16 +11,14 @@ /* … */ /* OBJECTS */ -@import url("./for-core-styles/objects/o-section.css") layer(base); -@import url("./for-core-styles/objects/o-heading-steps.css") layer(base); +/* … */ /* COMPONENTS */ @import url("./for-core-styles/components/c-card.css") layer(base); -@import url("./for-core-styles/components/c-card--frontera-about-page.css") layer(base); +@import url("./for-core-styles/components/c-content-block.css") layer(base); @import url("./for-core-styles/components/c-feed-list.css") layer(base); @import url("./for-core-styles/components/c-news.css") layer(base); @import url("./for-core-styles/components/c-pill.css") layer(base); /* TRUMPS */ -@import url("./for-core-styles/trumps/u-highlight.css") layer(base); -@import url("./for-core-styles/trumps/s-header.css") layer(base); +/* … */ diff --git a/libs/tup-components/src/auth/LoginComponent/LoginComponent.tsx b/libs/tup-components/src/auth/LoginComponent/LoginComponent.tsx index 0066ff3e2..5520649b4 100644 --- a/libs/tup-components/src/auth/LoginComponent/LoginComponent.tsx +++ b/libs/tup-components/src/auth/LoginComponent/LoginComponent.tsx @@ -17,8 +17,11 @@ type LoginProps = { className?: string; }; -const LoginError: React.FC<{ status?: number }> = ({ status }) => { - if (status === 200 || status === undefined) { +const LoginError: React.FC<{ status?: number; isError: boolean }> = ({ + status, + isError, +}) => { + if (!isError && (status === 200 || status === undefined)) { return null; } if (status === 403) { @@ -85,7 +88,7 @@ const LoginComponent: React.FC = ({ className }) => { const authCallback = useCallback(() => { window.location.replace(from); }, [from]); - const { login, data, error, isLoading } = useAuth(); + const { login, data, error, isLoading, isError } = useAuth(); // FAQ: To use inline messaging for required fields (instead of browser): // 1. Uncomment this constant definition @@ -121,7 +124,7 @@ const LoginComponent: React.FC = ({ className }) => {

- + { // Use the post hook with the auth endpoint and the callback const mutation = usePost({ endpoint: '/auth', - options: { onSuccess }, + timeout: 15000, + options: { + onSuccess, + }, }); // Rename some of the default react-query functions to be meaningful to this hook's functions diff --git a/libs/tup-hooks/src/requests.ts b/libs/tup-hooks/src/requests.ts index 3a40a00d5..8e5724d92 100644 --- a/libs/tup-hooks/src/requests.ts +++ b/libs/tup-hooks/src/requests.ts @@ -45,12 +45,14 @@ type UsePostParams = { endpoint: string; options?: UseMutationOptions; baseUrl?: string; + timeout?: number; }; export function usePost({ endpoint, options = {}, baseUrl: alternateBaseUrl, + timeout = undefined, }: UsePostParams) { const client = axios; const { baseUrl } = useConfig(); @@ -61,6 +63,7 @@ export function usePost({ body, { headers: { 'x-tup-token': jwt ?? '' }, + timeout, } ); return response.data; diff --git a/package-lock.json b/package-lock.json index 760fe2841..e6855c77d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -40,7 +40,7 @@ "@nx/vite": "16.5.3", "@nx/web": "16.5.3", "@nx/workspace": "16.5.3", - "@tacc/core-styles": "^2.16.3", + "@tacc/core-styles": "github:TACC/Core-Styles#v2.19.0", "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^14.0.0", "@testing-library/user-event": "^14.4.3", @@ -5502,10 +5502,10 @@ } }, "node_modules/@tacc/core-styles": { - "version": "2.16.3", - "resolved": "https://registry.npmjs.org/@tacc/core-styles/-/core-styles-2.16.3.tgz", - "integrity": "sha512-xudj4QACQ2qsNdEPiLsa5CpdKKHOeuRW6bQd94WmYl3/1cSbPrZCHWloDfDqGMvxjKgNjUeCMjPG5yK3G4Jeyg==", + "version": "2.19.0", + "resolved": "git+ssh://git@github.com/TACC/Core-Styles.git#4743bcbfc261deb61a207791fa3a07915e23eb37", "dev": true, + "license": "MIT", "bin": { "core-styles": "src/cli.js" }, @@ -5515,7 +5515,7 @@ }, "peerDependencies": { "commander": "^9.4.1", - "cssnano": "^5.1.14", + "cssnano": "^5.1.15", "js-yaml": "^4.1.0", "merge-lite": "^1.0.2", "node-cmd": "^5.0.0", @@ -5525,7 +5525,7 @@ "postcss-extend": "^1.0.5", "postcss-import": "^15.0.0", "postcss-preset-env": "^7.8.3", - "postcss-replace": "^2.0.0" + "postcss-replace": "^2.0.1" } }, "node_modules/@tanstack/query-core": { @@ -25541,10 +25541,9 @@ } }, "@tacc/core-styles": { - "version": "2.16.3", - "resolved": "https://registry.npmjs.org/@tacc/core-styles/-/core-styles-2.16.3.tgz", - "integrity": "sha512-xudj4QACQ2qsNdEPiLsa5CpdKKHOeuRW6bQd94WmYl3/1cSbPrZCHWloDfDqGMvxjKgNjUeCMjPG5yK3G4Jeyg==", + "version": "git+ssh://git@github.com/TACC/Core-Styles.git#4743bcbfc261deb61a207791fa3a07915e23eb37", "dev": true, + "from": "@tacc/core-styles@github:TACC/Core-Styles#v2.19.0", "requires": {} }, "@tanstack/query-core": { diff --git a/package.json b/package.json index 0a1f39194..88ff68e50 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@nx/vite": "16.5.3", "@nx/web": "16.5.3", "@nx/workspace": "16.5.3", - "@tacc/core-styles": "^2.16.3", + "@tacc/core-styles": "github:TACC/Core-Styles#v2.19.0", "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^14.0.0", "@testing-library/user-event": "^14.4.3",