Added client ticket module

This commit is contained in:
Juan 2018-03-12 14:02:29 +01:00
parent 3dbd7e6bc0
commit 5c9dab163d
13 changed files with 108 additions and 1 deletions

View File

@ -6,3 +6,4 @@ locator: []
production: []
salix: []
route: []
ticket: []

View File

@ -8,5 +8,7 @@ export default {
locator:
cb => require.ensure([], () => cb(require('locator'))),
item:
cb => require.ensure([], () => cb(require('item')))
cb => require.ensure([], () => cb(require('item'))),
ticket:
cb => require.ensure([], () => cb(require('ticket')))
};

1
client/ticket/index.js Normal file
View File

@ -0,0 +1 @@
export * from './src/ticket';

14
client/ticket/routes.json Normal file
View File

@ -0,0 +1,14 @@
{
"module": "ticket",
"name": "Tickets",
"icon": "receipt",
"validations": false,
"routes": [
{
"url": "/tickets",
"state": "tickets",
"component": "vn-ticket-index",
"acl": ["developer"]
}
]
}

View File

@ -0,0 +1,24 @@
<mg-ajax path="/client/api/Clients/filter" options="mgIndex"></mg-ajax>
<div margin-medium>
<div class="vn-list">
<vn-card>
<vn-horizontal pad-medium>
<vn-searchbar vn-one
index="index"
on-search="$ctrl.search(index)"
ignore-keys = "['page', 'size', 'search']">
</vn-searchbar>
</vn-horizontal>
</vn-card>
<vn-card margin-medium-top>
<vn-ticket-item
ng-repeat="ticket in index.model.instances"
ticket="ticket">
</vn-ticket-item>
</vn-card>
<vn-paging index="index" total="index.model.count"></vn-paging>
</div>
</div>
<a ui-sref="create" fixed-bottom-right>
<vn-float-button icon="person_add"></vn-float-button>
</a>

View File

@ -0,0 +1,14 @@
import ngModule from '../module';
import './item';
export default class Controller {
search(index) {
index.accept();
}
}
Controller.$inject = [];
ngModule.component('vnTicketIndex', {
template: require('./index.html'),
controller: Controller
});

View File

@ -0,0 +1,17 @@
<a
ui-sref="clientCard.basicData({ id: {{::$ctrl.ticket.id}} })"
translate-attr="{title: 'View client'}"
class="vn-list-item">
<vn-horizontal ng-click="$ctrl.onClick($event)">
<vn-one>
<h6>{{::$ctrl.ticket.name}}</h6>
<div><vn-label translate>Id</vn-label> {{::$ctrl.ticket.id}}</div>
</vn-one>
<vn-horizontal class="buttons">
<vn-icon
vn-tooltip="Preview"
icon="icon-preview">
</vn-icon>
</vn-horizontal>
</vn-horizontal>
</a>

View File

@ -0,0 +1,20 @@
import ngModule from '../module';
class Controller {
onClick(event) {
if (event.defaultPrevented)
event.stopImmediatePropagation();
}
preview(event) {
event.preventDefault();
}
}
ngModule.component('vnTicketItem', {
controller: Controller,
template: require('./item.html'),
bindings: {
ticket: '<'
}
});

View File

@ -0,0 +1,3 @@
vn-ticket-item {
display: block;
}

View File

@ -0,0 +1 @@
Tickets: Tickets

View File

@ -0,0 +1 @@
Tickets: Tickets

View File

@ -0,0 +1,5 @@
import {ng} from 'vendor';
import 'core';
const ngModule = ng.module('ticket', ['vnCore']);
export default ngModule;

View File

@ -0,0 +1,4 @@
export * from './module';
import './index/index';