Merge branch 'master' into 'production'

Master

See merge request Romulus21/portal!66
This commit is contained in:
Romain Delanoë
2020-08-08 14:24:32 +00:00
8 changed files with 134 additions and 52 deletions

View File

@@ -10,8 +10,10 @@ services:
- mysql:latest - mysql:latest
variables: variables:
MYSQL_DATABASE: portal MYSQL_DATABASE: "portal"
MYSQL_ROOT_PASSWORD: secret MYSQL_USER: "root"
MYSQL_PASSWORD: "app"
MYSQL_ROOT_PASSWORD: "secret"
# This folder is cached between builds # This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache # http://docs.gitlab.com/ce/ci/yaml/README.html#cache
@@ -28,13 +30,16 @@ before_script:
# Prep for Node # Prep for Node
- apt-get install gnupg -yqq - apt-get install gnupg -yqq
# Upgrade to Node 8 # Upgrade to Node 8
- curl -sL https://deb.nodesource.com/setup_10.x | bash - - curl -sL https://deb.nodesource.com/setup_8.x | bash -
# Install dependencies # Install dependencies
- apt-get install git nodejs libcurl4-gnutls-dev libicu-dev libmcrypt-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev unixodbc-dev libpq-dev libsqlite3-dev libaspell-dev libsnmp-dev libpcre3-dev libtidy-dev -yqq - apt-get install git nodejs libcurl4-gnutls-dev libicu-dev libmcrypt-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev unixodbc-dev libpq-dev libsqlite3-dev libaspell-dev libsnmp-dev libpcre3-dev libtidy-dev -yqq
#- apt-get install php-mbstring php-curl php-json php-intl php-gd php-xml php-zip php-bz2 -yqq #- apt-get install php-mbstring php-curl php-json php-intl php-gd php-xml php-zip php-bz2 -yqq
- apt-get install mariadb-server -yqq
# Install php extensions # Install php extensions
- docker-php-ext-install pdo pdo_mysql tokenizer xml pcntl curl json - docker-php-ext-install pdo pdo_mysql tokenizer xml pcntl curl json
# - docker-php-ext-install mbstring intl gd xml bz2 opcache pdo_mysql curl json zip # - docker-php-ext-install mbstring intl gd xml bz2 opcache pdo_mysql curl json zip
# Install php extensions
- docker-php-ext-install mbstring pdo_mysql curl json intl gd xml zip bz2 opcache
# Install & enable Xdebug for code coverage reports # Install & enable Xdebug for code coverage reports
- pecl install xdebug - pecl install xdebug
- docker-php-ext-enable xdebug - docker-php-ext-enable xdebug
@@ -43,7 +48,7 @@ before_script:
- php composer.phar install - php composer.phar install
# Install Node dependencies. # Install Node dependencies.
# comment this out if you don't have a node dependency # comment this out if you don't have a node dependency
- npm install # - npm install
# Copy over testing configuration. # Copy over testing configuration.
# Don't forget to set the database config in .env.testing correctly # Don't forget to set the database config in .env.testing correctly
# DB_HOST=mysql # DB_HOST=mysql
@@ -55,24 +60,21 @@ before_script:
# comment this out if you don't have a frontend build # comment this out if you don't have a frontend build
# you can change this to to your frontend building script like # you can change this to to your frontend building script like
# npm run build # npm run build
- npm run dev # - npm run dev
# Generate an application key. Re-cache. # Generate an application key. Re-cache.
- php artisan key:generate - php artisan key:generate
# - php artisan config:cache - php artisan config:cache
- php artisan optimize
# Run database migrations. # Run database migrations.
- php artisan migrate - php artisan migrate
# Run database seed # Run database seed
- php artisan db:seed - php artisan db:seed
only:
- master
test: test:
script: script:
# run laravel tests # run laravel tests
- php artisan test - php vendor/bin/phpunit --coverage-text --colors=never
# run frontend tests # run frontend tests
# if you have any task for testing frontend # if you have any task for testing frontend
# set it in your package.json script # set it in your package.json script
# comment this out if you don't have a frontend test # comment this out if you don't have a frontend test
# - npm test - npm test

60
composer.lock generated
View File

@@ -1076,16 +1076,16 @@
}, },
{ {
"name": "laravel/framework", "name": "laravel/framework",
"version": "v7.22.4", "version": "v7.23.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/framework.git", "url": "https://github.com/laravel/framework.git",
"reference": "30e851a2b3a2af73fba0b7f4fa22b04260db98e7" "reference": "17cbce101f2fc78e61a6135861823563c7cfb50b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/30e851a2b3a2af73fba0b7f4fa22b04260db98e7", "url": "https://api.github.com/repos/laravel/framework/zipball/17cbce101f2fc78e61a6135861823563c7cfb50b",
"reference": "30e851a2b3a2af73fba0b7f4fa22b04260db98e7", "reference": "17cbce101f2fc78e61a6135861823563c7cfb50b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1229,7 +1229,7 @@
"framework", "framework",
"laravel" "laravel"
], ],
"time": "2020-07-27T18:25:06+00:00" "time": "2020-08-04T14:36:37+00:00"
}, },
{ {
"name": "laravel/passport", "name": "laravel/passport",
@@ -1899,16 +1899,16 @@
}, },
{ {
"name": "nesbot/carbon", "name": "nesbot/carbon",
"version": "2.37.0", "version": "2.38.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/briannesbitt/Carbon.git", "url": "https://github.com/briannesbitt/Carbon.git",
"reference": "1f61206de973d67f36ce50f041c792ddac663c3e" "reference": "d8f6a6a91d1eb9304527b040500f61923e97674b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/1f61206de973d67f36ce50f041c792ddac663c3e", "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/d8f6a6a91d1eb9304527b040500f61923e97674b",
"reference": "1f61206de973d67f36ce50f041c792ddac663c3e", "reference": "d8f6a6a91d1eb9304527b040500f61923e97674b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1923,7 +1923,7 @@
"kylekatarnls/multi-tester": "^2.0", "kylekatarnls/multi-tester": "^2.0",
"phpmd/phpmd": "^2.8", "phpmd/phpmd": "^2.8",
"phpstan/extension-installer": "^1.0", "phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^0.12.30", "phpstan/phpstan": "^0.12.35",
"phpunit/phpunit": "^7.5 || ^8.0", "phpunit/phpunit": "^7.5 || ^8.0",
"squizlabs/php_codesniffer": "^3.4" "squizlabs/php_codesniffer": "^3.4"
}, },
@@ -1984,7 +1984,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2020-07-28T06:04:54+00:00" "time": "2020-08-04T19:12:46+00:00"
}, },
{ {
"name": "nikic/php-parser", "name": "nikic/php-parser",
@@ -3839,7 +3839,7 @@
}, },
{ {
"name": "symfony/polyfill-ctype", "name": "symfony/polyfill-ctype",
"version": "v1.18.0", "version": "v1.18.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git", "url": "https://github.com/symfony/polyfill-ctype.git",
@@ -3915,7 +3915,7 @@
}, },
{ {
"name": "symfony/polyfill-iconv", "name": "symfony/polyfill-iconv",
"version": "v1.18.0", "version": "v1.18.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-iconv.git", "url": "https://github.com/symfony/polyfill-iconv.git",
@@ -3992,7 +3992,7 @@
}, },
{ {
"name": "symfony/polyfill-intl-grapheme", "name": "symfony/polyfill-intl-grapheme",
"version": "v1.18.0", "version": "v1.18.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-intl-grapheme.git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git",
@@ -4070,16 +4070,16 @@
}, },
{ {
"name": "symfony/polyfill-intl-idn", "name": "symfony/polyfill-intl-idn",
"version": "v1.18.0", "version": "v1.18.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-intl-idn.git", "url": "https://github.com/symfony/polyfill-intl-idn.git",
"reference": "bc6549d068d0160e0f10f7a5a23c7d1406b95ebe" "reference": "5dcab1bc7146cf8c1beaa4502a3d9be344334251"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/bc6549d068d0160e0f10f7a5a23c7d1406b95ebe", "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/5dcab1bc7146cf8c1beaa4502a3d9be344334251",
"reference": "bc6549d068d0160e0f10f7a5a23c7d1406b95ebe", "reference": "5dcab1bc7146cf8c1beaa4502a3d9be344334251",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -4151,11 +4151,11 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2020-07-14T12:35:20+00:00" "time": "2020-08-04T06:02:08+00:00"
}, },
{ {
"name": "symfony/polyfill-intl-normalizer", "name": "symfony/polyfill-intl-normalizer",
"version": "v1.18.0", "version": "v1.18.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-intl-normalizer.git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git",
@@ -4236,7 +4236,7 @@
}, },
{ {
"name": "symfony/polyfill-mbstring", "name": "symfony/polyfill-mbstring",
"version": "v1.18.0", "version": "v1.18.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git", "url": "https://github.com/symfony/polyfill-mbstring.git",
@@ -4313,7 +4313,7 @@
}, },
{ {
"name": "symfony/polyfill-php70", "name": "symfony/polyfill-php70",
"version": "v1.18.0", "version": "v1.18.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-php70.git", "url": "https://github.com/symfony/polyfill-php70.git",
@@ -4390,7 +4390,7 @@
}, },
{ {
"name": "symfony/polyfill-php72", "name": "symfony/polyfill-php72",
"version": "v1.18.0", "version": "v1.18.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-php72.git", "url": "https://github.com/symfony/polyfill-php72.git",
@@ -4463,7 +4463,7 @@
}, },
{ {
"name": "symfony/polyfill-php73", "name": "symfony/polyfill-php73",
"version": "v1.18.0", "version": "v1.18.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-php73.git", "url": "https://github.com/symfony/polyfill-php73.git",
@@ -4539,7 +4539,7 @@
}, },
{ {
"name": "symfony/polyfill-php80", "name": "symfony/polyfill-php80",
"version": "v1.18.0", "version": "v1.18.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-php80.git", "url": "https://github.com/symfony/polyfill-php80.git",
@@ -5598,16 +5598,16 @@
}, },
{ {
"name": "facade/ignition", "name": "facade/ignition",
"version": "2.3.4", "version": "2.3.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/facade/ignition.git", "url": "https://github.com/facade/ignition.git",
"reference": "87335b120bc9652e4ee2bf285b7322a785211476" "reference": "58dc4a8df3d41174c677a370b6779b694e4539e7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/facade/ignition/zipball/87335b120bc9652e4ee2bf285b7322a785211476", "url": "https://api.github.com/repos/facade/ignition/zipball/58dc4a8df3d41174c677a370b6779b694e4539e7",
"reference": "87335b120bc9652e4ee2bf285b7322a785211476", "reference": "58dc4a8df3d41174c677a370b6779b694e4539e7",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -5666,7 +5666,7 @@
"laravel", "laravel",
"page" "page"
], ],
"time": "2020-07-27T15:17:39+00:00" "time": "2020-08-01T21:20:01+00:00"
}, },
{ {
"name": "facade/ignition-contracts", "name": "facade/ignition-contracts",

View File

@@ -31,7 +31,7 @@
"sass": "^1.26.10", "sass": "^1.26.10",
"sass-loader": "^8.0.0", "sass-loader": "^8.0.0",
"vue": "^2.5.17", "vue": "^2.5.17",
"vue-router": "^3.3.4", "vue-router": "^3.4.1",
"vue-template-compiler": "^2.6.10", "vue-template-compiler": "^2.6.10",
"vuex": "^3.5.1" "vuex": "^3.5.1"
}, },
@@ -40,6 +40,6 @@
"laravel-mix-svg-vue": "^0.2.6", "laravel-mix-svg-vue": "^0.2.6",
"markdown-it": "^10.0.0", "markdown-it": "^10.0.0",
"markdown-it-checkbox": "^1.1.0", "markdown-it-checkbox": "^1.1.0",
"tailwindcss": "^1.6.0" "tailwindcss": "^1.6.2"
} }
} }

View File

@@ -1,7 +1,17 @@
<template> <template>
<div class="mx-2 p-2"> <div class="mx-2 p-2">
<div class="flex justify-between flex-center mb-4"> <div class="flex justify-between items-center flex-wrap flex-center mb-4">
<a href="#" class="btn" @click="$router.back()">Back</a> <a href="#" class="btn" @click="$router.back()">Back</a>
<div>
<a class="btn-secondary btn-small mr-2" @click="reorderList(true, 'date')">
<svg-vue icon="order-time" class="" />
<svg-vue icon="arrow" v-bind:class="{ arrowUp: !this.orderDate }" class="transform m-0 rotate-90 transition duration-300 ease-in-out" />
</a>
<a class="btn-secondary btn-small" @click="reorderList(true, 'alpha')">
<svg-vue icon="order-alpha" class="" />
<svg-vue icon="arrow" v-bind:class="{ arrowUp: !this.orderAlpha }" class="transform m-0 rotate-90 transition duration-300 ease-in-out" />
</a>
</div>
<router-link :to="'/memos/create'" class="btn-primary">Add New Memo</router-link> <router-link :to="'/memos/create'" class="btn-primary">Add New Memo</router-link>
</div> </div>
<Loader v-if="loading" /> <Loader v-if="loading" />
@@ -36,6 +46,8 @@ export default {
return { return {
loading: true, loading: true,
memos: null, memos: null,
orderDate: false,
orderAlpha: false,
} }
}, },
mounted() { mounted() {
@@ -52,10 +64,22 @@ export default {
}) })
}, },
methods: { methods: {
reorderList() { reorderList(btn = false, types = 'date') {
this.memos.sort(function(a, b) { if(btn && types === 'date') {
return b.data.last_updated_timestamp - a.data.last_updated_timestamp this.orderDate = !this.orderDate
}) } else if (btn && types === 'alpha') {
this.orderAlpha = !this.orderAlpha
}
if(this.orderDate && types === 'date') {
this.memos.sort((a, b) => a.data.last_updated_timestamp - b.data.last_updated_timestamp)
} else if (this.orderAlpha && types === 'alpha') {
this.memos.sort((a, b) => a.data.name.localeCompare(b.data.name))
} else if(types === 'alpha') {
this.memos.sort((a, b) => b.data.name.localeCompare(a.data.name))
} else {
this.memos.sort((a, b) => b.data.last_updated_timestamp - a.data.last_updated_timestamp)
}
} }
} }
} }

View File

@@ -55,3 +55,17 @@
@apply bg-green-dark; @apply bg-green-dark;
} }
} }
.btn-small {
@extend .btn;
@apply text-sm p-2;
& svg {
@apply ml-2 mr-0;
}
}
.arrowUp {
--transform-rotate: -90deg !important;
}

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 432 432" style="0 0 432 432;" xml:space="preserve">
<g>
<g>
<g>
<polygon points="234.24,9.067 183.893,59.413 284.587,59.413 "/>
<polygon points="301.44,304.32 427.947,120.853 427.947,93.973 250.88,93.973 250.88,128.107 376.32,128.107 250.027,310.72 250.027,338.24 432,338.24 432,304.32 "/>
<polygon points="234.24,422.933 283.947,373.227 184.533,373.227 "/>
<path d="M226.773,338.24L130.987,93.76H96L0,338.24h39.253l19.627-52.267h109.013l19.627,52.267H226.773z M71.893,250.987 L113.28,140.48l41.387,110.507H71.893z"/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 772 B

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
version="1.1"
id="Capa_1"
x="0px"
y="0px"
viewBox="0 0 426.667 426.667"
style="0 0 426.667 426.667;"
xml:space="preserve">
<polygon
points="284.587,59.413 234.24,9.067 183.893,59.413 "
id="polygon2"
transform="translate(-20.906504)" />
<polygon
points="184.533,373.227 234.24,422.933 283.947,373.227 "
id="polygon10"
transform="translate(-20.906504)" /><g
id="g854"
transform="matrix(0.6546605,0,0,0.6546605,73.67248,73.672808)"><path
id="path4"
d="M 213.227,0 C 95.36,0 0,95.467 0,213.333 c 0,117.866 95.36,213.333 213.227,213.333 117.867,0 213.44,-95.467 213.44,-213.333 C 426.667,95.467 331.093,0 213.227,0 Z m 0.106,384 C 119.04,384 42.666,307.627 42.666,213.333 42.666,119.039 119.04,42.667 213.333,42.667 307.626,42.667 384,119.04 384,213.333 384,307.626 307.627,384 213.333,384 Z" /><polygon
id="polygon12"
points="192,234.667 303.893,301.867 320,275.627 224,218.667 224,106.667 192,106.667 " /></g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

10
webpack.mix.js vendored
View File

@@ -1,7 +1,7 @@
const mix = require('laravel-mix'); const mix = require('laravel-mix')
const tailwindcss = require('tailwindcss') const tailwindcss = require('tailwindcss')
require('laravel-mix-purgecss'); require('laravel-mix-purgecss')
require('laravel-mix-svg-vue'); require('laravel-mix-svg-vue')
mix.js('resources/js/app.js', 'public/js') mix.js('resources/js/app.js', 'public/js')
.svgVue() .svgVue()
@@ -10,4 +10,6 @@ mix.js('resources/js/app.js', 'public/js')
processCssUrls: false, processCssUrls: false,
postCss: [ tailwindcss('./tailwind.config.js') ], postCss: [ tailwindcss('./tailwind.config.js') ],
}) })
.purgeCss({whitelistPatterns: [/-active$/, /-enter$/, /-leave-to$/, /show$/, /code$/, /pre$/, /blockquote$/]}); .purgeCss({
whitelistPatterns: [/-active$/, /-enter$/, /-leave-to$/, /show$/, /code$/, /pre$/, /blockquote$/, /owf/]
})