Compare commits

...

25 Commits
drone ... main

Author SHA1 Message Date
aminecmi
a960889f34 Build changes.
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/promote/production Build is passing
2023-10-20 21:16:12 +02:00
aminecmi
25e435b2ee Fixing displaying issue.
All checks were successful
continuous-integration/drone Build is passing
continuous-integration/drone/push Build is passing
2022-08-19 21:25:59 +02:00
aminecmi
9775c6b0c6 Changed pisition handling.
All checks were successful
continuous-integration/drone Build is passing
continuous-integration/drone/push Build is passing
2022-08-12 22:22:41 +02:00
aminecmi
bb0c16501c Working cache and deployment.
All checks were successful
continuous-integration/drone Build is passing
continuous-integration/drone/push Build is passing
2022-08-06 16:04:21 +02:00
aminecmi
ecaffef993 Last cache try.
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is failing
2022-08-06 15:58:09 +02:00
aminecmi
82c7b793c0 Ssh and cache.
Some checks reported errors
continuous-integration/drone/push Build is passing
continuous-integration/drone Build was killed
2022-08-06 15:53:09 +02:00
aminecmi
e0f48c99bd Still caching.
Some checks reported errors
continuous-integration/drone/push Build is passing
continuous-integration/drone Build was killed
2022-08-06 15:46:18 +02:00
aminecmi
89808e8f6a Cache.
Some checks reported errors
continuous-integration/drone/push Build is passing
continuous-integration/drone Build was killed
2022-08-06 15:35:54 +02:00
aminecmi
15e69496b7 Laast pipeline should be laast.
Some checks reported errors
continuous-integration/drone/push Build is passing
continuous-integration/drone Build was killed
2022-08-06 15:24:47 +02:00
aminecmi
710af7eeee This may or may not work.
Some checks reported errors
continuous-integration/drone/push Build was killed
2022-08-06 15:24:06 +02:00
aminecmi
74f9e1fd94 Fixing drone build.
Some checks reported errors
continuous-integration/drone/push Build is passing
continuous-integration/drone Build was killed
2022-08-06 15:13:04 +02:00
aminecmi
16028ba07e Removed second router link.
Some checks reported errors
continuous-integration/drone/push Build is passing
continuous-integration/drone Build was killed
2022-08-06 15:06:02 +02:00
aminecmi
3039f3a415 Router link and modal issue? 2022-08-06 15:05:34 +02:00
aminecmi
884877572b New drone config. 2022-08-06 15:05:16 +02:00
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 141 additions and 36 deletions

95
.drone.yml Normal file
View File

@ -0,0 +1,95 @@
kind: pipeline
type: docker
name: build
steps:
- name: lintAndBuild
image: node:14
commands:
- npm install
- npm run lint
- npm run build:prod
environment:
VUE_APP_API_BASE_URL:
from_secret: baseurl
- name: saveNodeModules
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
rebuild: true
mount:
- ./node_modules
cache_key: [ DRONE_REPO_NAME, DRONE_BRANCH ]
trigger:
event:
- push
- pull_request
volumes:
- name: cache
host:
path: /tmp/cache
---
kind: pipeline
type: docker
name: Deploy
steps:
- name: getNodeModules
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
restore: true
mount:
- ./node_modules
cache_key: [ DRONE_REPO_NAME, DRONE_BRANCH ]
- name: build
image: node:14
commands:
- npm run build:prod
environment:
VUE_APP_API_BASE_URL:
from_secret: baseurl
- name: scpFiles
image: appleboy/drone-scp
settings:
host: amine-louveau.fr
username: ubuntu
key:
from_secret: privateKey
port: 22
target: /home/ubuntu/courses
source: dist/*
- name: deploy
image: appleboy/drone-ssh
settings:
host: amine-louveau.fr
user: ubuntu
key:
from_secret: privateKey
command_timeout: 2m
script:
- cd /home/ubuntu/courses
- mv dist/* ./
- sudo chown www-data:www-data ./*
- sudo rm -rf /var/www/amine/courses/*
- sudo mv ./* /var/www/amine/courses/
trigger:
event:
- promote
target:
- production
volumes:
- name: cache
host:
path: /tmp/cache

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

@ -26,14 +26,18 @@
</div>
<draggable
v-model="searchResults"
v-model="uncheckedItems"
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>
</draggable>
<div v-if="searchQ.length <= 0">
<ListItem v-for="element in checkedItems" v-bind:can-move="false" :key="element.id" v-bind:item="element" v-on:updateItem="updateItem" v-on:deleteElement="deleteElement"></ListItem>
</div>
<div v-if="searchQ.length > 0">
<ListItem v-for="element in searchResults" v-bind:can-move="false" :key="element.id" v-bind:item="element" v-on:updateItem="updateItem" v-on:deleteElement="deleteElement"></ListItem>
</div>
@ -55,6 +59,8 @@ export default {
listName: '',
searchQ: '',
searchResults: [],
uncheckedItems: [],
checkedItems: [],
initialItems: [],
loading: true,
addModalShown: false,
@ -113,23 +119,20 @@ export default {
})
},
recopyItemsObject: function () {
this.searchResults = this.initialItems.map(x => ({...x}));
this.uncheckedItems = this.initialItems.filter(x => !x.checked).map(x => ({...x}));
this.checkedItems = this.initialItems.filter(x => x.checked).map(x => ({...x}));
},
searchItem: function (e) {
if (e.key === 'Enter') {
this.createItem();
} else {
if (this.searchQ.length > 0) {
this.searchResults = this.searchResults.filter(i => i.content.toLowerCase().indexOf(this.searchQ.toLowerCase()) >= 0)
this.searchResults = this.initialItems.filter(i => i.content.toLowerCase().indexOf(this.searchQ.toLowerCase()) >= 0)
} else {
this.recopyItemsObject();
}
}
},
addItem: function (item) {
this.initialItems.push(item);
this.recopyItemsObject();
},
onChange: function (event) {
if (event.moved) {
this.updateItem({
@ -157,7 +160,7 @@ export default {
body: JSON.stringify({content: this.searchQ})
}).then(r => {
return r.json();
}).then(result => {
}).then(() => {
this.searchQ = '';
this.fetchListAndItems(true);
})

View File

@ -11,7 +11,7 @@
</div>
<div class="level-right">
<button class="button is-large" v-on:click="toggleModal">
<button class="button is-large" v-on:click="newItem">
<span class="icon is-medium">
<ion-icon name="add-outline"></ion-icon>
</span>
@ -20,25 +20,27 @@
</nav>
<div class="columns">
<div class="column is-one-quarter" v-for="item in lists" :key="item.id">
<div class="card">
<div class="card-content">
<p class="title">
{{item.name}}
</p>
<router-link :to="{ name: 'List', params: { id: item.id }}" custom v-slot="{ navigate }">
<div class="card" @click="navigate">
<div class="card-content">
<p class="title">
{{item.name}}
</p>
</div>
<footer class="card-footer">
<a href="#" class="card-footer-item" v-on:click.prevent="selectItem(item)">Edit</a>
<a href="#" class="card-footer-item" v-on:click.prevent="deleteItem(item)">Delete</a>
</footer>
</div>
<footer class="card-footer">
<router-link class="card-footer-item" :to="{ name: 'List', params: { id: item.id }}">Select</router-link>
<a href="#" class="card-footer-item" v-on:click="selectItem(item)">Edit</a>
<a href="#" class="card-footer-item" v-on:click="deleteItem(item)">Delete</a>
</footer>
</div>
</router-link>
</div>
</div>
</div>
</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 +73,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);
}
});
@ -80,6 +82,10 @@ export default {
toggleModal: function () {
this.addModalShown = !this.addModalShown;
},
newItem: function () {
this.selectedItem = null;
this.toggleModal();
},
selectItem: function (item) {
this.selectedItem = item;
this.toggleModal();
@ -103,6 +109,11 @@ export default {
}
</script>
<style scoped>
.columns {
flex-wrap: wrap;
}
</style>

View File

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