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 composeWithMongoose from 'graphql-compose-mongoose'; | |
| import { composeWithRelay, fromGlobalId } from 'graphql-compose-relay'; | |
| import { MyModel } from './dbSchema.js'; // mongoose models.. | |
| const mongoOrGlobalIdToMongoId = (_id) => { | |
| let resultId = _id; | |
| if (isString(_id) && !/^[a-fA-F0-9]{24}$/.test(_id)) { | |
| const { type, id } = fromGlobalId(_id); | |
| if (type && /^[a-zA-Z]*$/.test(type)) { | |
| resultId = id; |
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 _ from 'lodash'; | |
| import { WebClient as SlackWebClientCreator } from '@slack/client' | |
| const airtableActivitySlackChannelId = 'C30RWN4JY'; // The Slack ID of the channel | |
| const slackWebClient = new SlackWebClientCreator(process.env.SLACK_API_TOKEN) | |
| const recordFromLinkRegexp = /[^\/]+?$/ // then entire match | |
| const tableFromLinkRegexp = /\/([^\/]+?)\/[^\/]+?$/ // the first capture group | |
| const getSlackChannelHistory = async (channelId, since) => { | |
| return new Promise((res, rej) => { |
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
| { | |
| "text": "Yoad Snapir updated 1 record in table *Images* in Wescover Data Store", | |
| "bot_id": "B30PP75EE", | |
| "attachments": [{ | |
| "author_name": "Yoad Snapir", | |
| "title": "BestImageEver", | |
| "id": 1, | |
| "title_link": "https:\/\/airtable.com\/tblykBG6t4nC3tEGF\/recbEsFKWqHgYdN3X", | |
| "author_icon": "https:\/\/static.airtable.com\/images\/userIcons\/user_icon_4@3x.png", | |
| "color": "faa200", |
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 styles from "./styles.css" | |
| import React from "react" | |
| import { AppBar, Tabs, Tab } from "material-ui" | |
| import { Link } from "react-router" | |
| import { map, addIndex } from "ramda" | |
| import { actions } from "./update" | |
| export const view = ({ data: model, dispatch, children, location, ...props }) => | |
| <div className={styles.root} {...props}> |
NewerOlder