Skip to content

Commit

Permalink
Merge pull request #8 from palantirnet/7-evaluator
Browse files Browse the repository at this point in the history
Reviewed. Looks good!

The spacing around the table is a little weird, but definitely not a blocker for merging.
  • Loading branch information
lukewertz authored Jul 16, 2021
2 parents 4c09329 + be75b2e commit 2ad3b63
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 7 deletions.
4 changes: 2 additions & 2 deletions components/PointSummaries.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,9 @@ class PointSummaries extends React.Component<Props> {
<td className="tier-label" colSpan="3" key={tier}>Milestone {tier}</td>
)}
</tr>
{/* Level numbers */}
{/* Level numbers up to 15 */}
<tr>
{Object.entries(pointsToLevels).map((points, level) =>
{Object.entries(pointsToLevels).slice(0, 15).map((points, level) =>
<td className="level-label" key={level}>{level + 1}</td>
)}
</tr>
Expand Down
43 changes: 39 additions & 4 deletions components/SnowflakeApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import LevelSelector from '../components/LevelSelector'
type SnowflakeAppState = {
milestoneByTrack: MilestoneMap,
name: string,
evaluator: string,
title: string,
level: number,
focusedTrackId: TrackId,
Expand All @@ -34,7 +35,7 @@ const hashToState = (hash: String): ?SnowflakeAppState => {
if (hashValues[13]) result.level = decodeURI(hashValues[13])
if (hashValues[14]) result.name = decodeURI(hashValues[14])
if (hashValues[15]) result.cohort = decodeURI(hashValues[15])
//if (hashValues[16]) result.title = decodeURI(hashValues[16])
if (hashValues[16]) result.evaluator = decodeURI(hashValues[16])
return result
}

Expand All @@ -54,6 +55,7 @@ const coerceMilestone = (value: number): Milestone => {
const emptyState = (): SnowflakeAppState => {
return {
name: '',
evaluator: '',
cohort: '',
title: '',
level: 0,
Expand All @@ -73,13 +75,14 @@ const emptyState = (): SnowflakeAppState => {
'BIZDEV': 0,
},
focusedTrackId: 'HEADER_ONE',
version: "2.0.4"
version: "2.0.5"
}
}

const defaultState = (): SnowflakeAppState => {
return {
name: 'Palantiri Name',
evaluator: 'Evaluator Name/Team',
cohort: 'Project Management',
title: 'Project Manager, III',
level: 1,
Expand All @@ -104,7 +107,7 @@ const defaultState = (): SnowflakeAppState => {

const stateToHash = (state: SnowflakeAppState) => {
if (!state || !state.milestoneByTrack) return null
const values = trackIds.map(trackId => state.milestoneByTrack[trackId]).concat(encodeURI(state.level), encodeURI(state.name), encodeURI(state.cohort))
const values = trackIds.map(trackId => state.milestoneByTrack[trackId]).concat(encodeURI(state.level), encodeURI(state.name), encodeURI(state.cohort), encodeURI(state.evaluator))
return values.join(',')
}

Expand Down Expand Up @@ -176,7 +179,17 @@ class SnowflakeApp extends React.Component<Props, SnowflakeAppState> {
margin-right: 50px;
padding: .25em .125em;
}
.name-input:hover, .name-input:focus, .name-input:active {
.evaluator-input {
border: 0;
background: transparent;
display: inline-block;
margin-right: 10px;
color: #fff;
font-size: 16px;
line-height: 20px;
padding: 1em .125em;
}
.name-input:hover, .name-input:focus, .name-input:active, .evaluator-input:hover, .evaluator-input:focus, .evaluator-input:active {
border-color: #11a9a1;
background-color: rgba(17, 169, 161, .125);
outline: 0;
Expand All @@ -201,6 +214,12 @@ class SnowflakeApp extends React.Component<Props, SnowflakeAppState> {
background-color: rgba(17, 169, 161, .125);
cursor: pointer;
}
.input-wrapper {
display: inline-block;
height: 3em;
border-bottom: 2px solid #7e97a0;
margin-right: 10px;
}
a {
color: #109C95;
text-decoration: none;
Expand Down Expand Up @@ -249,6 +268,18 @@ class SnowflakeApp extends React.Component<Props, SnowflakeAppState> {
onChange={e => this.setState({name: e.target.value})}
placeholder="Name"
/>
<div className="form-input">
<label>Evaluator:</label>
<span className="input-wrapper">
<input
type="text"
className="evaluator-input"
value={this.state.evaluator}
onChange={e => this.setState({evaluator: e.target.value})}
placeholder="Evaluator"
/>
</span>
</div>
<div className="form-input">
<label>Cohort:</label>
<span className="select-wrapper">
Expand Down Expand Up @@ -365,6 +396,10 @@ class SnowflakeApp extends React.Component<Props, SnowflakeAppState> {
this.setState({ title })
}

setEvaluator(evaluator: string) {
this.setState({ evaluator })
}

setLevel(level: number) {
this.setState({ level })
}
Expand Down
2 changes: 1 addition & 1 deletion constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const pointsToLevels = {
'300': '13',
'330': '14',
'360': '15',
'10000' : '16',
'500': '16',
}

export const maxLevel = 360
Expand Down

0 comments on commit 2ad3b63

Please sign in to comment.