-
Notifications
You must be signed in to change notification settings - Fork 2
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
Relocate advanced materialization settings in workflows #1417
Merged
travjenkins
merged 12 commits into
main
from
kiahna-tucker/workflows/obscure-advanced-materialization-settings
Jan 21, 2025
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
31dcd68
Relocate advanced materialization settings in workflows
kiahna-tucker 7343abd
Enlarge advanced options section header in binding selector
kiahna-tucker c7722b5
Bundle binding advanced options section in component
kiahna-tucker a4ccf75
Provide indication of time travel form validation error
kiahna-tucker 317a84a
Provide indication of binding-level incompatible schema field validat…
kiahna-tucker b38af26
Provide indication of spec-level incompatible schema field validation…
kiahna-tucker 4056eb6
Remove error icon from binding advanced options header
kiahna-tucker 120036d
Update the Source Collection section description for edit workflow
kiahna-tucker e739b34
Hide binding-level backfill section in materialization create workflow
kiahna-tucker f731dc9
Merge branch 'main' into kiahna-tucker/workflows/obscure-advanced-mat…
kiahna-tucker 60b03f5
Move specification-level advanced opts out of backfill section
kiahna-tucker 27598ba
Merge branch 'main' into kiahna-tucker/workflows/obscure-advanced-mat…
travjenkins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import { Stack, Typography } from '@mui/material'; | ||
import WrapperWithHeader from 'components/shared/Entity/WrapperWithHeader'; | ||
import ErrorBoundryWrapper from 'components/shared/ErrorBoundryWrapper'; | ||
import { useEntityType } from 'context/EntityContext'; | ||
import { useIntl } from 'react-intl'; | ||
import { useBindingStore } from 'stores/Binding/Store'; | ||
import OnIncompatibleSchemaChange from '../OnIncompatibleSchemaChange'; | ||
import TimeTravel from '../TimeTravel'; | ||
import { AdvancedOptionsProps } from './types'; | ||
|
||
export default function AdvancedOptions({ | ||
bindingIndex, | ||
bindingUUID, | ||
collectionName, | ||
}: AdvancedOptionsProps) { | ||
const intl = useIntl(); | ||
|
||
const entityType = useEntityType(); | ||
|
||
const fullSourceErrorExists = useBindingStore((state) => { | ||
const fullSourceErrors = state.fullSourceConfigs[bindingUUID]?.errors; | ||
|
||
if (!fullSourceErrors) { | ||
return false; | ||
} | ||
|
||
return fullSourceErrors.length > 0; | ||
}); | ||
|
||
const onIncompatibleSchemaChangeErrorExists = useBindingStore( | ||
(state) => state.onIncompatibleSchemaChangeErrorExists.binding | ||
); | ||
|
||
if (entityType !== 'materialization') { | ||
return null; | ||
} | ||
|
||
return ( | ||
<WrapperWithHeader | ||
forceOpen={ | ||
fullSourceErrorExists || onIncompatibleSchemaChangeErrorExists | ||
} | ||
header={ | ||
<Typography variant="formSectionHeader"> | ||
{intl.formatMessage({ | ||
id: 'workflows.advancedSettings.title', | ||
})} | ||
</Typography> | ||
} | ||
hideBorder | ||
mountClosed | ||
> | ||
<Stack spacing={4}> | ||
<ErrorBoundryWrapper> | ||
<OnIncompatibleSchemaChange bindingIndex={bindingIndex} /> | ||
</ErrorBoundryWrapper> | ||
|
||
<TimeTravel | ||
bindingUUID={bindingUUID} | ||
collectionName={collectionName} | ||
/> | ||
</Stack> | ||
</WrapperWithHeader> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export interface AdvancedOptionsProps { | ||
bindingIndex: number; | ||
bindingUUID: string; | ||
collectionName: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { Box, Typography } from '@mui/material'; | ||
import WrapperWithHeader from 'components/shared/Entity/WrapperWithHeader'; | ||
import ErrorBoundryWrapper from 'components/shared/ErrorBoundryWrapper'; | ||
import { useEntityType } from 'context/EntityContext'; | ||
import { useIntl } from 'react-intl'; | ||
import { useBindingStore } from 'stores/Binding/Store'; | ||
import OnIncompatibleSchemaChange from './OnIncompatibleSchemaChange'; | ||
|
||
export default function AdvancedOptions() { | ||
const intl = useIntl(); | ||
|
||
const entityType = useEntityType(); | ||
|
||
const onIncompatibleSchemaChangeErrorExists = useBindingStore( | ||
(state) => state.onIncompatibleSchemaChangeErrorExists.spec | ||
); | ||
|
||
if (entityType !== 'materialization') { | ||
return null; | ||
} | ||
|
||
return ( | ||
<Box style={{ maxWidth: 850 }}> | ||
<WrapperWithHeader | ||
forceOpen={onIncompatibleSchemaChangeErrorExists} | ||
header={ | ||
<Typography variant="formSectionHeader"> | ||
{intl.formatMessage({ | ||
id: 'workflows.advancedSettings.title', | ||
})} | ||
</Typography> | ||
} | ||
hideBorder | ||
mountClosed | ||
> | ||
<ErrorBoundryWrapper> | ||
<OnIncompatibleSchemaChange /> | ||
</ErrorBoundryWrapper> | ||
</WrapperWithHeader> | ||
</Box> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -164,6 +164,7 @@ const getInitialMiscData = (): Pick< | |
| 'discoveredCollections' | ||
| 'evolvedCollections' | ||
| 'onIncompatibleSchemaChange' | ||
| 'onIncompatibleSchemaChangeErrorExists' | ||
| 'rediscoveryRequired' | ||
| 'resourceConfigErrorsExist' | ||
| 'resourceConfigErrors' | ||
|
@@ -185,6 +186,10 @@ const getInitialMiscData = (): Pick< | |
discoveredCollections: [], | ||
evolvedCollections: [], | ||
onIncompatibleSchemaChange: undefined, | ||
onIncompatibleSchemaChangeErrorExists: { | ||
binding: false, | ||
spec: false, | ||
}, | ||
rediscoveryRequired: false, | ||
resourceConfigErrorsExist: false, | ||
resourceConfigErrors: [], | ||
|
@@ -926,6 +931,16 @@ const getInitialState = ( | |
); | ||
}, | ||
|
||
setOnIncompatibleSchemaChangeErrorExists: (value, key) => { | ||
set( | ||
produce((state: BindingState) => { | ||
state.onIncompatibleSchemaChangeErrorExists[key] = value; | ||
}), | ||
false, | ||
'On Incompatible Schema Change Error Exists Set' | ||
); | ||
}, | ||
Comment on lines
+934
to
+942
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
setResourceSchema: async (val) => { | ||
const resolved = await getDereffedSchema(val); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 not need to change for this PR... but I think it would be safe to put these two into a single
shallow
call. I think that might help reduce how often these might change.