Skip to content
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

dev -> staging #447

Merged
merged 30 commits into from
Sep 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
0598cc2
Allow users to "select all" language filters
mjoyce91 Sep 20, 2019
c8aa724
Remove unnecessary code
mjoyce91 Sep 20, 2019
2d44447
Merge pull request #431 from MetaPhase-Consulting/feature/select-all-…
mjoyce91 Sep 20, 2019
933ff11
First pass at integrating available positions API
mjoyce91 Sep 23, 2019
280ce7f
Allow one of many permissions to pass validation in PermissionsWrapper
mjoyce91 Sep 23, 2019
d6a0560
TM-1262 display updated capsule date
BaldwinJordan Sep 24, 2019
bd7cf37
Login stats page
mjoyce91 Sep 24, 2019
9ecf02e
Remove login stats
mjoyce91 Sep 24, 2019
30fef81
update snapshot
BaldwinJordan Sep 24, 2019
6fa9798
Merge pull request #441 from MetaPhase-Consulting/feature/capsule-upd…
mjoyce91 Sep 24, 2019
dd24e39
Merge branch 'dev' into feature/permission-type
mjoyce91 Sep 24, 2019
57f3b0d
Merge pull request #440 from MetaPhase-Consulting/feature/permission-…
mjoyce91 Sep 24, 2019
6c0e0c6
fix: change the value of the no language filter to use the fsbid filt…
rtirserio Sep 25, 2019
141845a
Merge branch 'dev' into feature/login-stats-page
mjoyce91 Sep 25, 2019
a302f70
Additional integration to ensure both cycleposition models work
mjoyce91 Sep 25, 2019
b3e70d0
Merge branch 'dev' into feature/available-positions
mjoyce91 Sep 25, 2019
be767b5
Merge pull request #443 from MetaPhase-Consulting/fix/no_language_req…
rtirserio Sep 25, 2019
4d327d7
Merge branch 'dev' into feature/login-stats-page
mjoyce91 Sep 25, 2019
bdfffe1
Add ability to view full details page for projected vacancies
mjoyce91 Sep 25, 2019
93fe689
Merge pull request #442 from MetaPhase-Consulting/feature/login-stats…
mjoyce91 Sep 25, 2019
786e5a9
Merge branch 'dev' into feature/pv-details-page
mjoyce91 Sep 25, 2019
b4af5b7
fix: use the cycle position endpoint until we are ready for available…
rtirserio Sep 26, 2019
8bf23f3
fix: get the TED from the cycle position for display on the details a…
rtirserio Sep 26, 2019
17a544d
Merge branch 'dev' into fix/cycle_position_savedsearch
rtirserio Sep 26, 2019
85990c6
Merge pull request #444 from MetaPhase-Consulting/feature/pv-details-…
rtirserio Sep 26, 2019
651c851
Merge branch 'dev' into fix/cycle_position_savedsearch
rtirserio Sep 26, 2019
9d28e04
Merge branch 'dev' into fix/ted_compare_details
rtirserio Sep 26, 2019
df2276a
Merge pull request #445 from MetaPhase-Consulting/fix/cycle_position_…
rtirserio Sep 26, 2019
acd9919
Merge branch 'dev' into fix/ted_compare_details
rtirserio Sep 26, 2019
e8c2cbc
Merge pull request #446 from MetaPhase-Consulting/fix/ted_compare_det…
rtirserio Sep 26, 2019
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
3 changes: 2 additions & 1 deletion public/config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"static_content": true,
"notifications": true,
"complete_bidding": true,
"data_sync_admin": true
"data_sync_admin": true,
"available_positions": false
}
}
3 changes: 2 additions & 1 deletion public/config/config_dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"static_content": true,
"notifications": true,
"complete_bidding": true,
"data_sync_admin": true
"data_sync_admin": true,
"available_positions": false
}
}
2 changes: 2 additions & 0 deletions src/Components/AdministratorPage/AdministratorPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Route, Switch } from 'react-router-dom';
import { EMPTY_FUNCTION } from '../../Constants/PropTypes';
import Dashboard from './Dashboard';
import Logs from './Logs';
import Stats from './Stats';

const AdministratorPage = (props) => {
const {
Expand Down Expand Up @@ -52,6 +53,7 @@ const AdministratorPage = (props) => {
<Switch>
<Route path="/profile/administrator/dashboard" render={() => <Dashboard {...dashboardProps} />} />
<Route path="/profile/administrator/logs" render={() => <Logs {...logsProps} />} />
<Route path="/profile/administrator/stats" render={() => <Stats />} />
</Switch>
</div>
);
Expand Down
93 changes: 93 additions & 0 deletions src/Components/AdministratorPage/Stats/Stats.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import numeral from 'numeral';
import ProfileSectionTitle from '../../ProfileSectionTitle';
import Spinner from '../../Spinner';
import { EMPTY_FUNCTION } from '../../../Constants/PropTypes';
import { getLoginStats } from '../../../actions/stats';
import BidStatCard from '../../BidStatistics/BidStatCard';

export const formatNum = n => numeral(n).format('0,0');

class Stats extends Component {
constructor(props) {
super(props);
this.state = {
selected: '',
};
}

componentWillMount() {
const { getStats } = this.props;
getStats();
}

render() {
const {
stats,
statsIsLoading,
statsHasErrored,
} = this.props;

const statsSuccess = !statsIsLoading && !statsHasErrored;

return (
<div
className={`usa-grid-full profile-content-inner-container administrator-page
${(statsIsLoading) ? 'results-loading' : ''}`}
>
{
statsIsLoading && !statsHasErrored &&
<Spinner type="homepage-position-results" size="big" />
}
<div className="usa-grid-full">
<ProfileSectionTitle title="Login Statistics" icon="sitemap" />
</div>
{
statsSuccess &&
<div className="usa-grid-full bid-stat-card-list">
<div className="usa-grid-full">
<h3>Total Logins</h3>
{stats.filter(f => f.type === 'total').map(m => (
<BidStatCard title={m.title} number={formatNum(m.count)} />
))}
</div>
<div className="usa-grid-full">
<h3>Unique Logins</h3>
{stats.filter(f => f.type === 'unique').map(m => (
<BidStatCard title={m.title} number={formatNum(m.count)} />
))}
</div>
</div>
}
</div>
);
}
}

Stats.propTypes = {
stats: PropTypes.shape({}),
statsIsLoading: PropTypes.bool,
statsHasErrored: PropTypes.bool,
getStats: PropTypes.func,
};

Stats.defaultProps = {
stats: [],
statsIsLoading: false,
statsHasErrored: false,
getStats: EMPTY_FUNCTION,
};

const mapStateToProps = state => ({
stats: state.stats,
statsIsLoading: state.statsIsLoading,
statsHasErrored: state.statsHasErrored,
});

export const mapDispatchToProps = dispatch => ({
getStats: (options = {}) => dispatch(getLoginStats({ options })),
});

export default connect(mapStateToProps, mapDispatchToProps)(Stats);
1 change: 1 addition & 0 deletions src/Components/AdministratorPage/Stats/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './Stats';
2 changes: 1 addition & 1 deletion src/Components/CompareList/CompareList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class CompareList extends Component {
{
compareArray.map(c => (
<td key={shortId.generate()}>
{propOrDefault(c.position, 'current_assignment.estimated_end_date') ? formatDate(c.position.current_assignment.estimated_end_date) : NO_DATE }
{propOrDefault(c, 'ted') ? formatDate(c.ted) : NO_DATE }
</td>
))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ exports[`CompareListComponent matches snapshot 1`] = `
None listed
</td>
<td>
03/13/2020
None listed
</td>
<td
className="empty"
Expand Down Expand Up @@ -745,7 +745,7 @@ exports[`CompareListComponent matches snapshot when there is an obc id 1`] = `
None listed
</td>
<td>
03/13/2020
None listed
</td>
<td
className="empty"
Expand Down
11 changes: 6 additions & 5 deletions src/Components/CondensedCardData/CondensedCardData.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import React from 'react';
import { get } from 'lodash';
import { POSITION_DETAILS } from '../../Constants/PropTypes';
import { NO_DATE, NO_GRADE, NO_SKILL } from '../../Constants/SystemMessages';
import LanguageList from '../LanguageList';
import CondensedCardDataPoint from './CondensedCardDataPoint';
import { formatDate, propOrDefault } from '../../utilities';

const CondensedCardData = ({ position }) => {
const estimatedEndDate = propOrDefault(position, 'current_assignment.estimated_end_date') ?
formatDate(position.current_assignment.estimated_end_date) : NO_DATE;
const estimatedEndDate = propOrDefault(position, 'ted') ?
formatDate(position.ted) : NO_DATE;
return (
<div className="usa-grid-full condensed-card-data">
<CondensedCardDataPoint
Expand All @@ -17,17 +18,17 @@ const CondensedCardData = ({ position }) => {
/>
<CondensedCardDataPoint
title="Skill"
content={position.skill || NO_SKILL}
content={get(position, 'position.skill', NO_SKILL)}
hasFixedTitleWidth
/>
<CondensedCardDataPoint
title="Grade"
content={position.grade || NO_GRADE}
content={get(position, 'position.grade', NO_GRADE)}
hasFixedTitleWidth
/>
<CondensedCardDataPoint
title="Language"
content={<LanguageList languages={position.languages} propToUse="representation" />}
content={<LanguageList languages={get(position, 'position.languages')} propToUse="representation" />}
hasFixedTitleWidth
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ exports[`CondensedCardDataComponent matches snapshot 1`] = `
title="TED"
/>
<CondensedCardDataPoint
content="None listed"
content="OFFICE MANAGEMENT (9017)"
hasFixedTitleWidth={true}
title="Skill"
/>
<CondensedCardDataPoint
content="None listed"
content="06"
hasFixedTitleWidth={true}
title="Grade"
/>
Expand All @@ -42,12 +42,12 @@ exports[`CondensedCardDataComponent matches snapshot with an empty estimated end
title="TED"
/>
<CondensedCardDataPoint
content="None listed"
content="OFFICE MANAGEMENT (9017)"
hasFixedTitleWidth={true}
title="Skill"
/>
<CondensedCardDataPoint
content="None listed"
content="06"
hasFixedTitleWidth={true}
title="Grade"
/>
Expand All @@ -74,12 +74,12 @@ exports[`CondensedCardDataComponent matches snapshot with an empty skill 1`] = `
title="TED"
/>
<CondensedCardDataPoint
content="None listed"
content="OFFICE MANAGEMENT (9017)"
hasFixedTitleWidth={true}
title="Skill"
/>
<CondensedCardDataPoint
content="None listed"
content="06"
hasFixedTitleWidth={true}
title="Grade"
/>
Expand Down
9 changes: 7 additions & 2 deletions src/Components/PositionDetails/PositionDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class PositionDetails extends Component {
highlightPosition,
onHighlight,
userProfileIsLoading,
isProjectedVacancy,
} = this.props;

const isReady = details.id && userProfile.id && !isLoading && !hasErrored;
Expand All @@ -76,20 +77,22 @@ class PositionDetails extends Component {
editWebsiteContent={editWebsiteContent}
resetDescriptionEditMessages={resetDescriptionEditMessages}
userProfile={userProfile}
isProjectedVacancy={isProjectedVacancy}
/>
<PositionDetailsItem
details={position}
details={details}
editDescriptionContent={this.editDescriptionContent}
editPocContent={editPocContent}
editWebsiteContent={editWebsiteContent}
resetDescriptionEditMessages={resetDescriptionEditMessages}
userProfile={userProfile}
highlightPosition={highlightPosition}
onHighlight={onHighlight}
isProjectedVacancy={isProjectedVacancy}
/>
<hr />
<Row className="position-details-description-container padded-main-content" fluid>
<PositionSimilarPositions id={details.id} />
{ !isProjectedVacancy && <PositionSimilarPositions id={details.id} /> }
</Row>
</div>}
{isLoading$ && <Spinner type="position-details" size="big" />}
Expand Down Expand Up @@ -118,6 +121,7 @@ PositionDetails.propTypes = {
editWebsiteContent: PropTypes.func.isRequired,
highlightPosition: HIGHLIGHT_POSITION,
onHighlight: PropTypes.func.isRequired,
isProjectedVacancy: PropTypes.bool,
};

PositionDetails.defaultProps = {
Expand All @@ -131,6 +135,7 @@ PositionDetails.defaultProps = {
descriptionEditSuccess: false,
highlightPosition: DEFAULT_HIGHLIGHT_POSITION,
onHighlight: EMPTY_FUNCTION,
isProjectedVacancy: false,
};

export default PositionDetails;
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class PositionDetailsContact extends Component {

const isAllowedToEdit = !!(propOrDefault(details, 'description.is_editable_by_user'));

const formattedDate = formatDate(details.update_date);
const formattedDate = formatDate(details.description.date_updated);

const OBCUrl = propOrDefault(details, 'post.post_overview_url');

Expand Down Expand Up @@ -120,7 +120,7 @@ class PositionDetailsContact extends Component {
</div>
</div>
<div className={`contact-container ${!OBCUrl ? 'no-button' : ''}`}>
<strong>Updated</strong>: {formattedDate}
<strong>Capsule Last Updated</strong>: {formattedDate}
</div>
<div className="offset-bid-button-container">
<div className="offset-bid-button-container-button">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,9 @@ exports[`PositionDetailsContact matches snapshot 1`] = `
className="contact-container no-button"
>
<strong>
Updated
Capsule Last Updated
</strong>
:
06/08/2017
</div>
<div
className="offset-bid-button-container"
Expand Down
Loading