feat(core): block workflow update on interim change (#4374)

*  Add `updatedAt` to store

*  Set `updatedAt` in store

* 👕 Update FE types

* 👕 Update BE types

*  Set `updatedAt` on workflow open

*  Add endpoint check

*  Add first update check

* 🔥 Remove log

*  Simplify check

*  Make `makeWorkflow` more flexible

* 🗃️ Make `updatedAt` default consistent

* 🧪 Adjust tests checking for `updatedAt`

* 🧪 Add tests for interim changes block

* ✏️ Remove unneeded quotes

*  Simplify without using `-1`

* 👕 Simplify interfaces
This commit is contained in:
Iván Ovejero
2022-10-20 15:30:44 +02:00
committed by GitHub
parent 2f87b9fbf6
commit e83b9bd983
8 changed files with 116 additions and 8 deletions

View File

@@ -706,10 +706,7 @@ export const emptyPackage = () => {
// workflow
// ----------------------------------
export function makeWorkflow({
withPinData,
withCredential,
}: {
export function makeWorkflow(options?: {
withPinData: boolean;
withCredential?: { id: string; name: string };
}) {
@@ -724,9 +721,9 @@ export function makeWorkflow({
position: [740, 240],
};
if (withCredential) {
if (options?.withCredential) {
node.credentials = {
spotifyApi: withCredential,
spotifyApi: options.withCredential,
};
}
@@ -735,7 +732,7 @@ export function makeWorkflow({
workflow.connections = {};
workflow.nodes = [node];
if (withPinData) {
if (options?.withPinData) {
workflow.pinData = MOCK_PINDATA;
}