update tooltip

This commit is contained in:
Shaun Chyxion 2017-08-05 14:53:36 +08:00
parent ad354c76ac
commit d3d964cff6
16 changed files with 115 additions and 64 deletions

1
.gitignore vendored
View File

@ -20,6 +20,7 @@
!.editorconfig !.editorconfig
!.ember-cli !.ember-cli
!.jshintrc !.jshintrc
!.eslintrc.js
!.travis.yml !.travis.yml
!.watchmanconfig !.watchmanconfig
!.gitignore !.gitignore

View File

@ -111,7 +111,10 @@ public class CustomerServiceSupport
viewModel.setAttr("years", years != null ? years : new String[0]); viewModel.setAttr("years", years != null ? years : new String[0]);
viewModel.setAttr("ytdSales", ytdSales != null ? viewModel.setAttr("ytdSales", ytdSales != null ?
ytdSales : Collections.emptyList()); ytdSales : Collections.emptyList());
List<ViewModel<CustomerIssue>> recentIssues = customerIssueService.listViewModels(
// recent 3 issues
List<ViewModel<CustomerIssue>> recentIssues =
customerIssueService.listViewModels(
new Search(CustomerYearToDateSale.CUSTOMER_ID, model.getId()) new Search(CustomerYearToDateSale.CUSTOMER_ID, model.getId())
.eq(CustomerYearToDateSale.ENABLED, true) .eq(CustomerYearToDateSale.ENABLED, true)
.desc(CustomerYearToDateSale.DATE_CREATED) .desc(CustomerYearToDateSale.DATE_CREATED)

13
web/.eslintrc.js Normal file
View File

@ -0,0 +1,13 @@
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module'
},
extends: 'eslint:recommended',
env: {
browser: true
},
rules: {
}
};

View File

@ -1,5 +1,6 @@
import Ember from 'ember'; import Ember from 'ember';
export default Ember.Component.extend({ export default Ember.Component.extend({
classNames: ['widget-header'] classNames: ['widget-header'],
dropdownMenu: true
}); });

View File

@ -6,6 +6,7 @@ export default BaseComponent.extend({
tagName: 'a', tagName: 'a',
classNames: ['cursor-pointer'], classNames: ['cursor-pointer'],
attributeBindings: ['title'], attributeBindings: ['title'],
'data-rel': 'tooltip',
title: 'Reload', title: 'Reload',
click() { click() {
this.get('route').refresh(); this.get('route').refresh();

View File

@ -3,16 +3,24 @@ import BaseComponent from './base-component';
export default BaseComponent.extend({ export default BaseComponent.extend({
tagName: 'a', tagName: 'a',
attributeBindings: ['title', 'role', 'rel'], attributeBindings: ['title', 'role', 'data-rel'],
role: 'button', role: 'button',
rel: 'tooltip', 'data-rel': 'tooltip',
enabledText: 'Enable', enabledText: 'Enable',
disabledText: 'Disable', disabledText: 'Disable',
enabledOp: 'enable',
disabledOp: 'disable',
enabled: Ember.computed.alias('model.enabled'), enabled: Ember.computed.alias('model.enabled'),
title: Ember.computed('enabled', function() { title: Ember.computed('enabled', function() {
let me = this; let me = this;
return this.get('enabled') ? me.get('disabledText') : me.get('enabledText'); return this.get('enabled') ? me.get('disabledText') : me.get('enabledText');
}), }),
op: Ember.computed('enabled', function() {
let me = this;
return this.get('enabled') ?
me.get('disabledOp') || me.get('disabledText')
: me.get('enabledOp') || me.get('enabledText');
}),
iconSizeClass: 'bigger-120', iconSizeClass: 'bigger-120',
didReceiveAttrs() { didReceiveAttrs() {
let me = this; let me = this;
@ -27,6 +35,11 @@ export default BaseComponent.extend({
'iconOnly::btn-xs']); 'iconOnly::btn-xs']);
} }
}, },
didInsertElement() {
let me = this;
me._super(...arguments);
me.$().tooltip();
},
click() { click() {
let me = this; let me = this;
me.dialog.confirm('Are you sure to ' + me.get('title') + ' row?', () => { me.dialog.confirm('Are you sure to ' + me.get('title') + ' row?', () => {

View File

@ -18,7 +18,7 @@ const cols = ['showId',
'showIssue3', 'showIssue3',
]; ];
const config = { const config = {
showAll: true, showAll: false,
showAllChanged: Ember.observer('showAll', function() { showAllChanged: Ember.observer('showAll', function() {
let me = this; let me = this;
if (!me.get('lock')) { if (!me.get('lock')) {

View File

@ -13,7 +13,6 @@ export default Ember.Route.extend({
me.get('ajax').doPost('auth/login', model, me.get('ajax').doPost('auth/login', model,
function(user) { function(user) {
Ember.Logger.debug(`User ${user} Loggedin`); Ember.Logger.debug(`User ${user} Loggedin`);
Ember.$.sessionStorage.set('user', user);
me.set('ajax.user', user); me.set('ajax.user', user);
me.message.alert('Sign in successfully'); me.message.alert('Sign in successfully');
me.transitionTo('index'); me.transitionTo('index');

View File

@ -1,13 +1,17 @@
<div class="widget-toolbar"> <div class="widget-toolbar">
{{#if hasBlock}} {{#if hasBlock}}
{{#if dropdownMenu}}
<div class="widget-menu"> <div class="widget-menu">
<a href="#" data-action="settings" data-toggle="dropdown"> <a href="#" data-action="settings" data-toggle="dropdown" data-rel="tooltip" title="Dropdown">
<i class="ace-icon fa fa-bars"></i> <i class="ace-icon fa fa-bars"></i>
</a> </a>
<ul class="dropdown-menu dropdown-menu-right dropdown-light-blue dropdown-caret dropdown-closer"> <ul class="dropdown-menu dropdown-menu-right dropdown-light-blue dropdown-caret dropdown-closer">
{{yield}} {{yield}}
</ul> </ul>
</div> </div>
{{else}}
{{yield}}
{{/if}}
{{/if}} {{/if}}
{{reload-btn}} {{reload-btn}}
</div> </div>

View File

@ -4,6 +4,14 @@
placeholder="Search ..." placeholder="Search ..."
value=searchText value=searchText
insert-newline='search' insert-newline='search'
focus-out='search'
}} }}
<i class="ace-icon fa fa-search nav-search-icon"></i> <i class="ace-icon fa fa-search nav-search-icon"></i>
</span> </span>
{{!--
<div class="inline" style="margin-top:0">
<a class="btn btn-xs btn-info" style="margin-bottom: 3px;">
<i class="ace-icon fa fa-search bigger-120"></i>
</a>
</div>
--}}

View File

@ -17,7 +17,7 @@
<th> <th>
Name Name
</th> </th>
<th class="hidden-480"> <th>
<i class="ace-icon fa fa-sticky-note-o bigger-110 hidden-480"></i> <i class="ace-icon fa fa-sticky-note-o bigger-110 hidden-480"></i>
Remark Remark
</th> </th>
@ -38,7 +38,7 @@
<td> <td>
{{it.name}} {{it.name}}
</td> </td>
<td class="hidden-480"> <td>
{{editable-cell model=it field='note'}} {{editable-cell model=it field='note'}}
</td> </td>
<td> <td>
@ -72,7 +72,6 @@
<li> <li>
{{status-toggle-button model=it iconOnly=true}} {{status-toggle-button model=it iconOnly=true}}
</li> </li>
<li> <li>
{{#link-to 'customer-status.edit' it.id class='tooltip-info' data-rel='tooltip' title='Edit'}} {{#link-to 'customer-status.edit' it.id class='tooltip-info' data-rel='tooltip' title='Edit'}}
<span class="blue"> <span class="blue">
@ -80,17 +79,16 @@
</span> </span>
{{/link-to}} {{/link-to}}
</li> </li>
<li> <li>
{{#if (not-eq model.data.firstObject.id it.id)}} {{#if (not-eq model.data.firstObject.id it.id)}}
<button class="tooltip-info" title="Move Up" {{action (route-action 'moveUp' it)}}> <a class="tooltip-info" title="Move Up" {{action (route-action 'moveUp' it)}}>
<i class="ace-icon fa fa-arrow-up bigger-120"></i> <i class="ace-icon fa fa-arrow-up bigger-120"></i>
</button> </a>
{{/if}} {{/if}}
{{#if (not-eq model.data.lastObject.id it.id)}} {{#if (not-eq model.data.lastObject.id it.id)}}
<button class="tooltip-info" title="Move Down" {{action (route-action 'moveDown' it)}}> <a class="tooltip-info" title="Move Down" {{action (route-action 'moveDown' it)}}>
<i class="ace-icon fa fa-arrow-down bigger-120"></i> <i class="ace-icon fa fa-arrow-down bigger-120"></i>
</button> </a>
{{/if}} {{/if}}
</li> </li>
</ul> </ul>

View File

@ -1,6 +1,14 @@
{{#main-content}} {{#main-content}}
<div class="widget-box transparent"> <div class="widget-box transparent">
{{#grid-header}} {{#grid-header dropdownMenu=false}}
<div class="widget-menu">
{{#link-to 'customer.list.advanced-query' data-rel="tooltip" title='Advanced Query'}}
<i class="ace-icon fa fa-database"></i>
{{/link-to}}
<a href="#" data-action="settings" data-toggle="dropdown" data-rel="tooltip" title="Dropdown Menu">
<i class="ace-icon fa fa-bars"></i>
</a>
<ul class="dropdown-menu dropdown-menu-right dropdown-light-blue dropdown-caret dropdown-closer">
{{#if ajax.user.admin}} {{#if ajax.user.admin}}
<li> <li>
{{#link-to 'customer.import'}} {{#link-to 'customer.import'}}
@ -21,6 +29,8 @@
Advanced Query Advanced Query
{{/link-to}} {{/link-to}}
</li> </li>
</ul>
</div>
{{/grid-header}} {{/grid-header}}
<div class="widget-body"> <div class="widget-body">
@ -36,7 +46,7 @@
<th>Name</th> <th>Name</th>
{{/if}} {{/if}}
{{#if tableOptions.showDateAdded}} {{#if tableOptions.showDateAdded}}
{{sortable-th name='dateAdded' text='Added'}} {{sortable-th name='dateAdded' text='Added' class='hidden-480'}}
{{/if}} {{/if}}
{{#if tableOptions.showYears}} {{#if tableOptions.showYears}}
<th>Years</th> <th>Years</th>
@ -60,7 +70,7 @@
{{sortable-th name='region' text='Region' class='hidden-480'}} {{sortable-th name='region' text='Region' class='hidden-480'}}
{{/if}} {{/if}}
{{#if tableOptions.showSalesperson}} {{#if tableOptions.showSalesperson}}
{{sortable-th name='salesperson' text='Salesperson'}} {{sortable-th name='salesperson' text='Salesperson' class='hidden-480'}}
{{/if}} {{/if}}
{{#if tableOptions.showStatus}} {{#if tableOptions.showStatus}}
<th class="hidden-480">Status</th> <th class="hidden-480">Status</th>
@ -97,7 +107,7 @@
</td> </td>
{{/if}} {{/if}}
{{#if tableOptions.showDateAdded}} {{#if tableOptions.showDateAdded}}
<td> <td class='hidden-480'>
{{date-cell value=it.dateAdded format='D/M/YYYY'}} {{date-cell value=it.dateAdded format='D/M/YYYY'}}
</td> </td>
{{/if}} {{/if}}
@ -156,17 +166,17 @@
</td> </td>
{{/if}} {{/if}}
{{#if tableOptions.showSalesperson}} {{#if tableOptions.showSalesperson}}
<td> <td class="hidden-480">
{{it.salesperson}} {{it.salesperson}}
</td> </td>
{{/if}} {{/if}}
{{#if tableOptions.showStatus}} {{#if tableOptions.showStatus}}
<td> <td class="hidden-480">
{{it.statusText}} {{it.statusText}}
</td> </td>
{{/if}} {{/if}}
{{#if tableOptions.showIssue1}} {{#if tableOptions.showIssue1}}
<td style="max-width: 32px;"> <td class="hidden-480" style="max-width: 32px;">
{{#if it.issue1}} {{#if it.issue1}}
<div style="max-height: 48px; overflow: auto; cursor: pointer;"> <div style="max-height: 48px; overflow: auto; cursor: pointer;">
{{it.issue1.issue}} {{it.issue1.issue}}
@ -184,7 +194,7 @@
</td> </td>
{{/if}} {{/if}}
{{#if tableOptions.showIssue2}} {{#if tableOptions.showIssue2}}
<td style="max-width: 32px"> <td class="hidden-480" style="max-width: 32px;">
{{#if it.issue2}} {{#if it.issue2}}
<div style="max-height: 48px; overflow: auto; cursor: pointer;"> <div style="max-height: 48px; overflow: auto; cursor: pointer;">
{{it.issue2.issue}} {{it.issue2.issue}}
@ -199,7 +209,7 @@
</td> </td>
{{/if}} {{/if}}
{{#if tableOptions.showIssue3}} {{#if tableOptions.showIssue3}}
<td style="max-width: 32px"> <td class="hidden-480" style="max-width: 32px;">
{{#if it.issue3}} {{#if it.issue3}}
<div style="max-height: 48px; overflow: auto; cursor: pointer;"> <div style="max-height: 48px; overflow: auto; cursor: pointer;">
{{it.issue3.issue}} {{it.issue3.issue}}

View File

@ -42,7 +42,7 @@
<th> <th>
Name Name
</th> </th>
<th> <th class="hidden-480">
Name(EN) Name(EN)
</th> </th>
</tr> </tr>
@ -52,7 +52,6 @@
{{log model.users}} {{log model.users}}
{{#each model.users as |u|}} {{#each model.users as |u|}}
<tr> <tr>
{{log u}}
<td> <td>
{{u.employeeId}} {{u.employeeId}}
</td> </td>
@ -62,7 +61,7 @@
<td> <td>
{{u.name}} {{u.name}}
</td> </td>
<td> <td class="hidden-480">
{{u.enName}} {{u.enName}}
</td> </td>
</tr> </tr>

View File

@ -15,11 +15,11 @@
<thead class="thin-border-bottom"> <thead class="thin-border-bottom">
<tr> <tr>
{{sortable-th name='employeeId' text='Employee ID'}} {{sortable-th name='employeeId' text='Employee ID'}}
{{sortable-th name='account' text='Account'}} {{sortable-th name='account' text='Account' class="hidden-480"}}
<th> <th>
Name Name
</th> </th>
{{sortable-th name='enName' text='Name(EN)'}} {{sortable-th name='enName' text='Name(EN)' class="hidden-480"}}
<th> <th>
Admin Admin
</th> </th>
@ -27,7 +27,7 @@
<i class="ace-icon fa fa-sticky-note-o bigger-110 hidden-480"></i> <i class="ace-icon fa fa-sticky-note-o bigger-110 hidden-480"></i>
Remark Remark
</th> </th>
<th> <th class="hidden-480">
<i class="ace-icon fa fa-exchange bigger-110 hidden-480"></i> <i class="ace-icon fa fa-exchange bigger-110 hidden-480"></i>
Status Status
</th> </th>
@ -44,13 +44,13 @@
<td> <td>
{{it.employeeId}} {{it.employeeId}}
</td> </td>
<td> <td class="hidden-480">
{{it.account}} {{it.account}}
</td> </td>
<td> <td>
{{it.name}} {{it.name}}
</td> </td>
<td> <td class="hidden-480">
{{it.enName}} {{it.enName}}
</td> </td>
<td> <td>
@ -59,13 +59,13 @@
<td class="hidden-480"> <td class="hidden-480">
{{editable-cell model=it field='note'}} {{editable-cell model=it field='note'}}
</td> </td>
<td> <td class="hidden-480">
{{status-cell model=it field='enabled' enabledText='ACTIVE' disabledText='BLOCKED'}} {{status-cell model=it field='enabled' enabledText='ACTIVE' disabledText='BLOCKED'}}
</td> </td>
<td> <td>
<div class="hidden-sm hidden-xs btn-group"> <div class="hidden-sm hidden-xs btn-group">
{{status-toggle-button model=it enabledText='active' disabledText='block'}} {{status-toggle-button model=it enabledOp='active' disabledOp='block' enabledText='Active User' disabledText='Block User'}}
{{#link-to 'user.edit' it.id class='btn btn-xs btn-info' title='Edit User'}} {{#link-to 'user.edit' it.id class='btn btn-xs btn-info' data-rel='tooltip' title='Edit User'}}
<i class="ace-icon fa fa-pencil bigger-120"></i> <i class="ace-icon fa fa-pencil bigger-120"></i>
{{/link-to}} {{/link-to}}
</div> </div>

View File

@ -62,7 +62,7 @@ module.exports = function(defaults) {
importVendor(app, 'bower_components/bootbox/bootbox.js'); importVendor(app, 'bower_components/bootbox/bootbox.js');
importVendor(app, 'bower_components/validate/validate.js'); importVendor(app, 'bower_components/validate/validate.js');
importVendor(app, 'bower_components/jquery-storage-api/jquery.storageapi.min.js');
// FueUX // FueUX
importVendor(app, 'bower_components/fuelux/js/spinbox.js'); importVendor(app, 'bower_components/fuelux/js/spinbox.js');
importVendor(app, 'bower_components/fuelux/js/tree.js'); importVendor(app, 'bower_components/fuelux/js/tree.js');

View File

@ -1,2 +1,3 @@
# ember s --proxy http://127.0.0.1:8088/ rm -rf tmp dist
ember s --proxy http://101.236.35.13/ ember s --proxy http://127.0.0.1:8088/
# ember s --proxy http://101.236.35.13/