From a976d94e66753bca18d78890c910d1cefe0495fb Mon Sep 17 00:00:00 2001 From: Diky Diwo Suwanto Date: Thu, 6 May 2021 10:46:19 +0700 Subject: [PATCH 01/11] Fix issue #4360 --- src/components/TeamManagement/TeamManagement.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/TeamManagement/TeamManagement.scss b/src/components/TeamManagement/TeamManagement.scss index 2d5b387a6..4823249ec 100644 --- a/src/components/TeamManagement/TeamManagement.scss +++ b/src/components/TeamManagement/TeamManagement.scss @@ -457,6 +457,10 @@ display: flex; flex-wrap: wrap; flex-direction: column; + + div { + align-items: center; + } } } } From 3c0ea70b06853bb1f73748c6d1771b7754dbaaf0 Mon Sep 17 00:00:00 2001 From: Diky Diwo Suwanto Date: Thu, 6 May 2021 11:19:12 +0700 Subject: [PATCH 02/11] Fix issue #4362 --- .../timeline/CreateMilestoneForm/CreateMilestoneForm.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/projects/detail/components/timeline/CreateMilestoneForm/CreateMilestoneForm.jsx b/src/projects/detail/components/timeline/CreateMilestoneForm/CreateMilestoneForm.jsx index c5e59db9e..669b6aab6 100644 --- a/src/projects/detail/components/timeline/CreateMilestoneForm/CreateMilestoneForm.jsx +++ b/src/projects/detail/components/timeline/CreateMilestoneForm/CreateMilestoneForm.jsx @@ -34,13 +34,13 @@ class CreateMilestoneForm extends React.Component { cancelEdit() { const { previousMilestone } = this.props const startDate = previousMilestone ? moment.utc(previousMilestone.completionDate || previousMilestone.endDate) : moment.utc() - this.state = { + this.setState ({ isEditing: false, type: '', name: '', startDate: startDate.format('YYYY-MM-DD'), endDate: startDate.add(3, 'days').format('YYYY-MM-DD') - } + }) } onAddClick() { From 3f28d9ebb68a8b051e25650e2f1bc8118c738e00 Mon Sep 17 00:00:00 2001 From: Diky Diwo Suwanto Date: Thu, 6 May 2021 11:35:48 +0700 Subject: [PATCH 03/11] Revert commit 3c0ea70 --- .../timeline/CreateMilestoneForm/CreateMilestoneForm.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/projects/detail/components/timeline/CreateMilestoneForm/CreateMilestoneForm.jsx b/src/projects/detail/components/timeline/CreateMilestoneForm/CreateMilestoneForm.jsx index 669b6aab6..c5e59db9e 100644 --- a/src/projects/detail/components/timeline/CreateMilestoneForm/CreateMilestoneForm.jsx +++ b/src/projects/detail/components/timeline/CreateMilestoneForm/CreateMilestoneForm.jsx @@ -34,13 +34,13 @@ class CreateMilestoneForm extends React.Component { cancelEdit() { const { previousMilestone } = this.props const startDate = previousMilestone ? moment.utc(previousMilestone.completionDate || previousMilestone.endDate) : moment.utc() - this.setState ({ + this.state = { isEditing: false, type: '', name: '', startDate: startDate.format('YYYY-MM-DD'), endDate: startDate.add(3, 'days').format('YYYY-MM-DD') - }) + } } onAddClick() { From d3f6909575b5a34b87dc9d9e6602410926a7faf6 Mon Sep 17 00:00:00 2001 From: Diky Diwo Suwanto Date: Thu, 6 May 2021 12:06:03 +0700 Subject: [PATCH 04/11] Fix issue #4362 --- .../timeline/CreateMilestoneForm/CreateMilestoneForm.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/projects/detail/components/timeline/CreateMilestoneForm/CreateMilestoneForm.jsx b/src/projects/detail/components/timeline/CreateMilestoneForm/CreateMilestoneForm.jsx index c5e59db9e..7a609a8a0 100644 --- a/src/projects/detail/components/timeline/CreateMilestoneForm/CreateMilestoneForm.jsx +++ b/src/projects/detail/components/timeline/CreateMilestoneForm/CreateMilestoneForm.jsx @@ -34,13 +34,13 @@ class CreateMilestoneForm extends React.Component { cancelEdit() { const { previousMilestone } = this.props const startDate = previousMilestone ? moment.utc(previousMilestone.completionDate || previousMilestone.endDate) : moment.utc() - this.state = { + this.setState({ isEditing: false, type: '', name: '', startDate: startDate.format('YYYY-MM-DD'), endDate: startDate.add(3, 'days').format('YYYY-MM-DD') - } + }) } onAddClick() { From 24e50a2ffc9d2ede5b86dfdc8641e9bd3160111e Mon Sep 17 00:00:00 2001 From: Diky Diwo Suwanto Date: Thu, 6 May 2021 14:07:40 +0700 Subject: [PATCH 05/11] Fix issue #4341: show the Invite Copilot button (in the Manage copilots popup) for the admins --- src/components/TeamManagement/CopilotManagementDialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/TeamManagement/CopilotManagementDialog.js b/src/components/TeamManagement/CopilotManagementDialog.js index 6ca2ef958..db0c8551b 100644 --- a/src/components/TeamManagement/CopilotManagementDialog.js +++ b/src/components/TeamManagement/CopilotManagementDialog.js @@ -182,7 +182,7 @@ class ProjectManagementDialog extends React.Component { {i === 0 && !canManageCopilots &&
}
- {canManageCopilots && ( + {(canManageCopilots || canRemoveCopilots) && (
invite more copilots
Date: Fri, 7 May 2021 14:02:32 +0700 Subject: [PATCH 06/11] Fix issue #4341 --- .../TeamManagement/CopilotManagementDialog.js | 5 +++-- src/config/permissions.js | 11 +++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/components/TeamManagement/CopilotManagementDialog.js b/src/components/TeamManagement/CopilotManagementDialog.js index db0c8551b..74e340679 100644 --- a/src/components/TeamManagement/CopilotManagementDialog.js +++ b/src/components/TeamManagement/CopilotManagementDialog.js @@ -93,6 +93,7 @@ class ProjectManagementDialog extends React.Component { } = this.props const canManageCopilots = hasPermission(PERMISSIONS.MANAGE_COPILOTS) const canRemoveCopilots = hasPermission(PERMISSIONS.REMOVE_COPILOTS) + const canInviteCopilots = hasPermission(PERMISSIONS.INVITE_COPILOTS) const showSuggestions = hasPermission(PERMISSIONS.SEE_MEMBER_SUGGESTIONS) let i = 0 return ( @@ -182,7 +183,7 @@ class ProjectManagementDialog extends React.Component { {i === 0 && !canManageCopilots &&
}
- {(canManageCopilots || canRemoveCopilots) && ( + {canInviteCopilots && (
invite more copilots
)} - {!canManageCopilots &&
} + {!canInviteCopilots &&
}
diff --git a/src/config/permissions.js b/src/config/permissions.js index 4e60f67bd..ab6b0af96 100644 --- a/src/config/permissions.js +++ b/src/config/permissions.js @@ -252,6 +252,17 @@ export const PERMISSIONS = { projectRoles: [PROJECT_ROLE_COPILOT], }, + INVITE_COPILOTS: { + meta: { + group: 'Project Members', + title: 'Invite Copilots', + description: 'Invite copilots to the project.', + }, + topcoderRoles: [ + ...TOPCODER_ADMINS + ] + }, + MANAGE_TOPCODER_TEAM: { meta: { group: 'Project Members', From 8d04864eece5065078f945dd5f91e3fc2d5f6ee8 Mon Sep 17 00:00:00 2001 From: Diky Diwo Suwanto Date: Sat, 15 May 2021 13:32:46 +0700 Subject: [PATCH 07/11] Fix Issue #4341 Update 1 --- .../TeamManagement/CopilotManagementDialog.js | 4 ++-- src/components/TeamManagement/TeamManagement.jsx | 4 +++- src/config/permissions.js | 11 ----------- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/components/TeamManagement/CopilotManagementDialog.js b/src/components/TeamManagement/CopilotManagementDialog.js index 74e340679..d31b97420 100644 --- a/src/components/TeamManagement/CopilotManagementDialog.js +++ b/src/components/TeamManagement/CopilotManagementDialog.js @@ -183,7 +183,7 @@ class ProjectManagementDialog extends React.Component { {i === 0 && !canManageCopilots &&
}
- {canInviteCopilots && ( + {canManageCopilots && (
invite more copilots
)} - {!canInviteCopilots &&
} + {!canManageCopilots &&
}
diff --git a/src/components/TeamManagement/TeamManagement.jsx b/src/components/TeamManagement/TeamManagement.jsx index 6752ac5c2..019b26d88 100644 --- a/src/components/TeamManagement/TeamManagement.jsx +++ b/src/components/TeamManagement/TeamManagement.jsx @@ -114,8 +114,10 @@ class TeamManagement extends React.Component { const copilotRemoveAction = hasPermission(PERMISSIONS.REMOVE_COPILOTS) const copilotViewAction = hasPermission(PERMISSIONS.VIEW_COPILOTS) const canRequestCopilot = hasPermission(PERMISSIONS.REQUEST_COPILOTS) + const canManageCopilots = hasPermission(PERMISSIONS.MANAGE_COPILOTS) const copilotRequestLink = `https://topcoder.typeform.com/to/YJ7AL4p8#handle=${currentUser.handle}&projectid=${projectId}` const canJoinTopcoderTeam = !currentMember && hasPermission(PERMISSIONS.JOIN_TOPCODER_TEAM) + const hasCopilot = members.some(member => member.role === 'copilot') const sortedMembers = members let projectTeamInviteCount = 0 @@ -194,7 +196,7 @@ class TeamManagement extends React.Component {
Copilot - {(copilotTeamManageAction || copilotRemoveAction || copilotViewAction) && + {((copilotTeamManageAction || copilotRemoveAction || copilotViewAction) && (canManageCopilots || hasCopilot)) && onShowCopilotDialog(true)}> {(copilotTeamManageAction || copilotRemoveAction) ? 'Manage' : 'View'} diff --git a/src/config/permissions.js b/src/config/permissions.js index ab6b0af96..4e60f67bd 100644 --- a/src/config/permissions.js +++ b/src/config/permissions.js @@ -252,17 +252,6 @@ export const PERMISSIONS = { projectRoles: [PROJECT_ROLE_COPILOT], }, - INVITE_COPILOTS: { - meta: { - group: 'Project Members', - title: 'Invite Copilots', - description: 'Invite copilots to the project.', - }, - topcoderRoles: [ - ...TOPCODER_ADMINS - ] - }, - MANAGE_TOPCODER_TEAM: { meta: { group: 'Project Members', From 2fdf75e4423f5b9c51cb6d7372cf8e651744ac2a Mon Sep 17 00:00:00 2001 From: Diky Diwo Suwanto Date: Sat, 15 May 2021 14:01:08 +0700 Subject: [PATCH 08/11] Fix Issue #4341 --- src/components/TeamManagement/CopilotManagementDialog.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/TeamManagement/CopilotManagementDialog.js b/src/components/TeamManagement/CopilotManagementDialog.js index d31b97420..6ca2ef958 100644 --- a/src/components/TeamManagement/CopilotManagementDialog.js +++ b/src/components/TeamManagement/CopilotManagementDialog.js @@ -93,7 +93,6 @@ class ProjectManagementDialog extends React.Component { } = this.props const canManageCopilots = hasPermission(PERMISSIONS.MANAGE_COPILOTS) const canRemoveCopilots = hasPermission(PERMISSIONS.REMOVE_COPILOTS) - const canInviteCopilots = hasPermission(PERMISSIONS.INVITE_COPILOTS) const showSuggestions = hasPermission(PERMISSIONS.SEE_MEMBER_SUGGESTIONS) let i = 0 return ( From 620313013807e3745212b774ed84620a6abd65cd Mon Sep 17 00:00:00 2001 From: Mirza Ilhami Date: Mon, 17 May 2021 04:08:04 +0700 Subject: [PATCH 09/11] Update CreatePhaseForm.jsx --- .../detail/components/CreatePhaseForm/CreatePhaseForm.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/projects/detail/components/CreatePhaseForm/CreatePhaseForm.jsx b/src/projects/detail/components/CreatePhaseForm/CreatePhaseForm.jsx index a9547b40e..aec531f1a 100644 --- a/src/projects/detail/components/CreatePhaseForm/CreatePhaseForm.jsx +++ b/src/projects/detail/components/CreatePhaseForm/CreatePhaseForm.jsx @@ -120,11 +120,14 @@ class CreatePhaseForm extends React.Component { const phaseData = { title: model.title, - description: model.description || ' ', startDate: moment(model.startDate), endDate: moment(model.endDate), } + if (model.description.trim()) { + phaseData.description = model.description + } + const apiMilestones = milestones.map((milestone, index) => ({ // default values ...MILESTONE_DEFAULT_VALUES[milestone.type], From e1d52ea5b1983708de17bd2e1498c78560894321 Mon Sep 17 00:00:00 2001 From: Mirza Ilhami Date: Mon, 17 May 2021 04:12:51 +0700 Subject: [PATCH 10/11] #4358 - Get rid of the workaround of passing empty spaces --- src/projects/detail/components/PhaseCard/EditStageForm.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/projects/detail/components/PhaseCard/EditStageForm.jsx b/src/projects/detail/components/PhaseCard/EditStageForm.jsx index 1d2c98afe..f7c04504f 100644 --- a/src/projects/detail/components/PhaseCard/EditStageForm.jsx +++ b/src/projects/detail/components/PhaseCard/EditStageForm.jsx @@ -86,8 +86,10 @@ class EditStageForm extends React.Component { if (publishClicked && phase.status === PHASE_STATUS_DRAFT) { newStatus = PHASE_STATUS_ACTIVE } + if (!model.description.trim()) { + delete model.description + } const updateParam = _.assign({}, model, { - description: model.description || ' ', startDate: updatedStartDate, endDate: updatedEndDate || '', status: newStatus @@ -285,7 +287,7 @@ class EditStageForm extends React.Component { wrapperClass={`${styles['input-row']}`} label="Description" name="description" - value={phase.description ? phase.description.trim() : ''} + value={phase.description} maxLength={255} /> From c9a28ad6ef4d62fa87c95791828bf2678771e0c2 Mon Sep 17 00:00:00 2001 From: vikasrohit Date: Mon, 17 May 2021 10:00:09 +0530 Subject: [PATCH 11/11] Deployable feature branch --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9711ba7ed..76c515c40 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -128,7 +128,7 @@ workflows: - build-dev filters: branches: - only: ['dev', 'feature/project-plan-simplification-0'] + only: ['dev', 'feature/cf-2.20'] - deployTest01: context : org-global