Skip to content

Commit

Permalink
Merge pull request #930 from OpenSourceFellows/davidchapuis-tuolumne-…
Browse files Browse the repository at this point in the history
…update

modified merge variables in Tuolumne template
  • Loading branch information
breton16 authored Jun 6, 2024
2 parents ec71bb2 + 1401fb3 commit 63fd354
Show file tree
Hide file tree
Showing 14 changed files with 171 additions and 131 deletions.
18 changes: 9 additions & 9 deletions .docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
version: "2.24"
version: '2.24'

services:
amplify:
container_name: "amplify_app"
container_name: 'amplify_app'
build:
context: ../
dockerfile: .docker/Dockerfile
environment:
- POSTGRES_HOST=amplify_db
ports:
ports:
- 8080:8080
volumes:
- type: bind
source: "../"
target: "/src/amplify"
source: '../'
target: '/src/amplify'
command: sleep infinity
networks:
networks:
- amplify_dev
depends_on:
- amplify_db

amplify_db:
container_name: "amplify_db"
container_name: 'amplify_db'
image: postgres:latest
volumes:
- amplify_pg:/var/lib/postgresql/data
Expand All @@ -37,7 +37,7 @@ services:
networks:
- amplify_dev
healthcheck:
test: ["CMD", "pg_isready"]
test: ['CMD', 'pg_isready']
interval: 1m30s
timeout: 30s
retries: 5
Expand All @@ -47,4 +47,4 @@ volumes:
amplify_pg:

networks:
amplify_dev:
amplify_dev:
2 changes: 1 addition & 1 deletion .github/workflows/get-originaltime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

- name: Send time
if: contains(join(github.event.issue.labels.*.name, ','), 'originaltime-')
env:
env:
LABELS: ${{ toJson(github.event.issue.labels) }}
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
NOTION_DATABASE_ID: ${{ secrets.NOTION_DATABASE_ID }}
Expand Down
12 changes: 5 additions & 7 deletions roiScript/send-metrics.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ async function updateNotionDatabase() {
equals: parsedIssueId
}
}
});
})

console.log('response', response);
console.log('response', response)

// const pageId = response.results[0].id;
// const pageProperties = response.results[0].properties;
Expand All @@ -86,13 +86,13 @@ async function updateNotionDatabase() {
// properties: pageProperties
// });
} catch (error) {
console.error('Error updating data in Notion:', error);
console.error('Error updating data in Notion:', error)
}
}

updateNotionDatabase();
updateNotionDatabase()

// ---
// ---

// previous version
// mock data to test the connection
Expand Down Expand Up @@ -136,5 +136,3 @@ updateNotionDatabase();
// }

// addToNotionDatabase()


6 changes: 4 additions & 2 deletions roiScript/send-time.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ labels interface (filtered labels that contain `originaltime-`):
*/

// TODO: fix the unsupported engine error
// TODO: send the original time to the Notion DB
// TODO: send the original time to the Notion DB
const labelObjects = process.env.LABELS
const NOTION_TOKEN = process.env.NOTION_TOKEN
const NOTION_DATABASE_ID = process.env.NOTION_DATABASE_ID

const parsedLabels = JSON.parse(labelObjects)
const targetLabel = parsedLabels.find(item => item.name.startsWith('originaltime-'))
const targetLabel = parsedLabels.find((item) =>
item.name.startsWith('originaltime-')
)
const targetLabelName = targetLabel.name
const labelArr = targetLabelName.split('-')
const targetDuration = +labelArr[1]
Expand Down
45 changes: 26 additions & 19 deletions script/stringify.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@ const reps = JSON.stringify([
address_state: 'CA',
address_zip: '94102',
address_country: 'US',
email: '[email protected]',
email: '[email protected]'
},
{
name: 'Catherine Stefani',
title: 'District 2 Supervisor',
photoUrl: 'https://sfbos.org/sites/default/files/Supervisor_Stefani_2018.jpg',
photoUrl:
'https://sfbos.org/sites/default/files/Supervisor_Stefani_2018.jpg',
address_line1: '1 Dr Carlton B Goodlett Pl',
address_line2: '#244',
address_city: 'San Francisco',
address_state: 'CA',
address_zip: '94102',
address_country: 'US',
email: '[email protected]',
email: '[email protected]'
},
{
name: 'Aaron Peskin',
Expand All @@ -33,7 +34,7 @@ const reps = JSON.stringify([
address_state: 'CA',
address_zip: '94102',
address_country: 'US',
email: '[email protected]',
email: '[email protected]'
},
{
name: 'Joel Engardio',
Expand All @@ -45,7 +46,7 @@ const reps = JSON.stringify([
address_state: 'CA',
address_zip: '94102',
address_country: 'US',
email: '',
email: ''
},
{
name: 'Dean Preston',
Expand All @@ -57,7 +58,7 @@ const reps = JSON.stringify([
address_state: 'CA',
address_zip: '94102',
address_country: 'US',
email: '[email protected]',
email: '[email protected]'
},
{
name: 'Matt Dorsey',
Expand All @@ -69,7 +70,7 @@ const reps = JSON.stringify([
address_state: 'CA',
address_zip: '94102',
address_country: 'US',
email: '[email protected]',
email: '[email protected]'
},
{
name: 'Myrna Melgar',
Expand All @@ -81,19 +82,20 @@ const reps = JSON.stringify([
address_state: 'CA',
address_zip: '94102',
address_country: 'US',
email: '[email protected]',
email: '[email protected]'
},
{
name: 'Rafael Mandelman',
title: 'District 8 Supervisor',
photoUrl: 'https://sfbos.org/sites/default/files/Supervisor_Mandelman_2018.jpg',
photoUrl:
'https://sfbos.org/sites/default/files/Supervisor_Mandelman_2018.jpg',
address_line1: '1 Dr Carlton B Goodlett Pl',
address_line2: '#244',
address_city: 'San Francisco',
address_state: 'CA',
address_zip: '94102',
address_country: 'US',
email: '[email protected]',
email: '[email protected]'
},
{
name: 'Hillary Ronen',
Expand All @@ -105,7 +107,7 @@ const reps = JSON.stringify([
address_state: 'CA',
address_zip: '94102',
address_country: 'US',
email: '[email protected]',
email: '[email protected]'
},
{
name: 'Shamann Walton',
Expand All @@ -117,7 +119,7 @@ const reps = JSON.stringify([
address_state: 'CA',
address_zip: '94102',
address_country: 'US',
email: '[email protected]',
email: '[email protected]'
},
{
name: 'Ahsha Safai',
Expand All @@ -129,17 +131,22 @@ const reps = JSON.stringify([
address_state: 'CA',
address_zip: '94102',
address_country: 'US',
email: '[email protected]',
email: '[email protected]'
}
])

const assets = JSON.stringify({
campaign_logo: 'https://images.squarespace-cdn.com/content/v1/5eebc0039b04b54b2fb0ce52/1598500758914-E5HAIIGCP0ZXKKMN2FT0/TRT+Logo-13.png?format=500w',
campaign_background: 'https://images.squarespace-cdn.com/content/v1/5eebc0039b04b54b2fb0ce52/1610135975708-FV42Q30BPWF887M05O51/Poppies-13.jpg?format=1500w',
'campaign-img-1': 'https://images.squarespace-cdn.com/content/v1/5eebc0039b04b54b2fb0ce52/1609785926325-63M9MY247ORIL8ON8P5E/tuolumne-camp-960x540.jpg?format=1500w',
'campaign-img-2': 'https://images.squarespace-cdn.com/content/v1/5eebc0039b04b54b2fb0ce52/1592586646372-TBY3WC065NJ04KT2B38Z/000091400001.jpg?format=1500w',
'campaign-img-3': 'https://images.squarespace-cdn.com/content/v1/5eebc0039b04b54b2fb0ce52/1609781359705-Q5YNFL6DET5ORHW62ZU7/IMG_2249_WEBSITE+copy.jpg?format=1500w',
campaign_logo:
'https://images.squarespace-cdn.com/content/v1/5eebc0039b04b54b2fb0ce52/1598500758914-E5HAIIGCP0ZXKKMN2FT0/TRT+Logo-13.png?format=500w',
campaign_background:
'https://images.squarespace-cdn.com/content/v1/5eebc0039b04b54b2fb0ce52/1610135975708-FV42Q30BPWF887M05O51/Poppies-13.jpg?format=1500w',
'campaign-img-1':
'https://images.squarespace-cdn.com/content/v1/5eebc0039b04b54b2fb0ce52/1609785926325-63M9MY247ORIL8ON8P5E/tuolumne-camp-960x540.jpg?format=1500w',
'campaign-img-2':
'https://images.squarespace-cdn.com/content/v1/5eebc0039b04b54b2fb0ce52/1592586646372-TBY3WC065NJ04KT2B38Z/000091400001.jpg?format=1500w',
'campaign-img-3':
'https://images.squarespace-cdn.com/content/v1/5eebc0039b04b54b2fb0ce52/1609781359705-Q5YNFL6DET5ORHW62ZU7/IMG_2249_WEBSITE+copy.jpg?format=1500w'
})

console.log(reps)
console.log(assets)
console.log(assets)
4 changes: 1 addition & 3 deletions server/db/models/letter-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ class LetterVersion extends BaseModel {
municipality: {
anyOf: [{ type: 'string', minLength: 1 }, { type: 'null' }]
},
mergeVariables: {

}
mergeVariables: {}
}
}
}
Expand Down
Loading

0 comments on commit 63fd354

Please sign in to comment.