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

Commit 6c345e4

Browse files
committed
Merge 'origin/develop' into PLAT-1711
2 parents 925fced + ed7102c commit 6c345e4

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

.circleci/config.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
version: 2
22
defaults: &defaults
33
docker:
4-
- image: circleci/python:2.7-stretch-browsers
4+
- image: cimg/python:3.11.0-browsers
55
install_dependency: &install_dependency
66
name: Installation of build and deployment dependencies.
77
command: |
8+
sudo apt update
89
sudo apt install jq
10+
sudo apt install python3-pip
911
sudo pip install awscli --upgrade
1012
sudo pip install docker-compose
1113
install_deploysuite: &install_deploysuite

src/services/ProcessorService.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,10 @@ async function syncChallengePhases (legacyId, v5Phases, createdBy, isSelfService
131131
if (v5Equivalent.isOpen && _.toInteger(phase.phase_status_id) === constants.PhaseStatusTypes.Closed) {
132132
newStatus = constants.PhaseStatusTypes.Scheduled
133133
}
134-
const newStatus = v5Equivalent.isOpen
135-
? constants.PhaseStatusTypes.Open
136-
: _.toInteger(phase.phase_status_id)
137134
await timelineService.updatePhase(
138135
phase.project_phase_id,
139136
legacyId,
137+
phase.fixed_start_time ? v5Equivalent.scheduledStartDate : null,
140138
v5Equivalent.scheduledStartDate,
141139
v5Equivalent.scheduledEndDate,
142140
v5Equivalent.duration * 1000,

src/services/timelineService.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ const phaseIdGen = new IDGenerator('project_phase_id_seq')
1515

1616
const QUERY_GET_PHASE_TYPES = 'SELECT phase_type_id, name FROM phase_type_lu'
1717

18-
const QUERY_GET_CHALLENGE_PHASES = 'SELECT project_phase_id, scheduled_start_time, scheduled_end_time, duration, phase_status_id, phase_type_id FROM project_phase WHERE project_id = %d'
18+
const QUERY_GET_CHALLENGE_PHASES = 'SELECT project_phase_id, fixed_start_time, scheduled_start_time, scheduled_end_time, duration, phase_status_id, phase_type_id FROM project_phase WHERE project_id = %d'
1919
const QUERY_DROP_CHALLENGE_PHASE = 'DELETE FROM project_phase WHERE project_id = ? AND project_phase_id = ?'
2020
const QUERY_INSERT_CHALLENGE_PHASE = 'INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) VALUES (?, ?, ?, ?, ?, ?, ?, ?, CURRENT, ?, CURRENT)'
21-
const QUERY_UPDATE_CHALLENGE_PHASE = 'UPDATE project_phase SET scheduled_start_time = ?, scheduled_end_time = ?, duration = ?, phase_status_id = ? WHERE project_phase_id = %d and project_id = %d'
21+
const QUERY_UPDATE_CHALLENGE_PHASE = 'UPDATE project_phase SET fixed_start_time = ?, scheduled_start_time = ?, scheduled_end_time = ?, duration = ?, phase_status_id = ? WHERE project_phase_id = %d and project_id = %d'
2222

2323
const QUERY_DROP_CHALLENGE_PHASE_CRITERIA = 'DELETE FROM phase_criteria WHERE project_phase_id = ?'
2424

@@ -37,6 +37,9 @@ const QUERY_INSERT_CHALLENGE_PHASE_SCORECARD_ID = 'INSERT INTO phase_criteria (p
3737
* @param {String} dateStr the date in string format
3838
*/
3939
function formatDate (dateStr) {
40+
if (!dateStr) {
41+
return null
42+
}
4043
const date = momentTZ.tz(dateStr, config.TIMEZONE).format('YYYY-MM-DD HH:mm:ss')
4144
logger.info(`Formatting date ${dateStr} New Date ${date}`)
4245
return date
@@ -228,18 +231,19 @@ async function createPhase (challengeLegacyId, phaseTypeId, statusTypeId, schedu
228231
* Update a phase in IFX
229232
* @param {Number} phaseId the phase ID
230233
* @param {Number} challengeLegacyId the legacy challenge ID
234+
* @param {Date} fixedStartTime the fixed start date
231235
* @param {Date} startTime the scheduled start date
232236
* @param {Date} endTime the scheduled end date
233237
* @param {Date} duration the duration
234238
* @param {Number} statusTypeId the status type ID
235239
*/
236-
async function updatePhase (phaseId, challengeLegacyId, startTime, endTime, duration, statusTypeId) {
240+
async function updatePhase (phaseId, challengeLegacyId, fixedStartTime, startTime, endTime, duration, statusTypeId) {
237241
const connection = await helper.getInformixConnection()
238242
let result = null
239243
try {
240244
// await connection.beginTransactionAsync()
241245
const query = await prepare(connection, util.format(QUERY_UPDATE_CHALLENGE_PHASE, phaseId, challengeLegacyId))
242-
result = await query.executeAsync([formatDate(startTime), formatDate(endTime), duration, statusTypeId])
246+
result = await query.executeAsync([formatDate(fixedStartTime), formatDate(startTime), formatDate(endTime), duration, statusTypeId])
243247
// await connection.commitTransactionAsync()
244248
} catch (e) {
245249
logger.error(`Error in 'updatePhase' ${e}, rolling back transaction`)

0 commit comments

Comments
 (0)