This file contains hidden or 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
return data.results[0].result.map((result) => { | |
return { | |
key: result.breakdown_value, | |
value: result.aggregated_value | |
} | |
}) |
This file contains hidden or 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
return data.results[0].result[0].data.map((value, index) => { | |
const label = data.results[0].result[0].labels[index]; | |
return { | |
label, | |
value | |
} | |
}) |
This file contains hidden or 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
const keys = ['member_count', 'total_contacts', 'unsubscribe_count', 'open_rate'] | |
return Object.keys(data.stats).filter((key) => keys.includes(key)).map((key) => { | |
const value = data.stats[key] | |
return { | |
key, | |
value | |
} | |
}) |
This file contains hidden or 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
version: '2' | |
services: | |
api: | |
image: tryretool/backend:latest | |
env_file: ./stack.env | |
environment: | |
- SERVICE_TYPE=MAIN_BACKEND | |
- DB_CONNECTOR_HOST=http://db-connector | |
- DB_CONNECTOR_PORT=3002 | |
- DB_SSH_CONNECTOR_HOST=http://db-ssh-connector |
This file contains hidden or 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
import { convertHexColorToRgbColor } from '@create-figma-plugin/utilities' | |
function setFillColourForNodes(colourHex) { | |
const nodes = figma.currentPage.children.slice() | |
const fillRgb = convertHexColorToRgbColor(colourHex) | |
nodes.map(node => { | |
if ('fill' in node) { | |
const clonedFill = JSON.parse(JSON.stringify(node.fills)) | |
clonedFill.map(fill => fill.color = fillRgb) | |
node.fills = clonedFill |
This file contains hidden or 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
// main.ts | |
import { emit, on, showUI } from '@create-figma-plugin/utilities' | |
export default function () { | |
on('RESET_SELECTION', () => { | |
figma.currentPage.selection = [] | |
}) | |
figma.on('selectionchange', () => { | |
const nodes = figma.currentPage.selection.map(node => ({ id: node.id, name: node.name })) | |
emit('UPDATE_SELECTION', nodes) |
This file contains hidden or 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
""" | |
Input looks like | |
{ | |
"where": { | |
"id": "ID of the node to delete" | |
} | |
} | |
""" | |
mutation Mutation($where: TestWhere) { | |
deleteTests(where: $where) { |
This file contains hidden or 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
""" | |
Arguments look like | |
{ | |
"where": { | |
"id": "ID of the node to update" | |
}, | |
"update": { | |
"userStories": [ | |
{ | |
"disconnect": [ |
This file contains hidden or 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
""" | |
Arguments look like | |
{ | |
"where": { | |
"id": "ID of the node to update" | |
}, | |
"update": { | |
"userStories": [ | |
{ |
This file contains hidden or 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
""" | |
Arguments look like | |
{ | |
"where": { | |
"id": "ID of the node to update" | |
}, | |
"update": { | |
"name": "Updated test" | |
} | |
} |