Skip to content

Commit 1cc7363

Browse files
author
Jonathan Geiger
committedJan 6, 2014
Remove project managers.
It's an unnecessary concept and we're using users for clients anyway.
1 parent c2cf6e9 commit 1cc7363

File tree

8 files changed

+18
-39
lines changed

8 files changed

+18
-39
lines changed
 

‎app/controllers/project/edit.js

+1-11
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,7 @@
33
module.exports = App.ProjectEditController = Ember.ObjectController.extend({
44
// Load up a list of users that the project can be assigned
55
// to, which we'll use for populating the select list.
6-
allUsers: function () {
6+
clients: function () {
77
return this.store.findAll('user');
88
}.property(),
9-
10-
// And then filter down to only clients.
11-
clients: function () {
12-
return this.get('allUsers').filterBy('role', 'client');
13-
}.property('allUsers.isFulfilled'),
14-
15-
// And also filter down to valid managers
16-
managers: function () {
17-
return this.get('allUsers').rejectBy('role', 'client');
18-
}.property('allUsers.isFulfilled'),
199
});

‎app/controllers/project/index.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@
33
var c = Ember.computed;
44

55
module.exports = App.ProjectIndexController = Ember.ObjectController.extend({
6-
// Display the name of the project manager and client
7-
managerName: c.alias('managedBy.name'),
8-
clientName: c.alias('client.name'),
9-
10-
// Track the project budge details
6+
// Track the project budget and billing details
117
hoursBudgeted: c.alias('hourBudget'),
8+
clientName: c.alias('client.name'),
129
isInternal: c.not('client'),
1310

1411
// Sum up the hours logged for the project by looping over

‎app/controllers/projects.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
module.exports = App.ProjectsController = Ember.ArrayController.extend({
44
sortProperties: ['id'],
5-
itemController: 'Project',
5+
itemController: 'ProjectIndex',
66
});

‎app/models/project.js

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ module.exports = App.Project = DS.Model.extend({
55
description: DS.attr('string'),
66
hourBudget: DS.attr('number'),
77
rateAmount: DS.attr('number'),
8-
managedBy: DS.belongsTo('user'),
98
client: DS.belongsTo('user'),
109
users: DS.hasMany('user', { async: true }),
1110
tasks: DS.hasMany('task', { async: true }),

‎app/templates/project/edit.hbs

-12
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,6 @@
3333
classNames="form-control"}}
3434
</div>
3535
</div>
36-
37-
<div class="form-group">
38-
<label class="col-sm-2 control-label">Manager</label>
39-
<div class="col-sm-10">
40-
{{view Ember.Select
41-
content=managers
42-
optionValuePath="content.id"
43-
optionLabelPath="content.name"
44-
selection=managedBy
45-
classNames="form-control"}}
46-
</div>
47-
</div>
4836
</form>
4937
</div>
5038
</div>

‎app/templates/project/index.hbs

+7-5
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@
88
<div class="row">
99
<div class="col-lg-12">
1010
<p>
11-
<span class="fui-user"></span>
12-
Managed by <strong>{{managerName}}</strong>
13-
{{#unless isInternal}}
14-
and billed to <strong>{{clientName}}</strong>
15-
{{/unless}}
11+
{{#if isInternal}}
12+
<span class="fui-heart"></span>
13+
Billed <strong>internally</strong>
14+
{{else}}
15+
<span class="fui-user"></span>
16+
Billed to <strong>{{clientName}}</strong>
17+
{{/if}}
1618
</p>
1719

1820
<p>

‎app/templates/projects.hbs

+7-3
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,19 @@
44
<tr>
55
<th>Name</th>
66
<th>Description</th>
7-
<th>Manager</th>
87
<th>Client</th>
98
</tr>
109
{{#each}}
1110
<tr>
1211
<td>{{#link-to 'project' this}}{{name}}{{/link-to}}</td>
1312
<td>{{description}}</td>
14-
<td>{{managerName}}</td>
15-
<td>{{clientName}}</td>
13+
<td>
14+
{{#if isInternal}}
15+
<span class="text-muted">Internal</span>
16+
{{else}}
17+
{{clientName}}
18+
{{/if}}
19+
</td>
1620
</tr>
1721
{{/each}}
1822
</table>

‎data/models.js

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ module.exports = {
5555
rate_amount: String,
5656
rate_code: String,
5757
client: 'user',
58-
managed_by: 'user',
5958
users: ['user'],
6059
tasks: ['task'],
6160
time_entries: ['time_entry']

0 commit comments

Comments
 (0)