diff --git a/.github/workflows/deploy-dev.yml b/.github/workflows/deploy-dev.yml deleted file mode 100644 index 38b16a6..0000000 --- a/.github/workflows/deploy-dev.yml +++ /dev/null @@ -1,64 +0,0 @@ - -name: Deploy to Firebase Hosting - -# This workflow deploys the static-generated nextjs app to Firebase Hosting -# Triggered by push to the "dev" branch -on: - push: - branches: - - dev - -jobs: - lint-export-client: - name: Lint and Export client - runs-on: ubuntu-latest - env: - NEXT_PUBLIC_BASE_PATH: '' - NEXT_PUBLIC_FIREBASE_WEB_API_KEY: ${{ secrets.FIREBASE_WEB_API_KEY_DEV }} - NEXT_PUBLIC_FIREBASE_WEB_AUTHDOMAIN: ${{ secrets.FIREBASE_WEB_AUTHDOMAIN_DEV }} - NEXT_PUBLIC_FIREBASE_WEB_PROJECT_ID: ${{ secrets.FIREBASE_WEB_PROJECT_ID_DEV }} - NEXT_PUBLIC_FIREBASE_WEB_STORAGE_BUCKET: ${{ secrets.FIREBASE_WEB_STORAGE_BUCKET_DEV }} - steps: - - name: Checkout the repository - uses: actions/checkout@v3 - - name: Use NodeJS v16.14.2 - uses: actions/setup-node@v3 - with: - node-version: 16.14.2 - - name: Install Dependencies and lint - run: | - cd client - npm install - - name: Lint - run: | - cd client - npm run lint - - name: Export static files - run: | - cd client - npm run export - - name: Archive Development Artifact - uses: actions/upload-artifact@v3 - with: - name: dev-app - path: | - client/out - client/firebase.json - client/.firebaserc - retention-days: 3 - - deploy-client: - name: Deploy Client to Firebase Hosting - needs: lint-export-client - runs-on: ubuntu-latest - steps: - - name: Download Artifact - uses: actions/download-artifact@v3 - with: - name: dev-app - - name: Deploy to Firebase - uses: w9jds/firebase-action@master - with: - args: deploy --only hosting:dev - env: - FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 895a1e9..fd9fe73 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -6,7 +6,6 @@ on: push: branches-ignore: - master - - dev jobs: lint-client: diff --git a/README.md b/README.md index 0b13b44..ab191d1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ -## climate-profile-full +## assets-cms -Dynaimc widgets/apps for external website embedding on Google Sites. +Dynamic widgets/apps for external website embedding on Google Sites.
+This project will also serve as a Content Management System (CMS) for tracking and hosting common ACAP assets. ## Requirements @@ -15,24 +16,14 @@ Dynaimc widgets/apps for external website embedding on Google Sites. 4. firebase v9.18.0 5. firebase-admin v11.5.0 -### Online Demo +### Online App -#### Production App -https://weaponsforge.github.io/climate-profile-full/ - -#### Development App -https://climate-profile-dev.web.app/ - -``` -EXAMPLE USER (Development App Only) -email: user@gmail.com -password: useruser -``` +https://acaptutorials.github.io/assets-cms/ ## Installation 1. Clone this repository.
-`git clone https://github.com/weaponsforge/climate-profile-full.git` +`git clone https://github.com/acaptutorials/assets-cms.git` 2. Install dependencies in the **/client** and **/server** directories.
``` @@ -47,5 +38,5 @@ password: useruser 2. Follow the instructions in the README files inside the **/client** and **/server** directories for more information on configuring and using the client and server apps. -@weaponsforge
+@acaptutorials
20230326 diff --git a/client/.env.example b/client/.env.example index b4d1c9a..d9e2008 100644 --- a/client/.env.example +++ b/client/.env.example @@ -1,5 +1,5 @@ NEXT_PUBLIC_BASE_PATH='' -NEXT_PUBLIC_FIREBASE_WEB_API_KEY=AIzaSyD65tGpVAl23Iu_IfLatCO3ikoNQzR347o -NEXT_PUBLIC_FIREBASE_WEB_AUTHDOMAIN=climate-profile-app.firebaseapp.com -NEXT_PUBLIC_FIREBASE_WEB_PROJECT_ID=climate-profile-app -NEXT_PUBLIC_FIREBASE_WEB_STORAGE_BUCKET=climate-profile-app.appspot.com \ No newline at end of file +NEXT_PUBLIC_FIREBASE_WEB_API_KEY=AIzaSyB3kHDai_NDlkMEk23lwjvAKuYEyu0M-6E +NEXT_PUBLIC_FIREBASE_WEB_AUTHDOMAIN=assets-cms.firebaseapp.com +NEXT_PUBLIC_FIREBASE_WEB_PROJECT_ID=assets-cms +NEXT_PUBLIC_FIREBASE_WEB_STORAGE_BUCKET=assets-cms.appspot.com \ No newline at end of file diff --git a/client/.firebaserc b/client/.firebaserc index 82dcfae..2c00301 100644 --- a/client/.firebaserc +++ b/client/.firebaserc @@ -1,17 +1,12 @@ { "projects": { - "default": "climate-profile-app" + "default": "assets-cms" }, "targets": { - "climate-profile-app": { - "hosting": { - "dev": [ - "climate-profile-dev" - ] - }, + "assets-cms": { "storage": { "dev": [ - "climate-profile-app.appspot.com" + "assets-cms.appspot.com" ] } } diff --git a/client/README.md b/client/README.md index 38cf6ed..f82babd 100644 --- a/client/README.md +++ b/client/README.md @@ -1,4 +1,4 @@ -## climate-profile-full +## assets-cms Testing display of all related content based on a URL query string. @@ -15,7 +15,7 @@ Testing display of all related content based on a URL query string. ### Online Demo #### Production App -https://weaponsforge.github.io/climate-profile-full/ +https://acaptutorials.github.io/assets-cms/ #### Development App https://climate-profile-dev.web.app/ @@ -69,5 +69,5 @@ password: useruser 4. Export the static website.
`npm run export` -@weaponsforge
+@acaptutorials
2022112 diff --git a/client/components/countries/index.js b/client/components/countries/index.js deleted file mode 100644 index 4950d72..0000000 --- a/client/components/countries/index.js +++ /dev/null @@ -1,33 +0,0 @@ -import PropTypes from 'prop-types' - -import Container from '@mui/material/Container' -import Typography from '@mui/material/Typography' -import CountryList from '@/domain/profile/countrylist' - -function CountriesComponent ({ - countries, - handleSelectCountry -}) { - return ( - - - Country Profile - - - Select a country to view its profile - - - - - ) -} - -CountriesComponent.propTypes = { - countries: PropTypes.array, - handleSelectCountry: PropTypes.func -} - -export default CountriesComponent diff --git a/client/components/login/index.js b/client/components/login/index.js index 8765bfd..b191879 100644 --- a/client/components/login/index.js +++ b/client/components/login/index.js @@ -30,7 +30,7 @@ function LoginComponent ({ signIn, loading = false }) { />

- Login! + Login

diff --git a/client/components/profile-centered/index.js b/client/components/profile-centered/index.js deleted file mode 100644 index 906b635..0000000 --- a/client/components/profile-centered/index.js +++ /dev/null @@ -1,167 +0,0 @@ -import PropTypes from 'prop-types' - -import Image from 'next/image' -import Box from '@mui/material/Box' -import Container from '@mui/material/Container' -import Grid from '@mui/material/Grid' -import Typography from '@mui/material/Typography' -import SubContentText from '@/components/common/layout/subtcontenttext' -import DonutChart from '@/components/common/ui/charts/donut' -import BarChart from '@/components/common/ui/charts/bar' -import LineGraph from '@/components/common/ui/charts/line' -import ArticleText from '@/components/common/layout/articletext' -import CountryList from '@/domain/profile/countrylist' -import Notification from '@/components/common/ui/notification' -import AppCard from '@/components/common/ui/appcard' -import styles from './styles' - -import ImgClimateRisks from '@/assets/images/figures/climate_risks_img.png' -import ImgVulnerability from '@/assets/images/figures/vulnerability_img.png' - -function ProfileCenteredComponent ({ - country, - countries, - state, - textData, - donutData, - barData, - handleSelectCountry -}) { - return ( - - {state.msg !== '' && - - } - - {state.loading - ? Loading please wait... - : - - - Climate Profile - {country !== '' && ` - ${country}`} - - - - - - {/** Greehouse Gas (GHG) Emmissions Section */} - - - - - - - - - {/** Climate Risks Section */} - - - Climate Change Scenarios - - - - - {country !== 'Armenia' - ? - - - : - - - Climate Risks - - - } - - - {country === 'Armenia' - ?
- : - } - - - {/** Climate Change Scenarios Section */} - {country !== 'Armenia' - ? - - - : - - - } - - - {country === 'Armenia' - ?
- : - } - - - {/** Other Lengthy Text Section */} - {textData.map((item, index) => { - if (index >= 3) { - const picture = (item.key === 'impacts' && country === 'Armenia') - ? { - picture: ImgVulnerability, - pictureAlt: item.title, - pictureSize: { width: 761 } - } - : null - - return - - - } - })} - - } - - ) -} - -ProfileCenteredComponent.propTypes = { - country: PropTypes.string, - countries: PropTypes.array, - state: PropTypes.object, - textData: PropTypes.array, - donutData: PropTypes.object, - barData: PropTypes.object, - handleSelectCountry: PropTypes.func -} - -export default ProfileCenteredComponent diff --git a/client/components/profile-centered/styles.js b/client/components/profile-centered/styles.js deleted file mode 100644 index ce38674..0000000 --- a/client/components/profile-centered/styles.js +++ /dev/null @@ -1,26 +0,0 @@ -const styles = { - container: { - '& h3, h4': { - textAlign: 'center', - marginBottom: '32px' - }, - '& img': { - height: 'auto', - border: '2px solid rgba(0, 0, 0, 0.87)' - }, - marginTop: '40px' - }, - imageGrid: { - marginTop: '32px' - }, - imgVulnerability: { - '& img': { - maxWidth: '561px', - height: 'auto', - textAlign: 'center' - } - } -} - -export default styles - diff --git a/client/components/profile/index.js b/client/components/profile/index.js deleted file mode 100644 index 66a0415..0000000 --- a/client/components/profile/index.js +++ /dev/null @@ -1,125 +0,0 @@ -import PropTypes from 'prop-types' - -import Grid from '@mui/material/Grid' -import Typography from '@mui/material/Typography' -import SubContentText from '@/components/common/layout/subtcontenttext' -import DonutChart from '@/components/common/ui/charts/donut' -import BarChart from '@/components/common/ui/charts/bar' -import LineGraph from '@/components/common/ui/charts/line' -import ArticleText from '@/components/common/layout/articletext' -import CountryList from '@/domain/profile/countrylist' -import AppCard from '@/components/common/ui/appcard' -import Notification from '@/components/common/ui/notification' -import styles from './styles' - -function ProfileComponent ({ - country, - countries, - state, - textData, - donutData, - barData, - handleSelectCountry -}) { - return ( -
- {state.error !== '' && - - } - - - - {state.loading - ? - Loading please wait... - - : - - - Climate Profile - {country !== '' && ` - ${country}`} - - - - {/** Greehouse Gas (GHG) Emmissions Section */} - - - - - - - - - {/** Climate Risks Section */} - - - Climate Change Scenarios - - - - - - - - - - - - {/** Climate Change Scenarios Section */} - - - - - - - - - {/** Other Lengthy Text Section */} - {textData.map((item, index) => { - if (index >= 3) { - return - - - } - })} - - } -
- ) -} - -ProfileComponent.propTypes = { - country: PropTypes.string, - countries: PropTypes.array, - state: PropTypes.object, - textData: PropTypes.array, - donutData: PropTypes.object, - barData: PropTypes.object, - handleSelectCountry: PropTypes.func -} - -export default ProfileComponent diff --git a/client/components/profile/styles.js b/client/components/profile/styles.js deleted file mode 100644 index 02375b9..0000000 --- a/client/components/profile/styles.js +++ /dev/null @@ -1,12 +0,0 @@ -const styles = { - container: { - '& h3, h4': { - textAlign: 'center', - marginBottom: '32px' - }, - marginTop: '40px' - } -} - -export default styles - diff --git a/client/components/profiletabs/index.js b/client/components/profiletabs/index.js deleted file mode 100644 index 75d5dd6..0000000 --- a/client/components/profiletabs/index.js +++ /dev/null @@ -1,110 +0,0 @@ -import { useState } from 'react' -import Link from 'next/link' -import PropTypes from 'prop-types' - -import Button from '@mui/material/Button' -import Box from '@mui/material/Box' -import Container from '@mui/material/Container' -import Grid from '@mui/material/Grid' -import Typography from '@mui/material/Typography' - -import NavigationTabs from '@/domain/profiletabs/navigationtabs' -import TabPanel from '@/domain/profiletabs/tabpanel' -import Notification from '@/components/common/ui/notification' -import AppCard from '@/components/common/ui/appcard' - -// Main tab sections -import GHGEmmissions from '@/domain/profiletabs/sections/ghgemmissions' -import ClimateRisks from '@/domain/profiletabs/sections/climaterisks' -import ClimateChange from '@/domain/profiletabs/sections/climatechange' -import ArticleText from '@/components/common/layout/articletext' -import styles from './styles' - -function ProfileTabsComponent ({ - country, - state, - textData, - donutData, - barData, -}) { - const [tab, setTab] = useState(0) - - return ( - - {state.error !== '' && - - } - - {/** Header */} - - - - - - {country} - - - Country Profile - - - - - - - - - { - setTab(newValue) - }} - /> - - - - - - {state.loading - ? - Loading please wait... - - : - - - - - - - - - - - - - - - - - } - - - ) -} - -ProfileTabsComponent.propTypes = { - country: PropTypes.string, - state: PropTypes.object, - textData: PropTypes.array, - donutData: PropTypes.object, - barData: PropTypes.object, -} - -export default ProfileTabsComponent diff --git a/client/components/profiletabs/styles.js b/client/components/profiletabs/styles.js deleted file mode 100644 index ada1480..0000000 --- a/client/components/profiletabs/styles.js +++ /dev/null @@ -1,39 +0,0 @@ -const styles = { - headerContainer: { - backgroundColor: theme => theme.palette.primary.main, - height: '270px' - }, - headerContent: { - paddingBottom: 0, - '& h1': { - lineHeight: '60px', - }, - '& h1, h3, h4': { - color: '#fff', - fontFamily: 'Bebas Neue', - fontWeight: 'normal' - }, - height: '100%', - display: 'flex', - flexDirection: 'column', - justifyContent: 'space-between' - }, - headerTitle: { - marginTop: theme => theme.spacing(9), - display: 'flex', - justifyContent: 'space-between', - alignItems: 'center', - '& button': { - height: '50px', - backgroundColor: theme => theme.palette.primary.light, - '&:hover': { - backgroundColor: '#fff' - } - }, - '& a': { - textDecoration: 'none' - } - } -} - -export default styles diff --git a/client/domain/profile/countrybutton/index.js b/client/domain/profile/countrybutton/index.js deleted file mode 100644 index b8b1d13..0000000 --- a/client/domain/profile/countrybutton/index.js +++ /dev/null @@ -1,11 +0,0 @@ -import Button from '@mui/material/Button' -import { styled } from '@mui/material/styles' - -const CountryButton = styled((props) => ( -