-
Notifications
You must be signed in to change notification settings - Fork 32
Conversation
Deploying matrix-authentication-service-docs with Cloudflare Pages
|
bfcb4df
to
bf5df43
Compare
bf5df43
to
07cc9c4
Compare
07cc9c4
to
32356f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few things here and there, but that looks really nice!
flex: 1; | ||
} | ||
|
||
.link { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an existing Link component which should have the same style?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I stole this from UserEmail
FWIW
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the Link
component does not have the underline or the white text colour, it just looks like plain grey text
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fundamentally we're missing a good implementation of the Text Link component: https://www.figma.com/design/rTaQE2nIUSLav4Tg3nozq7/Compound-Web-Components?node-id=645-3494&t=OH2MjoxKqsJTB1vF-4
I'll leave the duplication for now, and will see to implement that in Compound
frontend/src/components/AccountManagementPasswordPreview/AccountManagementPasswordPreview.tsx
Outdated
Show resolved
Hide resolved
case SetPasswordStatus.NoCurrentPassword: | ||
return t( | ||
"frontend.password_change.failure.description_NO_CURRENT_PASSWORD", | ||
); | ||
case SetPasswordStatus.NotAllowed: | ||
return t("frontend.password_change.failure.description_NOT_ALLOWED"); | ||
case SetPasswordStatus.NotFound: | ||
return t("frontend.password_change.failure.description_NOT_FOUND"); | ||
case SetPasswordStatus.PasswordChangesDisabled: | ||
return t( | ||
"frontend.password_change.failure.description_PASSWORD_CHANGES_DISABLED", | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually for those I would just throw
within the component? None of those are not recoverable by the user, so showing a page 'crash' is probably the best thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some of these I'm on the fence about.
e.g. password change disabled: the functionality could have been disabled since you navigated to the page, it feels a bit crap to show a generic 'something went wrong' error when we know the actual reason.
not allowed / not found: these probably make more sense if we had an admin control panel in MAS, but agreed we can probably lose them
no current password: I'd be tempted to keep it, since it's explanatory of a real-world error you might hit?
e34f212
to
05ab6bd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few nitpicks but we're almost there!
const CURRENT_VIEWER_QUERY = graphql(/* GraphQL */ ` | ||
query CurrentViewerQuery { | ||
viewer { | ||
__typename | ||
... on Node { | ||
id | ||
} | ||
} | ||
} | ||
`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arguably, we don't need to load the current user as we're not really displaying anything about them, but I guess we need this for showing a 404 if the user isn't logged in. Also that query is most certainly cached so 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I was on the fence about this one...
{handleableError && ( | ||
<Alert | ||
type="critical" | ||
title={t("frontend.password_change.failure.title")} | ||
> | ||
{errorMsg} | ||
</Alert> | ||
)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I like the switch/case
logic up there. Because we have some errors specific to fields, I would rather have a series of {result.data?.setPassword.status === SetPasswordStatus.NoCurrentPassword && (<Alert … />)}
. wdyt?
Also could you stick alerts at the top of the form?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you think we should not show the errors in an alert if they are specific to a form field? I was thinking that might make it a bit harder to notice but wasn't entirely sure.
Both the switch and the sequence of conditionally rendered alerts feel a bit tedious but struggling to think of anything better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that said: I think it's important to have a 'default' case (for unhandled errors etc) and by taking your approach, it's harder to see how we'd do that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you think we should not show the errors in an alert if they are specific to a form field? I was thinking that might make it a bit harder to notice but wasn't entirely sure.
Yep, as radix forms will take care of focusing the errored field. I don't think I've saw any form with an alert like that in the designs
that said: I think it's important to have a 'default' case (for unhandled errors etc) and by taking your approach, it's harder to see how we'd do that
that's a fair point. Although could be offset by doing something like:
const status = result.data?.setPassword.status;
switch (status) {
// Cases that are handled by the form
case SetPasswordStatus.InvalidNewPassword:
case SetPasswordStatus.NoCurrentPassword:
case SetPasswordStatus.PasswordChangesDisabled:
case SetPasswordStatus.WrongPassword:
case SetPasswordStatus.Allowed:
case undefined:
break;
case SetPasswordStatus.NotFound:
case SetPasswordStatus.NotAllowed:
throw new Error(`unexpected error when changing password: ${status}`);
default:
unreachable(status);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means you then have to remember to keep that in sync with what the form shows. I wouldn't mind something different but I prefer to make sure that handling the error and knowing we handle the error are guaranteed to be the same
df75bff
to
befdeea
Compare
56a683d
to
e5a21a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with the double-error message for now, will see during design review I guess wether we should change that or not
60b42ce
to
408dd07
Compare
I updated the double-error thing to not show, if it does focus like you say then I think my concern has been dealt with. I also find it a bit weird to double-show so on balance I'll go with this for now. |
408dd07
to
2c8ed61
Compare
This is still missing some polish, like:
Fixes #2148.