Skip to content

feat: implement CRUD UI for IDP organization sync settings #15503

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

Merged
merged 71 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
d0baa8c
feat: initial commit for idp org sync settings
jaaydenh Nov 13, 2024
6463076
feat: add export policy button
jaaydenh Nov 15, 2024
f714986
feat: update badge styles for multiple selector
jaaydenh Nov 17, 2024
072d775
feat: use input component and move export button
jaaydenh Nov 17, 2024
f6e286c
feat: add delete button for org mapping
jaaydenh Nov 17, 2024
acf8cbe
feat: disabled button states
jaaydenh Nov 17, 2024
ad1aa84
feat: update export policy button to shadcn
jaaydenh Nov 17, 2024
b01588d
fix: fix format
jaaydenh Nov 17, 2024
6203d04
feat: display success/error toast on form submission
jaaydenh Nov 20, 2024
bc37998
feat: create story for export policy button
jaaydenh Nov 20, 2024
2c2246d
feat: update pill list component
jaaydenh Nov 21, 2024
6971f91
feat: add down chevron to multiple selector
jaaydenh Nov 21, 2024
6e87130
chore: update conventions for shadcn components
jaaydenh Nov 23, 2024
a1b6e79
feat: use semantic list html for overflow pills
jaaydenh Nov 24, 2024
36c8706
chore: update css variable colors
jaaydenh Nov 24, 2024
a4e66c2
fix: make link style and behavior match existing links
jaaydenh Nov 24, 2024
f7be49f
fix: use display name for org in multi-select component
jaaydenh Nov 24, 2024
90a65fe
chore: cleanup
jaaydenh Nov 25, 2024
c282765
fix: styling for x and chevron buttons
jaaydenh Nov 25, 2024
40155bc
chore: extract fixed filter options to a variable
jaaydenh Nov 25, 2024
a129820
fix: update focus styles
jaaydenh Nov 25, 2024
8edd4b4
fix: multi-select placement fix
jaaydenh Nov 25, 2024
e54e5ca
fix: improve export policy button logic
jaaydenh Nov 25, 2024
bb16bd1
chore: update to use pointer instead of mouse events
jaaydenh Nov 25, 2024
678a91d
fix: extract UUID testing to separate variable
jaaydenh Nov 25, 2024
a13d9b2
fix: update error handling
jaaydenh Nov 25, 2024
1b8efd1
chore: add source comment
jaaydenh Nov 26, 2024
137c25c
chore: remove debounce
jaaydenh Nov 26, 2024
46a4646
fix: format
jaaydenh Nov 26, 2024
85a455c
feat: update form save logic
jaaydenh Nov 26, 2024
a9e06f1
fix: remove popover and muted colors from shadcn
jaaydenh Nov 26, 2024
d921b08
chore: cleanup
jaaydenh Nov 26, 2024
ba665b4
fix: use form instead of sync settings for state
jaaydenh Nov 26, 2024
8a0e789
chore: fix component filename casing
jaaydenh Nov 26, 2024
234c0fb
fix: dont await form.setFieldValue
jaaydenh Nov 26, 2024
7d88a38
feat: add radix visually hidden
jaaydenh Nov 26, 2024
c6c9b16
fix: improve focus styling
jaaydenh Nov 27, 2024
5322a4e
chore: cleanup
jaaydenh Nov 27, 2024
eab8a0d
fix: format
jaaydenh Nov 27, 2024
721d5d4
feat: updates for Badge component
jaaydenh Nov 27, 2024
8986cbd
feat: updates for shadcn button component
jaaydenh Nov 27, 2024
89a7b12
feat: update stories and input component
jaaydenh Nov 27, 2024
148dca7
fix: format
jaaydenh Nov 27, 2024
0c338b0
feat: add stories for switch component
jaaydenh Nov 27, 2024
0cadc8b
feat: setup stories for Label component
jaaydenh Nov 27, 2024
1d7153b
feat: setup stories for shadcn Dialog component
jaaydenh Nov 27, 2024
a914c54
fix: format
jaaydenh Nov 27, 2024
bd307c0
chore: make clasnames multi-line
jaaydenh Nov 27, 2024
95bfd17
fix: use multiline classnames
jaaydenh Nov 27, 2024
82bd850
fix: display blue outline on multiple selector when focused
jaaydenh Nov 27, 2024
6eb6987
fix: format
jaaydenh Nov 27, 2024
3822b2e
feat: add stories for MultiSelectCombobox
jaaydenh Dec 2, 2024
fe17b1c
feat: add tooltip for assign default org switch
jaaydenh Dec 2, 2024
e75e179
feat: add stories for IdpOrgSyncPageview
jaaydenh Dec 2, 2024
c6e07ff
chore: extract UUID regex
jaaydenh Dec 2, 2024
a3b9b27
chore: cleanup
jaaydenh Dec 2, 2024
0601164
feat: add form validation schema
jaaydenh Dec 2, 2024
b01e5d3
fix: cleanup paywall copy
jaaydenh Dec 2, 2024
1c5b6ef
fix: cleanup
jaaydenh Dec 2, 2024
6e2ee08
fix: remove useEffect
jaaydenh Dec 2, 2024
ae30db0
chore: cleanup
jaaydenh Dec 2, 2024
ac74cdc
fix: format
jaaydenh Dec 2, 2024
a99dca5
chore: cleanup for PR review comments
jaaydenh Dec 3, 2024
4c00959
fix: focus rings
jaaydenh Dec 3, 2024
568a5a9
chore: use tailwinds sr-only class
jaaydenh Dec 4, 2024
c313439
fix: fix 2xs fontSize
jaaydenh Dec 4, 2024
506223d
chore: convert UUID regex to a function
jaaydenh Dec 4, 2024
f223ab7
feat: add enabled check
jaaydenh Dec 4, 2024
94ff4ca
chore: cleanup
jaaydenh Dec 4, 2024
9101e0e
fix: fix format
jaaydenh Dec 4, 2024
5ca2c0c
chore: cleanup
jaaydenh Dec 4, 2024
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
Prev Previous commit
Next Next commit
fix: update error handling
  • Loading branch information
jaaydenh committed Dec 2, 2024
commit a13d9b242c044a5a172d552755d245eb1df0fc31
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Paywall } from "components/Paywall/Paywall";
import { SquareArrowOutUpRight } from "lucide-react";
import { useDashboard } from "modules/dashboard/useDashboard";
import { useFeatureVisibility } from "modules/dashboard/useFeatureVisibility";
import type { FC } from "react";
import { type FC, useEffect } from "react";
import { Helmet } from "react-helmet-async";
import { useMutation, useQuery, useQueryClient } from "react-query";
import { docs } from "utils/docs";
Expand All @@ -35,6 +35,17 @@ export const IdpOrgSyncPage: FC = () => {
patchOrganizationSyncSettings(queryClient),
);

useEffect(() => {
if (patchOrganizationSyncSettingsMutation.error) {
displayError(
getErrorMessage(
patchOrganizationSyncSettingsMutation.error,
"Error updating organization idp sync settings.",
),
);
}
}, [patchOrganizationSyncSettingsMutation.error]);

if (isLoading) {
return <Loader />;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { ErrorAlert } from "components/Alert/ErrorAlert";
import { ChooseOne, Cond } from "components/Conditionals/ChooseOne";
import { EmptyState } from "components/EmptyState/EmptyState";
import { Loader } from "components/Loader/Loader";
import { Stack } from "components/Stack/Stack";
import {
TableLoaderSkeleton,
TableRowSkeleton,
Expand Down Expand Up @@ -70,10 +69,6 @@ export const IdpSyncPageView: FC<IdpSyncPageViewProps> = ({
? Object.entries(syncSettings.mapping).length
: 0;

if (error) {
return <ErrorAlert error={error} />;
}

if (!organizationSyncSettings) {
return <Loader />;
}
Expand All @@ -100,7 +95,8 @@ export const IdpSyncPageView: FC<IdpSyncPageViewProps> = ({
};

return (
<Stack spacing={2}>
<div className="flex flex-col gap-2">
Copy link
Member

@Parkreiner Parkreiner Dec 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to be honest: I spun up the UI, and I don't fully understand how to use it, or how to evaluate whether the user flows make sense.

I'm just going to be writing questions/comments that come to mind while I'm testing things out. Feel free to pick and choose which feedback actually makes sense:

  • I have no idea what a "Sync Field" does, and the documentation linked on the page doesn't mention those words once
  • The "organization sync field" input mentions "If empty, organization sync is deactivated". I don't know if that means that the entire form should be disabled while the field is empty, or not. Right now, all the main inputs are still interactive
    • As in, if the point of the page is syncing organizations, and the UI tells me "organization sync is deactivated", but it's not really, that feels like communication broke down
  • I don't know if the UI around the switch is clear.
    • It's not clear from looking at the switch that clicking it immediately makes a POST request, especially when there's a separate Save button right next to it
    • I feel like the label text would be more clear if it said something like "Give all users default organization". I know that "Assign" is also a verb, but something with the current phrasing makes it less clear to me for some reason
  • Maybe the word "Save" could be renamed to "Sync" to make it more clear that the button is only relevant to the sync field?
  • There's no easy way to add a new Coder org to an existing IDP org. You have to add a new IDP org with the same name, and manually re-add all the Coder orgs (with the risk of forgetting one if the list is long enough)
  • On the flip side, it's not easy to remove a Coder org from an IDP org
  • I don't know if it makes sense to display the table when there are no IDP orgs. It makes the UI show two extra headers that just add visual noise/confusion, because there's nothing for them to apply to. I'd rather just display the call-to-action outside the table
  • It'd be nice if the Delete icons had a tooltip
  • When I'm in the empty state and have no groups, it's not clear what the UI wants me to look at first. The Call to Action is drawing my attention a lot more because it's larger and has more relative brightness. But the only action there is looking at the docs
Screenshot 2024-12-03 at 5 00 44 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation hasn't been created yet and some of the things you are mentioning, especially editing rows in the table are intended to be updated in a future PR. I also wanted to leave the table as is, since this would get replaced with a non-MUI table in the future with the work for IDP group and role sync.

When clicking the switch, a toast does appear telling the user the settings have been updated.

Copy link
Member

@Parkreiner Parkreiner Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So my thinking with UI is that it should be as obvious to the user before they even interact with it. As in, it should set relatively firm expectations on what something does, so that the user can confidently decide if the element is even relevant to them

If the user has to interact with the element once to know exactly what it does, I feel like there's something that can be done to make the UI more clear. UI engineering wants to minimize surprises

Copy link
Contributor Author

@jaaydenh jaaydenh Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Parkreiner I think this may be a good discussion for FE Variety. Right now, the assumption is that a user would probably not interact with this page without reading the docs first. Historically, I believe these kings of settings would be handled with an onboarding call. Of course its a great goal for a user to intuitively understand everything about a page just by looking at it but there will be tradeoffs in usability and design esthetics. For example, the atomic saving of each element of the form was a tradeoff, the alternative design with a single save button for the entire form, considered that if the table had many rows, the save button for the entire form would be pushed below the fold, so that an indicator would be needed to let the user know the form is dirty. Is possible this is a better design, but doing the work iteratively will allow more people to use it and to get some feedback about what works and doesn't work.

{Boolean(error) && <ErrorAlert error={error} />}
<form onSubmit={form.handleSubmit}>
<fieldset disabled={form.isSubmitting}>
<div className="flex flex-row">
Expand Down Expand Up @@ -238,7 +234,7 @@ export const IdpSyncPageView: FC<IdpSyncPageViewProps> = ({
</div>
</fieldset>
</form>
</Stack>
</div>
);
};

Expand Down