Compare commits

...

11 Commits

Author SHA1 Message Date
aminecmi
20069bfe84 Updating the items content.
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing
2022-08-06 13:58:02 +02:00
aminecmi
8c4f036431 Handle for mobile use. 2022-08-06 13:57:38 +02:00
aminecmi
59b138be5e Removed badge.
All checks were successful
continuous-integration/drone/push Build is passing
2022-07-23 22:45:09 +02:00
aminecmi
fa83860c0a Cleaning code.
All checks were successful
continuous-integration/drone Build is passing
2022-07-23 13:31:02 +02:00
aminecmi
1b8f85606f Variaables. 2022-07-22 21:46:00 +02:00
aminecmi
da23d9cda0 Sonar scanner. 2022-07-22 20:45:41 +02:00
aminecmi
c20329d2b3 Updated badge. 2022-07-20 08:59:27 +02:00
aminecmi
e875af8e49 Sonar integration not working. 2022-07-20 08:58:43 +02:00
aminecmi
58a1e109ce Trying sonar. 2022-07-20 08:54:22 +02:00
aminecmi
0c67cbf6da Main only. 2022-07-19 21:59:26 +02:00
Amine Louveau
b124bc8c3a drone (#5)
Co-authored-by: aminecmi <aminecmi@gmail.com>
Reviewed-on: https://gitea.amine-louveau.fr/AmineL/liste-de-courses-www/pulls/5
2022-07-19 19:57:14 +00:00
7 changed files with 57 additions and 21 deletions

42
.drone.yml Normal file
View File

@@ -0,0 +1,42 @@
kind: pipeline
type: docker
steps:
- name: code-analysis
image: sonarsource/sonar-scanner-cli
detach: true
failure: ignore
commands:
- ls -la
- sonar-scanner -Dsonar.projectKey=LDC-WWW -Dsonar.sources=. -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_LOGIN
environment:
SONAR_HOST_URL:
from_secret: sonarScannerHostUrl
SONAR_LOGIN:
from_secret: sonarScannerLogin
- name: build
image: node:14
commands:
- npm install
- echo $VUE_APP_API_BASE_URL
- npm run lint
- npm run build:prod
environment:
VUE_APP_API_BASE_URL:
from_secret: baseurl
- name: scp files
image: appleboy/drone-scp
settings:
host: amine-louveau.fr
username: ubuntu
key:
from_secret: privateKey
port: 22
target: /home/ubuntu/courses
source: dist/*
when:
branch:
- main

View File

@@ -5,6 +5,7 @@
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"build:prod": "vue-cli-service build --mode production",
"lint": "vue-cli-service lint"
},
"dependencies": {

View File

@@ -71,7 +71,3 @@ export default {
}
}
</script>
<style scoped>
</style>

View File

@@ -1,14 +1,14 @@
<template>
<div class="panel-block" v-bind:class="{'disabled': element.loading}">
<span class="icon is-pulled-left" v-if="canMove">
<span class="icon is-pulled-left handle" v-if="canMove">
<ion-icon name="move-outline"></ion-icon>
</span>
<input type="checkbox" v-model="element.checked" v-on:change="updateItem(element)">
<input type="checkbox" v-model="element.checked" v-on:change="updateCheckbox(element)">
<div class="field is-horizontal has-addons">
<div class="control">
<input class="input" type="text" v-bind:disabled="element.checked" v-model="element.content"
v-on:blur="updateItem(element)">
v-on:blur="updateContent(element)">
</div>
<div class="control">
<a class="button is-danger" v-on:click="deleteElement(element)">
@@ -29,9 +29,12 @@ export default {
}
},
methods: {
updateItem: function () {
updateCheckbox: function () {
this.$emit('updateItem', {id: this.element.id, checked: this.element.checked}, true)
},
updateContent: function () {
this.$emit('updateItem', {id: this.element.id, content: this.element.content}, true)
},
deleteElement: function () {
this.$emit('deleteElement', this.element.id)
}

View File

@@ -29,7 +29,8 @@
v-model="searchResults"
group="listItems"
@change="onChange"
item-key="id" v-if="searchQ.length <= 0">
item-key="id" v-if="searchQ.length <= 0"
handle=".handle">
<template #item="{element}">
<ListItem v-bind:item="element" v-bind:can-move="!element.checked" v-on:updateItem="updateItem" v-on:deleteElement="deleteElement"></ListItem>
</template>
@@ -157,7 +158,7 @@ export default {
body: JSON.stringify({content: this.searchQ})
}).then(r => {
return r.json();
}).then(result => {
}).then(() => {
this.searchQ = '';
this.fetchListAndItems(true);
})

View File

@@ -38,7 +38,8 @@
</template>
<script>
import ListCreateUpdateModal from "../../../liste-de-courses-www/src/components/ListCreateUpdateModal";
import ListCreateUpdateModal from "@/components/ListCreateUpdateModal";
export default {
name: "Lists",
components: {ListCreateUpdateModal},
@@ -71,8 +72,8 @@ export default {
'Content-Type': 'application/json;charset=utf-8',
'X-API-KEY': localStorage.getItem('KEY')
}
}).then(r => {
if (r.status !== 404) {
}).then(result => {
if (result.status !== 404) {
this.lists = this.lists.filter(r => r.id !== item.id);
}
});
@@ -102,7 +103,3 @@ export default {
}
}
</script>
<style scoped>
</style>

View File

@@ -46,7 +46,3 @@ export default {
}
}
</script>
<style scoped>
</style>