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

Changed handling of partner "All" #133

Open
wants to merge 3 commits into
base: development
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion src/components/Filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class Filters extends React.Component {
render() {
const { filters, user, SALTAstronomers, location, loadingProposals } = this.props
const { selectedPartner, selectedSemester, selectedPartnerStatsSemester, selectedLiaison } = filters
const partnerList = getPartnerList(user.roles)
const mayViewAll = user.roles.some(role => ['ADMINISTRATOR', 'BOARD', 'SALT_ASTRONOMER'].includes(role.type));
const partnerList = mayViewAll ? getPartnerList(user.roles) : getPartnerList(user.roles).filter(partner => partner !== ALL_PARTNER)
const astronomersList = ['All', 'Assigned'].concat(getAstronomersList(SALTAstronomers)).concat(['Not Assigned'])
const partnerStatAstronomersList = astronomersList.filter((astronomer) => !['Assigned', 'Not Assigned'].includes(astronomer))
const partnerStatAstronomer = ['Assigned', 'Not Assigned'].includes(selectedLiaison) ? 'All' : selectedLiaison
Expand Down
5 changes: 2 additions & 3 deletions src/components/tables/PartnerSummaryStatTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ import PartnerSummaryStatTableRow1 from './tablesComponents/PartnerSummaryStatTa

class PartnerSummaryStatTable extends React.Component {
render () {
const { partner, totalObservation, completion } = this.props

const { totalObservation, completion } = this.props
return (
<div className='SATableDiv'>
<h2>Summary Statistics for {partner === 'All' ? 'All Partners' : partner}</h2>
<h2>Summary Statistics</h2>
<table className='SATable' align='center'>
<thead>
<tr>
Expand Down