Commit 2dd5de53 authored by jfriedli's avatar jfriedli
Browse files

Merge branch 'develop' into 'master'

Go for v1.0.0

See merge request jfriedli/mat2-quasar-frontend!64
parents c4382348 efe4e9de
......@@ -30,7 +30,7 @@ build site:
- dist/pwa
test:integration:
image: docker:19.03.2
image: docker:19.03.3
variables:
DOCKER_DRIVER: overlay2
......@@ -38,7 +38,7 @@ test:integration:
DOCKER_HOST: tcp://localhost:2375
services:
- docker:19.03.2-dind
- docker:19.03.3-dind
only:
- develop
- master
......@@ -80,23 +80,31 @@ build_container:
- develop
- merge_requests
build_production_container:
build_latest_container:
<<: *container-build-template
script:
- docker pull $CI_REGISTRY_IMAGE:latest || true
- docker build --cache-from $CI_REGISTRY_IMAGE:latest
--build-arg MAT2_API_URL_PROD='$MAT_API_HOST_PLACEHOLDER'
--tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
--tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
--tag $CI_REGISTRY_IMAGE:latest .
- docker push $CI_REGISTRY_IMAGE:latest
only:
- tags
- master
build_tagged_container:
<<: *container-build-template
script:
- docker pull $CI_REGISTRY_IMAGE:latest || true
- docker build --cache-from $CI_REGISTRY_IMAGE:latest
--build-arg MAT2_API_URL_PROD='$MAT_API_HOST_PLACEHOLDER'
--tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
only:
- tags
review_app:
stage: review
image: lachlanevenson/k8s-kubectl:v1.15.3
image: lachlanevenson/k8s-kubectl:v1.16.2
before_script:
- echo "deploying review app"
- apk add --no-cache gettext
......@@ -122,7 +130,7 @@ review_app:
stop_review_app:
stage: review
image: lachlanevenson/k8s-kubectl:v1.15.3
image: lachlanevenson/k8s-kubectl:v1.16.2
before_script:
- echo "deleting review app"
- apk add --no-cache gettext
......
......@@ -33,6 +33,9 @@ Or alternatively get it from the registry prebuilt.
Then run it:
`docker run -it -e MAT_API_HOST_PLACEHOLDER='https://mybackend.gnu/' -p 80:80 mat2frontend`
## Dependency Management
We do use renovate which checks every night for updates and creates automated merge request.
## E2E Tests
Run the E2E tests: `quasar test --e2e cypress`.
We use the cypress.io framework for testing.
......
......@@ -11,7 +11,7 @@ services:
- '8080:8080'
volumes:
- '.:/app'
command: /bin/sh -c "yarn && quasar dev -m pwa"
command: /bin/sh -c "yarn && quasar dev"
mat2-web-api:
# use latest on purpose to detect when backend changes
......
server {
# Expires map
map $sent_http_content_type $expires {
default off;
text/html epoch; #means no cache, as it is not a static page
text/css max;
application/javascript max;
application/ttf max;
~image/ 30d; #it is only the logo, so maybe I could change it once a month now
}
server {
expires $expires;
add_header Allow "GET, HEAD" always;
if ($request_method !~ ^(GET|HEAD)$ )
{
......@@ -10,9 +20,14 @@ server {
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options nosniff;
add_header Feature-Policy "geolocation none;midi none;notifications none;push none;sync-xhr none;magnetometer none;gyroscope none;speaker self;vibrate self;payment none;";
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
add_header Referrer-Policy "no-referrer-when-downgrade";
location /robots.txt {return 200 "User-agent: *\nAllow:\n";}
location / {
root /var/www/html;
try_files $uri $uri/ /index.html;
add_header Cache-Control "no-store, no-cache, must-revalidate";
}
}
......@@ -25,6 +25,7 @@ module.exports = function (ctx) {
'roboto-font', // optional, you are not bound to it
'material-icons' // optional, you are not bound to it
],
preFetch: true,
framework: {
// iconSet: 'ionicons-v4',
......@@ -47,12 +48,8 @@ module.exports = function (ctx) {
'QCard',
'QCardActions',
'QBadge',
'QList',
'QItem',
'QItemSection',
'QChip',
'QCircularProgress',
'QAvatar'
'QCircularProgress'
],
directives: [
......@@ -109,7 +106,10 @@ module.exports = function (ctx) {
pwa: {
// workboxPluginMode: 'InjectManifest',
// workboxOptions: {}, // only for NON InjectManifest,
workboxOptions: {
// DO NOT REMOVE!
importWorkboxFrom: 'local'
}, // only for NON InjectManifest,
runtimeCaching: [
{
// To match cross-origin requests, use a RegExp that matches
......
......@@ -33,10 +33,20 @@
},
"build_always": false,
"__internal": {
"dev": {},
"dev": {
"pwa": {
"iconHash": "51e31cc02307f0d15d0242396dcd9361"
},
"spa": {
"iconHash": "51e31cc02307f0d15d0242396dcd9361"
}
},
"build": {
"spa": {
"iconHash": "51e31cc02307f0d15d0242396dcd9361"
},
"pwa": {
"iconHash": "51e31cc02307f0d15d0242396dcd9361"
}
}
}
......
......@@ -2,44 +2,51 @@
@font-face
font-family rubik-regular
src url(./font/Rubik/Rubik-Regular.ttf)
font-display swap
@font-face
font-family rubik-regular-italic
src url(./font/Rubik/Rubik-RegularItalic.ttf)
font-display swap
@font-face
font-family rubik-bold
src url(./font/Rubik/Rubik-Bold.ttf)
font-display swap
@font-face
font-family rubik-bold-italic
src url(./font/Rubik/Rubik-BoldItalic.ttf)
font-display swap
@font-face
font-family rubik-black
src url(./font/Rubik/Rubik-Black.ttf)
font-display swap
@font-face
font-family rubik-black-italic
src url(./font/Rubik/Rubik-BlackItalic.ttf)
font-display swap
@font-face
font-family rubik-light
src url(./font/Rubik/Rubik-Light.ttf)
font-display swap
@font-face
font-family rubik-light-italic
src url(./font/Rubik/Rubik-LightItalic.ttf)
font-display swap
@font-face
font-family rubik-medium
src url(./font/Rubik/Rubik-Medium.ttf)
font-display swap
@font-face
font-family rubik-medium-italic
src url(./font/Rubik/Rubik-MediumItalic.ttf)
font-display swap
@font-face
font-family rubik-regular
src url(./font/Rubik/Rubik-Regular.ttf)
font-display swap
@font-face
font-family rubik-regular-italic
src url(./font/Rubik/Rubik-RegularItalic.ttf)
font-display swap
.rubik-regular
font-family 'rubik-regular'
......
......@@ -19,7 +19,7 @@ $info = #31CCEC
$warning = #F2C037
// mat colors
$light-font-color = #9c9c9c
$light-font-color = #6c6c6c
$light-blue = #f4f7fb
$shadow = 0 0 7px 1px
......
......@@ -7,9 +7,9 @@ export default {
info: 'Info',
simply_drag: 'Simply drag & drop, paste or use the file select button above.',
metadata_removed: 'Metadata removed',
metadata_managed_to_remove: 'MAT2 managed to remove the metadata',
metadata_managed_to_remove: 'Successfully removed the metadata',
removal_failed: 'Metadata removal failed',
could_not_clean_files: 'MAT2 couldn\'t clean the following files',
could_not_clean_files: 'Unable to clean the following files',
loading_failed: 'Loading failed',
four_o_four: 'There\'s no yarn here.',
go_home: 'Back',
......@@ -23,7 +23,7 @@ export default {
bulk_download: 'Download',
error_bulk_download_creation: 'Creating Zip file failed!',
general_error: 'O Ooooh, Something went wrong',
error_report: 'If you keep getting this error report it <a href="https://0xacab.org/jfriedli/mat2-quasar-frontend/issues">here</a>',
error_report: 'If you keep getting this error report it <a rel="noreferrer" href="https://0xacab.org/jfriedli/mat2-quasar-frontend/issues">here</a>',
MAT2_metadata: 'What are metadata?',
mat_what_is_metadata_1: 'Metadata consist of information that characterizes data.\n' +
'Metadata are used to provide documentation for data products.\n' +
......
......@@ -7,7 +7,7 @@
<meta name="description" content="<%= htmlWebpackPlugin.options.productDescription %>">
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width<% if (htmlWebpackPlugin.options.ctx.mode.cordova) { %>, viewport-fit=cover<% } %>">
<meta name="viewport" content="user-scalable=yes, initial-scale=1, minimum-scale=1, maximum-scale=5, width=device-width<% if (htmlWebpackPlugin.options.ctx.mode.cordova) { %>, viewport-fit=cover<% } %>">
<link rel="icon" type="image/png" href="statics/icons/icon-128x128.png">
<link rel="icon" type="image/png" sizes="16x16" href="statics/icons/favicon-16x16.png">
......@@ -103,7 +103,7 @@
</style>
<div id="svg-container" class="fadeIn zoomInDown loading-animation">
<noscript>
<a href="<%= process.env.API_URL %>">Go to noscript version</a>
<a rel="noreferrer" href="<%= process.env.API_URL %>">Go to noscript version</a>
</noscript>
<svg id="#svg-1" version="1.0" xmlns="http://www.w3.org/2000/svg" width="15rem" height="15rem" viewBox="0 0 5120 5120" preserveAspectRatio="xMidYMid meet">
<g id="layer101" fill="#241f31" stroke="none">
......
<template>
<q-layout view="hhh lpR fff">
<q-header class="">
<q-header>
<q-btn
v-show="$route.path !== '/'"
flat
round
to="/"
color="primary"
class="back-icon"
icon="arrow_back_ios"
aria-labelledby="back button"
data-cy="main-back-button"
/>
<div class="header-div column items-center">
<router-link to="/">
<img id="mat-logo" src="~/assets/logo.svg" alt="Logo of the mat-2 project">
......@@ -15,6 +26,7 @@
data-cy="footer-source-link"
class="source-link"
target="_blank"
rel="noreferrer"
href="https://0xacab.org/jfriedli/mat2-quasar-frontend"
>
<q-icon name="code"></q-icon> source
......@@ -51,4 +63,8 @@ export default {
padding-top 5rem
.source-link
text-decoration none
.back-icon
position absolute
top: 1.25rem
left: 1rem
</style>
......@@ -18,6 +18,7 @@
icon="done_all"
:loading="zipCreating"
data-cy="zip-download-button"
aria-labelledby="bulk download button"
>
</q-btn>
<div class="row standard-padding justify-center" v-if="cleanedFiles.successful.length < 4">
......@@ -30,6 +31,7 @@
:href="file.response.data.download_link"
:download="file.response.data.output_filename"
data-cy="card-download-link"
rel="noreferrer"
@click="deactivate(file.response.data.key)"
>
<q-card
......@@ -62,6 +64,7 @@
class="full-width ellipsis download-btn"
color="secondary"
data-cy="download-link"
:aria-labelledby="'download ' + file.response.data.output_filename + 'button'"
>
{{file.response.data.output_filename | truncate}}
</q-btn>
......@@ -78,9 +81,9 @@
>
<div class="row standard-padding mat-shadowed-box">
<div class="col col-12">
<h4 class="text-red">
<h5 class="text-red">
<q-icon name="error_outline"></q-icon> {{$t('removal_failed')}}
</h4>
</h5>
<p>
{{$t('could_not_clean_files')}}
</p>
......@@ -90,19 +93,17 @@
to="/"
color="primary"
:label="$t('back')"
aria-labelledby="back to home button"
>
</q-btn>
</p>
<ul class="failed-list" data-cy="failed-items-list">
<li v-for="file of cleanedFiles.failed" :key="file.id" data-cy="failed-file-name">
{{file.data.name | truncate(25) }}
</li>
</ul>
</div>
</div>
<q-list separator data-cy="failed-items-list">
<q-item class="mat-shadowed-box failed-list" v-for="file of cleanedFiles.failed" :key="file.id">
<q-item-section avatar>
<q-avatar rounded color="primary" text-color="white" icon="insert_drive_file" />
</q-item-section>
<q-item-section data-cy="failed-file-name">{{file.data.name | truncate(25) }}</q-item-section>
</q-item>
</q-list>
</div>
</section>
</div>
......@@ -250,7 +251,7 @@ export default {
.error-box
margin-top 2rem
.failed-list
margin-top 1rem
list-style none
.download-card
cursor pointer
.inactive
......
......@@ -10,7 +10,7 @@
<b>{{$t('general_error')}}</b>
</p>
<p class="text-faded" data-cy="general-error-report" v-html="$t('error_report')"></p>
<q-btn data-cy="error-btn" to="/" :label="$t('go_home')" color="primary" />
<q-btn data-cy="error-btn" to="/" :label="$t('go_home')" color="primary" aria-labelledby="error to home button" />
</div>
</template>
......
......@@ -9,7 +9,7 @@
<p class="text-faded" data-cy="four-o-four-text">
{{$t('four_o_four')}} <strong>(404)</strong>
</p>
<q-btn data-cy="404-btn" to="/" :label="$t('go_home')" color="primary" />
<q-btn data-cy="404-btn" to="/" :label="$t('go_home')" color="primary" aria-labelledby="back to home button" />
</div>
</template>
......
......@@ -7,7 +7,11 @@
<h1 data-cy="mat-locally-title">{{$t('MAT2_metadata')}}</h1>
<p data-cy="mat-locally-info" class="word-wrapping">
{{$t('mat_what_is_metadata_1')}}<br>
<a target="_blank" href="https://0xacab.org/jvoisin/mat2/blob/master/README.md">
<a
rel="noreferrer"
target="_blank"
href="https://0xacab.org/jvoisin/mat2/blob/master/README.md"
>
https://0xacab.org/jvoisin/mat2/blob/master/README.md (09.2019)
</a>
</p>
......@@ -35,6 +39,7 @@
{{$t('more_info')}}
<a
data-cy="debian-link"
rel="noreferrer"
href="https://packages.debian.org/sid/mat2"
>
https://packages.debian.org/sid/mat2
......
<template>
<q-page padding>
<div class="row text-center">
<div class="row text-center main-upload-cont">
<section
v-show="supportedExtensions.length > 0"
class="q-pa-sm q-pa-md col-xs-10 offset-xs-1
class="q-pa-sm q-pa-md col-xs-12
col-sm-6 offset-sm-3 col-md-8 offset-md-2
col-lg-6 offset-lg-3 p-1 mat-shadowed-box"
>
<h1>{{$t('remove_metadata')}}</h1>
<p>
<p class="xs-hide">
{{$t('the_file_you_see')}}
</p>
<div id="drag-drop-area"></div>
<span class="info-link">
<q-btn color="secondary" size="xs" round :to="{ name: 'info' }">
<q-btn color="secondary" size="xs" round :to="{ name: 'info' }" aria-labelledby="help button">
?
</q-btn>
</span>
......@@ -39,6 +39,8 @@
<style lang="stylus">
#drag-drop-area
max-width: 95vw
.uppy-Dashboard-AddFilesPanel
height 45vh
.uppy-Dashboard-inner
min-height: 0 !important
background-color: white
......@@ -68,6 +70,9 @@
padding unset
.uppy-size--md .uppy-DashboardAddFiles
border: unset
.uppy-DashboardTabs
height 100%
margin-top 1.5rem
</style>
<script>
......
src/statics/icons/favicon.ico

35.2 KB | W: | H:

src/statics/icons/favicon.ico

35.2 KB | W: | H:

src/statics/icons/favicon.ico
src/statics/icons/favicon.ico
src/statics/icons/favicon.ico
src/statics/icons/favicon.ico
  • 2-up
  • Swipe
  • Onion skin
test/cypress/fixtures/test-image-two.png

84 Bytes | W: | H:

test/cypress/fixtures/test-image-two.png

149 Bytes | W: | H:

test/cypress/fixtures/test-image-two.png
test/cypress/fixtures/test-image-two.png
test/cypress/fixtures/test-image-two.png
test/cypress/fixtures/test-image-two.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -61,8 +61,9 @@ describe('Upload page tests', () => {
cy.get('[data-cy=removed-metadata-title]').should('have.text', 'Metadata removed')
cy.get('[data-cy=removed-metadata-paragraph]').should(
'have.text',
'MAT2 managed to remove the metadata'
'Successfully removed the metadata'
)
cy.get('[data-cy=main-back-button]').should('be.visible')
cy.get('[data-cy=success-badge]').should('have.css', 'background-color')
.and('eq', 'rgb(76, 175, 80)')
......
......@@ -14,5 +14,6 @@ describe('error page', () => {
'include',
'/'
)
cy.get('[data-cy=main-back-button]').should('be.visible')
})
})
......@@ -13,5 +13,6 @@ describe('404 page', () => {
'include',
'/'
)
cy.get('[data-cy=main-back-button]').should('be.visible')
})
})
......@@ -22,5 +22,8 @@ describe('Info page', () => {
cy.get('[data-cy=supp-formats]').contains('Supported file formats')
cy.get('[data-cy=supp-formats-chip]').contains('.asc')
cy.get('[data-cy=main-back-button]').should('be.visible')
cy.get('[data-cy=main-back-button]').click()
cy.url().should('not.contain', '/info')
})
})
......@@ -18,6 +18,7 @@ describe('Landing', () => {
'include',
'https://0xacab.org/jfriedli/mat2-quasar-frontend'
)
cy.get('[data-cy=main-back-button]').should('not.be.visible')
})
})
......@@ -58,7 +59,7 @@ describe('Upload page tests', () => {
cy.get('[data-cy=removed-metadata-title]').should('have.text', 'Metadata removed')
cy.get('[data-cy=removed-metadata-paragraph]').should(
'have.text',
'MAT2 managed to remove the metadata'
'Successfully removed the metadata'
)
cy.get('[data-cy=success-badge]').should('have.css', 'background-color')
.and('eq', 'rgb(76, 175, 80)')
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment