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

MFA pairing UI/accessibility tweaks - design changes #270

Merged
Show file tree
Hide file tree
Changes from 85 commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
772fcc6
refactor: move link to to docs (TUP-535:4,5)
wesleyboar Jul 19, 2023
f958384
refactor!: prepare for c-nav--piped (TUP-535:3)
wesleyboar Jul 20, 2023
bbce029
refactor: change 5m msg, get help link (TUP-535:6)
wesleyboar Jul 20, 2023
bb92b8c
refactor: change qr error to reuse a help modal
wesleyboar Jul 20, 2023
fa9aa7c
style: npx nx format:write
wesleyboar Jul 20, 2023
0ec0fd2
refactor: simplify `qr-code-box` markup and styles
wesleyboar Jul 20, 2023
6116bcd
refactor: use lists for mfa panels
wesleyboar Jul 20, 2023
d2ba130
fix: missing space before "Get help." link
wesleyboar Jul 20, 2023
37dcb12
refactor: simpler messages (TUP-535:2.1.1+2.1.2)
wesleyboar Jul 20, 2023
4e4ad51
refactor: let modal manage duplicate instances
wesleyboar Jul 20, 2023
3081292
Merge branch 'task/TUP-517--mfa-ui-tweaks' into task/TUP-517--mfa-ui-…
wesleyboar Jul 20, 2023
1d5ca09
fix: restore code that I had made text for testing
wesleyboar Jul 20, 2023
59709fd
chore: remove now-unnecessary id form markup
wesleyboar Jul 20, 2023
0b50542
feat: new message if QR code alt. is unavilable
wesleyboar Jul 20, 2023
2d76c1a
fix: add periods to end of sentences…
wesleyboar Jul 20, 2023
874445d
chore: remove now-unnecessary id from props
wesleyboar Jul 20, 2023
ef3ea72
chore: remove now-unnecessary id from props
wesleyboar Jul 20, 2023
3d7133c
Merge branch 'task/TUP-517--mfa-ui-tweaks--design-changes' of github.…
wesleyboar Jul 20, 2023
fc49944
fix: load v2.13 c-nav component
wesleyboar Jul 20, 2023
cdf6a2e
chore: improve a comment
wesleyboar Jul 20, 2023
6707584
style: npx nx format:write
wesleyboar Jul 21, 2023
eb77b11
fix: bad grammar in error message
wesleyboar Jul 21, 2023
2ecd7f5
fix: bad grammar, remove please
wesleyboar Jul 21, 2023
1866868
feat: TextCopyField.jsx to .tsx, and enable it
wesleyboar Jul 21, 2023
28ef6ad
feat: TextCopyModal
wesleyboar Jul 21, 2023
f753720
fix: FieldWrapper, opt. req. & let desc. be React
wesleyboar Jul 21, 2023
fa7a910
fix: FieldWrapperFormik, let desc. be React
wesleyboar Jul 21, 2023
e3e45be
feat: text copy modal (TUP-535:2.1.3)
wesleyboar Jul 21, 2023
d4e1bd0
chore: uninstall react-copy-to-clipboard
wesleyboar Jul 21, 2023
6152efa
feat: install @tacc/core-styles 2.14.0
wesleyboar Jul 24, 2023
48efbdf
refactor: FieldWrapper mirror FeildWrapperFormik
wesleyboar Jul 24, 2023
dd6c8e3
feat: style text copy modal (TUP-535:2.1.3)
wesleyboar Jul 24, 2023
0cf3f6e
npx nx format:write
wesleyboar Jul 24, 2023
caafb10
fix: qr code box was not 200px until image loaded
wesleyboar Jul 24, 2023
bcf682a
fix: remove test logic for msg. about qr alt. code
wesleyboar Jul 24, 2023
6b8d862
fix: pass qr alt. verification code
wesleyboar Jul 24, 2023
e3ef9ae
feat: allow markup in label e.g. <a>
wesleyboar Jul 24, 2023
26722e0
fix: markup in label should not be spaced by flex
wesleyboar Jul 24, 2023
51f7642
fix: let core-styles style form error text
wesleyboar Jul 24, 2023
ec61a3d
fix: use FieldWrapper consistently and correctly
wesleyboar Jul 24, 2023
7d401ab
chore: rename `qr-code-message` to `mfa-message`
wesleyboar Jul 24, 2023
ce524d6
chore: remove unused `ButtonWrapper`
wesleyboar Jul 24, 2023
17a3d0d
chore: load sibling core-components from rel. path
wesleyboar Jul 24, 2023
cfb2977
chore: remove unused `SectionMessage` import
wesleyboar Jul 24, 2023
1b7aad9
fix: resolve "circular dependency"
wesleyboar Jul 24, 2023
e306285
nx format:write
wesleyboar Jul 24, 2023
ee04665
fix: loose ends after "circular dependency" fix
wesleyboar Jul 24, 2023
864279a
fix: fieldwrapper css duplication too confusing
wesleyboar Jul 24, 2023
06bf969
chore: remove excess `<span>` tag
wesleyboar Jul 25, 2023
a49e17f
chore: no field wrapper desc unless desc exists
wesleyboar Jul 25, 2023
c4fdd87
npx nx format:write
wesleyboar Jul 25, 2023
74ed6a7
fix: grammar error from design
wesleyboar Jul 25, 2023
83e10bf
chore: use installed @core-styles, not CDN
wesleyboar Jul 26, 2023
cfe9d92
refactor: simplify TextCopyField (no CopyField)
wesleyboar Jul 26, 2023
529b3e8
refactor: simplify TextCopyField (no ButtonWrapper)
wesleyboar Jul 26, 2023
962d715
refactor: TextCopyModal hint → <TextCopyModalHint>
wesleyboar Jul 26, 2023
03ba9a2
feat: support and add id attr to <Button>
wesleyboar Jul 26, 2023
b561e94
npx nx format:write
wesleyboar Jul 26, 2023
538b72c
fix: qr code should resize w/ browser base font
wesleyboar Jul 26, 2023
03779be
refactor: simplify qr code styles
wesleyboar Jul 26, 2023
ff0727a
refactor: use variable for qr code size
wesleyboar Jul 26, 2023
165d16b
fix: increase qr coe size back to 200px not 160px
wesleyboar Jul 26, 2023
f2f325d
fix(a11y): status msg box needs role before msg
wesleyboar Jul 26, 2023
7613a4f
fix(a11y): no use <label> text for <button> text
wesleyboar Jul 26, 2023
ff7d271
Revert "fix(a11y): status msg box needs role before msg"
wesleyboar Jul 26, 2023
457a5d9
fix: add and pass id to TextCopyField
wesleyboar Jul 26, 2023
97bf0bc
feat(a11y): title text for qr code img
wesleyboar Jul 26, 2023
d9aab1c
npx nx format:write
wesleyboar Jul 26, 2023
9d1479f
feat: allow custom `tagName` for `<Message>`
wesleyboar Jul 26, 2023
58faf33
chore: describe FieldWrapperFormik global css
wesleyboar Jul 26, 2023
7c1e2da
refactor: replace FieldWrapper w/ upcoming s-form
wesleyboar Jul 26, 2023
ae380db
chore: remove FieldWrapper (not Formik)
wesleyboar Jul 26, 2023
58e15e9
refactor:return feild wrap CSS to comp. as global
wesleyboar Jul 26, 2023
0ab4bba
npx nx format:write
wesleyboar Jul 26, 2023
4823620
refactor: simpler id assignment
wesleyboar Jul 27, 2023
3e28e3b
fix: static mfa panel width so mfa-msg is centered
wesleyboar Jul 27, 2023
74e5aae
refactor: no modal for text copty
wesleyboar Jul 27, 2023
d60583d
fix: restore accientally deleted conditions
wesleyboar Jul 27, 2023
eabd2bf
chore: remove component changes moved to PR #277
wesleyboar Jul 27, 2023
b6e1cb1
chore: remove component changes moved to PR #276
wesleyboar Jul 27, 2023
97c6db1
chore: remove stray changes
wesleyboar Jul 27, 2023
04e6c6d
fix: restore TypeScript TextCopyModal
wesleyboar Jul 27, 2023
aafcd92
fix: data.otpkey as var not text
wesleyboar Jul 27, 2023
34d1b8e
fix: disable read-only fields, just to be safe
wesleyboar Jul 27, 2023
429ee9e
refactor: use core-styles v2.15, not form.cms.css (#279)
wesleyboar Jul 31, 2023
8bb2924
fix: alt. qr otp label as block instead of inline
wesleyboar Aug 2, 2023
9827d10
fix: add space between mfa msg and section bottom
wesleyboar Aug 2, 2023
90e26bc
fix: QR loading div was higher than button and img
wesleyboar Aug 2, 2023
44c09e7
fix: darker danger color was not taking effect
wesleyboar Aug 2, 2023
e0c82ad
fix: core-styles v2.16.2
wesleyboar Aug 2, 2023
6f4816a
fix: remove (now?) unnecessary <br />
wesleyboar Aug 2, 2023
bc24bff
fix: match action spacing, drop related deviations
wesleyboar Aug 2, 2023
0333151
refactor: use SectionHeader / less duplicate code
wesleyboar Aug 2, 2023
e88f365
chore: nx format:write
wesleyboar Aug 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions apps/tup-ui/src/main.global.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
/* To use new c-nav component not yet in TACC/Core-CMS core-styles.base.css */
/* TODO: Remove when TACC/Core-CMS loads TACC/Core-Styles v2.13+ */
/* CAVEAT: Duplicates older, unchanged, global c-nav styles */
@import url("@tacc/core-styles/dist/components/c-nav.css");

/* To use s-affixed-input-wrapper which had been unused outside TACC/Core-CMS */
/* TODO: Remove when TACC/Core-CMS loads TACC/Core-Styles v2.14+ */
@import url("@tacc/core-styles/dist/trumps/s-affixed-input-wrapper.css");
wesleyboar marked this conversation as resolved.
Show resolved Hide resolved

/* To use new form styles in core-styles.base.css */
/* TODO: Remove when TACC/Core-CMS loads TACC/Core-Styles v2.15+ */
@import url("@tacc/core-styles/dist/elements/form.css");
@import url("@tacc/core-styles/dist/trumps/s-form.css");
wesleyboar marked this conversation as resolved.
Show resolved Hide resolved

/* To overwrite @tacc/core-styles CEPv2 spacing */
:root {
/* TACC/Core-Styles/blob/823b7b9/src/lib/_imports/settings/space.css */
Expand Down Expand Up @@ -54,3 +68,10 @@ h3 {
table {
width: 100%;
}

/* Forms */
/* To hide icon of a Message that is used as a form error */
/* FAQ: Used by MfaValidationPanel, MfaSmsPanel */
.s-form input + [role="status"] > .icon {
display: none;
}
6 changes: 6 additions & 0 deletions apps/tup-ui/src/main.global.for-core-styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,9 @@ hr {
margin-right: 0.25ch;
text-transform: none;
}

/* TODO: Remove this after:
0. CEP v2 colors are removed from Core-Styles settings/color--portal */
:root {
--global-color-danger--normal: #dc393b;
}
1 change: 1 addition & 0 deletions libs/core-components/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ export { default as InfiniteScrollTable } from './lib/InfiniteScrollTable';
export { default as Sidebar } from './lib/Sidebar';
export { default as HistoryBadge } from './lib/HistoryBadge';
export { default as Collapse } from './lib/Collapse';
export { default as TextCopyField } from './lib/TextCopyField';
export * from './lib/Form';
3 changes: 3 additions & 0 deletions libs/core-components/src/lib/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ type ButtonProps = React.PropsWithChildren<{
className?: string;
iconNameBefore?: string;
iconNameAfter?: string;
id?: string;
dataTestid?: string;
disabled?: boolean;
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
Expand All @@ -54,6 +55,7 @@ const Button: React.FC<ButtonProps> = ({
className,
iconNameBefore,
iconNameAfter,
id,
type = 'secondary',
size = '',
dataTestid,
Expand All @@ -74,6 +76,7 @@ const Button: React.FC<ButtonProps> = ({

return (
<button
id={id}
className={`
${styles['root']}
c-button
Expand Down
7 changes: 5 additions & 2 deletions libs/core-components/src/lib/Message/Message.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,14 @@ const Message = ({
onDismiss,
canDismiss,
isVisible,
tagName,
scope,
type,
}) => {
const typeMap = TYPE_MAP[type];
const scopeMap = SCOPE_MAP[scope || DEFAULT_SCOPE];
const { iconName, iconText, className: typeClassName } = typeMap;
const { role, tagName, className: scopeClassName } = scopeMap;
const { role, tagName: autoTagName, className: scopeClassName } = scopeMap;

const hasDismissSupport = scope === 'section';

Expand Down Expand Up @@ -137,7 +138,7 @@ const Message = ({
// Avoid manually syncing Reactstrap <Fade>'s default props
// eslint-disable-next-line react/jsx-props-no-spreading
{...fadeProps}
tag={tagName}
tag={tagName || autoTagName}
className={`${className} ${containerStyleNames}`}
role={role}
in={isVisible}
Expand Down Expand Up @@ -186,6 +187,8 @@ Message.propTypes = {
onDismiss: PropTypes.func,
/** How to place the message within the layout */
scope: PropTypes.oneOf(SCOPES), // RFE: Require scope; change all instances
/** Message HTML tag (overwrites tag based on scope) */
tagName: PropTypes.string,
/** Message type or severity */
type: PropTypes.oneOf(TYPES).isRequired,
};
Expand Down
91 changes: 0 additions & 91 deletions libs/core-components/src/lib/TextCopyField/TextCopyField.jsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
@import url('@tacc/core-styles/dist/settings/color--portal.css');

.input {
/* composes: input from '@tacc/core-styles/dist/components/...form.css'; */
}

.copy-button {
/* So JavaScript can set this (JavaScript also needs the value) */
--transition-duration: 0;
/* WARNING: Must match JavaScript `transitionDuration` */
--transition-duration: 0.15;
wesleyboar marked this conversation as resolved.
Show resolved Hide resolved

transition: color var(--transition-duration),
background-color var(--transition-duration);
Expand Down
75 changes: 75 additions & 0 deletions libs/core-components/src/lib/TextCopyField/TextCopyField.tsx
wesleyboar marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import React, { useCallback, useState } from 'react';

import Button from '../Button';

import styles from './TextCopyField.module.css';

type TextCopyFieldProps = {
value: string;
placeholder?: string;
className?: string;
id?: string;
buttonClassName?: string;
};

const TextCopyField: React.FC<TextCopyFieldProps> = ({
value,
placeholder,
className,
id,
buttonClassName,
}) => {
/* WARNING: Must match CSS `--transition-duration` */
const transitionDuration = 0.15; // second(s)
const stateDuration = 1; // second(s)
const stateTimeout = transitionDuration + stateDuration; // second(s)

const [isCopied, setIsCopied] = useState(false);

const onCopy = useCallback(() => {
navigator.clipboard.writeText(value);
setIsCopied(true);

const timeout = setTimeout(() => {
setIsCopied(false);
clearTimeout(timeout);
}, stateTimeout * 1000);
}, [value, setIsCopied, stateTimeout]);
const isEmpty = !value || value.length === 0;
const onChange = (event: React.ChangeEvent<HTMLInputElement>) => {
// Swallow keyboard events on the Input control, but
// still allow selecting the text. readOnly property of
// Input is not adequate for this purpose because it
// prevents text selection
event.preventDefault();
};

return (
<>
<Button
className={`${styles['copy-button']} ${
isCopied ? styles['is-copied'] : ''
} ${buttonClassName}`}
size="small"
onClick={onCopy}
disabled={isEmpty}
iconNameBefore={isCopied ? 'approved-reverse' : 'link'}
>
Copy
</Button>
<input
id={id}
type="text"
onChange={onChange}
value={value}
className={className}
placeholder={placeholder}
data-testid="input"
disabled
readOnly
wesleyboar marked this conversation as resolved.
Show resolved Hide resolved
/>
</>
);
};

export default TextCopyField;
12 changes: 1 addition & 11 deletions libs/tup-components/src/accounts/ManageAccountMfa.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,6 @@ const MfaUnpair: React.FC<{ pairing: MfaTokenResponse }> = ({ pairing }) => {
const MfaSectionHeader: React.FC = () => (
<div className={styles['tap-header']}>
<strong>MFA Pairing</strong>
<div style={{ float: 'right' }}>
<a
target="_blank"
rel="noreferrer"
href="https://docs.tacc.utexas.edu/basics/mfa/"
>
<strong>MFA Documentation</strong>
</a>
</div>
wesleyboar marked this conversation as resolved.
Show resolved Hide resolved
</div>
);

Expand All @@ -144,8 +135,7 @@ export const AccountMfa: React.FC = () => {
<MfaSectionHeader />
<SectionMessage type="error">
There was an error retrieving your multifactor authentication status.
Your account may be in a non-valid state. if this error persists
please{' '}
Your account may be in a non-valid state. If this error persists,{' '}
wesleyboar marked this conversation as resolved.
Show resolved Hide resolved
<TicketCreateModal display="link">submit a ticket</TicketCreateModal>{' '}
with this information and TACC User Services will assist you.
</SectionMessage>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/* So login form is built off CMS styles */
@import url('@tacc/core-styles/dist/elements/form.cms.css') layer(base);

/* CONTAINER */

.root {
Expand Down Expand Up @@ -54,10 +51,8 @@
display: none;
}
.field {
max-width: unset; /* undo forms.cms.css `input...` */

/* To use larger field inputs, always (not just coarse pointer devices) */
padding: 12px 12px; /* mimic forms.cms.css `@media (pointer: coarse)` */
padding: 12px 12px; /* mimic Core Styles forms.css @media (pointer: coarse) */
}


Expand Down
Loading
Loading