Skip to content

Production release #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
Jan 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
7afbc8d
Add same regex as client to address validation
chq-matteo Jan 6, 2018
e727fd3
Move address regex to constants.js
chq-matteo Jan 6, 2018
bafdb19
Merge pull request #61 from chq-matteo/connect-link-regex
gondzo Jan 7, 2018
29150db
add event initiator id
gondzo Jan 14, 2018
2357c75
add search by ref code
gondzo Jan 15, 2018
65c0f1a
Update create.spec.js
gondzo Jan 15, 2018
a5606d3
fix tests
gondzo Jan 15, 2018
7605d1f
update es index for searching details.utm.code
gondzo Jan 15, 2018
44190fa
lint fix
gondzo Jan 15, 2018
187e3b2
lint fix
gondzo Jan 15, 2018
7a78c2f
remove ref code search
gondzo Jan 15, 2018
ac3166d
Github issue#1604, Allow managers/admins to assign Manager role to pe…
Jan 17, 2018
dcaee3f
Temp deployment of feature branch to dev
Jan 17, 2018
eef87a1
Github issue#1604, Allow managers/admins to assign Manager role to pe…
Jan 17, 2018
90feb2f
debugging
Jan 17, 2018
6bc605c
debugging
Jan 17, 2018
5a8f1b9
more debugging
Jan 17, 2018
648e94a
added request id
Jan 17, 2018
3e24201
Fixed lint error
Jan 17, 2018
15d292a
Fixing URL creation for identity api endpoint
Jan 17, 2018
f5545ab
removed debug statements
Jan 17, 2018
f1d2f43
add utm code search query
gondzo Jan 18, 2018
b12e940
lin fix
gondzo Jan 18, 2018
cc89674
update ES index format
gondzo Jan 20, 2018
abc8017
lint fix
gondzo Jan 20, 2018
e75f5d0
reverted temp deployment of feature branch to dev
Jan 25, 2018
fbf1761
Merge pull request #62 from topcoder-platform/feature/allow_managers_…
Jan 25, 2018
9bd9ca5
add file download endpoint
gondzo Jan 28, 2018
8f72422
Merge pull request #63 from topcoder-platform/feature/downloadAttachment
gondzo Jan 28, 2018
d0f3867
add event bus call logging
gondzo Jan 31, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
319 changes: 246 additions & 73 deletions migrations/elasticsearch_sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,91 +33,264 @@ function getRequestBody(indexName) {
const projectMapping = {
_all: { enabled: false },
properties: {
id: { type: 'long' },
directProjectId: { type: 'long' },
billingAccountId: { type: 'long' },
name: { type: 'string' },
description: { type: 'string' },
external: { type: 'object',
actualPrice: {
type: 'double',
},
attachments: {
type: 'nested',
properties: {
id: { type: 'string', index: 'not_analyzed' },
type: { type: 'string', index: 'not_analyzed' },
data: { type: 'string' },
} },
bookmarks: { type: 'nested',
category: {
type: 'string',
index: 'not_analyzed',
},
contentType: {
type: 'string',
index: 'not_analyzed',
},
createdAt: {
type: 'date',
format: 'strict_date_optional_time||epoch_millis',
},
createdBy: {
type: 'integer',
},
description: {
type: 'string',
},
filePath: {
type: 'string',
},
id: {
type: 'long',
},
projectId: {
type: 'long',
},
size: {
type: 'double',
},
title: {
type: 'string',
},
updatedAt: {
type: 'date',
format: 'strict_date_optional_time||epoch_millis',
},
updatedBy: {
type: 'integer',
},
},
},
billingAccountId: {
type: 'long',
},
bookmarks: {
type: 'nested',
properties: {
title: { type: 'string' },
address: { type: 'string' },
} },
utm: { type: 'object',
address: {
type: 'string',
},
title: {
type: 'string',
},
},
},
cancelReason: {
type: 'string',
},
challengeEligibility: {
type: 'nested',
properties: {
campaign: { type: 'string' },
medium: { type: 'string' },
source: { type: 'string' },
} },
estimatedPrice: { type: 'double' },
actualPrice: { type: 'double' },
terms: { type: 'integer' },
type: { type: 'string', index: 'not_analyzed' },
status: { type: 'string', index: 'not_analyzed' },
details: { type: 'nested',
groups: {
type: 'long',
},
role: {
type: 'string',
index: 'not_analyzed',
},
users: {
type: 'long',
},
},
},
createdAt: {
type: 'date',
format: 'strict_date_optional_time||epoch_millis',
},
createdBy: {
type: 'integer',
},
description: {
type: 'string',
},
details: {
type: 'nested',
properties: {
summary: { type: 'string' },
TBD_usageDescription: { type: 'string' },
TBD_features: { type: 'nested',
TBD_features: {
type: 'nested',
properties: {
id: { type: 'integer' },
title: { type: 'string' },
description: { type: 'string' },
isCustom: { type: 'boolean' },
} },
} },
challengeEligibility: { type: 'nested',
description: {
type: 'string',
},
id: {
type: 'integer',
},
isCustom: {
type: 'boolean',
},
title: {
type: 'string',
},
},
},
TBD_usageDescription: {
type: 'string',
},
appDefinition: {
properties: {
goal: {
properties: {
value: {
type: 'string',
},
},
},
primaryTarget: {
type: 'string',
},
users: {
properties: {
value: {
type: 'string',
},
},
},
},
},
hideDiscussions: {
type: 'boolean',
},
products: {
type: 'string',
},
summary: {
type: 'string',
},
utm: {
type: 'nested',
properties: {
code: {
type: 'string',
},
},
},
},
},
directProjectId: {
type: 'long',
},
estimatedPrice: {
type: 'double',
},
external: {
properties: {
role: { type: 'string', index: 'not_analyzed' },
users: { type: 'long' },
groups: { type: 'long' },
} },
cancelReason: { type: 'string' },
createdAt: { type: 'date' },
updatedAt: { type: 'date' },
createdBy: { type: 'integer' },
updatedBy: { type: 'integer' },
// project members nested data type
data: {
type: 'string',
},
id: {
type: 'string',
index: 'not_analyzed',
},
type: {
type: 'string',
index: 'not_analyzed',
},
},
},
id: {
type: 'long',
},
members: {
type: 'nested',
properties: {
id: { type: 'long' },
userId: { type: 'long' },
projectId: { type: 'long' },
role: { type: 'string', index: 'not_analyzed' },
firstName: { type: 'string' },
lastName: { type: 'string' },
email: { type: 'string', index: 'not_analyzed' },
handle: { type: 'string', index: 'not_analyzed' },
isPrimary: { type: 'boolean' },
createdAt: { type: 'date' },
updatedAt: { type: 'date' },
createdBy: { type: 'integer' },
updatedBy: { type: 'integer' },
createdAt: {
type: 'date',
format: 'strict_date_optional_time||epoch_millis',
},
createdBy: {
type: 'integer',
},
email: {
type: 'string',
index: 'not_analyzed',
},
firstName: {
type: 'string',
},
handle: {
type: 'string',
index: 'not_analyzed',
},
id: {
type: 'long',
},
isPrimary: {
type: 'boolean',
},
lastName: {
type: 'string',
},
projectId: {
type: 'long',
},
role: {
type: 'string',
index: 'not_analyzed',
},
updatedAt: {
type: 'date',
format: 'strict_date_optional_time||epoch_millis',
},
updatedBy: {
type: 'integer',
},
userId: {
type: 'long',
},
},
},
// project attachments nested data type
attachments: {
type: 'nested',
name: {
type: 'string',
},
status: {
type: 'string',
index: 'not_analyzed',
},
terms: {
type: 'integer',
},
type: {
type: 'string',
index: 'not_analyzed',
},
updatedAt: {
type: 'date',
format: 'strict_date_optional_time||epoch_millis',
},
updatedBy: {
type: 'integer',
},
utm: {
properties: {
id: { type: 'long' },
title: { type: 'string' },
size: { type: 'double' },
category: { type: 'string', index: 'not_analyzed' },
description: { type: 'string' },
filePath: { type: 'string' },
projectId: { type: 'long' },
contentType: { type: 'string', index: 'not_analyzed' },
createdAt: { type: 'date' },
updatedAt: { type: 'date' },
createdBy: { type: 'integer' },
updatedBy: { type: 'integer' },
campaign: {
type: 'string',
},
medium: {
type: 'string',
},
source: {
type: 'string',
},
},
},
},
Expand Down
5 changes: 5 additions & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const USER_ROLE = {

export const ADMIN_ROLES = [USER_ROLE.CONNECT_ADMIN, USER_ROLE.TOPCODER_ADMIN];

export const MANAGER_ROLES = [...ADMIN_ROLES, USER_ROLE.MANAGER];

export const EVENT = {
ROUTING_KEY: {
Expand Down Expand Up @@ -71,3 +72,7 @@ export const BUS_API_EVENT = {
PROJECT_FILE_UPLOADED: 'connect.project.fileUploaded',
PROJECT_SPECIFICATION_MODIFIED: 'connect.project.specificationModified',
};

export const REGEX = {
URL: /^(http(s?):\/\/)?(www\.)?[a-zA-Z0-9\.\-\_]+(\.[a-zA-Z]{2,15})+(\:[0-9]{2,5})?(\/[a-zA-Z0-9\_\-\s\.\/\?\%\#\&\=]*)?$/, // eslint-disable-line
};
Loading