diff --git a/package-lock.json b/package-lock.json index 7a755cdc..6ab2a581 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "fabric-portal", - "version": "1.6.5", + "version": "1.7.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/App.js b/src/App.js index 1b799f78..9fae3820 100644 --- a/src/App.js +++ b/src/App.js @@ -7,6 +7,7 @@ import checkGlobalRoles from "./utils/checkGlobalRoles"; import { default as portalData } from "./services/portalData.json"; import Home from "./pages/Home"; import Resources from "./pages/Resources"; +import MeasurementMetrics from "./pages/static/MeasurementMetrics.jsx"; import ProjectForm from "./pages/ProjectForm"; import Signup from "./pages/static/Signup"; import AUP from "./pages/static/AUP"; @@ -195,7 +196,9 @@ class App extends React.Component { } /> } /> } /> - } /> + } /> + } /> + } /> } /> } /> } /> diff --git a/src/components/Experiment/ArtifactManager.jsx b/src/components/Experiment/ArtifactManager.jsx index b3830332..6f5a0387 100644 --- a/src/components/Experiment/ArtifactManager.jsx +++ b/src/components/Experiment/ArtifactManager.jsx @@ -8,7 +8,9 @@ class ArtifactManager extends React.Component {

Artifact Manager

-
+
+ Artifact Manager is a platform for sharing and reproducing FABRIC research artifacts. It also provides a REST API for use by various clients.  + An artifact consists of one or more files organized into a single directory in TGZ format (.tgz or .tar.gz).  Please consult   { const navItems = (props.globalRoles && !props.globalRoles.isJupterhubUser) ? [ - { name: "Resources", path: "/resources/all", child: [] }, + { + name: "Resources", + path: "/resources", + child: [ + { + name: "Testbed Resources", + path: "/resources/overview" + }, + { + name: "Measurement Metrics", + path: "/resources/tools" + } + ] + }, { name: "Experiments", path: "/experiments", @@ -56,6 +69,10 @@ const Header = (props) => { name: "News", href: portalData.knowledgeBaseNewsLink, }, + { + name: "KNIT", + href: portalData.KNITWebsiteLink, + }, { name: "Events", href: portalData.knowledgeBaseEventsLink, @@ -84,7 +101,20 @@ const Header = (props) => { path: "/community" } ] : [ - { name: "Resources", path: "/resources/all", child: [] }, + { + name: "Resources", + path: "/resources", + child: [ + { + name: "Resources Overview", + path: "/resources/overview" + }, + { + name: "Measuring and Monitoring Tools", + path: "/resources/tools" + } + ] + }, { name: "Experiments", path: "/experiments", @@ -128,6 +158,10 @@ const Header = (props) => { name: "News", href: portalData.knowledgeBaseNewsLink, }, + { + name: "KNIT", + href: portalData.KNITWebsiteLink, + }, { name: "Events", href: portalData.knowledgeBaseEventsLink, diff --git a/src/components/Home/DynamicMetrics.jsx b/src/components/Home/DynamicMetrics.jsx index 627db033..81115c9d 100644 --- a/src/components/Home/DynamicMetrics.jsx +++ b/src/components/Home/DynamicMetrics.jsx @@ -16,7 +16,7 @@ class DynamicMetrics extends React.Component { count: 0 }, { - name: "Active Users", + name: "Total Users", count: 0 }, { @@ -52,7 +52,7 @@ class DynamicMetrics extends React.Component { // active users' count and total project metricsItems.push({ - name: "Active Users", + name: "Total Users", count: coreMetrics.users.active_cumulative }); metricsItems.push({ diff --git a/src/components/Project/Community/CommunityTags.jsx b/src/components/Project/Community/CommunityTags.jsx index bd5ef20c..05b0bf61 100644 --- a/src/components/Project/Community/CommunityTags.jsx +++ b/src/components/Project/Community/CommunityTags.jsx @@ -34,11 +34,12 @@ class Community extends React.Component { render() { const { domain_options, subdomain_options, selected_domain, selected_subdomain } = this.state; - const { communities } = this.props; + const { communities, canUpdate } = this.props; return ( -
+
Community
-
+ { + canUpdate &&
-
+
+ } +
    { communities.length > 0 && @@ -94,17 +97,27 @@ class Community extends React.Component { className="mr-2 my-2" > {community} - { - this.props.onCommunityUpdate("remove", community); - }} - > + { + canUpdate && { + this.props.onCommunityUpdate("remove", community); + }} + > + } ) }
-
+ { + communities.length === 0 && !canUpdate && +
+ This project has no community tag added yet. +
+ }
) } diff --git a/src/components/Project/Community/Funding.jsx b/src/components/Project/Community/Funding.jsx index b4db11c7..22b7fd84 100644 --- a/src/components/Project/Community/Funding.jsx +++ b/src/components/Project/Community/Funding.jsx @@ -67,23 +67,23 @@ class Funding extends React.Component { parseFundingStr = (funding) => { if (funding.agency === "Other") { - return `${funding.agency_other} | ${funding.award_number ? funding.award_number : ""} | ${funding.award_amount ? funding.award_amount : ""}`; + return `${funding.agency_other} ${funding.award_number ? `| ${funding.award_number}` : ""} ${funding.award_amount ? `| ${funding.award_amount}` : ""}`; } else if (funding.agency === "NSF") { - return `${funding.agency} | ${funding.directorate ? funding.directorate : ""} | - ${funding.award_number ? funding.award_number : ""} | ${funding.award_amount ? funding.award_amount : ""}`; + return `${funding.agency} ${funding.directorate ? `| ${funding.directorate}` : ""} ${funding.award_number ? `| ${funding.award_number}` : ""} ${funding.award_amount ? `| ${funding.award_amount}` : ""}`; } else { - return `${funding.agency} | ${funding.award_number ? funding.award_number : ""} | ${funding.award_amount ? funding.award_amount : ""}`; + return `${funding.agency} ${funding.award_number ? `| ${funding.award_number}` : ""} ${funding.award_amount ? `| ${funding.award_amount}` : ""}`; } } render() { const { agency, directorate, award_number, award_amount, agency_options, directorate_options, agency_other } = this.state; - const { fundings } = this.props; + const { fundings, canUpdate } = this.props; return ( -
+
Funding Information
-
+ { + canUpdate &&
+ }
    { @@ -167,14 +168,26 @@ class Funding extends React.Component { className="mr-2 my-2" > { this.parseFundingStr(funding) } - {this.props.onFundingUpdate("remove", funding);}} - > + { + canUpdate && + {this.props.onFundingUpdate("remove", funding);}} + > + } ) }
+
+ { + fundings.length === 0 && !canUpdate && +
+ This project has no funding added yet.
+ }
) } diff --git a/src/components/Project/ProjectBasicInfoTable.jsx b/src/components/Project/ProjectBasicInfoTable.jsx index b1e09700..d7913b77 100644 --- a/src/components/Project/ProjectBasicInfoTable.jsx +++ b/src/components/Project/ProjectBasicInfoTable.jsx @@ -91,6 +91,7 @@ class ProjectBasicInfoTable extends Component { className="form-control" value={fabricMatrix} onChange={this.props.onMatrixUpdate} + disabled={!canUpdate} />
Save diff --git a/src/components/Project/ProjectProfile.jsx b/src/components/Project/ProjectProfile.jsx index 72c731be..2ffd57f6 100644 --- a/src/components/Project/ProjectProfile.jsx +++ b/src/components/Project/ProjectProfile.jsx @@ -32,12 +32,11 @@ class ProjectProfile extends Component { parseFundingStr = (funding) => { if (funding.agency === "Other") { - return `${funding.agency_other} | ${funding.award_number ? funding.award_number : ""} | ${funding.award_amount ? funding.award_amount : ""}`; + return `${funding.agency_other} ${funding.award_number ? `| ${funding.award_number}` : ""} ${funding.award_amount ? `| ${funding.award_amount}` : ""}`; } else if (funding.agency === "NSF") { - return `${funding.agency} | ${funding.directorate ? funding.directorate : ""} | - ${funding.award_number ? funding.award_number : ""} | ${funding.award_amount ? funding.award_amount : ""}`; + return `${funding.agency} ${funding.directorate ? `| ${funding.directorate}` : ""} ${funding.award_number ? `| ${funding.award_number}` : ""} ${funding.award_amount ? `| ${funding.award_amount}` : ""}`; } else { - return `${funding.agency} | ${funding.award_number ? funding.award_number : ""} | ${funding.award_amount ? funding.award_amount : ""}`; + return `${funding.agency} ${funding.award_number ? `| ${funding.award_number}` : ""} ${funding.award_amount ? `| ${funding.award_amount}` : ""}`; } } diff --git a/src/components/Project/ProjectsTable.jsx b/src/components/Project/ProjectsTable.jsx index 7ba419b4..aa8519fc 100644 --- a/src/components/Project/ProjectsTable.jsx +++ b/src/components/Project/ProjectsTable.jsx @@ -2,7 +2,7 @@ import React, { Component } from "react"; import { Link } from "react-router-dom"; import Table from "../common/Table"; import _ from "lodash"; -import Parser from 'html-react-parser'; +import shortenStr from "../../utils/shortenStr"; class ProjectsTable extends Component { columns = { @@ -19,7 +19,7 @@ class ProjectsTable extends Component { label: "Description", content: (project) => ( - {Parser(project.description)} + {shortenStr(this.getTextfromHTML(project.description), 200)} ) }, @@ -60,7 +60,7 @@ class ProjectsTable extends Component { label: "Description", content: (project) => ( - {Parser(project.description)} + {shortenStr(this.getTextfromHTML(project.description), 200)} ) }, @@ -92,6 +92,12 @@ class ProjectsTable extends Component { ] } + getTextfromHTML = (htmlStr) => { + return new DOMParser() + .parseFromString(htmlStr, "text/html") + .documentElement.textContent; + } + render() { const { projects, isPublic } = this.props; diff --git a/src/components/Project/Public/PublicProjectProfile.jsx b/src/components/Project/Public/PublicProjectProfile.jsx index a428d493..73ccb392 100644 --- a/src/components/Project/Public/PublicProjectProfile.jsx +++ b/src/components/Project/Public/PublicProjectProfile.jsx @@ -27,12 +27,11 @@ class PublicProjectProfile extends Component { parseFundingStr = (funding) => { if (funding.agency === "Other") { - return `${funding.agency_other} | ${funding.award_number ? funding.award_number : ""} | ${funding.award_amount ? funding.award_amount : ""}`; + return `${funding.agency_other} ${funding.award_number ? `| ${funding.award_number}` : ""} ${funding.award_amount ? `| ${funding.award_amount}` : ""}`; } else if (funding.agency === "NSF") { - return `${funding.agency} | ${funding.directorate ? funding.directorate : ""} | - ${funding.award_number ? funding.award_number : ""} | ${funding.award_amount ? funding.award_amount : ""}`; + return `${funding.agency} ${funding.directorate ? `| ${funding.directorate}` : ""} ${funding.award_number ? `| ${funding.award_number}` : ""} ${funding.award_amount ? `| ${funding.award_amount}` : ""}`; } else { - return `${funding.agency} | ${funding.award_number ? funding.award_number : ""} | ${funding.award_amount ? funding.award_amount : ""}`; + return `${funding.agency} ${funding.award_number ? `| ${funding.award_number}` : ""} ${funding.award_amount ? `| ${funding.award_amount}` : ""}`; } } diff --git a/src/components/Resource/SiteDetailPage.jsx b/src/components/Resource/SiteDetailPage.jsx index b44be60e..b72fe170 100644 --- a/src/components/Resource/SiteDetailPage.jsx +++ b/src/components/Resource/SiteDetailPage.jsx @@ -152,7 +152,7 @@ class SiteDetailPage extends React.Component { data.status &&

Site - {data.name}

- +