Compare commits
5 Commits
24da34bbef
...
79809ab774
Author | SHA1 | Date | |
---|---|---|---|
79809ab774 | |||
e0f9f7ae47 | |||
3825397238 | |||
ae13f80c7c | |||
b871072e01 |
@ -1,17 +1,18 @@
|
||||
package com.pudonghot.ambition.crm.service.support;
|
||||
|
||||
import lombok.val;
|
||||
import java.util.List;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import lombok.val;
|
||||
import org.springframework.util.Assert;
|
||||
import me.chyxion.tigon.model.ViewModel;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import com.pudonghot.ambition.crm.model.User;
|
||||
import org.springframework.stereotype.Service;
|
||||
import me.chyxion.tigon.kit.sequence.IdSequence;
|
||||
import com.pudonghot.ambition.crm.util.Sha512Utils;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import com.pudonghot.ambition.crm.mapper.UserMapper;
|
||||
import com.pudonghot.ambition.crm.service.UserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import com.pudonghot.ambition.crm.form.create.UserFormForCreate;
|
||||
import com.pudonghot.ambition.crm.form.update.UserFormForUpdate;
|
||||
import me.chyxion.tigon.service.support.BaseCrudByFormServiceSupport;
|
||||
@ -31,6 +32,9 @@ public class UserServiceSupport
|
||||
UserFormForCreate, UserFormForUpdate, UserMapper>
|
||||
implements UserService {
|
||||
|
||||
@Autowired
|
||||
private IdSequence idSeq;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@ -48,7 +52,7 @@ public class UserServiceSupport
|
||||
*/
|
||||
@Override
|
||||
public int delete(final String id) {
|
||||
User user = find(id);
|
||||
final User user = find(id);
|
||||
Assert.state(user != null, "No user [" + id + "] found");
|
||||
Assert.state(!user.getEnabled(), "User [" + id + "] is enabled");
|
||||
return super.delete(id);
|
||||
@ -59,7 +63,7 @@ public class UserServiceSupport
|
||||
*/
|
||||
@Override
|
||||
public boolean validatePassword(String userId, String password) {
|
||||
final User user = mapper.find(userId);
|
||||
val user = mapper.find(userId);
|
||||
return hashPassword(user.getId(), password)
|
||||
.equals((user.getPassword()));
|
||||
}
|
||||
@ -68,7 +72,7 @@ public class UserServiceSupport
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public List<ViewModel<User>> listByCustomerId(@NotBlank String customerId) {
|
||||
public List<ViewModel<User>> listByCustomerId(final String customerId) {
|
||||
return toViewModel(mapper.listByCustomerId(customerId));
|
||||
}
|
||||
|
||||
@ -80,7 +84,7 @@ public class UserServiceSupport
|
||||
Assert.state(form.getPassword().equals(form.getConfirmPassword()),
|
||||
"Repeat password does not match");
|
||||
|
||||
final User user = mapper.find(userId);
|
||||
val user = mapper.find(userId);
|
||||
Assert.state(user != null, "No user [" + userId + "] found");
|
||||
Assert.state(hashPassword(userId, form.getOriginPassword())
|
||||
.equals((user.getPassword())), "Incorrect origin password");
|
||||
@ -94,7 +98,7 @@ public class UserServiceSupport
|
||||
*/
|
||||
@Override
|
||||
public String findAccount(final String id) {
|
||||
final User user = find(id);
|
||||
val user = find(id);
|
||||
Assert.state(user != null, "No user [" + id + "] found");
|
||||
return user.getAccount();
|
||||
}
|
||||
@ -105,6 +109,7 @@ public class UserServiceSupport
|
||||
@Override
|
||||
protected void beforeInsert(final User model) {
|
||||
super.beforeInsert(model);
|
||||
model.setId(idSeq.get());
|
||||
model.setPassword(hashPassword(model.getId(), model.getPassword()));
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,30 @@
|
||||
package com.pudonghot.ambition.crm.service;
|
||||
|
||||
import lombok.val;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chyxion.tigon.mybatis.Search;
|
||||
import com.pudonghot.ambition.crm.AmbitionCRM;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Sep 27, 2022 15:28:31
|
||||
*/
|
||||
@Slf4j
|
||||
@SpringBootTest
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = AmbitionCRM.class)
|
||||
public class UserServiceTest {
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
|
||||
@Test
|
||||
public void testList() {
|
||||
val users = userService.list(new Search().limit(1));
|
||||
}
|
||||
}
|
46
server/crm/src/test/resources/application.yml
Normal file
46
server/crm/src/test/resources/application.yml
Normal file
@ -0,0 +1,46 @@
|
||||
server:
|
||||
port: 8088
|
||||
|
||||
spring:
|
||||
jackson:
|
||||
default-property-inclusion: NON_NULL
|
||||
time-zone: GMT+8
|
||||
serialization:
|
||||
write-dates-as-timestamps: true
|
||||
fail-on-empty-beans: false
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 512MB
|
||||
max-request-size: 512MB
|
||||
|
||||
datasource:
|
||||
database-name: ambition-crm
|
||||
host: 172.16.4.6
|
||||
password: MySQL2b||!2b
|
||||
port: 3306
|
||||
username: root
|
||||
|
||||
database:
|
||||
backup-dir: d:/data/database_backups
|
||||
restore-shell: /data/program/mysql-backup/bin/mysql_restore.sh
|
||||
|
||||
file:
|
||||
base-dir: /Users/donghuang/Documents/Workspaces/ambition-crm/files/
|
||||
base-path: http://127.0.0.1:1217/lm-f/
|
||||
|
||||
export:
|
||||
location: d:/data/export
|
||||
|
||||
tigon:
|
||||
shiro:
|
||||
session:
|
||||
validation:
|
||||
scheduler:
|
||||
enabled: true
|
||||
filter-chain: >
|
||||
/auth/login=anon
|
||||
/=anon
|
||||
/index.html=anon
|
||||
/assets/**=anon
|
||||
/f/**=anon
|
||||
/**=user
|
@ -1 +1 @@
|
||||
Subproject commit 1c57bdaf5ab05684239ea1a1e50d33730095d464
|
||||
Subproject commit 2b1df37ce5b3aa0ae401c0368c2156b1b8f27d3b
|
@ -17,7 +17,7 @@
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
|
||||
|
||||
<tigon.version>0.0.1-SNAPSHOT</tigon.version>
|
||||
<tigon.version>0.0.4-SNAPSHOT</tigon.version>
|
||||
<spring-boot.version>2.3.12.RELEASE</spring-boot.version>
|
||||
<aspectj.version>1.8.10</aspectj.version>
|
||||
</properties>
|
||||
|
@ -9,5 +9,6 @@ module.exports = {
|
||||
browser: true
|
||||
},
|
||||
rules: {
|
||||
'no-console': 'off'
|
||||
}
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
import Ember from 'ember';
|
||||
import { isNone } from '@ember/utils';
|
||||
import BaseFormInput from './base-form-input';
|
||||
|
||||
export default BaseFormInput.extend({
|
||||
@ -8,6 +8,6 @@ export default BaseFormInput.extend({
|
||||
didReceiveAttrs() {
|
||||
let me = this;
|
||||
me._super(...arguments);
|
||||
Ember.isNone(me.getVal()) && me.setVal(false);
|
||||
isNone(me.getVal()) && me.setVal(false);
|
||||
}
|
||||
});
|
||||
|
@ -1,4 +1,5 @@
|
||||
import Ember from 'ember';
|
||||
import { observer } from '@ember/object';
|
||||
import { addObserver } from '@ember/object/observers';
|
||||
import BaseFormInput from './base-form-input';
|
||||
import $ from 'jquery'
|
||||
|
||||
@ -8,7 +9,7 @@ export default BaseFormInput.extend({
|
||||
let me = this;
|
||||
me._super(...arguments);
|
||||
|
||||
Ember.addObserver(me, me.getFieldPath(), me, 'colorChanged');
|
||||
addObserver(me, me.getFieldPath(), me, 'colorChanged');
|
||||
me.colorChanged();
|
||||
},
|
||||
didInsertElement() {
|
||||
@ -35,7 +36,7 @@ export default BaseFormInput.extend({
|
||||
me.set('lockColor', false);
|
||||
}
|
||||
},
|
||||
hexColorObserver: Ember.observer('hexColor', function() {
|
||||
hexColorObserver: observer('hexColor', function() {
|
||||
let me = this;
|
||||
if (!me.get('lockHexColor')) {
|
||||
let hexColor = me.get('hexColor');
|
||||
|
@ -1,4 +1,4 @@
|
||||
import Ember from 'ember';
|
||||
import { isNone } from '@ember/utils';
|
||||
import BaseFormInput from './base-form-input';
|
||||
|
||||
export default BaseFormInput.extend({
|
||||
@ -10,6 +10,6 @@ export default BaseFormInput.extend({
|
||||
didReceiveAttrs() {
|
||||
let me = this;
|
||||
me._super(...arguments);
|
||||
Ember.isNone(me.getVal()) && me.setVal(false);
|
||||
isNone(me.getVal()) && me.setVal(false);
|
||||
}
|
||||
});
|
||||
|
@ -1,4 +1,4 @@
|
||||
import Ember from 'ember';
|
||||
import { bind } from '@ember/runloop';
|
||||
import Component from '@ember/component';
|
||||
import $ from 'jquery';
|
||||
|
||||
@ -7,7 +7,7 @@ export default Component.extend({
|
||||
init() {
|
||||
let me = this;
|
||||
me._super(...arguments);
|
||||
$(window).on('resize', Ember.run.bind(me, me.onWindowResize));
|
||||
$(window).on('resize', bind(me, me.onWindowResize));
|
||||
},
|
||||
didInsertElement() {
|
||||
let me = this;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import Ember from 'ember';
|
||||
import { isNone } from '@ember/utils';
|
||||
import Component from '@ember/component';
|
||||
|
||||
export default Component.extend({
|
||||
@ -9,7 +9,7 @@ export default Component.extend({
|
||||
increase() {
|
||||
let me = this;
|
||||
let max = me.get('max');
|
||||
if (!Ember.isNone(max) && me.get('value') == max) {
|
||||
if (!isNone(max) && me.get('value') == max) {
|
||||
console.info('Spinner increase to max: ', max);
|
||||
return;
|
||||
}
|
||||
@ -18,7 +18,7 @@ export default Component.extend({
|
||||
decrease() {
|
||||
let me = this;
|
||||
let min = me.get('min');
|
||||
if (!Ember.isNone(min) && me.get('value') == min) {
|
||||
if (!isNone(min) && me.get('value') == min) {
|
||||
console.info('Spinner decrease to min: ', min);
|
||||
return;
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import Component from '@ember/component';
|
||||
import { htmlSafe } from '@ember/template';
|
||||
import $ from 'jquery'
|
||||
|
||||
export default Component.extend({
|
||||
@ -8,7 +9,7 @@ export default Component.extend({
|
||||
me._super(...arguments);
|
||||
const issue = me.get('issue').replace(/\r?\n/g, '<br />');
|
||||
me.set('issuePopover', issue);
|
||||
me.set('issueHtml', Ember.String.htmlSafe(issue));
|
||||
me.set('issueHtml', htmlSafe(issue));
|
||||
},
|
||||
didInsertElement() {
|
||||
const me = this;
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { computed } from '@ember/object';
|
||||
import { computed, set } from '@ember/object';
|
||||
import { alias } from '@ember/object/computed';
|
||||
import { merge } from '@ember/polyfills';
|
||||
import BaseComponent from './basic-component';
|
||||
|
||||
export default BaseComponent.extend({
|
||||
@ -41,10 +42,10 @@ export default BaseComponent.extend({
|
||||
let me = this;
|
||||
me.dialog.confirm('Are you sure to ' + me.get('title') + ' row?', () => {
|
||||
let model = me.get('model');
|
||||
Ember.set(model, 'enabled', !me.get('enabled'));
|
||||
set(model, 'enabled', !me.get('enabled'));
|
||||
let params = me.get('params');
|
||||
me.get('service').update(params ?
|
||||
Ember.merge(params, model) : model, true);
|
||||
merge(params, model) : model, true);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -1,8 +1,8 @@
|
||||
import Ember from 'ember';
|
||||
import { helper } from '@ember/component/helper';
|
||||
|
||||
export function array(params/*, hash*/) {
|
||||
console.info('Array: ', params);
|
||||
return params;
|
||||
}
|
||||
|
||||
export default Ember.Helper.helper(array);
|
||||
export default helper(array);
|
||||
|
@ -1,7 +1,7 @@
|
||||
import Ember from 'ember';
|
||||
import { helper } from '@ember/component/helper';
|
||||
|
||||
export function looseEq(params) {
|
||||
return params[0] == params[1];
|
||||
}
|
||||
|
||||
export default Ember.Helper.helper(looseEq);
|
||||
export default helper(looseEq);
|
||||
|
@ -1,10 +1,11 @@
|
||||
import Ember from 'ember';
|
||||
import { helper } from '@ember/component/helper';
|
||||
import { isNone } from '@ember/utils';
|
||||
|
||||
export function numberUs(params) {
|
||||
let num = Ember.isNone(params[0]) ? 0 : params[0];
|
||||
let num = isNone(params[0]) ? 0 : params[0];
|
||||
let p = num.toFixed(2).split('.');
|
||||
return p[0].split('').reverse().reduce(function(acc, num, i, orig) {
|
||||
return num == '-' ? '-' + acc : num + (i && !(i % 3) ? ',' : '') + acc;
|
||||
}, ''); // + '.' + p[1];
|
||||
}
|
||||
export default Ember.Helper.helper(numberUs);
|
||||
export default helper(numberUs);
|
||||
|
@ -1,8 +1,8 @@
|
||||
import Ember from 'ember';
|
||||
import { helper } from '@ember/component/helper';
|
||||
import $ from 'jquery'
|
||||
|
||||
export function objMerge(params) {
|
||||
return $.extend(true, {}, ...params);
|
||||
}
|
||||
|
||||
export default Ember.Helper.helper(objMerge);
|
||||
export default helper(objMerge);
|
||||
|
@ -1,11 +1,12 @@
|
||||
import Ember from 'ember';
|
||||
import EmberObject from '@ember/object';
|
||||
import { helper } from '@ember/component/helper';
|
||||
|
||||
export function objQueryParams(params, hash) {
|
||||
console.debug('Obj Query Params: ', params, hash);
|
||||
return Ember.Object.create({
|
||||
return EmberObject.create({
|
||||
isQueryParams: true,
|
||||
values: hash.length > 0 ? hash : params[0]
|
||||
});
|
||||
}
|
||||
|
||||
export default Ember.Helper.helper(objQueryParams);
|
||||
export default helper(objQueryParams);
|
||||
|
@ -1,7 +1,8 @@
|
||||
import Ember from 'ember';
|
||||
import { helper } from '@ember/component/helper';
|
||||
import { htmlSafe } from '@ember/template';
|
||||
|
||||
export function repeatIt([val, t]) {
|
||||
return Ember.String.htmlSafe(Array(t).fill(val).join(''));
|
||||
return htmlSafe(Array(t).fill(val).join(''));
|
||||
}
|
||||
|
||||
export default Ember.Helper.helper(repeatIt);
|
||||
export default helper(repeatIt);
|
||||
|
@ -1,7 +1,7 @@
|
||||
import Ember from 'ember';
|
||||
import EmberRouter from '@ember/routing/router';
|
||||
import config from './config/environment';
|
||||
|
||||
const Router = Ember.Router.extend({
|
||||
const Router = EmberRouter.extend({
|
||||
location: config.locationType
|
||||
});
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import Ember from 'ember';
|
||||
import { set } from '@ember/object';
|
||||
import BaseListRoute from './base-list';
|
||||
|
||||
export default BaseListRoute.extend({
|
||||
@ -42,14 +42,14 @@ export default BaseListRoute.extend({
|
||||
let it = me.get('controller.selectedModel');
|
||||
if (it) {
|
||||
console.info('select: ', it);
|
||||
Ember.set(parentModel, me.get('controller.idField'), itId);
|
||||
Ember.set(parentModel, me.get('controller.nameField'), it.name);
|
||||
set(parentModel, me.get('controller.idField'), itId);
|
||||
set(parentModel, me.get('controller.nameField'), it.name);
|
||||
}
|
||||
}
|
||||
// not select
|
||||
else {
|
||||
Ember.set(parentModel, me.get('controller.idField'), '');
|
||||
Ember.set(parentModel, me.get('controller.nameField'), '');
|
||||
set(parentModel, me.get('controller.idField'), '');
|
||||
set(parentModel, me.get('controller.nameField'), '');
|
||||
}
|
||||
me.router.transitionTo(parentRouteName);
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
import Ember from 'ember';
|
||||
import { inject as service } from '@ember/service';
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default Route.extend({
|
||||
toolService: Ember.inject.service('tool-service'),
|
||||
toolService: service('tool-service'),
|
||||
beforeModel(transition) {
|
||||
let me = this;
|
||||
let service = me.get('service');
|
||||
|
@ -1,8 +1,8 @@
|
||||
import Ember from 'ember';
|
||||
import { inject as service } from '@ember/service';
|
||||
import BaseListRoute from './../base-list';
|
||||
|
||||
export default BaseListRoute.extend({
|
||||
service: Ember.inject.service('customer-property.service'),
|
||||
service: service('customer-property.service'),
|
||||
actions: {
|
||||
moveUp(it) {
|
||||
let me = this;
|
||||
|
@ -1,8 +1,8 @@
|
||||
import Ember from 'ember';
|
||||
import { inject as service } from '@ember/service';
|
||||
import BaseRoute from '../base';
|
||||
|
||||
export default BaseRoute.extend({
|
||||
service: Ember.inject.service('customer-property.service'),
|
||||
service: service('customer-property.service'),
|
||||
breadcrumbs: [{route: 'customer-status.list', params: 1, text: 'Customer Status'},
|
||||
{text: 'Create Customer Status'}],
|
||||
model() {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import Ember from 'ember';
|
||||
import { inject as service } from '@ember/service';
|
||||
import BaseEditRoute from '../base-edit';
|
||||
|
||||
export default BaseEditRoute.extend({
|
||||
service: Ember.inject.service('customer-property.service'),
|
||||
service: service('customer-property.service'),
|
||||
afterModel(model) {
|
||||
this.set('breadcrumbs',
|
||||
[{route: 'customer-status.list', params: 1, text: 'Customer Status'},
|
||||
|
@ -1,8 +1,8 @@
|
||||
import Ember from 'ember';
|
||||
import { inject as service } from '@ember/service';
|
||||
import BaseListSelectRoute from '../base-list-select';
|
||||
|
||||
export default BaseListSelectRoute.extend({
|
||||
service: Ember.inject.service('customer-property.service'),
|
||||
service: service('customer-property.service'),
|
||||
extraParams() {
|
||||
return {
|
||||
type: 'STATUS',
|
||||
|
@ -1,6 +1,6 @@
|
||||
import Ember from 'ember';
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default Ember.Route.extend({
|
||||
export default Route.extend({
|
||||
model() {
|
||||
let me = this;
|
||||
let parentController = me.controllerFor(me.getParentRouteName());
|
||||
|
@ -1,8 +1,9 @@
|
||||
import Ember from 'ember';
|
||||
import { get, set } from '@ember/object';
|
||||
import { inject as service } from '@ember/service';
|
||||
import BaseEditRoute from '../base-edit';
|
||||
|
||||
export default BaseEditRoute.extend({
|
||||
issueService: Ember.inject.service('customer-issue/service'),
|
||||
issueService: service('customer-issue/service'),
|
||||
afterModel(model) {
|
||||
let me = this;
|
||||
me._super(...arguments);
|
||||
@ -18,13 +19,13 @@ export default BaseEditRoute.extend({
|
||||
});
|
||||
}
|
||||
|
||||
Ember.set(model, 'userAccounts', Ember.get(model, 'users').mapBy('account').join(', '));
|
||||
set(model, 'userAccounts', get(model, 'users').mapBy('account').join(', '));
|
||||
},
|
||||
actions: {
|
||||
removeIssue(issue) {
|
||||
let me = this;
|
||||
me.get('dialog').confirm('Are you sure to remove customer comment?', () => {
|
||||
Ember.set(issue, 'enabled', false);
|
||||
set(issue, 'enabled', false);
|
||||
me.get('issueService').update(issue).then(() => {
|
||||
me.get('message').alert('Comment removed');
|
||||
me.get('controller.model.issues').removeObject(issue);
|
||||
|
@ -1,4 +1,5 @@
|
||||
import Route from '@ember/routing/route';
|
||||
import { htmlSafe } from '@ember/template';
|
||||
|
||||
export default Route.extend({
|
||||
model() {
|
||||
@ -10,7 +11,7 @@ export default Route.extend({
|
||||
console.log('home page loaded: ', model);
|
||||
if (model.content) {
|
||||
// model.content =
|
||||
model.content = Ember.String.htmlSafe(model.content);
|
||||
model.content = htmlSafe(model.content);
|
||||
}
|
||||
// this.transitionTo('app.list', 1);
|
||||
},
|
||||
|
@ -1,8 +1,8 @@
|
||||
import Ember from 'ember';
|
||||
import BaseEditRoute from '../base-edit';
|
||||
import Route from '@ember/routing/route';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default Ember.Route.extend({
|
||||
service: Ember.inject.service('user.service'),
|
||||
export default Route.extend({
|
||||
service: service('user.service'),
|
||||
breadcrumbs: [{text: 'Change Password'}],
|
||||
model() {
|
||||
return {};
|
||||
|
@ -16,23 +16,23 @@
|
||||
<div class="widget-box transparent">
|
||||
<div class="widget-header widget-header-small">
|
||||
<div class="widget-toolbar action-buttons">
|
||||
<a href="#" data-rel="tooltip" title="Add Image" {{action (route-action 'addImage')}}>
|
||||
{{#a-btn data-rel="tooltip" title="Add Image" click=(route-action 'addImage')}}
|
||||
<i class="ace-icon fa fa-plus-circle green"></i>
|
||||
</a>
|
||||
{{/a-btn}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget-body">
|
||||
<div class="widget-main padding-4">
|
||||
{{#each model.images as |image i|}}
|
||||
{{#each model.images as |image index|}}
|
||||
<div class="col-xs-6 no-padding-left">
|
||||
<div class="space-4"></div>
|
||||
{{input name=(concat 'imageTitles[' i ']') class='width-80' placeholder='Image title' value=image.title}}
|
||||
{{input name=(concat 'imageTitles[' index ']') class='width-80' placeholder='Image title' value=image.title}}
|
||||
|
||||
<a href="#" class="red" data-rel="tooltip" title="Remove Image" {{action (route-action 'removeImage' image)}}>
|
||||
{{#a-btn class="red" data-rel="tooltip" title="Remove Image" click=(route-action 'removeImage' image)}}
|
||||
<i class="ace-icon fa fa-times bigger-125"></i>
|
||||
</a>
|
||||
{{/a-btn}}
|
||||
<div class="space-2"></div>
|
||||
{{image-input name=(concat 'images[' i ']') image=image}}
|
||||
{{image-input name=(concat 'images[' index ']') image=image}}
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
@ -44,24 +44,24 @@
|
||||
<div class="widget-box transparent">
|
||||
<div class="widget-header widget-header-small">
|
||||
<div class="widget-toolbar action-buttons">
|
||||
<a href="#" data-rel="tooltip" title="Add Attachment" {{action (route-action 'addAttachment')}}>
|
||||
{{#a-btn data-rel="tooltip" title="Add Attachment" click=(route-action 'addAttachment')}}
|
||||
<i class="ace-icon fa fa-plus-circle green"></i>
|
||||
</a>
|
||||
{{/a-btn}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget-body">
|
||||
<div class="widget-main padding-4">
|
||||
{{#each model.attachments as |attachment i|}}
|
||||
{{#each model.attachments as |attachment index|}}
|
||||
<div class="col-xs-6 no-padding-left">
|
||||
<div class="space-4"></div>
|
||||
{{input name=(concat 'attachmentTitles[' i ']') class='width-80' placeholder='Attachment name' value=image.title}}
|
||||
{{input name=(concat 'attachmentTitles[' index ']') class='width-80' placeholder='Attachment name' value=image.title}}
|
||||
|
||||
<a href="#" class="red" data-rel="tooltip" title="Remove Attachment" {{action (route-action 'removeAttachment' attachment)}}>
|
||||
{{#a-btn class="red" data-rel="tooltip" title="Remove Attachment" click=(route-action 'removeAttachment' attachment)}}
|
||||
<i class="ace-icon fa fa-times bigger-125"></i>
|
||||
</a>
|
||||
{{/a-btn}}
|
||||
<div class="space-2"></div>
|
||||
{{!input type='file'}}
|
||||
{{file-input name=(concat 'attachments[' i ']') file=attachment}}
|
||||
{{file-input name=(concat 'attachments[' index ']') file=attachment}}
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
|
@ -8,23 +8,23 @@
|
||||
<div class="widget-box transparent">
|
||||
<div class="widget-header widget-header-small">
|
||||
<div class="widget-toolbar action-buttons">
|
||||
<a href="#" data-rel="tooltip" title="Add Image" {{action (route-action 'addImage')}}>
|
||||
{{#a-btn data-rel="tooltip" title="Add Image" click=(route-action 'addImage')}}
|
||||
<i class="ace-icon fa fa-plus-circle green"></i>
|
||||
</a>
|
||||
{{/a-btn}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget-body">
|
||||
<div class="widget-main padding-4">
|
||||
{{#each model.images as |image i|}}
|
||||
{{#each model.images as |image index|}}
|
||||
<div class="col-xs-6 no-padding-left">
|
||||
<div class="space-4"></div>
|
||||
{{input name=(concat 'imageTitles[' i ']') class='width-80' placeholder='Image title' value=image.title}}
|
||||
{{input name=(concat 'imageTitles[' index ']') class='width-80' placeholder='Image title' value=image.title}}
|
||||
|
||||
<a href="#" class="red" data-rel="tooltip" title="Remove Image" {{action (route-action 'removeImage' image)}}>
|
||||
{{#a-btn class="red" data-rel="tooltip" title="Remove Image" click=(route-action 'removeImage' image)}}
|
||||
<i class="ace-icon fa fa-times bigger-125"></i>
|
||||
</a>
|
||||
{{/a-btn}}
|
||||
<div class="space-2"></div>
|
||||
{{image-input name=(concat 'images[' i ']') image=image}}
|
||||
{{image-input name=(concat 'images[' index ']') image=image}}
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
@ -36,24 +36,23 @@
|
||||
<div class="widget-box transparent">
|
||||
<div class="widget-header widget-header-small">
|
||||
<div class="widget-toolbar action-buttons">
|
||||
<a href="#" data-rel="tooltip" title="Add Attachment" {{action (route-action 'addAttachment')}}>
|
||||
{{#a-btn data-rel="tooltip" title="Add Attachment" click=(route-action 'addAttachment')}}
|
||||
<i class="ace-icon fa fa-plus-circle green"></i>
|
||||
</a>
|
||||
{{/a-btn}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget-body">
|
||||
<div class="widget-main padding-4">
|
||||
{{#each model.attachments as |attachment i|}}
|
||||
{{#each model.attachments as |attachment index|}}
|
||||
<div class="col-xs-6 no-padding-left">
|
||||
<div class="space-4"></div>
|
||||
{{input name=(concat 'attachmentTitles[' i ']') class='width-80' placeholder='Attachment name' value=image.title}}
|
||||
{{input name=(concat 'attachmentTitles[' index ']') class='width-80' placeholder='Attachment name' value=image.title}}
|
||||
|
||||
<a href="#" class="red" data-rel="tooltip" title="Remove Attachment" {{action (route-action 'removeAttachment' attachment)}}>
|
||||
{{#a-btn class="red" data-rel="tooltip" title="Remove Attachment" click=(route-action 'removeAttachment' attachment)}}
|
||||
<i class="ace-icon fa fa-times bigger-125"></i>
|
||||
</a>
|
||||
{{/a-btn}}
|
||||
<div class="space-2"></div>
|
||||
{{!input type='file'}}
|
||||
{{file-input name=(concat 'attachments[' i ']') file=attachment}}
|
||||
{{file-input name=(concat 'attachments[' index ']') file=attachment}}
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
|
@ -16,6 +16,7 @@
|
||||
"author": "Shaun Chyxion",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@ember/jquery": "1.1.0",
|
||||
"@ember/optional-features": "^1.3.0",
|
||||
"@ember/test-helpers": "^2.8.1",
|
||||
"bootbox": "5.1.3",
|
||||
|
@ -1,12 +1,12 @@
|
||||
import Ember from 'ember';
|
||||
import { merge } from '@ember/polyfills';
|
||||
import Application from '../../app';
|
||||
import config from '../../config/environment';
|
||||
|
||||
export default function startApp(attrs) {
|
||||
let application;
|
||||
|
||||
let attributes = Ember.merge({}, config.APP);
|
||||
attributes = Ember.merge(attributes, attrs); // use defaults, but you can override;
|
||||
const attributes = merge(merge({}, config.APP), attrs); // use defaults, but you can override;
|
||||
|
||||
Ember.run(() => {
|
||||
application = Application.create(attributes);
|
||||
|
@ -1,4 +1,4 @@
|
||||
import Ember from 'ember';
|
||||
import EmberObject from '@ember/object';
|
||||
import AppManageVersionBasicRouteMixin from '../../../mixins/app/manage/version/basic-route';
|
||||
import { module, test } from 'qunit';
|
||||
|
||||
@ -6,7 +6,7 @@ module('Unit | Mixin | app/manage/version/basic route');
|
||||
|
||||
// Replace this with your real tests.
|
||||
test('it works', function(assert) {
|
||||
var AppManageVersionBasicRouteObject = Ember.Object.extend(AppManageVersionBasicRouteMixin);
|
||||
var AppManageVersionBasicRouteObject = EmberObject.extend(AppManageVersionBasicRouteMixin);
|
||||
var subject = AppManageVersionBasicRouteObject.create();
|
||||
assert.ok(subject);
|
||||
});
|
||||
|
@ -1,4 +1,4 @@
|
||||
import Ember from 'ember';
|
||||
import EmberObject from '@ember/object';
|
||||
import BasicListRouteMixin from '../../../mixins/basic-list-route';
|
||||
import { module, test } from 'qunit';
|
||||
|
||||
@ -6,7 +6,7 @@ module('Unit | Mixin | basic list route');
|
||||
|
||||
// Replace this with your real tests.
|
||||
test('it works', function(assert) {
|
||||
var BasicListRouteObject = Ember.Object.extend(BasicListRouteMixin);
|
||||
var BasicListRouteObject = EmberObject.extend(BasicListRouteMixin);
|
||||
var subject = BasicListRouteObject.create();
|
||||
assert.ok(subject);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user