Skip to content

Commit

Permalink
Merge branch 'feat/tup-463' into feat/TUP-463-c-button-migration
Browse files Browse the repository at this point in the history
  • Loading branch information
R-Tomas-Gonzalez committed Nov 7, 2023
2 parents c659bdb + 960194f commit e4eebe0
Show file tree
Hide file tree
Showing 20 changed files with 29 additions and 323 deletions.
4 changes: 2 additions & 2 deletions apps/tup-cms/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion apps/tup-cms/src/apps/portal/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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 <p> `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 */
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
/* ... */

/* GENERICS */
@import url("./for-core-cms/generics/pseudo-elements.css") layer(project);

/* ELEMENTS */
/* … */
Expand All @@ -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 */
/* … */
Original file line number Diff line number Diff line change
Expand Up @@ -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);
/* … */
11 changes: 7 additions & 4 deletions libs/tup-components/src/auth/LoginComponent/LoginComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -85,7 +88,7 @@ const LoginComponent: React.FC<LoginProps> = ({ 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
Expand Down Expand Up @@ -121,7 +124,7 @@ const LoginComponent: React.FC<LoginProps> = ({ className }) => {
</p>
<Formik initialValues={initialValues} onSubmit={onSubmit}>
<Form className="c-form">
<LoginError status={status} />
<LoginError status={status} isError={isError} />
<FormikInput
name="username"
label="User Name"
Expand Down
Loading

0 comments on commit e4eebe0

Please sign in to comment.