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

View File

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

View File

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