Skip to content

Prod deploy Aug 18 2023 - v20.12 #1563

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 5 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
35 changes: 35 additions & 0 deletions src/actions/users.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* Sidebar related redux actions
*/
import { fetchMemberProjects } from '../services/projects'
import {
LOAD_ALL_USER_PROJECTS_PENDING,
LOAD_ALL_USER_PROJECTS_SUCCESS,
LOAD_ALL_USER_PROJECTS_FAILURE
} from '../config/constants'

/**
* Loads projects of the authenticated user
*/
export function loadAllUserProjects (isAdmin = true) {
return (dispatch) => {
dispatch({
type: LOAD_ALL_USER_PROJECTS_PENDING
})

const filters = {
status: 'active',
sort: 'lastActivityAt desc'
}
if (!isAdmin) {
filters['memberOnly'] = true
}

fetchMemberProjects(filters).then(projects => dispatch({
type: LOAD_ALL_USER_PROJECTS_SUCCESS,
projects
})).catch(() => dispatch({
type: LOAD_ALL_USER_PROJECTS_FAILURE
}))
}
}
6 changes: 6 additions & 0 deletions src/components/ChallengeEditor/ChallengeView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@ const ChallengeView = ({
)}
</>
)}
<div className={styles.row}>
<div className={styles.col}>
<span className={styles.fieldTitle}>Timezone:</span>
{Intl.DateTimeFormat().resolvedOptions().timeZone}
</div>
</div>
{
challenge.legacy.subTrack === 'WEB_DESIGNS' && challenge.phases.length === 8 ? phases.map((phase, index) => (
<PhaseInput
Expand Down
15 changes: 13 additions & 2 deletions src/components/ChallengeEditor/Resources/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,6 @@ export default class Resources extends React.Component {
const currentPhase = getCurrentPhase(challenge).toLowerCase()
const isCurrentPhasesNotSubmissionOrRegistration = _.every(['submission', 'registration'], (phase) => currentPhase.indexOf(phase) < 0)
const exceptionHandlesDeleteList = {}
// The creator of the challenge can't be deleted
exceptionHandlesDeleteList[challenge.createdBy] = true
_.forEach(submissions, (s) => {
// do not allow to delete submitters who submitted
exceptionHandlesDeleteList[s.createdBy] = true
Expand All @@ -182,13 +180,26 @@ export default class Resources extends React.Component {
], (status) => challenge.status.toUpperCase() === status)
) {
if (
// The creator of the challenge can't be deleted
resourceItem.memberHandle === challenge.createdBy
) {
// where the copilot has multiple roles, we should allow the additional roles to be deleted, but not the copilot role
if (`${resourceItem.role}`.toLowerCase().indexOf('copilot') >= 0) {
exceptionResourceIdDeleteList[resourceItem.id] = true
}
} else if (
// Copilots can't delete themselves from the challenge
loggedInUserResource &&
_.some(loggedInUserResource.roles, (role) => `${role}`.toLowerCase().indexOf('copilot') >= 0) &&
loggedInUserResource.memberHandle === resourceItem.memberHandle
) {
exceptionResourceIdDeleteList[resourceItem.id] = true
}
} else if (
// The creator of the challenge can't be deleted
resourceItem.memberHandle === challenge.createdBy
) {
exceptionResourceIdDeleteList[resourceItem.id] = true
} else if (
// If the current phase is not submission or registration
// then we will disable removing reviewers and copilots.
Expand Down
6 changes: 6 additions & 0 deletions src/components/ChallengeEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1749,6 +1749,12 @@ class ChallengeEditor extends Component {
)}
{!isTask && (
<>
<div className={styles.row}>
<div className={styles.col}>
<span className={styles.fieldTitle}>Timezone:</span>
{Intl.DateTimeFormat().resolvedOptions().timeZone}
</div>
</div>
{
phases.map((phase, index) => (
<PhaseInput
Expand Down
66 changes: 0 additions & 66 deletions src/components/Sidebar/Sidebar.module.scss

This file was deleted.

58 changes: 0 additions & 58 deletions src/components/Sidebar/index.js

This file was deleted.

4 changes: 4 additions & 0 deletions src/config/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ export const LOAD_PROJECTS_PENDING = 'LOAD_PROJECTS_PENDING'
export const LOAD_PROJECTS_FAILURE = 'LOAD_PROJECTS_FAILURE'
export const UNLOAD_PROJECTS_SUCCESS = 'UNLOAD_PROJECTS_SUCCESS'

export const LOAD_ALL_USER_PROJECTS_SUCCESS = 'LOAD_ALL_USER_PROJECTS_SUCCESS'
export const LOAD_ALL_USER_PROJECTS_PENDING = 'LOAD_ALL_USER_PROJECTS_PENDING'
export const LOAD_ALL_USER_PROJECTS_FAILURE = 'LOAD_ALL_USER_PROJECTS_FAILURE'

// project billingAccount
export const LOAD_PROJECT_BILLING_ACCOUNT = 'LOAD_PROJECT_BILLING_ACCOUNT'
export const LOAD_PROJECT_BILLING_ACCOUNT_PENDING = 'LOAD_PROJECT_BILLING_ACCOUNT_PENDING'
Expand Down
104 changes: 0 additions & 104 deletions src/containers/Sidebar/index.js

This file was deleted.

Loading