SlideShare a Scribd company logo
Vue.js and Dyploma
Dr. Yoram Kornatzky
kornatzky@gmail.com
http://yoramkornatzky.com
What is Vue.js?
• Front End JavaScript framework
• Fast
• Simpler than Angular or React
• Fast learning curve
• Originated by Evan You
• 84K GitHub Stars
GitHub Rising Stars 2017
Front-End Frameworks
NPM Downloads
State of JavaScript 2018
28K developers attention
Vue.js in a Nutshell
• Single Page Applications (SPA)
• Components
• Separate HTML, JavaScript, and CSS
• Vue Router
• Vuex for state management - Redux
The Ecosystem
• CLI to generate a project
• Build - Webpack (and Parcel)
• Test - Vue Test Utils - Mocha and Chai
• ES6 (x,y,z) => x + y + z, async/await
• ESLint
Single File Component -
List.vue
<template lang="html">
...
</template>
<script lang="js">
import ...
export default {
...
}
</script>
<style scoped lang=“scss">
…
</style>
The Template
<div v-if="!isLoading && !error && list.length > 0">
<Item v-for="(item, index) in list" :key="item.id"
v-bind:single="item"
v-bind:header-fields="headerFields"
v-bind:fields="fields"
v-bind:actions-icons="actionsIcons"
v-bind:actions=“actions"
v-bind:name-field=“nameField"
v-on:action=“doAction"
v-on:selectedItem="selectedItem"
>
</Item>
</div>
Rendering - Virtual DOM
• v-if for conditional rendering
• v-for for looping over data
• v-bind for transferring props
• v-on for receiving events
v-on:click=“doThis"
Binding HTML Classes
<div class=“select-all” v-bind:class="{ 'no-select-all': !hasSelectAll }" >
<div class="advanced" v-bind:style=“advancedStyle">
computed: {
advancedStyle() {
if (!this.isVertical) {
return {};
}
return { height: 'auto' /* `${2 *
18.95 this.advancedFields.length}vh` */ };
},
}
JavaScript
import _ from 'lodash';
import Spinner from 'vue-simple-spinner';
import Item from '@/components/list/Item';
import Pagination from '@/components/list/Pagination';
Components and Props
export default {
name: 'list',
components: { Top, Item, Pagination,
Spinner },
props: ['title', ‘placeholder’],
Local Data
data( ) {
return {
inSearch: false,
list: [
{ id: 11, name: ‘whoami’, cpu: 2, replicas: 7 … },
…
],
};
},
Lifecycle Methods
mounted() {
},
activated() {
this.rangeFetched = false;
this.query = this.init ||
this.field.default || '';
},
Methods
methods: {
doAction(data) {
this.allSelected({ chosen: false });
this.$emit('operation', data);
},
}
Computed Properties
<div class="artifact-information">
<detail
v-bind:detail="artifact"
v-bind:title="title"
v-bind:name="name"
v-bind:partition="partition"
v-on:reload="reload"
v-bind:is-loading="isLoadingSingle"
v-bind:error="singleError"
>
</detail>
</div>
computed: {
artifact( ) {
return {
...this.single,
branch: this.single.extraValues.branch,
java_env: this.single.extraValues.java_env,
user: this.single.extraValues.user
};
},
},
Two-Way Data Binding
<input
v-model="query"
@focus="reset"
type="text"
v-bind:placeholder="field.placeholder"
v-bind:disabled="isDisabled"
v-bind:class="{ 'disabled': isDisabled }"
>
data() {
return {
query: '',
};
},
Watching Data Changes
watch: {
query(to, from) {
if (this.query.trim().length >=
this.startAt) {
this.fetchItems();
}
}
},
index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>dyploma-ui</title>
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
main.js
import 'babel-polyfill';
import Vue from 'vue';
import App from './App';
import router from './router';
import store from './store';
Vue.config.productionTip = false;
new Vue({
el: '#app',
store,
router,
template: '<App/>',
components: { App },
});
App.vue
<template>
<div id="app">
<navigation/>
</div>
</template>
<script>
import Navigation from '@/components/Navigation';
export default {
name: 'app',
components: {
navigation: Navigation,
},
};
</script>
<style lang="scss" scoped>
#app {
margin: 0;
padding: 0;
width: 100%;
height: 100vh;
}
</style>
Vuex Store
State
Deployments
Service
s
Blocker
s
Artifacts
Mutations
Getters
Component
Actions
Server
Using the Store
computed: {
...mapGetters(['listError',
'isLoadingList', 'all', 'noMoreData',]),
deployments() {
return this.all(this.page,
this.inSearch);
},
}
Vue Router
import Vue from 'vue';
import Router from 'vue-router';
Vue.use(Router);
export default new Router({ routes: [
{ path: ‘/', name: ‘Root', redirect: { name: 'Deployments' }, },
{ path: ‘/deployments', name: ‘Deployments', component: Deployments, },
{ path: ‘/deployments/deploymentInformation/:id', name: 'Deployment Information’,
component: DeploymentInformation, },
{ path: ‘/deployments/edit-deployment-information', name: 'Edit Deployment Information',
component: EditDeploymentInformation,
}, ]
});
beforeRouteEnter(to, from, next) {
next((vm) => {
vm.clearDeployments();
vm.getDeployments({ page: 1 });
});
},
Call Action on Entry
Dyploma
A system for managing containerised applications and
services on top of Kubernetes in Outbrain:
1. deployments
2. artifacts
3. services
4. blockers
The Backend
• Java Spring backend
• REST API
• MySQL database
• Python CLI:
dyploma-cli deployment create -n ob1ktemplate -e prod -v
db959fffc49 -c sadc1a - - parameter
service_configuration.cpu=4.0 -cm “simple commment”
Dyploma Web UI
Dyploma Web UI
• BitBucket: Delivery / delivery-ui
• Cloud Platform > Core Services > Delivery Team
Structure of App
• Generic components: do not interact with store
1. List
2. Detail
3. Form
• Containers: interact with store, use generic components
Fields Block
Flat Block
Field Block
<div class=“fields-block">
<flat-block
v-for="(f, index) in fields" :key="f.key"
v-bind:data="data"
v-bind:field="f">
</flat-block>
</div>
The Power of Generics
Detail Form component
Advanced Search component
Generic Input Form
<div v-for="(f, index) in advancedFields" :key="index" class="field">
<div class="field-label" v-if="f.key != nameField">{{ f.name }}</div>
<input class="field-input"
v-if="simpleField(f)"
v-bind:id="f.key"
v-bind:value="initialFieldValue(f)"
v-on:change="onChange"
v-bind:disabled="f.disabled"
v-bind:class="{ 'disabled': f.disabled }"
>
</input>
<typeahead
v-bind:field="f"
:start-at="3"
v-on:selected="typeaheadFiltered"
v-if="f.typeahead && f.key != nameField"
v-bind:init="initial && initial[f.full]"
v-bind:is-disabled="f.disabled"
v-bind:additional="initial && f.additional && initial[f.additional]"
>
</typeahead>
</div>
Container - Deployments
<template lang="html">
<div class="deployments">
<List
v-bind:list="deployments"
v-bind:title="title"
v-bind:has-advanced="hasAdvanced"
v-bind:has-search="hasSearch"
v-bind:placeholder="placeholder"
v-bind:fields="fields"
v-bind:actions-icons="actionsIcons"
v-bind:actions="actions"
>
</List>
</div>
</template>
Using the Store
import { createNamespacedHelpers } from ‘vuex';
const { mapActions, mapGetters } = createNamespacedHelpers(‘deployments’);
export default {
methods: {
...mapActions(['getDeployments', 'clearDeployments',
'searchDeployments', ‘deleteDeployment']),
},
computed: {
...mapGetters(['listError', 'isLoadingList', 'all',
'noMoreData', 'errorsList']),
deployments() {
return this.all(this.page, this.inSearch);
},
}
The Styling
• SASS (SCSS)
• Flexbox
• Grid
• Vue Material
• Chrome on desktop
• Desktop responsiveness

More Related Content

PDF
Building and deploying React applications
PDF
Overview of the AngularJS framework
PDF
An introduction to Vue.js
PPTX
How to Build SPA with Vue Router 2.0
PPTX
Testing frontends with nightwatch & saucelabs
PDF
Room with a Vue - Introduction to Vue.js
PPTX
An introduction to Vue.js
PDF
Enjoy the vue.js
Building and deploying React applications
Overview of the AngularJS framework
An introduction to Vue.js
How to Build SPA with Vue Router 2.0
Testing frontends with nightwatch & saucelabs
Room with a Vue - Introduction to Vue.js
An introduction to Vue.js
Enjoy the vue.js

What's hot (20)

PDF
Node.js and Selenium Webdriver, a journey from the Java side
PDF
How to Build ToDo App with Vue 3 + TypeScript
PDF
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
PDF
JavaFX Pitfalls
PDF
AtlasCamp 2015: Connect everywhere - Cloud and Server
PDF
AngularJS Basics
PPTX
Vue presentation
PDF
Why Vue.js?
PDF
Modern frontend development with VueJs
PPTX
Vue business first
PDF
AngularJS Basics and Best Practices - CC FE &UX
PDF
JavaFX – 10 things I love about you
PDF
introduction to Vue.js 3
PDF
The Point of Vue - Intro to Vue.js
PDF
JavaFX JumpStart @JavaOne 2016
PDF
AtlasCamp 2015: Web technologies you should be using now
PDF
20160905 - BrisJS - nightwatch testing
PDF
JavaLand 2014 - Ankor.io Presentation
PDF
Fullstack End-to-end test automation with Node.js, one year later
Node.js and Selenium Webdriver, a journey from the Java side
How to Build ToDo App with Vue 3 + TypeScript
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
JavaFX Pitfalls
AtlasCamp 2015: Connect everywhere - Cloud and Server
AngularJS Basics
Vue presentation
Why Vue.js?
Modern frontend development with VueJs
Vue business first
AngularJS Basics and Best Practices - CC FE &UX
JavaFX – 10 things I love about you
introduction to Vue.js 3
The Point of Vue - Intro to Vue.js
JavaFX JumpStart @JavaOne 2016
AtlasCamp 2015: Web technologies you should be using now
20160905 - BrisJS - nightwatch testing
JavaLand 2014 - Ankor.io Presentation
Fullstack End-to-end test automation with Node.js, one year later
Ad

Similar to Vue js and Dyploma (20)

PDF
Vue routing tutorial getting started with vue router
PPTX
A New Vue for Web Development
PDF
Love at first Vue
PDF
Vuejs for Angular developers
PPTX
Vue 2.0 + Vuex Router & Vuex at Vue.js
PDF
Building a Single Page Application with VueJS
PDF
Vue fundamentasl with Testing and Vuex
PDF
Intro to VueJS Workshop
PDF
Vue, vue router, vuex
PDF
VueJS Best Practices
PDF
Vue.js - An Introduction
DOCX
vue js.docx
PDF
Bermon Painter - Rapid Prototyping with Vue.js - Codemotion Rome 2019
PDF
Vuex to Pinia, how to migrate an existing app
PDF
Da Vuex a Pinia: come fare la migrazione
PDF
VueJS: The Simple Revolution
PDF
Vue JS @ MindDoc. The progressive road to online therapy
PPTX
Vue.js Use Cases
PDF
Why Vue JS
Vue routing tutorial getting started with vue router
A New Vue for Web Development
Love at first Vue
Vuejs for Angular developers
Vue 2.0 + Vuex Router & Vuex at Vue.js
Building a Single Page Application with VueJS
Vue fundamentasl with Testing and Vuex
Intro to VueJS Workshop
Vue, vue router, vuex
VueJS Best Practices
Vue.js - An Introduction
vue js.docx
Bermon Painter - Rapid Prototyping with Vue.js - Codemotion Rome 2019
Vuex to Pinia, how to migrate an existing app
Da Vuex a Pinia: come fare la migrazione
VueJS: The Simple Revolution
Vue JS @ MindDoc. The progressive road to online therapy
Vue.js Use Cases
Why Vue JS
Ad

Recently uploaded (20)

PPTX
L1 - Introduction to python Backend.pptx
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
Digital Strategies for Manufacturing Companies
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
Transform Your Business with a Software ERP System
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
System and Network Administration Chapter 2
PDF
medical staffing services at VALiNTRY
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
L1 - Introduction to python Backend.pptx
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
2025 Textile ERP Trends: SAP, Odoo & Oracle
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Digital Strategies for Manufacturing Companies
Wondershare Filmora 15 Crack With Activation Key [2025
Odoo POS Development Services by CandidRoot Solutions
Design an Analysis of Algorithms II-SECS-1021-03
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Transform Your Business with a Software ERP System
How to Choose the Right IT Partner for Your Business in Malaysia
System and Network Administration Chapter 2
medical staffing services at VALiNTRY
Odoo Companies in India – Driving Business Transformation.pdf
Which alternative to Crystal Reports is best for small or large businesses.pdf
Understanding Forklifts - TECH EHS Solution
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool

Vue js and Dyploma