Added client ticket module
This commit is contained in:
parent
3dbd7e6bc0
commit
5c9dab163d
|
@ -6,3 +6,4 @@ locator: []
|
|||
production: []
|
||||
salix: []
|
||||
route: []
|
||||
ticket: []
|
||||
|
|
|
@ -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')))
|
||||
};
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
export * from './src/ticket';
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"module": "ticket",
|
||||
"name": "Tickets",
|
||||
"icon": "receipt",
|
||||
"validations": false,
|
||||
"routes": [
|
||||
{
|
||||
"url": "/tickets",
|
||||
"state": "tickets",
|
||||
"component": "vn-ticket-index",
|
||||
"acl": ["developer"]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -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>
|
|
@ -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
|
||||
});
|
|
@ -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>
|
|
@ -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: '<'
|
||||
}
|
||||
});
|
|
@ -0,0 +1,3 @@
|
|||
vn-ticket-item {
|
||||
display: block;
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
Tickets: Tickets
|
|
@ -0,0 +1 @@
|
|||
Tickets: Tickets
|
|
@ -0,0 +1,5 @@
|
|||
import {ng} from 'vendor';
|
||||
import 'core';
|
||||
|
||||
const ngModule = ng.module('ticket', ['vnCore']);
|
||||
export default ngModule;
|
|
@ -0,0 +1,4 @@
|
|||
export * from './module';
|
||||
|
||||
import './index/index';
|
||||
|
Loading…
Reference in New Issue