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

Enabling entity level setting for sourceCapture optional settings #1326

Merged

Conversation

travjenkins
Copy link
Member

@travjenkins travjenkins commented Oct 24, 2024

Issues

#1135

Changes

1135

  • Wire up new options for delta updates and schema naming
  • Add new optional settings for the add dialoge
  • Ability to add custom secondary button to the entity selector modal

Misc

  • Update how we add annotations to the ajv instance
  • Just directly store the default ajv instance and stop using iife
  • Renaming variables that are expecting components
  • Moved some stuff related to resource config to a shared handler

Tests

Manually tested

  • scenarios you manually tested

Automated tests

  • unit testing covered

Playwright tests ran locally

  • Admin
  • Captures
  • Collections
  • HomePage
  • Login
  • Materialization

Screenshots

Long name / wide view
image

Long name / narrow view
image

@travjenkins travjenkins changed the title Add entity level binding options Add binding property prefill ability to collection selection Nov 12, 2024
moving details into a single chip
Adding some padding around the top and bottom
…operly)

Starting to stub out where the WASM calls will go
Adding a Nullable typescript util
Minor renaming
More work on handling name vs setting changes
  config so they are not going to be like backfill
Getting the cancel button working right
Starting to check the props in the forms
Copy link
Member Author

Choose a reason for hiding this comment

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

This made sharing stuff for auto complete harder so fixing.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added the documentation comments here now that we do not need to declare these multiple times

Copy link
Member

@kiahna-tucker kiahna-tucker left a comment

Choose a reason for hiding this comment

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

Releasing review comments while testing is underway.


// Schema Mode
'schemaMode.header': `Source Capture Schema Mode`,
'schemaMode.message': `How should the schema of the materialization binding be set.`,
Copy link
Member

Choose a reason for hiding this comment

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

This sentence is phrased like a question. I would prefer for it to be declarative in nature: How the schema of the materialization should be set. That said, this piece of content reads a tad awkwardly out of context.

'schemaMode.message': `How should the schema of the materialization binding be set.`,
'schemaMode.input.label': `Set new bindings schemas as`,

'schemaMode.error.message': `The current setting "{currentSetting}" does not match a known option. Please update or remove.`,
Copy link
Member

Choose a reason for hiding this comment

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

This may become a common error message for menus of this nature. We should keep an eye on how often this is repeated. The onIncompatibleSchemaChange fields employ a similar error message.

'schemaMode.options.leaveEmpty.description': `Leave the materialization binding's schema field empty, therefore falling back to the default schema of the materialization.`,

'schemaMode.options.fromSourceName.label': `From Source Name`,
'schemaMode.options.fromSourceName.description': `Use the 2nd-to-last component of the collection name as the schema of the materialization binding.`,
Copy link
Member

Choose a reason for hiding this comment

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

Do you know how 2nd-to-last will be translated?

Copy link
Member Author

Choose a reason for hiding this comment

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

Depends on the language and if they have the concept of numerical ordering.

return Object.hasOwn(schema, Annotations.oAuthProvider);
};
const isOAuthConfig = (schema: JsonSchema): boolean =>
Object.hasOwn(schema, Annotations.oAuthProvider);
Copy link
Member

Choose a reason for hiding this comment

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

Calling out the presence of Object.hasOwn() in the event you would like to replace it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah - I think we might just end up polyfilling it possibly. Like make it the only one off. Cause it'll be easier.

src/stores/Binding/Store.ts Outdated Show resolved Hide resolved
Comment on lines +109 to +111
// Control sourceCapture optional settings
sourceCaptureTargetSchemaSupported: boolean;
sourceCaptureDeltaUpdatesSupported: boolean;
Copy link
Member

Choose a reason for hiding this comment

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

Why were these pieces of state added to the bindings store? If you explained this before the holiday, would you mind jogging my memory?

Copy link
Member Author

Choose a reason for hiding this comment

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

They are settings based on the resource config. Eventually we'll probably be adding support to mass change these settings within the bindings as well.

if (sourceCapture) {
draftSpec.sourceCapture = sourceCapture;
} else {
delete draftSpec.sourceCapture;
Copy link
Member

Choose a reason for hiding this comment

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

Out of curiosity, do you prefer delete to Lodash's omit?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah

});

return (
<Button variant="contained" onClick={close}>
Copy link
Member

Choose a reason for hiding this comment

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

Why use the contained variant for this Cancel button and not one of lesser weight?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy and paste error - it is supposed to be outlined like it is today.

@kiahna-tucker kiahna-tucker added the change:planned This is a planned change label Dec 3, 2024
Copy link
Member

@kiahna-tucker kiahna-tucker left a comment

Choose a reason for hiding this comment

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

Potential Defects

  1. Enter the edit workflow for a materialization without a linked capture, click the Source from Capture CTA, select a capture table row, click the Default schema from source name switch so it is in the on position, click the Continue button, and observe that the summary chip displays an X icon next to Schema Names. This happens regardless of which switch is turn on; the summary chip does not consistently reflect the state of either (or both) settings when turned on in the aforementioned scenario. It should be noted that the summary chip does briefly show the correct state while the form is active, but is reset to the default state when the form returns to an idle state.

  2. Enter the edit workflow for a materialization with a linked capture that has one, sourceCapture setting set, click the Source from Capture CTA, select a different capture table row, and observe that the previously linked capture row is shadow selected (i.e., greyed-out with its checkbox checked).

Additional Comments

  • It does feel a little strange for the backend to cleanup sourceCapture properties with a default value. Presently, there is no benefit to mirroring the backend behavior here; merely wanted to share my reaction for the record.

References

Potential bug 2 | Shadow selected table row

image

@travjenkins
Copy link
Member Author

Pushed fixes - ready for another review ad testing

Copy link
Member

@kiahna-tucker kiahna-tucker left a comment

Choose a reason for hiding this comment

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

Approved with minimal testing of the latest round of changes.

@travjenkins travjenkins merged commit 96749d6 into main Dec 5, 2024
3 checks passed
@travjenkins travjenkins deleted the travjenkins/feature/incompatible-schema-entity-level branch December 5, 2024 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change:planned This is a planned change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants