Skip to content

chore(data-modeling): add most of the redux store logic and a basic UI for it #6879

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 3 commits into from
Apr 24, 2025

Conversation

gribnoysup
Copy link
Collaborator

@gribnoysup gribnoysup commented Apr 22, 2025

This PR contains all of the redux store busines logic required for the groundwork project + most of the rough UI attached to the store

Work in progress, I'll probably not finish this fully before I'm OOO, but this can basically be polished into a fully finished implementation, I'll also use this as a base for the tech design

Main things missing at the moment:

  • UI is super rought and would benefit from better decomposition into smaller parts, although I think it's good enough to merge and adjust afterwards
  • Tests are missing, although in the spirit of redux documentation, we should be testing them through UI that will change a lot, we can probably add some basic ones, but leave most to the point when the UI is being added

Kapture 2025-04-23 at 12 25 39

For obvious reasons the most interesting part in this PR that's worth a thorough look is the redux store as the UI is mostly throwaway

@gribnoysup gribnoysup force-pushed the data-modeling-store branch 4 times, most recently from e45a4fe to 92c0b94 Compare April 23, 2025 10:27
@gribnoysup gribnoysup force-pushed the data-modeling-store branch from 92c0b94 to 2a67c20 Compare April 23, 2025 10:40
connectionId: z.string().nullable(),

// TODO: define rest of the schema based on arch doc / tech design
edits: z.array(z.unknown()).default([]),
Copy link
Member

Choose a reason for hiding this comment

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

Should we add createdAt and updatedAt?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, definitely! There's an example in pipeline storage where we get this info from the file stats, but also I guess for web we'd need to just set it on save because there are no stats there

Copy link
Member

Choose a reason for hiding this comment

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

Noting we might not need this as we can refer to the edits in the diagram for this. Each edit will have a timestamp (first is the createdAt, last would be updatedAt).

@@ -112,6 +112,29 @@ delete (Checkbox as React.ComponentType<any>).propTypes;
// all hrefs.
export { Link, Button, IconButton } from './links/link';

// Working around leafygreen lack of support for `defaultValue` property
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Asked about it here, if they open a ticket, we can link it here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Okay, we have a ticket to follow now https://jira.mongodb.org/browse/LG-5063

@@ -207,3 +209,32 @@ export const ConfirmationModalArea: React.FunctionComponent = ({
</ConfirmationModalAreaMountedContext.Provider>
);
};

export async function showPrompt(
Copy link
Collaborator Author

@gribnoysup gribnoysup Apr 23, 2025

Choose a reason for hiding this comment

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

New thing: similar to showConfirmation allows to prompt the user in place without the need for all the extra state that's usually associated with this sort of modal UI

@@ -6,10 +6,10 @@ import {
FormFieldContainer,
FormModal,
openToast,
SelectTable,
Copy link
Collaborator Author

@gribnoysup gribnoysup Apr 23, 2025

Choose a reason for hiding this comment

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

Moved out of connection-import-export to compass-components as we now have two places where this UI is used

const deviceAuthAbortController = new AbortController();

connectionInfo = cloneDeep(connectionInfo);
try {
Copy link
Collaborator Author

@gribnoysup gribnoysup Apr 23, 2025

Choose a reason for hiding this comment

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

Fun bug I found in connect logic while working on this: because we only clean up inflightConnection in the finally, if you short circuit before that, you can never reconnect 🙈 Before that this was only affecting maximumNumberOfActiveConnections check and I'm just assuming that it was a corner-case enough that nobody ever ran into this yet

@gribnoysup gribnoysup marked this pull request as ready for review April 24, 2025 14:44
@gribnoysup gribnoysup changed the title wip: data-modeling redux store chore(data-modeling): add most of the redux store logic and a basic UI for it Apr 24, 2025
@gribnoysup gribnoysup merged commit 28cbfb9 into main Apr 24, 2025
53 of 55 checks passed
@gribnoysup gribnoysup deleted the data-modeling-store branch April 24, 2025 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants