Skip to content

Commit

Permalink
tests push to testing folder
Browse files Browse the repository at this point in the history
  • Loading branch information
ajrothwell committed Jan 2, 2025
1 parent 37019de commit d9a3655
Show file tree
Hide file tree
Showing 7 changed files with 178 additions and 124 deletions.
2 changes: 2 additions & 0 deletions .env.testing
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VITE_PUBLICPATH=/testing/obme/resources/
VITE_DEBUG=true
40 changes: 40 additions & 0 deletions .github/workflows/testing_push_to_s3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: testing Push to S3

on:
push:
branches:
- vue3-pinboard

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: '20.x'
cache: 'npm'

- name: npm install, and build
run: |
printf "@fortawesome:registry=https://npm.fontawesome.com/\n//npm.fontawesome.com/:_authToken=${FONTAWESOME_NPM_AUTH_TOKEN}" >> ~/.npmrc
npm ci
npm run build:testing
env:
FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.FA_AUTH_TOKEN }}

- name: Deploy to Dev s3, Set index headers
env:
AWS_DEFAULT_REGION: 'us-east-1'
AWS_S3_BUCKET: phila-resource-finder-v2/testing/obme/resources/
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
aws s3 sync dist s3://$AWS_S3_BUCKET --region us-east-1 --delete
aws s3 cp s3://$AWS_S3_BUCKET s3://$AWS_S3_BUCKET --recursive --exclude "*" --include "*.html" --metadata-directive REPLACE --acl public-read --cache-control max-age=0,no-cache,no-store,must-revalidate,proxy-revalidate,public --expires "0" --content-type "text/html; charset=utf-8"
32 changes: 19 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"private": true,
"scripts": {
"dev": "vite",
"test": "vite --mode=testing",
"build": "vite build",
"build:testing": "vite build --mode=testing",
"preview": "vite preview",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore"
},
Expand All @@ -16,7 +18,7 @@
"@fortawesome/pro-regular-svg-icons": "^6.6.0",
"@fortawesome/pro-solid-svg-icons": "^6.6.0",
"@phila/phila-ui-core": "^1.0.18",
"@phila/pinboard": "^2.0.66",
"@phila/pinboard": "^2.0.79",
"unplugin-auto-import": "^0.18.3",
"unplugin-vue-router": "^0.10.8"
},
Expand Down
131 changes: 64 additions & 67 deletions src/components/ExpandCollapseContent.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,52 @@
<script setup>
// import SharedFunctions from '@phila/pinboard/src/components/mixins/SharedFunctions.vue';
// import PrintShareSection from '@phila/pinboard/src/components/PrintShareSection';
const props = defineProps({
item: {
type: Object,
default: function(){
return {};
},
},
});
// methods
const parseAddress = (address) => {
const formattedAddress = address.replace(/(Phila.+)/g, city => `<div>${city}</div>`).replace(/^\d+\s[A-z]+\s[A-z]+/g, lineOne => `<div>${lineOne}</div>`).replace(/,/, '');
return formattedAddress;
};
const makeValidUrl = (url) => {
let newUrl = window.decodeURIComponent(url);
newUrl = newUrl
.trim()
.replace(/\s/g, '');
if (/^(:\/\/)/.test(newUrl)) {
return `http${newUrl}`;
}
if (!/^(f|ht)tps?:\/\//i.test(newUrl)) {
return `http://${newUrl}`;
}
return newUrl;
};
const parseServiceList = (list) => {
const formattedService = list;
return formattedService;
};
const parseTagsList = (list) => {
const formattedTags = list.toLowerCase();
console.log('parseTagsList is running, list:', list, 'formattedTags:', formattedTags);
// const formattedTags = list.slice().sort().join(", ");
return formattedTags;
};
</script>

<template>
<div :class="isMobile ? 'main-content-mobile' : 'main-content'">
<print-share-section
Expand All @@ -7,46 +56,46 @@
<div class="columns top-section">
<div class="column is-6">
<div
v-if="item.attributes.address"
v-if="item.properties.address"
class="columns is-mobile"
>
<div class="column is-1">
<font-awesome-icon icon="map-marker-alt" />
</div>
<div class="column is-11">
{{ item.attributes.address }}<br>
Philadelphia, PA {{ item.attributes.zip_code }}<br>
{{ item.properties.address }}<br>
Philadelphia, PA {{ item.properties.zip_code }}<br>
</div>
</div>
</div>

<div class="column is-6">
<div
v-if="item.attributes.phone"
v-if="item.properties.phone"
class="columns is-mobile"
>
<div class="column is-1">
<font-awesome-icon icon="phone" />
</div>
<div class="column is-11">
{{ item.attributes.phone }}
{{ item.properties.phone }}
</div>
</div>

<div
v-if="item.attributes.email"
v-if="item.properties.email"
class="columns is-mobile"
>
<div class="column is-1">
<font-awesome-icon icon="envelope" />
</div>
<div class="column is-11">
<a :href="`mailto:${item.attributes.email}`">{{ item.attributes.email }}</a>
<a :href="`mailto:${item.properties.email}`">{{ item.properties.email }}</a>
</div>
</div>

<div
v-if="item.attributes.website"
v-if="item.properties.website"
class="columns is-mobile website-div"
>
<div class="column is-1">
Expand All @@ -55,9 +104,9 @@
<div class="column is-11">
<a
target="_blank"
:href="makeValidUrl(item.attributes.website)"
:href="makeValidUrl(item.properties.website)"
>
{{ item.attributes.website }}
{{ item.properties.website }}
<font-awesome-icon icon="external-link-alt" />
</a>
</div>
Expand Down Expand Up @@ -91,82 +140,30 @@
</div>

<div
v-if="item.attributes.services_offered"
v-if="item.properties.services_offered"
>
<h3 class="title section-title is-3">
Services offered
</h3>
<div class="columns is-multiline is-gapless">
{{ item.attributes.services_offered }}
{{ item.properties.services_offered }}
</div>
</div>

<div
v-if="item.attributes.tags && item.attributes.tags.length"
v-if="item.properties.tags && item.properties.tags.length"
>
<h3 class="title section-title is-3">
Tags
</h3>
<div>
<!-- {{ item.attributes.tags }} -->
{{ parseTagsList(item.attributes.tags) }}
<!-- {{ item.properties.tags }} -->
{{ parseTagsList(item.properties.tags) }}
</div>
</div>
</div>
</template>

<script>
// import SharedFunctions from '@phila/pinboard/src/components/mixins/SharedFunctions.vue';
// import PrintShareSection from '@phila/pinboard/src/components/PrintShareSection';
export default {
name: 'ExpandCollapseContent',
// components: {
// PrintShareSection,
// },
// mixins: [ SharedFunctions ],
props: {
item: {
type: Object,
default: function(){
return {};
},
},
},
methods: {
parseAddress(address) {
const formattedAddress = address.replace(/(Phila.+)/g, city => `<div>${city}</div>`).replace(/^\d+\s[A-z]+\s[A-z]+/g, lineOne => `<div>${lineOne}</div>`).replace(/,/, '');
return formattedAddress;
},
makeValidUrl(url) {
let newUrl = window.decodeURIComponent(url);
newUrl = newUrl
.trim()
.replace(/\s/g, '');
if (/^(:\/\/)/.test(newUrl)) {
return `http${newUrl}`;
}
if (!/^(f|ht)tps?:\/\//i.test(newUrl)) {
return `http://${newUrl}`;
}
return newUrl;
},
parseServiceList(list) {
const formattedService = list;
return formattedService;
},
parseTagsList(list) {
const formattedTags = list.toLowerCase();
console.log('parseTagsList is running, list:', list, 'formattedTags:', formattedTags);
// const formattedTags = list.slice().sort().join(", ");
return formattedTags;
},
},
};
</script>

<style lang="scss">
// .td-style {
Expand Down
5 changes: 3 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import { faMinus as farMinus } from '@fortawesome/pro-regular-svg-icons/faMinus'
library.add(farAngleDown, farAngleUp, farTimes, farPlus, farMinus);

// import pinboard
import pinboard from '@phila/pinboard';
// import pinboard from '../node_modules/@phila/pinboard/src/main.js';
// import pinboard from '@phila/pinboard';
import pinboard from '../node_modules/@phila/pinboard/src/main.js';
import '../node_modules/@phila/pinboard/dist/style.css';

// data-sources
Expand Down Expand Up @@ -76,6 +76,7 @@ let $config = {
},
},
locationInfo: {
siteNameField: 'organization_name',
siteName: function(item) {
return item.properties.organization_name;
},
Expand Down
Loading

0 comments on commit d9a3655

Please sign in to comment.