Skip to content

Commit 0589926

Browse files
committed
Merge changes from 'dev' branch
1 parent 080c4c4 commit 0589926

File tree

147 files changed

+12761
-510
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+12761
-510
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"mocha": true
99
},
1010
"rules": {
11-
"import/no-extraneous-dependencies": ["error", {"devDependencies": ["**/*.test.js", "**/*.spec.js", "**/serviceMocks.js"]}],
11+
"import/no-extraneous-dependencies": ["error", {"devDependencies": ["**/*.test.js", "**/*.spec.js", "src/tests/*.js"]}],
1212
"max-len": ["error", { "ignoreComments": true, "code": 120 }],
1313
"valid-jsdoc": ["error", {
1414
"requireReturn": true,

config/custom-environment-variables.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,6 @@
5252
"accountsAppUrl": "ACCOUNTS_APP_URL",
5353
"inviteEmailSubject": "INVITE_EMAIL_SUBJECT",
5454
"inviteEmailSectionTitle": "INVITE_EMAIL_SECTION_TITLE",
55-
"pageSize": "PAGE_SIZE"
55+
"pageSize": "PAGE_SIZE",
56+
"SSO_REFCODES": "SSO_REFCODES"
5657
}

config/default.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,7 @@
5656
"accountsAppUrl": "https://accounts.topcoder-dev.com",
5757
"MAX_REVISION_NUMBER": 100,
5858
"UNIQUE_GMAIL_VALIDATION": false,
59-
"pageSize": 20
59+
"pageSize": 20,
60+
"VALID_STATUSES_BEFORE_PAUSED": "[\"active\"]",
61+
"SSO_REFCODES": "[]"
6062
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
--
2+
-- Create table status history
3+
--
4+
5+
CREATE TABLE status_history (
6+
id bigint,
7+
"reference" character varying(45) NOT NULL,
8+
"referenceId" bigint NOT NULL,
9+
"status" character varying(45) NOT NULL,
10+
"comment" text,
11+
"createdAt" timestamp with time zone,
12+
"updatedAt" timestamp with time zone,
13+
"createdBy" integer NOT NULL,
14+
"updatedBy" integer NOT NULL
15+
);
16+
17+
CREATE SEQUENCE status_history_id_seq
18+
START WITH 1
19+
INCREMENT BY 1
20+
NO MINVALUE
21+
NO MAXVALUE
22+
CACHE 1;
23+
24+
ALTER SEQUENCE status_history_id_seq OWNED BY status_history.id;
25+
26+
ALTER TABLE ONLY status_history ALTER COLUMN id SET DEFAULT nextval('status_history_id_seq'::regclass);
27+
28+
ALTER TABLE ONLY status_history
29+
ADD CONSTRAINT status_history_pkey PRIMARY KEY (id);
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--
2+
-- FIX for 20190316_extract_scope_from_project_templates.sql
3+
-- apply created auto-increments sequences to `id` columns
4+
5+
ALTER TABLE form
6+
ALTER COLUMN id SET DEFAULT nextval('form_id_seq');
7+
8+
ALTER TABLE price_config
9+
ALTER COLUMN id SET DEFAULT nextval('price_config_id_seq');
10+
11+
ALTER TABLE plan_config
12+
ALTER COLUMN id SET DEFAULT nextval('plan_config_id_seq');
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--
2+
-- UPDATE EXISTING TABLES:
3+
-- template:
4+
-- remove `sections` if exists and change `questions` to `sections`
5+
6+
--
7+
-- product_templates
8+
9+
UPDATE product_templates
10+
SET template = (template::jsonb #- '{questions}' #- '{sections}') || jsonb_build_object('sections', template::jsonb ->'questions')
11+
WHERE template::jsonb ? 'questions';

migrations/20190624_workStream.sql

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
--
2+
-- CREATE NEW TABLE:
3+
-- work_streams
4+
--
5+
CREATE TABLE work_streams (
6+
id bigint NOT NULL,
7+
"name" character varying(255) NOT NULL,
8+
"type" character varying(45) NOT NULL,
9+
"status" character varying(255) NOT NULL,
10+
"projectId" bigint NOT NULL,
11+
"deletedAt" timestamp with time zone,
12+
"createdAt" timestamp with time zone,
13+
"updatedAt" timestamp with time zone,
14+
"deletedBy" bigint,
15+
"createdBy" bigint NOT NULL,
16+
"updatedBy" bigint NOT NULL
17+
);
18+
19+
CREATE SEQUENCE work_streams_id_seq
20+
START WITH 1
21+
INCREMENT BY 1
22+
NO MINVALUE
23+
NO MAXVALUE
24+
CACHE 1;
25+
26+
ALTER SEQUENCE work_streams_id_seq OWNED BY work_streams.id;
27+
28+
ALTER TABLE work_streams
29+
ALTER COLUMN id SET DEFAULT nextval('work_streams_id_seq');
30+
31+
ALTER TABLE ONLY work_streams
32+
ADD CONSTRAINT "work_streams_pkey" PRIMARY KEY (id);
33+
34+
ALTER TABLE ONLY work_streams
35+
ADD CONSTRAINT "work_streams_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES projects(id) ON UPDATE CASCADE ON DELETE SET NULL;
36+
37+
--
38+
-- CREATE NEW TABLE:
39+
-- work_management_permissions
40+
--
41+
CREATE TABLE work_management_permissions (
42+
id bigint NOT NULL,
43+
"policy" character varying(255) NOT NULL,
44+
"permission" json NOT NULL,
45+
"projectTemplateId" bigint NOT NULL,
46+
"deletedAt" timestamp with time zone,
47+
"createdAt" timestamp with time zone,
48+
"updatedAt" timestamp with time zone,
49+
"deletedBy" bigint,
50+
"createdBy" bigint NOT NULL,
51+
"updatedBy" bigint NOT NULL
52+
);
53+
54+
CREATE SEQUENCE work_management_permissions_id_seq
55+
START WITH 1
56+
INCREMENT BY 1
57+
NO MINVALUE
58+
NO MAXVALUE
59+
CACHE 1;
60+
61+
ALTER SEQUENCE work_management_permissions_id_seq OWNED BY work_management_permissions.id;
62+
63+
ALTER TABLE work_management_permissions
64+
ALTER COLUMN id SET DEFAULT nextval('work_management_permissions_id_seq');
65+
66+
--
67+
-- CREATE NEW TABLE:
68+
-- phase_work_streams
69+
--
70+
CREATE TABLE phase_work_streams (
71+
"workStreamId" bigint NOT NULL,
72+
"phaseId" bigint NOT NULL
73+
);
74+
75+
ALTER TABLE ONLY phase_work_streams
76+
ADD CONSTRAINT "phase_work_streams_pkey" PRIMARY KEY ("workStreamId", "phaseId");
77+
78+
ALTER TABLE ONLY phase_work_streams
79+
ADD CONSTRAINT "phase_work_streams_phaseId_fkey" FOREIGN KEY ("phaseId") REFERENCES project_phases(id) ON UPDATE CASCADE ON DELETE CASCADE;
80+
81+
ALTER TABLE ONLY phase_work_streams
82+
ADD CONSTRAINT "phase_work_streams_workStreamId_fkey" FOREIGN KEY ("workStreamId") REFERENCES work_streams(id) ON UPDATE CASCADE ON DELETE CASCADE;
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
-- CREATE NEW TABLES:
2+
-- project_settings
3+
-- project_estimation_items
4+
--
5+
6+
--
7+
-- project_settings
8+
--
9+
10+
CREATE TABLE project_settings (
11+
id bigint NOT NULL,
12+
key character varying(255),
13+
value character varying(255),
14+
"valueType" character varying(255),
15+
"projectId" bigint NOT NULL,
16+
metadata json NOT NULL DEFAULT '{}'::json,
17+
"readPermission" json NOT NULL DEFAULT '{}'::json,
18+
"writePermission" json NOT NULL DEFAULT '{}'::json,
19+
"deletedAt" timestamp with time zone,
20+
"createdAt" timestamp with time zone,
21+
"updatedAt" timestamp with time zone,
22+
"deletedBy" bigint,
23+
"createdBy" bigint NOT NULL,
24+
"updatedBy" bigint NOT NULL,
25+
CONSTRAINT project_settings_pkey PRIMARY KEY (id)
26+
);
27+
28+
CREATE SEQUENCE project_settings_id_seq
29+
START WITH 1
30+
INCREMENT BY 1
31+
NO MINVALUE
32+
NO MAXVALUE
33+
CACHE 1;
34+
35+
ALTER SEQUENCE project_settings_id_seq OWNED BY project_settings.id;
36+
37+
ALTER TABLE project_settings
38+
ALTER COLUMN id SET DEFAULT nextval('project_settings_id_seq');
39+
40+
ALTER TABLE project_settings
41+
ADD CONSTRAINT project_settings_key_project_id UNIQUE (key, "projectId");
42+
43+
--
44+
-- project_estimation_items
45+
--
46+
47+
CREATE TABLE project_estimation_items (
48+
id bigint NOT NULL,
49+
"projectEstimationId" bigint NOT NULL,
50+
price double precision NOT NULL,
51+
type character varying(255) NOT NULL,
52+
"markupUsedReference" character varying(255) NOT NULL,
53+
"markupUsedReferenceId" bigint NOT NULL,
54+
metadata json NOT NULL DEFAULT '{}'::json,
55+
"deletedAt" timestamp with time zone,
56+
"createdAt" timestamp with time zone,
57+
"updatedAt" timestamp with time zone,
58+
"deletedBy" bigint,
59+
"createdBy" bigint NOT NULL,
60+
"updatedBy" bigint NOT NULL,
61+
CONSTRAINT project_estimation_items_pkey PRIMARY KEY (id)
62+
);
63+
64+
CREATE SEQUENCE project_estimation_items_id_seq
65+
START WITH 1
66+
INCREMENT BY 1
67+
NO MINVALUE
68+
NO MAXVALUE
69+
CACHE 1;
70+
71+
ALTER SEQUENCE project_estimation_items_id_seq OWNED BY form.id;
72+
73+
ALTER TABLE project_estimation_items
74+
ALTER COLUMN id SET DEFAULT nextval('project_estimation_items_id_seq');
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
--
2+
-- CREATE NEW TABLE:
3+
-- building_blocks
4+
--
5+
CREATE TABLE building_blocks (
6+
id bigint NOT NULL,
7+
"key" character varying(255) NOT NULL,
8+
"config" json NOT NULL DEFAULT '{}'::json,
9+
"privateConfig" json NOT NULL DEFAULT '{}'::json,
10+
"deletedAt" timestamp with time zone,
11+
"createdAt" timestamp with time zone,
12+
"updatedAt" timestamp with time zone,
13+
"deletedBy" bigint,
14+
"createdBy" bigint NOT NULL,
15+
"updatedBy" bigint NOT NULL
16+
);
17+
18+
ALTER TABLE building_blocks
19+
ADD CONSTRAINT building_blocks_key_uniq UNIQUE (key);
20+
21+
CREATE SEQUENCE building_blocks_id_seq
22+
START WITH 1
23+
INCREMENT BY 1
24+
NO MINVALUE
25+
NO MAXVALUE
26+
CACHE 1;
27+
28+
ALTER SEQUENCE building_blocks_id_seq OWNED BY building_blocks.id;
29+
30+
ALTER TABLE building_blocks
31+
ALTER COLUMN id SET DEFAULT nextval('building_blocks_id_seq');
32+
33+
ALTER TABLE ONLY building_blocks
34+
ADD CONSTRAINT building_blocks_pkey PRIMARY KEY (id);
35+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
--
2+
-- UPDATE EXISTING TABLES:
3+
-- project_phases
4+
-- description column: added
5+
-- requirements column: added
6+
7+
ALTER TABLE project_phases ADD COLUMN "description" character varying(255);
8+
ALTER TABLE project_phases ADD COLUMN "requirements" text;
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
--
2+
-- CREATE NEW TABLE:
3+
-- scope_change_requests
4+
--
5+
6+
CREATE TABLE scope_change_requests
7+
(
8+
id bigint NOT NULL,
9+
"projectId" bigint NOT NULL,
10+
"oldScope" json NOT NULL,
11+
"newScope" json NOT NULL,
12+
status character varying(45) NOT NULL,
13+
"deletedAt" timestamp with time zone,
14+
"createdAt" timestamp with time zone,
15+
"updatedAt" timestamp with time zone,
16+
"approvedAt" timestamp with time zone,
17+
"deletedBy" integer,
18+
"createdBy" integer NOT NULL,
19+
"updatedBy" integer NOT NULL,
20+
"approvedBy" integer
21+
);
22+
23+
24+
CREATE SEQUENCE scope_change_requests_id_seq
25+
START WITH 1
26+
INCREMENT BY 1
27+
NO MINVALUE
28+
NO MAXVALUE
29+
CACHE 1;
30+
31+
32+
ALTER SEQUENCE scope_change_requests_id_seq OWNED BY scope_change_requests.id;
33+
34+
ALTER TABLE scope_change_requests
35+
ALTER COLUMN id SET DEFAULT nextval('scope_change_requests_id_seq');
36+
37+
ALTER TABLE ONLY scope_change_requests
38+
ADD CONSTRAINT scope_change_requests_pkey PRIMARY KEY (id);
39+
40+
ALTER TABLE ONLY scope_change_requests
41+
ADD CONSTRAINT "scope_change_requests_projectId_fkey" FOREIGN KEY ("projectId")
42+
REFERENCES projects(id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE CASCADE;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
--
2+
-- UPDATE EXISTING TABLES:
3+
-- milestones
4+
5+
ALTER TABLE milestones ALTER COLUMN "plannedText" DROP NOT NULL;
6+
ALTER TABLE milestones ALTER COLUMN "activeText" DROP NOT NULL;
7+
ALTER TABLE milestones ALTER COLUMN "completedText" DROP NOT NULL;
8+
ALTER TABLE milestones ALTER COLUMN "blockedText" DROP NOT NULL;

0 commit comments

Comments
 (0)