forked from AutomaApp/automa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
72 changed files
with
1,570 additions
and
833 deletions.
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
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
38 changes: 38 additions & 0 deletions
38
src/background/workflow-engine/blocks-handler/handler-delete-data.js
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,38 @@ | ||
import { getBlockConnection } from '../helper'; | ||
|
||
function deleteData({ data, outputs }) { | ||
return new Promise((resolve) => { | ||
data.deleteList.forEach((item) => { | ||
if (item.type === 'table') { | ||
if (item.columnId === '[all]') { | ||
this.engine.referenceData.table = []; | ||
this.engine.columns = { | ||
column: { index: 0, name: 'column', type: 'any' }, | ||
}; | ||
} else { | ||
const columnName = this.engine.columns[item.columnId].name; | ||
|
||
this.engine.referenceData.table.forEach((_, index) => { | ||
const row = this.engine.referenceData.table[index]; | ||
delete row[columnName]; | ||
|
||
if (!row || Object.keys(row).length === 0) { | ||
this.engine.referenceData.table[index] = {}; | ||
} | ||
}); | ||
|
||
this.engine.columns[item.columnId].index = 0; | ||
} | ||
} else if (item.variableName) { | ||
delete this.engine.referenceData.variables[item.variableName]; | ||
} | ||
}); | ||
|
||
resolve({ | ||
data: '', | ||
nextBlockId: getBlockConnection({ outputs }), | ||
}); | ||
}); | ||
} | ||
|
||
export default deleteData; |
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
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
23 changes: 23 additions & 0 deletions
23
src/background/workflow-engine/blocks-handler/handler-reload-tab.js
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,23 @@ | ||
import browser from 'webextension-polyfill'; | ||
import { getBlockConnection } from '../helper'; | ||
|
||
export async function reloadTab({ outputs }) { | ||
const nextBlockId = getBlockConnection({ outputs }); | ||
|
||
try { | ||
if (!this.activeTab.id) throw new Error('no-tab'); | ||
|
||
await browser.tabs.reload(this.activeTab.id); | ||
|
||
return { | ||
data: '', | ||
nextBlockId, | ||
}; | ||
} catch (error) { | ||
error.nextBlockId = nextBlockId; | ||
|
||
throw error; | ||
} | ||
} | ||
|
||
export default reloadTab; |
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
Oops, something went wrong.