Skip to content

Commit

Permalink
Bypass trial storage evaluation for bound collections in capture work…
Browse files Browse the repository at this point in the history
…flows (#1475)

* Bypass trial storage evaluation in capture workflows

* Bypass trial storage evaluation in backfill button click handler

* Prevent trial storage alert from appearing outside of materialization workflows
  • Loading branch information
kiahna-tucker authored Feb 25, 2025
1 parent 569bb86 commit 348e373
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
29 changes: 16 additions & 13 deletions src/components/editor/Bindings/Backfill/BackfillButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,20 +162,22 @@ function BackfillButton({

setBackfilledBindings(increment, targetBindingUUID);

evaluateTrialCollections(
changes.counterIncremented
).then(
(response) => {
setCollectionMetadata(response, []);
},
() => {}
);

if (hasLength(changes.counterDecremented)) {
setSourceBackfillRecommended(
changes.counterDecremented,
false
if (workflow === 'materialization_edit') {
evaluateTrialCollections(
changes.counterIncremented
).then(
(response) => {
setCollectionMetadata(response, []);
},
() => {}
);

if (hasLength(changes.counterDecremented)) {
setSourceBackfillRecommended(
changes.counterDecremented,
false
);
}
}

setFormState({ status: FormStatus.UPDATED });
Expand Down Expand Up @@ -204,6 +206,7 @@ function BackfillButton({
setFormState,
setSourceBackfillRecommended,
updateBackfillCounter,
workflow,
]
);

Expand Down
4 changes: 3 additions & 1 deletion src/components/materialization/TrialOnlyPrefixAlert.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Typography } from '@mui/material';
import AlertBox from 'components/shared/AlertBox';
import { useEntityType } from 'context/EntityContext';
import { useIntl } from 'react-intl';
import { TrialOnlyPrefixAlertProps } from './types';

Expand All @@ -8,8 +9,9 @@ export default function TrialOnlyPrefixAlert({
triggered,
}: TrialOnlyPrefixAlertProps) {
const intl = useIntl();
const entityType = useEntityType();

if (!triggered) {
if (entityType !== 'materialization' || !triggered) {
return null;
}

Expand Down
5 changes: 4 additions & 1 deletion src/stores/Binding/Store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ const getInitialState = (

const boundCollections = Object.keys(get().bindings);

if (hasLength(boundCollections)) {
if (
entityType === 'materialization' &&
hasLength(boundCollections)
) {
const trialCollections = await evaluateTrialCollections(
boundCollections,
getTrialOnlyPrefixes
Expand Down

0 comments on commit 348e373

Please sign in to comment.