Skip to content

Commit

Permalink
NIFI-13100:
Browse files Browse the repository at this point in the history
- Updating API response error handling for canvas based actions.
  • Loading branch information
mcgilman committed Apr 25, 2024
1 parent 335f08e commit 43041f8
Show file tree
Hide file tree
Showing 20 changed files with 286 additions and 211 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,8 @@ export class DraggableBehavior {
},
restoreOnFailure: {
position: d.position
}
},
errorStrategy: 'snackbar'
};
}

Expand Down Expand Up @@ -361,7 +362,8 @@ export class DraggableBehavior {
},
restoreOnFailure: {
bends: connection.bends
}
},
errorStrategy: 'snackbar'
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,8 @@ export class CanvasContextMenu implements ContextMenuDefinitionProvider {
id: d.id,
uri: d.uri,
type: d.type,
revision: this.client.getRevision(d)
revision: this.client.getRevision(d),
errorStrategy: 'snackbar'
});
});
this.store.dispatch(
Expand Down Expand Up @@ -640,7 +641,8 @@ export class CanvasContextMenu implements ContextMenuDefinitionProvider {
id: d.id,
uri: d.uri,
type: d.type,
revision: this.client.getRevision(d)
revision: this.client.getRevision(d),
errorStrategy: 'snackbar'
});
});
this.store.dispatch(
Expand Down Expand Up @@ -710,7 +712,8 @@ export class CanvasContextMenu implements ContextMenuDefinitionProvider {
id: d.id,
uri: d.uri,
type: d.type,
revision: this.client.getRevision(d)
revision: this.client.getRevision(d),
errorStrategy: 'snackbar'
});
});
this.store.dispatch(
Expand Down Expand Up @@ -741,7 +744,8 @@ export class CanvasContextMenu implements ContextMenuDefinitionProvider {
id: d.id,
uri: d.uri,
type: d.type,
revision: this.client.getRevision(d)
revision: this.client.getRevision(d),
errorStrategy: 'snackbar'
});
});
this.store.dispatch(
Expand All @@ -768,7 +772,8 @@ export class CanvasContextMenu implements ContextMenuDefinitionProvider {
id: d.id,
uri: d.uri,
type: d.type,
revision: this.client.getRevision(d)
revision: this.client.getRevision(d),
errorStrategy: 'snackbar'
});
});

Expand Down Expand Up @@ -796,7 +801,8 @@ export class CanvasContextMenu implements ContextMenuDefinitionProvider {
id: d.id,
uri: d.uri,
type: d.type,
revision: this.client.getRevision(d)
revision: this.client.getRevision(d),
errorStrategy: 'snackbar'
});
});
this.store.dispatch(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,8 @@ export class ConnectionManager {
disconnectedNodeAcknowledged: this.clusterConnectionService.isDisconnectionAcknowledged(),
component: connection
},
restoreOnFailure: restoreOnFailure
restoreOnFailure: restoreOnFailure,
errorStrategy: 'snackbar'
};

// updateConnection is not needed here because we don't need any
Expand Down Expand Up @@ -2012,7 +2013,8 @@ export class ConnectionManager {
type: ComponentType.Connection,
uri: connectionData.uri,
previousDestination: connectionData.component.destination,
payload
payload,
errorStrategy: 'snackbar'
}
})
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ export class LabelManager {
different = true;
}

// only save the updated bends if necessary
// only save the updated dimensions if necessary
if (different) {
const updateLabel: UpdateComponentRequest = {
id: labelData.id,
Expand All @@ -368,7 +368,8 @@ export class LabelManager {
width: widthSet ? labelData.component.width : LabelManager.INITIAL_WIDTH,
height: heightSet ? labelData.component.height : LabelManager.INITIAL_HEIGHT
}
}
},
errorStrategy: 'snackbar'
};

self.store.dispatch(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,6 @@ export const loadChildProcessGroupSuccess = createAction(
props<{ response: ComponentEntity }>()
);

export const flowApiError = createAction(`${CANVAS_PREFIX} Flow Api Error`, props<{ error: string }>());

export const clearFlowApiError = createAction(`${CANVAS_PREFIX} Clear Flow Api Error`);

export const startProcessGroupPolling = createAction(`${CANVAS_PREFIX} Start Process Group Polling`);

export const stopProcessGroupPolling = createAction(`${CANVAS_PREFIX} Stop Process Group Polling`);
Expand Down Expand Up @@ -766,11 +762,6 @@ export const saveToFlowRegistrySuccess = createAction(
props<{ response: VersionControlInformationEntity }>()
);

export const flowVersionBannerError = createAction(
`${CANVAS_PREFIX} Flow Version Banner Error`,
props<{ error: string }>()
);

export const stopVersionControlRequest = createAction(
`${CANVAS_PREFIX} Stop Version Control Request`,
props<{ request: ConfirmStopVersionControlRequest }>()
Expand All @@ -788,6 +779,8 @@ export const stopVersionControlSuccess = createAction(

export const flowSnackbarError = createAction(`${CANVAS_PREFIX} Flow Snackbar Error`, props<{ error: string }>());

export const flowBannerError = createAction(`${CANVAS_PREFIX} Flow Banner Error`, props<{ error: string }>());

export const openShowLocalChangesDialogRequest = createAction(
`${CANVAS_PREFIX} Open Show Local Changes Dialog Request`,
props<{ request: OpenLocalChangesDialogRequest }>()
Expand Down

0 comments on commit 43041f8

Please sign in to comment.