Skip to content

Commit 13ed77b

Browse files
author
Matteo Depalo
committed
Merge branch 'release/0.0.7'
2 parents 776d09e + e6154e2 commit 13ed77b

24 files changed

+271
-115
lines changed

Brocfile.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ if (EmberApp.env() === 'test') {
3838
app.import('bower_components/jquery-simulate-ext/libs/jquery.simulate.js', { type: 'test' });
3939
app.import('bower_components/jquery-simulate-ext/src/jquery.simulate.ext.js', { type: 'test' });
4040
app.import('bower_components/jquery-simulate-ext/src/jquery.simulate.drag-n-drop.js', { type: 'test' });
41+
app.import('bower_components/deep-diff/index.js', { type: 'test' });
4142
}
4243

4344
module.exports = app.toTree();

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Phoenix Changelog
22

3+
### Release 0.0.7
4+
5+
- [#418 BUGFIX](https://github.com/alphasights/phoenix/pull/418) Fix quick jump result links not working sometimes
6+
- [#414](https://github.com/alphasights/phoenix/pull/414) Add section to interaction completion form for paying/not paying advisor
7+
38
### Release 0.0.6 (June 29, 2015)
49

510
- [#381](https://github.com/alphasights/phoenix/pull/381) Move call completion form to nested side panel

app/controllers/quick-jump.js renamed to app/components/as-quick-jump.js

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
import Ember from 'ember';
2-
import PromiseController from './promise';
2+
import PromiseController from 'phoenix/controllers/promise';
3+
import KeyEventsMixin from 'phoenix/mixins/key-events';
34
import { request } from 'ic-ajax';
45

5-
export default Ember.Controller.extend({
6+
export default Ember.Component.extend(KeyEventsMixin, {
7+
classNameBindings: [':quick-jump', 'isActive:active', 'isLoading:loading'],
8+
tagName: 'section',
9+
610
query: null,
711
results: null,
812
requestPromise: null,
13+
isActive: false,
14+
isLoading: Ember.computed.oneWay('requestPromise.isLoading'),
15+
placeholder: null,
916

1017
resultSectionsOrder: [
1118
'user', 'contact', 'advisor', 'project', 'entity', 'account', 'target'
@@ -123,9 +130,50 @@ export default Ember.Controller.extend({
123130
}
124131
},
125132

133+
clickEventName: Ember.computed('elementId', function() {
134+
return `click.${this.get('elementId')}`;
135+
}),
136+
137+
didInsertElement: function() {
138+
this._super.apply(this, arguments);
139+
140+
Ember.$(document).on(this.get('clickEventName'), (event) => {
141+
var $target = Ember.$(event.target);
142+
var $nonBlurringElements = this.$('.bar, .results');
143+
144+
if ($target.closest($nonBlurringElements).length === 0) {
145+
this.send('clear');
146+
}
147+
148+
return true;
149+
});
150+
},
151+
152+
willDestroyElement: function() {
153+
this._super.apply(this, arguments);
154+
155+
Ember.$(document).off(this.get('clickEventName'));
156+
},
157+
158+
onIsActiveDidChange: Ember.observer('isActive', function() {
159+
if (!this.get('isActive')) {
160+
this.$('input').blur();
161+
}
162+
}),
163+
164+
keyEvents: {
165+
esc: function() {
166+
this.set('isActive', false);
167+
}
168+
},
169+
126170
actions: {
127171
clear: function() {
128172
this.set('query', null);
173+
},
174+
175+
activate: function() {
176+
this.set('isActive', true);
129177
}
130178
}
131179
});

app/controllers/dashboard/interaction.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,15 @@ export default Ember.Controller.extend(ModelsNavigationMixin, {
5656
chargeClient: function() {
5757
this.get('completionForm').save().then(() => {
5858
notify('The interaction has been completed.');
59-
this.get('sidePanel').send('close');
6059
});
6160
},
6261

62+
toggleAdvisorPayment: function() {
63+
this.toggleProperty('model.paymentRequired');
64+
65+
this.get('advisorPaymentForm').save();
66+
},
67+
6368
hideSidePanel: function() {
6469
this.transitionToRoute('dashboard');
6570
},

app/forms/advisor-payment-form.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import Form from 'phoenix/forms/form';
2+
3+
export default Form.extend({
4+
genericErrorMessage: 'There has been an error with the advisor payment.',
5+
6+
setPersistedValues: function() {
7+
var model = this.get('model');
8+
9+
model.setProperties({
10+
paymentRequired: model.get('paymentRequired')
11+
});
12+
}
13+
});

app/forms/form.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ export default Ember.Controller.extend(EmberValidations.Mixin, {
88

99
init: function() {
1010
this._super.apply(this, arguments);
11-
this.setDefaultValues();
11+
if (this.setDefaultValues !== undefined) {
12+
this.setDefaultValues();
13+
}
1214
},
1315

1416
save: function() {

app/models/interaction.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export default DS.Model.extend({
88
clientAccessNumberCountry: DS.attr('string'),
99
clientContact: DS.belongsTo('clientContact'),
1010
additionalContactDetails: DS.attr('string'),
11+
paymentRequired: DS.attr('boolean'),
1112
primaryContact: DS.belongsTo('user'),
1213
project: DS.belongsTo('project'),
1314
requestedAt: DS.attr('date'),

app/routes/application.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export default Ember.Route.extend({
3535
} else if (error.errors[0].status === '404') {
3636
logError(error);
3737
this.render('not_found', { into: 'application' });
38+
return true;
3839
} else {
3940
logError(error);
4041
return true;

app/routes/dashboard/interaction.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Ember from 'ember';
22
import SidePanelRouteMixin from 'ember-cli-paint/mixins/side-panel-route';
3+
import AdvisorPaymentForm from 'phoenix/forms/advisor-payment-form';
34
import InteractionCompletionForm from 'phoenix/forms/interaction-completion-form';
45

56
export default Ember.Route.extend(SidePanelRouteMixin, {
@@ -30,6 +31,11 @@ export default Ember.Route.extend(SidePanelRouteMixin, {
3031
container: this.get('container')
3132
}),
3233

34+
advisorPaymentForm: AdvisorPaymentForm.create({
35+
model: models.interaction,
36+
container: this.get('container')
37+
}),
38+
3339
showForm: false
3440
});
3541
}

app/styles/components/_project-history.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,9 @@ $project-history-baby-blue: #54acb0;
7171
margin: 0;
7272
min-width: $avatar-size;
7373
}
74+
75+
.occurred-at {
76+
white-space: nowrap;
77+
}
7478
}
7579
}

0 commit comments

Comments
 (0)