Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
a8345fa
Merge pull request #3977 from appirio-tech/hotfix/post-release-2.9.1
maxceem Apr 30, 2020
5c3b34d
feat: SelectDropdown support placeholder
May 4, 2020
42a3645
fix: metadata default dropdown option
May 4, 2020
3d8af2a
Merge pull request #3980 from maxceem/feature/select-dropdown-improve…
maxceem May 4, 2020
6596f6f
feat: add column to Milestone Template table
May 4, 2020
671c585
chore: use special Project Service instance
May 5, 2020
17de466
chore: hack to test as admin user
May 5, 2020
1b7282b
Merge pull request #3984 from appirio-tech/hotfix/post-release-2.9.1
maxceem May 6, 2020
8fc46f0
Merge pull request #3985 from appirio-tech/hotfix/post-release-2.9.1
maxceem May 6, 2020
24e1462
Merge pull request #3987 from appirio-tech/hotfix/post-release-2.9.1
maxceem May 7, 2020
8446070
chore: use new CDN URLs
May 12, 2020
c10c5ec
Merge pull request #2 from appirio-tech/feature/bulk-milestone-updates
nqviet May 12, 2020
6214061
Milestone Bulk Updates
May 12, 2020
1034c92
Merge pull request #3993 from nqviet/feature/bulk-milestone-updates
maxceem May 12, 2020
706e709
chore: deploy branch to TEST env
May 12, 2020
d40c8bb
chore: use https on demo backend
May 12, 2020
f061325
chore: fix demo port
May 12, 2020
aab1472
Merge branch 'dev' into feature/bulk-milestone-updates
May 12, 2020
7c60795
fix: show error on milestone actions
May 15, 2020
929c60c
chore: letter case "Company Name"
May 15, 2020
6a87632
Merge pull request #3996 from appirio-tech/feature/bulk-milestone-upd…
maxceem May 15, 2020
37aa0a4
chore: updated axios "0.13.1" to "0.19.2"
May 15, 2020
c05ed0c
chore: removed digitalocean URLs as API
May 15, 2020
cf1b5a0
chore: disable loggin webpack config
May 15, 2020
31e4a3b
fix: limit number of avatars to fit card
May 15, 2020
148b17c
- Changes for displaying project type icon on project's left hand nav…
RishiRajSahu May 15, 2020
f173398
lint fix
RishiRajSahu May 15, 2020
7945aae
Merge branch 'dev' into feature/Add_project_type_icon_in_leftNavigati…
RishiRajSahu May 15, 2020
506074f
Using templateName for tooltip title, for V2 projects still using pro…
RishiRajSahu May 21, 2020
70cad97
Removed feature from deployable
RishiRajSahu May 26, 2020
d97ca42
Merge pull request #4047 from appirio-tech/feature/Add_project_type_i…
RishiRajSahu May 26, 2020
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ workflows:
- build-dev
filters:
branches:
only: ['feature/permissions']
only: ['feature/bulk-milestone-updates']

- deployProd:
context : org-global
Expand Down
2 changes: 1 addition & 1 deletion config/constants/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ module.exports = {
TC_SYSTEM_USERID: process.env.DEV_TC_SYSTEM_USERID,
MAINTENANCE_MODE: process.env.DEV_MAINTENANCE_MODE,

TC_CDN_URL: process.env.TC_CDN_URL || 'https://d1aahxkjiobka8.cloudfront.net'
TC_CDN_URL: process.env.TC_CDN_URL
}
2 changes: 1 addition & 1 deletion config/constants/master.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ module.exports = {
TC_SYSTEM_USERID: process.env.PROD_TC_SYSTEM_USERID,
MAINTENANCE_MODE: process.env.PROD_MAINTENANCE_MODE,

TC_CDN_URL: process.env.TC_CDN_URL || 'https://dlxczxztayxv6.cloudfront.net'
TC_CDN_URL: process.env.TC_CDN_URL
}
2 changes: 1 addition & 1 deletion config/constants/qa.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ module.exports = {
TC_SYSTEM_USERID: process.env.QA_TC_SYSTEM_USERID,
MAINTENANCE_MODE: process.env.QA_MAINTENANCE_MODE,

TC_CDN_URL: process.env.TC_CDN_URL || 'https://d1aahxkjiobka8.cloudfront.net'
TC_CDN_URL: process.env.TC_CDN_URL
}
26 changes: 22 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
},
"dependencies": {
"appirio-tech-react-components": "git+https://github.com/appirio-tech/react-components.git#feature/connectv2",
"axios": "^0.13.1",
"axios": "^0.19.2",
"brace": "^0.11.1",
"classnames": "^2.2.3",
"coffeescript": "^1.12.7",
Expand Down
3 changes: 2 additions & 1 deletion scripts/permissions-doc/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ webpackConfig.module.rules.push({

webpackConfig.plugins = []

console.log('webpackConfig', JSON.stringify(webpackConfig, null, 2))
// Uncomment for debugging the final webpack config
// console.log('webpackConfig', JSON.stringify(webpackConfig, null, 2))

module.exports = webpackConfig
2 changes: 2 additions & 0 deletions src/actions/loadUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ export function loadUserSuccess(dispatch, token) {
currentUser.id = currentUser.userId
currentUser.token = token
}
// uncomment to add admin role to the user for testing admin functionality locally
// currentUser.roles.push('administrator')
if (currentUser) {
getUserProfile(currentUser.handle).then((profile) => {
currentUser = _.assign(currentUser, profile)
Expand Down
13 changes: 13 additions & 0 deletions src/api/timelines.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@ export function updateMilestone(timelineId, milestoneId, updatedProps) {
.then(resp => resp.data)
}

/**
* Bulk update milestones
*
* @param {Number} timelineId timeline id
* @param {Array<{}>} milestones the timeline's milestones
*
* @returns {Promise} milestones
*/
export function updateMilestones(timelineId, milestones) {
return axios.patch(`${PROJECTS_API_URL}/v5/timelines/${timelineId}/milestones`, milestones)
.then(resp => resp.data)
}

/**
* Get milestone templates by product template id
*
Expand Down
62 changes: 41 additions & 21 deletions src/components/ProjectInfo/ProjectInfo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import { SCREEN_BREAKPOINT_MD, PROJECT_STATUS_ACTIVE, PHASE_STATUS_ACTIVE, PHASE
import ReviewProjectButton from '../../projects/detail/components/ReviewProjectButton'
import Tooltip from 'appirio-tech-react-components/components/Tooltip/Tooltip'
import { TOOLTIP_DEFAULT_DELAY } from '../../config/constants'
import { getProjectTemplateByKey } from '../../helpers/templates'

import ProjectTypeIcon from '../../components/ProjectTypeIcon'
import './ProjectInfo.scss'

class ProjectInfo extends Component {
Expand All @@ -23,7 +25,7 @@ class ProjectInfo extends Component {
render() {
const { project, currentMemberRole,
onChangeStatus, isSuperUser, phases, onSubmitForReview, isProjectProcessing,
showDeleteConfirm, toggleProjectDelete, onConfirmDelete } = this.props
showDeleteConfirm, toggleProjectDelete, onConfirmDelete, projectTemplates } = this.props

const code = _.get(project, 'details.utm.code', '')

Expand All @@ -50,29 +52,47 @@ class ProjectInfo extends Component {
</div>
)

const url = `/projects/${project.id}`
const projectTemplateId = project.templateId
const projectTemplateKey = _.get(project, 'details.products[0]')
const projectTemplate = projectTemplateId
? _.find(projectTemplates, pt => pt.id === projectTemplateId)
: getProjectTemplateByKey(projectTemplates, projectTemplateKey)
// icon for the product, use default generic work project icon for categories which no longer exist now
const productIcon = _.get(projectTemplate, 'icon', 'tech-32px-outline-work-project')
const templateName = _.get(projectTemplate, 'name', null)
const projectType = project.type !== undefined ? project.type[0].toUpperCase() + project.type.substr(1).replace(/_/g, ' ') : null
return (
<div className="project-info">
<div className="project-status">
<div styleName="project-name">{_.unescape(project.name)}</div>

<div styleName="project-status-bottom">
<div className="project-status-time">
Created {moment(project.createdAt).format('MMM DD, YYYY')}
</div>
{!!code &&
<div styleName="tooltip-target-container">
<Tooltip styleName="tooltip" theme="light" tooltipDelay={TOOLTIP_DEFAULT_DELAY}>
<div className="tooltip-target">
<div className="project-status-ref">{_.unescape(code)}</div>
</div>
<div className="tooltip-body">
<div>{_.unescape(code)}</div>
</div>
</Tooltip>
</div>

}
<div className="icon-and-status" >
<div className="item-icon">
<Link to={url} className="spacing">
<div className="project-type-icon" title={templateName ? templateName : projectType}>
<ProjectTypeIcon type={productIcon} />
</div>
</Link>
</div>
<div className="project-status">
<div styleName="project-name">{_.unescape(project.name)}</div>
</div>
</div>
<div styleName="project-status-bottom">
<div className="project-status-time">
Created {moment(project.createdAt).format('MMM DD, YYYY')}
</div>
{!!code &&
<div styleName="tooltip-target-container">
<Tooltip styleName="tooltip" theme="light" tooltipDelay={TOOLTIP_DEFAULT_DELAY}>
<div className="tooltip-target">
<div className="project-status-ref">{_.unescape(code)}</div>
</div>
<div className="tooltip-body">
<div>{_.unescape(code)}</div>
</div>
</Tooltip>
</div>

}
</div>
{showDeleteConfirm && (
<DeleteProjectModal
Expand Down
24 changes: 23 additions & 1 deletion src/components/ProjectInfo/ProjectInfo.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,26 @@
margin-top: 4 * $base_unit;
padding-bottom: 0;
}
.icon-and-status {
display: flex;
flex-direction: row;
align-items: inherit;
.item-icon {
display: flex;
flex-direction: column;
min-width: 52px;
width: 52px;
padding-left: 4 * $base-unit;
margin-bottom: 2 * $base-unit;

.spacing {
margin-top: 5 * $base-unit;
}
.project-type-icon > svg > path {
fill: $tc-dark-blue-110;
}
}
}

.project-info-review {
> p {
Expand All @@ -42,7 +62,7 @@

.project-status {
margin-bottom: 10px;
padding-left: 4 * $base_unit;
padding-left: 2 * $base_unit;
padding-right: 4 * $base_unit;
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -124,6 +144,8 @@
.project-status-bottom {
display: flex;
justify-content: space-between;
padding-left: 4 * $base_unit;
padding-right: 4 * $base_unit;
}

.tooltip-target-container {
Expand Down
27 changes: 18 additions & 9 deletions src/components/SelectDropdown/SelectDropdownBase.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,15 @@ class SelectDropdown extends PureComponent {
}

componentWillMount() {
this.updateSelectedOptionValue(_.toString(this.props.value))
this.updateSelectedOptionValue(this.props.value)
}

updateSelectedOptionValue(value) {
const { options } = this.props

let selectedOption = _.find(options, (o) => o.value === value)
if (!selectedOption) {
selectedOption = options[0]
}

const selectedOption = _.find(options, { value }) || null

this.setState({
selectedOption
}/*, function() {
Expand Down Expand Up @@ -89,9 +88,9 @@ class SelectDropdown extends PureComponent {
}

render() {
const { options, theme, disabled } = this.props
const { options, theme, disabled, placeholder } = this.props
const { selectedOption, confirmOption } = this.state
const selectedValue = selectedOption.title
const selectedValue = selectedOption ? selectedOption.title : placeholder
const renderOption = (option, optIdx) => {
if (option.hide) {
return null
Expand Down Expand Up @@ -160,18 +159,28 @@ class SelectDropdown extends PureComponent {
}
}

const valuePropType = PT.oneOfType([PT.string, PT.number])

SelectDropdown.defaultProps = {
placeholder: ' - Select - '
}

SelectDropdown.propTypes = {
onSelect : PT.func,
options : PT.arrayOf(PT.shape({
title: PT.string.isRequired,
value: PT.string.isRequired,
value: valuePropType.isRequired,
disabled: PT.bool,
hide: PT.bool,
confirm: PT.oneOfType([PT.string, PT.bool]),
toolTipMessage: PT.string,
})).isRequired,
theme : PT.string,
selectedOption : PT.object
value : valuePropType,
/**
* Placeholder to show when there is no selected option
*/
placeholder: PT.string,
}

export default SelectDropdown
9 changes: 8 additions & 1 deletion src/config/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,11 @@ export const UPDATE_PRODUCT_MILESTONE_PENDING = 'UPDATE_PRODUCT_MILESTONE_PE
export const UPDATE_PRODUCT_MILESTONE_FAILURE = 'UPDATE_PRODUCT_MILESTONE_FAILURE'
export const UPDATE_PRODUCT_MILESTONE_SUCCESS = 'UPDATE_PRODUCT_MILESTONE_SUCCESS'

export const BULK_UPDATE_PRODUCT_MILESTONES = 'BULK_UPDATE_PRODUCT_MILESTONES'
export const BULK_UPDATE_PRODUCT_MILESTONES_PENDING = 'BULK_UPDATE_PRODUCT_MILESTONES_PENDING'
export const BULK_UPDATE_PRODUCT_MILESTONES_FAILURE = 'BULK_UPDATE_PRODUCT_MILESTONES_FAILURE'
export const BULK_UPDATE_PRODUCT_MILESTONES_SUCCESS = 'BULK_UPDATE_PRODUCT_MILESTONES_SUCCESS'

export const COMPLETE_PRODUCT_MILESTONE = 'COMPLETE_PRODUCT_MILESTONE'
export const COMPLETE_PRODUCT_MILESTONE_PENDING = 'COMPLETE_PRODUCT_MILESTONE_PENDING'
export const COMPLETE_PRODUCT_MILESTONE_FAILURE = 'COMPLETE_PRODUCT_MILESTONE_FAILURE'
Expand Down Expand Up @@ -708,8 +713,10 @@ export const TC_API_URL = `https://api.${DOMAIN}`
export const DIRECT_PROJECT_URL = `https://www.${DOMAIN}/direct/projectOverview?formData.projectId=`
export const SALESFORCE_PROJECT_LEAD_LINK = process.env.SALESFORCE_PROJECT_LEAD_LINK
export const TC_NOTIFICATION_URL = process.env.TC_NOTIFICATION_URL || `${TC_API_URL}/v5/notifications`
// Uncomment if you run TC Notifications locally
// export const TC_NOTIFICATION_URL = 'http://localstho:4000/v5/notifications'

export const TC_CDN_URL = process.env.TC_CDN_URL
export const TC_CDN_URL = process.env.TC_CDN_URL || `https://community-app.${DOMAIN}/api/cdn/public`

export const RESET_PASSWORD_URL = `https://accounts.${DOMAIN}/connect/reset-password`
export const VERIFY_EMAIL_URL = `http://www.${DOMAIN}/settings/account/changeEmail`
Expand Down
Loading