Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 7593ab2

Browse files
committed
map product_types to name
1 parent ec1ca32 commit 7593ab2

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

src/common/constants.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
const _ = require('lodash');
1111
const config = require('config');
1212

13+
const projectTypes = {
14+
app_dev: 'Full App',
15+
generic: 'Work Project',
16+
visual_prototype: 'Design & Prototype',
17+
visual_design: 'Design',
18+
};
1319
module.exports = {
1420
// The event types to be consumed from the source RabbitMQ
1521
events: {
@@ -45,7 +51,7 @@ module.exports = {
4551
},
4652
{
4753
title: 'Project Type',
48-
value: data.project.type,
54+
value: projectTypes[data.project.type],
4955
short: false,
5056
},
5157
],
@@ -64,7 +70,7 @@ module.exports = {
6470
fields: [
6571
{
6672
title: 'Project Type',
67-
value: data.project.type,
73+
value: projectTypes[data.project.type],
6874
short: false,
6975
},
7076
]
@@ -83,7 +89,7 @@ module.exports = {
8389
fields: [
8490
{
8591
title: 'Project Type',
86-
value: data.project.type,
92+
value: projectTypes[data.project.type],
8793
short: false,
8894
},
8995
]
@@ -102,7 +108,7 @@ module.exports = {
102108
fields: [
103109
{
104110
title: 'Project Type',
105-
value: data.project.type,
111+
value: projectTypes[data.project.type],
106112
short: false,
107113
},
108114
]
@@ -187,6 +193,7 @@ module.exports = {
187193
canceled: 'cancelled', // spelling is not a type :)
188194
completed: 'completed',
189195
},
196+
projectTypes,
190197
memberRoles: {
191198
manager: 'manager',
192199
customer: 'customer',

src/test/app.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const expectedSlackNotficationBase = {
6060
{
6161
short: false,
6262
title: 'Project Type',
63-
value: 'visual_design',
63+
value: 'Design',
6464
},
6565
],
6666
footer: "Topcoder",
@@ -99,7 +99,7 @@ _.extend(expectedManagerSlackNotification.attachments[0], {
9999
{
100100
short: false,
101101
title: 'Project Type',
102-
value: 'visual_design',
102+
value: 'Design',
103103
},
104104
]
105105
})

0 commit comments

Comments
 (0)