Skip to content

Commit

Permalink
#328: fixed project search issue on navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
yaxue1123 committed Jul 18, 2024
1 parent eabf7b6 commit 00618b8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
12 changes: 9 additions & 3 deletions src/components/Experiment/Projects.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,15 @@ class Projects extends React.Component {
generateCommunityFilterQuery = (selectedList) => {
const communities = [];
for (const s of selectedList) {
communities.push(s.name);
if (portalData.communityMapping[s.name]) {
communities.push(`${s.name}:${portalData.communityMapping[s.name]}`);
if (s.name === "HPC" || s.name === "RNE") {
communities.push(`Additional Communities:${s.name}`);
} else {
communities.push(s.name);
if (portalData.communityMapping[s.name]) {
for (const sub of portalData.communityMapping[s.name]) {
communities.push(`${s.name}:${sub}`);
}
}
}
}
return communities.toString();
Expand Down
9 changes: 4 additions & 5 deletions src/components/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import betaLogo from "../imgs/logos/fabric-brand-beta.png";
import ProfileModal from './ProfileModal';

const Header = (props) => {
const navItems = ((props.globalRoles && props.globalRoles.isJupterhubUser) ||
props.userStatus !== "active") ? [
const navItems = (props.globalRoles && !props.globalRoles.isJupterhubUser) ? [
{ name: "Resources", path: "/resources/all", child: [] },
{
name: "Experiments",
Expand All @@ -28,9 +27,8 @@ const Header = (props) => {
},
{
name: "JupyterHub",
href: portalData.jupyterHubLinks[checkPortalType(window.location.href)],
child: [],
path: ""
path: "/jupyter-no-access"
},
{ name: "Contact Us", path: "/help", child: [] },
{
Expand Down Expand Up @@ -100,8 +98,9 @@ const Header = (props) => {
},
{
name: "JupyterHub",
href: portalData.jupyterHubLinks[checkPortalType(window.location.href)],
child: [],
path: "/jupyter-no-access"
path: ""
},
{ name: "Contact Us", path: "/help", child: [] },
{
Expand Down
2 changes: 1 addition & 1 deletion src/pages/SearchResults.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class SearchResults extends Component {
if (query !== "") {
this.setState({ showSpinner: true });
try {
const { data: res1 } = await getProjects("allProjects", 0, limit, query);
const { data: res1 } = await getProjects("allProjects", 0, limit, query, "description");
const projectCount = res1.total;
let projects = res1.results;
const { data: res2 } = await getFullPeopleByName(0, limit, query);
Expand Down

0 comments on commit 00618b8

Please sign in to comment.