Skip to content

Commit

Permalink
try to get action to run
Browse files Browse the repository at this point in the history
  • Loading branch information
pwolanin committed May 14, 2024
1 parent 6fb754b commit 54ad9ab
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 54 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run lint
# - run: npm run lint
- run: npm run build
- run: npm test
# - run: npm test
- run: npm run e2e-ci
- name: Upload E2E Test Report
uses: actions/upload-artifact@v3
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
"private": true,
"scripts": {
"dev": "vite",
"start": "cross-env NODE_ENV=development webpack-dev-server --host 0.0.0.0 --hot",
"preview": "vite build && vite preview --port 8080",
"build": "vite build",
"test": "jest --testPathIgnorePatterns ./e2e",
"lint": "standard --plugin html 'src/**/*.{js,vue}'",
"e2e": "playwright test",
"e2e-ci": "playwright install --with-deps && playwright test",
"serve-http": "http-server ./public -p 8080",
"preview": "vite preview"
"serve-http": "vite preview --port 8080"
},
"dependencies": {
"@mapbox/leaflet-pip": "^1.1.0",
Expand Down
34 changes: 17 additions & 17 deletions src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ export default class Api {
if (subWard) requestOpts['fields.subWard'] = subWard

return this.client.getEntries(requestOpts)
.then((response) => {
if (response.items.length > 0) {
return simplifyLinkedItems(getFieldsAndId(response.items[0]))
} else {
throw new Error('Ward leader was not found')
}
})
.then((response) => {
if (response.items.length > 0) {
return simplifyLinkedItems(getFieldsAndId(response.items[0]))
} else {
throw new Error('Ward leader was not found')
}
})
}

fetchSampleBallots (ward, subWard, party) {
Expand All @@ -59,7 +59,7 @@ export default class Api {
if (subWard) requestOpts['fields.subWard'] = subWard

return this.client.getEntries(requestOpts)
.then((response) => response.items.map(getFieldsAndId))
.then((response) => response.items.map(getFieldsAndId))
}

fetchCommitteePersons (ward, party) {
Expand All @@ -71,21 +71,21 @@ export default class Api {
}

return this.client.getEntries(requestOpts)
.then((response) => response.items.map(getFieldsAndId))
.then((response) => response.items.map(getFieldsAndId))
}

fetchContentPage (slug) {
return this.client.getEntries({
content_type: 'page',
'fields.slug': slug
})
.then((response) => {
if (response.items.length > 0) {
return getFieldsAndId(response.items[0])
} else {
throw new Error('Page not found')
}
})
.then((response) => {
if (response.items.length > 0) {
return getFieldsAndId(response.items[0])
} else {
throw new Error('Page not found')
}
})
}

fetchWardBoundaries (ward) {
Expand All @@ -95,7 +95,7 @@ export default class Api {
}

fetchCitywideBoundaries () {
const url = `/data/citywide-boundaries.geojson`
const url = '/data/citywide-boundaries.geojson'
return axios.get(url)
.then((response) => response.data)
}
Expand Down
8 changes: 4 additions & 4 deletions src/components/baseball-card/svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function createFront (el, data) {

const photoPattern = photo.toPattern()
.attr({
viewBox: [ photoX, photoY, photoWidth, photoHeight ]
viewBox: [photoX, photoY, photoWidth, photoHeight]
})

// Photo container
Expand Down Expand Up @@ -64,7 +64,7 @@ export function createFront (el, data) {
'text-anchor': 'middle',
'font-family': 'arial',
'font-size': 12,
'fill': config.cardBorderColor
fill: config.cardBorderColor
})

// Ward text line 2
Expand All @@ -74,15 +74,15 @@ export function createFront (el, data) {
'font-family': 'arial',
'font-weight': 'bold',
'font-size': 18,
'fill': config.cardBorderColor
fill: config.cardBorderColor
})

const nameWidth = config.cardWidth - 19
const nameHeight = config.cardHeight - 17
const nameText = svg.text(nameWidth, nameHeight, data.name)
.attr({
'text-anchor': 'end',
'fill': config.cardBorderColor,
fill: config.cardBorderColor,
'font-size': 22,
'font-family': 'Arial'
})
Expand Down
12 changes: 6 additions & 6 deletions src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export async function FETCH_LEADERS (ctx) {
ctx.commit('FETCH_LEADERS_SUCCESS', leaders)
} catch (err) {
logError(err)
ctx.dispatch('NOTIFY', `Failed to retrieve ward leaders`)
ctx.dispatch('NOTIFY', 'Failed to retrieve ward leaders')
}
ctx.commit('END_REQUEST', 'FETCH_LEADERS')
}
Expand All @@ -33,7 +33,7 @@ export async function FETCH_LEADER (ctx, { ward, subWard, party }) {
ctx.commit('FETCH_LEADER_SUCCESS', leader)
} catch (err) {
logError(err)
ctx.dispatch('NOTIFY', `Failed to get information about the ward leader`)
ctx.dispatch('NOTIFY', 'Failed to get information about the ward leader')
}
ctx.commit('END_REQUEST', 'FETCH_LEADER')
}
Expand All @@ -45,7 +45,7 @@ export async function FETCH_SAMPLE_BALLOTS (ctx, { ward, subWard, party }) {
ctx.commit('FETCH_SAMPLE_BALLOTS_SUCCESS', sampleBallots)
} catch (err) {
logError(err)
ctx.dispatch('NOTIFY', `Failed to get sample ballots`)
ctx.dispatch('NOTIFY', 'Failed to get sample ballots')
}
ctx.commit('END_REQUEST', 'FETCH_SAMPLE_BALLOTS')
}
Expand All @@ -57,7 +57,7 @@ export async function FETCH_COMMITTEE_PERSONS (ctx, { ward, subWard, party }) {
ctx.commit('FETCH_COMMITTEE_PERSONS_SUCCESS', committeePersons)
} catch (err) {
logError(err)
ctx.dispatch('NOTIFY', `Failed to get list of committee persons`)
ctx.dispatch('NOTIFY', 'Failed to get list of committee persons')
}
ctx.commit('END_REQUEST', 'FETCH_COMMITTEE_PERSONS')
}
Expand All @@ -81,7 +81,7 @@ export async function FETCH_CITYWIDE_BOUNDARIES (ctx) {
ctx.commit('FETCH_CITYWIDE_BOUNDARIES_SUCCESS', citywideBoundaries)
} catch (err) {
logError(err)
ctx.dispatch('NOTIFY', `Failed to retrieve ward boundaries`)
ctx.dispatch('NOTIFY', 'Failed to retrieve ward boundaries')
}
ctx.commit('END_REQUEST', 'FETCH_CITYWIDE_BOUNDARIES')
}
Expand All @@ -93,7 +93,7 @@ export async function FETCH_CONTENT_PAGE (ctx, slug) {
ctx.commit('FETCH_CONTENT_PAGE_SUCCESS', contentPage)
} catch (err) {
logError(err)
ctx.dispatch('NOTIFY', `Failed to retrieve content`)
ctx.dispatch('NOTIFY', 'Failed to retrieve content')
}
ctx.commit('END_REQUEST', 'FETCH_CONTENT_PAGE')
}
Expand Down
2 changes: 1 addition & 1 deletion src/store/mutations.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function FETCH_CONTENT_PAGE_SUCCESS (state, contentPage) {
}

export function ADD_NOTIFICATION (state, notification) {
state.notifications[notification.id] = notification
state.notifications[notification.id] = notification
}

export function REMOVE_NOTIFICATION (state, id) {
Expand Down
6 changes: 3 additions & 3 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function ordinalize (value) {

export function slugify (value) {
return value.toString().toLowerCase().trim()
.replace(/[^a-zA-Z0-9]/g, '-') // Replace non-alphanumeric chars with -
.replace(/--+/g, '-') // Replace multiple - with single -
.replace(/^-|-$/i, '') // Remove leading/trailing hyphen
.replace(/[^a-zA-Z0-9]/g, '-') // Replace non-alphanumeric chars with -
.replace(/--+/g, '-') // Replace multiple - with single -
.replace(/^-|-$/i, '') // Remove leading/trailing hyphen
}
10 changes: 5 additions & 5 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
const path = require("path")
const path = require('path')

// https://vitejs.dev/config/
export default defineConfig({
resolve: {
alias: {
'node_modules': path.resolve(__dirname, 'node_modules')
node_modules: path.resolve(__dirname, 'node_modules')
}
},
css: {
preprocessorOptions: {
scss: {
includePaths: [path.join(__dirname, 'node_modules')],
additionalData: `@import "node_modules/bulma/sass/utilities/initial-variables.sass";`
additionalData: '@import "node_modules/bulma/sass/utilities/initial-variables.sass";'
}
}
},
build: {
outDir:"./build"
outDir: './build'
},
plugins: [vue()],
plugins: [vue()]
})
26 changes: 13 additions & 13 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const path = require('path')
const webpack = require('webpack')

module.exports = {
entry: [ 'babel-polyfill', './src/main.js' ],
entry: ['babel-polyfill', './src/main.js'],
output: {
path: path.resolve(__dirname, './public'),
publicPath: '/',
Expand All @@ -12,15 +12,15 @@ module.exports = {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
loader: 'vue-loader'
},
{
test: /\.scss$/,
use: [
'vue-style-loader',
'css-loader',
'sass-loader'
]
test: /\.scss$/,
use: [
'vue-style-loader',
'css-loader',
'sass-loader'
]
},
{
test: /\.sass$/,
Expand All @@ -37,7 +37,7 @@ module.exports = {
}
}
]
},
},
{
test: /\.js$/,
loader: 'babel-loader',
Expand All @@ -55,9 +55,9 @@ module.exports = {
loader: 'imports-loader',
options: {
wrapper: {
thisArg:'window',
args:{
fix:module.exports=0
thisArg: 'window',
args: {
fix: module.exports = 0
}
}
}
Expand All @@ -66,7 +66,7 @@ module.exports = {
},
resolve: {
alias: {
'vue$': 'vue/dist/vue.runtime.esm-bundler.js',
vue$: 'vue/dist/vue.runtime.esm-bundler.js',
snapsvg: 'snapsvg/dist/snap.svg.js'
}
},
Expand Down

0 comments on commit 54ad9ab

Please sign in to comment.