Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anhar Amir Fathoni #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
> 1%
last 2 versions
not ie <= 8
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[*.{js,jsx,ts,tsx,vue}]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
17 changes: 17 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
root: true,
env: {
node: true
},
'extends': [
'plugin:vue/essential',
'@vue/standard'
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
},
parserOptions: {
parser: 'babel-eslint'
}
}
3 changes: 3 additions & 0 deletions .firebase/hosting.cHVibGlj.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
favicon.ico,1548605200845,efd24a56239d255af28537949b97eb64b060ac198368fe3832f7d082cd34f091
index.html,1548612799725,97313604227c486bab85d5d9f6384a54a7d498a3add5ec440f0de085699199b0
nike.png,1544970159103,3c0df68c7241f846432b9cd9a1ecd273c49f17ef81a94ed03730548bfa242951
5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "mykanban-app"
}
}
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.DS_Store
node_modules
/dist
/src/config/config.json

# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw*
37 changes: 36 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,36 @@
# kanban
# kanban-1

## Project setup
```
npm install
```

### Compiles and hot-reloads for development
```
npm run serve
```

### Compiles and minifies for production
```
npm run build
```

### Run your tests
```
npm run test
```

### Lints and fixes files
```
npm run lint
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).


<br><br><br>
***
## LINK DEPLOY
***
[http://kanban.anharfathoni.site](http://kanban.anharfathoni.site)
5 changes: 5 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/app'
]
}
16 changes: 16 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"hosting": {
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
28 changes: 28 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "kanban-1",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"bootstrap-vue": "^2.0.0-rc.11",
"firebase": "^5.8.1",
"sweetalert": "^2.1.2",
"vue": "^2.5.21",
"vue-router": "^3.0.1",
"vuex": "^3.0.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.3.0",
"@vue/cli-plugin-eslint": "^3.3.0",
"@vue/cli-service": "^3.3.0",
"@vue/eslint-config-standard": "^4.0.0",
"babel-eslint": "^10.0.1",
"eslint": "^5.8.0",
"eslint-plugin-vue": "^5.0.0",
"vue-template-compiler": "^2.5.21"
}
}
5 changes: 5 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
plugins: {
autoprefixer: {}
}
}
Binary file added public/favicon.ico
Binary file not shown.
18 changes: 18 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>nike.png">
<title>Kanban</title>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
</head>
<body>
<noscript>
<strong>We're sorry but kanban-1 doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
Binary file added public/nike.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<template>
<div id="app">
<router-view/>
</div>
</template>

<style>
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
}
#nav {
padding: 30px;
}

#nav a {
font-weight: bold;
color: #2c3e50;
}

#nav a.router-link-exact-active {
color: #42b983;
}
</style>
Binary file added src/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions src/components/Box.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<template>
<b-card class="todos" :header="status.title" :header-bg-variant="status.headercolor" >
<div v-for="(task,i) in tasks" :key="i">
<Task :detail="task" :button="status.button" :color="status.headercolor"></Task>
</div>
</b-card>
</template>

<script>
import db from "@/config/config.js";
import Task from "@/components/Task.vue";

export default {
name: 'task',
components: {
Task
},
data(){
return {
tasks: []
}
},
props: ['status'],
methods: {
getTask() {
db.collection("tasks")
.where("status", "==", this.status.status)
.onSnapshot(querySnapshot => {
this.tasks = [];
querySnapshot.forEach(doc => {
var obj = doc.data();
obj.id = doc.id;
this.tasks.push(obj);
});
});
},
},
created() {
this.getTask();
},
}
</script>
76 changes: 76 additions & 0 deletions src/components/Task.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<template>
<div>
<b-card :header="detail.title" :header-bg-variant="color">
<p class="card-text">Assigned To: {{detail.assignedTo}}</p>
<div class="">
<b-button @click="modalDetails = !modalDetails" size="sm" variant="outline-primary">Detail</b-button>
</div>
</b-card>
<b-modal v-model="modalDetails" id="detailTask" hide-footer :title="detail.title">
<p>Description: {{detail.description}}</p>
<p>Status: {{detail.status}}</p>
<p>Assigned To: {{detail.assignedTo}}</p>

<b-btn @click.prevent="changeStatus(detail.id, button.previous)" v-if="button.previous" class="float-left" :variant="button.colorprevious">
<span>
<!-- <i class="fas fa-arrow-left"></i> -->
<i class="fas fa-backward"></i>
</span>
{{button.previous}}
</b-btn>
<a href="#" class="ml-auto">
<i @click.prevent="deleteTask(detail.id)" class="fas fa-trash-alt mt-2 fa-2x" ></i>
</a>
<b-btn @click.prevent="changeStatus(detail.id, button.next)" v-if="button.next" class="float-right mx-2" :variant="button.colornext">
{{button.next}}
<span>
<!-- <i class="fas fa-arrow-right"></i> -->
<i class="fas fa-forward"></i>
</span>
</b-btn>
</b-modal>
</div>
</template>

<script>
import swal from "sweetalert"
import db from "@/config/config.js"

export default {
props: ["detail", "button", "color"],
data() {
return {
modalDetails: false
};
},
components: {
swal
},
methods: {
deleteTask(taskId) {
db.collection("tasks")
.doc(taskId)
.delete()
.then(function() {
swal("Success delete task", {
icon: "success"
});
})
.catch(function(error) {
console.error("Error:", error);
});
},

changeStatus(taskId, status) {
db.collection("tasks")
.doc(taskId)
.update({
status: status
})
.then(() => {
console.log("Success Change Status");
});
}
}
};
</script>
9 changes: 9 additions & 0 deletions src/config/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const firebase = require('firebase')
require('firebase/firestore')

var config = require('./config.json')

firebase.initializeApp(config)
var db = firebase.firestore()

export default db
3 changes: 3 additions & 0 deletions src/config/config.json-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
your_config_here
}
18 changes: 18 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

Vue.config.productionTip = false

import BootstrapVue from 'bootstrap-vue'
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'

Vue.use(BootstrapVue);

new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
15 changes: 15 additions & 0 deletions src/router.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'

Vue.use(Router)

export default new Router({
routes: [
{
path: '/',
name: 'home',
component: Home
}
]
})
16 changes: 16 additions & 0 deletions src/store.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
state: {

},
mutations: {

},
actions: {

}
})
Loading