Skip to content

Commit

Permalink
Merge pull request #87 from fastsurvey/0.6.1
Browse files Browse the repository at this point in the history
0.6.1
  • Loading branch information
dostuffthatmatters authored Dec 8, 2021
2 parents 370d922 + 69af205 commit f0af66f
Show file tree
Hide file tree
Showing 24 changed files with 50 additions and 74 deletions.
14 changes: 6 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
FROM node:12

COPY package.json package.json
COPY yarn.lock yarn.lock

FROM node:12 as build
WORKDIR /app
COPY package.json yarn.lock server.js ./
RUN yarn install --production=true

COPY server.js server.js
COPY dist dist

FROM gcr.io/distroless/nodejs
COPY --from=build /app /
EXPOSE 8080
CMD [ "node", "server.js" ]
CMD ["server.js"]
2 changes: 1 addition & 1 deletion cypress.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"baseUrl": "http://localhost:3000",
"baseUrl": "http://localhost:8080",
"testFiles": "**/*.e2e.spec.{js,ts}",
"component": {
"testFiles": "**/*.ct.spec.{js,ts,jsx,tsx}",
Expand Down
2 changes: 0 additions & 2 deletions cypress/integration/landing_page.e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const get = getCySelector;

const elements = {
sectionIntro: () => get(['landing-section-intro'], {count: 1}),
sectionWhy: () => get(['landing-section-why'], {count: 1}),
sectionDemo: () => get(['landing-section-demo'], {count: 1}),
sectionPricing: () => get(['landing-section-pricing'], {count: 1}),
sectionQuestions: () => get(['landing-section-faq'], {count: 1}),
Expand All @@ -19,7 +18,6 @@ describe('The Landing Page', () => {
it('successfully loads, contains all sections', () => {
cy.visit('/');
elements.sectionIntro();
elements.sectionWhy();
elements.sectionDemo();
elements.sectionPricing();
elements.sectionQuestions();
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/not_found_page.e2e.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('The Not Found Page', () => {
.first()
.should('have.text', 'Back to Landing Page')
.click();
cy.url().should('eq', 'http://localhost:3000/');
cy.location('pathname').should('eq', '/');
}
it('works for 404s', () => {
cy.visit('/some-unknown-url');
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/page_header.e2e.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('The Page Header', () => {
it('has a working logo link', () => {
cy.visit('/some-unknown-url');
cy.get('header').find('a').should('have.text', 'FastSurvey').click();
cy.url().should('eq', 'http://localhost:3000/');
cy.location('pathname').should('eq', '/');
});

it('has working dark mode toggles', () => {
Expand Down
8 changes: 8 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
<meta property="og:image" content="/og-image.png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="628" />
<script
data-host="https://microanalytics.io"
data-dnt="false"
src="https://microanalytics.io/js/script.js"
id="ZwSg9rf6GA"
async
defer
></script>
</head>
<body>
<div id="root"></div>
Expand Down
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "fastsurvey-frontend",
"version": "0.5.0",
"version": "0.6.1",
"main": "server.js",
"author": {
"name": "Moritz Makowski",
"email": "moritz@dostuffthatmatters.dev",
Expand All @@ -9,26 +10,27 @@
"license": "UNLICENSED",
"scripts": {
"develop": "vite --host",
"build": "tsc && vite build",
"build": "VITE_COMMIT_SHA=\"$(git rev-parse --short --verify HEAD)\" && tsc && vite build",
"serve": "vite preview",
"analyze": "source-map-explorer 'dist/assets/*.js'",
"cypress:integration": "cypress open",
"cypress:component": "yarn tailwind:build && cypress open-ct",
"tailwind:build": "npx tailwindcss -i src/styles/tailwind.css -o src/styles/tailwind.out.css"
},
"dependencies": {
"express": "^4.17.1"
},
"devDependencies": {
"@sentry/react": "^6.15.0",
"axios": "^0.21.1",
"express": "^4.17.1",
"js-cookie": "^3.0.1",
"lodash": "^4.17.21",
"react": "^17.0.0",
"react-dom": "^17.0.0",
"react-redux": "^7.2.4",
"react-router-dom": "^5.2.0",
"redux": "^4.1.1",
"typeface-quicksand": "^1.1.13"
},
"devDependencies": {
"typeface-quicksand": "^1.1.13",
"@cypress/react": "^5.10.1",
"@cypress/vite-dev-server": "^2.2.0",
"@cypress/webpack-dev-server": "^1.7.0",
Expand Down
4 changes: 4 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

yarn build
docker build -t gcr.io/fastsurvey-infrastructure/frontend-dev .
5 changes: 2 additions & 3 deletions scripts/deploy-development.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#!/bin/bash

export VITE_COMMIT_SHA="$(git rev-parse --short --verify HEAD)"
export VITE_ENV="development"
yarn build

docker build --platform linux/amd64 -t gcr.io/fastsurvey-infrastructure/frontend-dev .
docker push gcr.io/fastsurvey-infrastructure/frontend-dev:latest

VITE_COMMIT_SHA="$(git rev-parse --short --verify HEAD)"
gcloud run deploy frontend-dev \
--image=gcr.io/fastsurvey-infrastructure/frontend-dev:latest \
--platform managed --tag "commit-$VITE_COMMIT_SHA"
--platform managed --tag "commit-$VITE_COMMIT_SHA"
16 changes: 0 additions & 16 deletions scripts/deploy-maintenance.sh

This file was deleted.

4 changes: 2 additions & 2 deletions scripts/deploy-production.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash

export VITE_COMMIT_SHA="$(git rev-parse --short --verify HEAD)"
yarn build

docker build --platform linux/amd64 -t gcr.io/fastsurvey-infrastructure/frontend .
docker push gcr.io/fastsurvey-infrastructure/frontend:latest

VITE_COMMIT_SHA="$(git rev-parse --short --verify HEAD)"
gcloud run deploy frontend \
--image=gcr.io/fastsurvey-infrastructure/frontend:latest \
--platform managed --no-traffic --tag "commit-$VITE_COMMIT_SHA"
--platform managed --no-traffic --tag "commit-$VITE_COMMIT_SHA"
3 changes: 3 additions & 0 deletions scripts/run-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

docker run -d -p 8080:8080 gcr.io/fastsurvey-infrastructure/frontend-dev:latest
6 changes: 0 additions & 6 deletions scripts/run-docker-build.sh

This file was deleted.

5 changes: 0 additions & 5 deletions scripts/run-vite-build.sh

This file was deleted.

Binary file added src/assets/images/editor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/images/image-01-create.png
Binary file not shown.
Binary file removed src/assets/images/image-02-collect.png
Binary file not shown.
Binary file removed src/assets/images/image-03-analyze.png
Binary file not shown.
Binary file removed src/assets/images/landing-example-survey.png
Binary file not shown.
Binary file added src/assets/images/results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 13 additions & 13 deletions src/components/landing-sections/landing-section-demo.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, {useState} from 'react';
import DemoImage1 from '/src/assets/images/image-01-create.png';
import DemoImage2 from '/src/assets/images/image-02-collect.png';
import DemoImage3 from '/src/assets/images/image-03-analyze.png';
import DemoImage1 from '/src/assets/images/editor.png';
import DemoImage2 from '/src/assets/images/form.png';
import DemoImage3 from '/src/assets/images/results.png';
import {LandingPageSection} from './section';

export default function LandingSectionDemo(props: {index: number}) {
Expand Down Expand Up @@ -69,16 +69,16 @@ export default function LandingSectionDemo(props: {index: number}) {
</button>
))}
</div>
<div className='w-full sm:w-[36rem] md:w-[44rem] lg:w-[60rem] lg:max-w-full !m-0'>
<div className='relative w-full h-0 pt-[calc((9/16)*100%)] rounded-md shadow-md overflow-hidden'>
<div className='absolute top-0 w-full h-full bg-gray-600' />
<img
className='absolute top-0 w-full h-full'
src={
[DemoImage1, DemoImage2, DemoImage3][imageIndex]
}
/>
</div>
<div
className={
'w-full sm:w-[36rem] md:w-[44rem] lg:w-[60rem] lg:max-w-full !m-0 ' +
'rounded-lg shadow-md overflow-hidden'
}
>
<img
className='w-full h-full'
src={[DemoImage1, DemoImage2, DemoImage3][imageIndex]}
/>
</div>
</div>
</LandingPageSection>
Expand Down
1 change: 1 addition & 0 deletions src/components/layout/main-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ function MainContent(props: {
<div
className={
'mx-2 text-2xl lg:text-2xl ' +
'block md:hidden xl:block ' +
'font-weight-700 lg:font-weight-600 ' +
'text-gray-800 dark:text-gray-100'
}
Expand Down
10 changes: 0 additions & 10 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,6 @@ if (import.meta.env.MODE === 'production') {

ReactDOM.render(
<React.StrictMode>
{import.meta.env.MODE === 'production' && (
<script
data-host='https://microanalytics.io'
data-dnt='false'
src='https://microanalytics.io/js/script.js'
id='ZwSg9rf6GA'
async
defer
></script>
)}
<PageRouter />
</React.StrictMode>,
document.getElementById('root'),
Expand Down

0 comments on commit f0af66f

Please sign in to comment.