Merge pull request #29 from sgotti/npm_update_deps

npm: update dependencies
This commit is contained in:
Simone Gotti 2020-02-14 16:04:28 +01:00 committed by GitHub
commit 3fa224d0be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 4120 additions and 2691 deletions

View File

@ -1,5 +1,5 @@
module.exports = { module.exports = {
presets: [ presets: [
'@vue/app' '@vue/cli-plugin-babel/preset'
] ]
} }

6519
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,6 @@
{ {
"name": "agola-web", "name": "agola-web",
"version": "0.1.0", "version": "0.1.0",
"license": "Apache-2.0",
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
@ -9,27 +8,30 @@
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"
}, },
"dependencies": { "dependencies": {
"@mdi/font": "^3.9.97", "@mdi/font": "^4.9.95",
"ansi_up": "^4.0.4", "ansi_up": "^4.0.4",
"core-js": "^3.6.4",
"moment": "^2.23.0", "moment": "^2.23.0",
"moment-duration-format": "^2.3.2", "moment-duration-format": "^2.3.2",
"v-click-outside-x": "^4.0.19", "v-click-outside-x": "^4.1.0",
"vue": "^2.6.10", "vue": "^2.6.11",
"vue-router": "^3.1.3", "vue-router": "^3.1.5",
"vue2-filters": "^0.6.1", "vue2-filters": "^0.9.1",
"vuex": "^3.1.1" "vuex": "^3.1.2"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "^3.11.0", "@vue/cli-plugin-babel": "~4.2.2",
"@vue/cli-plugin-eslint": "^3.11.0", "@vue/cli-plugin-eslint": "~4.2.2",
"@vue/cli-service": "^3.11.0", "@vue/cli-plugin-router": "^4.2.2",
"@vue/cli-plugin-vuex": "^4.2.2",
"@vue/cli-service": "~4.2.2",
"babel-eslint": "^10.0.3", "babel-eslint": "^10.0.3",
"eslint": "^5.16.0", "eslint": "^6.7.2",
"eslint-plugin-vue": "^5.2.3", "eslint-plugin-vue": "^6.1.2",
"node-sass": "^4.12.0", "node-sass": "^4.13.1",
"sass-loader": "^7.3.1", "sass-loader": "^8.0.2",
"tailwindcss": "^1.1.2", "tailwindcss": "^1.2.0",
"vue-template-compiler": "^2.6.10" "vue-template-compiler": "^2.6.11"
}, },
"eslintConfig": { "eslintConfig": {
"root": true, "root": true,
@ -49,5 +51,6 @@
"> 1%", "> 1%",
"last 2 versions", "last 2 versions",
"not ie <= 8" "not ie <= 8"
] ],
"license": "Apache-2.0"
} }

View File

@ -1,58 +1,66 @@
<template> <template>
<div class="overflow-x-auto"> <div class="overflow-x-auto">
<svg version="1.1" :width="width" :height="height" class="svg-content" scroll overflow="scroll"> <svg
<g v-for="(segment, i) in segments" v-bind:key="segment + i"> version="1.1"
<line :width="width"
:x1="segment.x1" :height="height"
:y1="segment.y1" class="svg-content"
:x2="segment.x2" scroll
:y2="segment.y2" overflow="scroll"
:stroke-width="segment.strokeWidth" >
:stroke="segment.stroke" <g v-for="(segment, i) in segments" v-bind:key="segment + i">
stroke-linecap="round" <line
:class="['stroke-current', segment.stroke]" :x1="segment.x1"
/> :y1="segment.y1"
</g> :x2="segment.x2"
<g v-for="(task, idx) in outTasks" v-bind:key="idx"> :y2="segment.y2"
<foreignObject :stroke-width="segment.strokeWidth"
:x="(taskWidth + taskXSpace) * task.level" :stroke="segment.stroke"
:y="(taskHeight + taskYSpace) * task.row" stroke-linecap="round"
rx="3" :class="['stroke-current', segment.stroke]"
ry="3" />
:width="taskWidth" </g>
:height="taskHeight" <g v-for="(task, idx) in outTasks" v-bind:key="idx">
> <foreignObject
<body> :x="(taskWidth + taskXSpace) * task.level"
<div :y="(taskHeight + taskYSpace) * task.row"
class="mb-2 border-l-5 rounded-l" rx="3"
:class="taskClass(task)" ry="3"
@mouseover="hoverTask = task" :width="taskWidth"
@mouseleave="hoverTask = null" :height="taskHeight"
> >
<router-link <body>
tag="a" <div
:to="task.link" class="mb-2 border-l-5 rounded-l"
class="px-1 flex flex-col border border-l-0 rounded-r" :class="taskClass(task)"
:style="{ height: taskHeight +'px'}" @mouseover="hoverTask = task"
:title="task.name" @mouseleave="hoverTask = null"
> >
<div class="flex justify-end"> <router-link
<div class="text-right text-xs">{{ task.duration }}</div> tag="a"
</div> :to="task.link"
<div class="font-bold truncate">{{task.name}}</div> class="px-1 flex flex-col border border-l-0 rounded-r"
<div class="flex justify-end"> :style="{ height: taskHeight + 'px' }"
<span :title="task.name"
v-if="task.waiting_approval" >
class="bg-gray-200 rounded-full px-2 py-0 text-xs text-center font-semibold" <div class="flex justify-end">
>Waiting Approval</span> <div class="text-right text-xs">{{ task.duration }}</div>
</div> </div>
</router-link> <div class="font-bold truncate">{{ task.name }}</div>
</div> <div class="flex justify-end">
</body> <span
</foreignObject> v-if="task.waiting_approval"
</g> class="bg-gray-200 rounded-full px-2 py-0 text-xs text-center font-semibold"
</svg> >Waiting Approval</span
</div> >
</div>
</router-link>
</div>
</body>
</foreignObject>
</g>
</svg>
</div>
</template> </template>
<script> <script>
@ -217,12 +225,6 @@ export default {
return levelTasks; return levelTasks;
}; };
let levelTasksByRow = function(tasks, level) {
return levelTasks(tasks, level).sort((a, b) =>
a.row > b.row ? 1 : b.row > a.row ? -1 : 0
);
};
let levelsTasksByRow = function(tasks, startLevel) { let levelsTasksByRow = function(tasks, startLevel) {
return levelsTasks(tasks, startLevel).sort((a, b) => return levelsTasks(tasks, startLevel).sort((a, b) =>
a.row > b.row ? 1 : b.row > a.row ? -1 : 0 a.row > b.row ? 1 : b.row > a.row ? -1 : 0

View File

@ -1,140 +1,128 @@
import store from "@/store"; import store from "@/store";
const ID_TOKEN_KEY = 'id_token'; const ID_TOKEN_KEY = "id_token";
const USER_KEY = 'user'; const USER_KEY = "user";
const LOGIN_REDIRECT_KEY = 'login_redirect'; const LOGIN_REDIRECT_KEY = "login_redirect";
let API_URL = window.CONFIG.API_URL; let API_URL = window.CONFIG.API_URL;
let API_BASE_PATH = window.CONFIG.API_BASE_PATH; let API_BASE_PATH = window.CONFIG.API_BASE_PATH;
export function setLoggedUser(token, user) { export function setLoggedUser(token, user) {
setIdToken(token); setIdToken(token);
setUser(user); setUser(user);
store.dispatch('setUser', user) store.dispatch("setUser", user);
} }
export function doLogout() { export function doLogout() {
unsetIdToken(); unsetIdToken();
unsetUser() unsetUser();
store.dispatch('setUser', null) store.dispatch("setUser", null);
} }
export function apiurlwithtoken(path) { export function apiurlwithtoken(path) {
let u = new URL(API_URL + API_BASE_PATH + path); let u = new URL(API_URL + API_BASE_PATH + path);
let idToken = getIdToken(); let idToken = getIdToken();
if (idToken) { if (idToken) {
u.searchParams.append("access_token", idToken); u.searchParams.append("access_token", idToken);
} }
return u return u;
} }
export function apiurl(path) { export function apiurl(path) {
return new URL(API_URL + API_BASE_PATH + path); return new URL(API_URL + API_BASE_PATH + path);
} }
export function loginurl() { export function loginurl() {
return new URL(API_URL + "/api/login"); return new URL(API_URL + "/api/login");
} }
export function authorizeurl() { export function authorizeurl() {
return new URL(API_URL + "/api/authorize"); return new URL(API_URL + "/api/authorize");
} }
export function registerurl() { export function registerurl() {
return new URL(API_URL + "/api/register"); return new URL(API_URL + "/api/register");
} }
export function oauth2callbackurl() { export function oauth2callbackurl() {
return new URL(API_URL + "/api/oauth2/callback"); return new URL(API_URL + "/api/oauth2/callback");
} }
export async function loginapi(init) { export async function loginapi(init) {
if (init === undefined) { if (init === undefined) {
init = {} init = {};
} }
try { return await window.fetch(loginurl(), init);
return await window.fetch(loginurl(), init)
} catch (e) {
throw e
}
} }
export async function registerapi(init) { export async function registerapi(init) {
if (init === undefined) { if (init === undefined) {
init = {} init = {};
} }
try { return await window.fetch(registerurl(), init);
return await window.fetch(registerurl(), init)
} catch (e) {
throw e
}
} }
export async function fetch(url, init, signal) { export async function fetch(url, init, signal) {
if (!init) { if (!init) {
init = {} init = {};
} }
if (init.headers === undefined) { if (init.headers === undefined) {
init["headers"] = {} init["headers"] = {};
} }
if (signal) { if (signal) {
init["signal"] = signal; init["signal"] = signal;
} }
let idToken = getIdToken(); let idToken = getIdToken();
if (idToken) { if (idToken) {
init.headers["Authorization"] = "bearer " + idToken init.headers["Authorization"] = "bearer " + idToken;
} }
try { return await window.fetch(url, init);
return await window.fetch(url, init)
} catch (e) {
throw e
}
} }
export function setIdToken(idToken) { export function setIdToken(idToken) {
localStorage.setItem(ID_TOKEN_KEY, idToken); localStorage.setItem(ID_TOKEN_KEY, idToken);
} }
export function getIdToken() { export function getIdToken() {
return localStorage.getItem(ID_TOKEN_KEY); return localStorage.getItem(ID_TOKEN_KEY);
} }
export function unsetIdToken() { export function unsetIdToken() {
localStorage.removeItem(ID_TOKEN_KEY); localStorage.removeItem(ID_TOKEN_KEY);
} }
export function setUser(user) { export function setUser(user) {
localStorage.setItem(USER_KEY, JSON.stringify(user)); localStorage.setItem(USER_KEY, JSON.stringify(user));
} }
export function getUser() { export function getUser() {
let user = localStorage.getItem(USER_KEY); let user = localStorage.getItem(USER_KEY);
if (user) { if (user) {
return JSON.parse(user) return JSON.parse(user);
} }
return null return null;
} }
export function unsetUser() { export function unsetUser() {
localStorage.removeItem(USER_KEY); localStorage.removeItem(USER_KEY);
} }
export function isLoggedIn() { export function isLoggedIn() {
const idToken = getIdToken(); const idToken = getIdToken();
return !!idToken; return !!idToken;
} }
export function getLoginRedirect() { export function getLoginRedirect() {
return sessionStorage.getItem(LOGIN_REDIRECT_KEY); return sessionStorage.getItem(LOGIN_REDIRECT_KEY);
} }
export function setLoginRedirect(url) { export function setLoginRedirect(url) {
sessionStorage.setItem(LOGIN_REDIRECT_KEY, url); sessionStorage.setItem(LOGIN_REDIRECT_KEY, url);
} }
export function unsetLoginRedirect() { export function unsetLoginRedirect() {
return sessionStorage.removeItem(LOGIN_REDIRECT_KEY); return sessionStorage.removeItem(LOGIN_REDIRECT_KEY);
} }

View File

@ -5,6 +5,9 @@ module.exports = {
center: true, center: true,
padding: '2rem', padding: '2rem',
}, },
fontFamily: {
'sans': ['Segoe UI', 'Roboto', 'Helvetica Neue', 'Arial', 'Noto Sans', 'sans-serif', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji']
},
borderWidth: { borderWidth: {
default: '1px', default: '1px',
'0': '0', '0': '0',