Skip to content
Snippets Groups Projects
Commit 90dc5def authored by danieldeng2's avatar danieldeng2
Browse files

Filter out panopto content on dashboard

parent 8161bbc1
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,7 @@ import styles from "./style.module.scss"; ...@@ -5,6 +5,7 @@ import styles from "./style.module.scss";
import classNames from "classnames"; import classNames from "classnames";
import { faGlobe, faLink } from "@fortawesome/free-solid-svg-icons"; import { faGlobe, faLink } from "@fortawesome/free-solid-svg-icons";
import PageButtonGroup from "components/molecules/PageButtonGroup"; import PageButtonGroup from "components/molecules/PageButtonGroup";
import queryString from "query-string";
import { request } from "../../../utils/api"; import { request } from "../../../utils/api";
import { api, methods } from "../../../constants/routes"; import { api, methods } from "../../../constants/routes";
...@@ -33,13 +34,19 @@ const ModuleDashboard: React.FC = () => { ...@@ -33,13 +34,19 @@ const ModuleDashboard: React.FC = () => {
data.json().then((json) => { data.json().then((json) => {
for (const key in json) { for (const key in json) {
let resource = json[key]; let resource = json[key];
if (resource.type !== "link") continue; let resourceURL = queryString.parseUrl(resource.path);
newButtons.push({ if (
title: resource.title, resource.type === "link" &&
icon: faLink, resourceURL.url !==
url: resource.path, "https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx"
}); ) {
newButtons.push({
title: resource.title,
icon: faLink,
url: resource.path,
});
}
} }
setButtons((b) => b.concat(newButtons)); setButtons((b) => b.concat(newButtons));
}); });
...@@ -63,7 +70,10 @@ const ModuleDashboard: React.FC = () => { ...@@ -63,7 +70,10 @@ const ModuleDashboard: React.FC = () => {
<Dandruff heading={generateHeading(id)} /> <Dandruff heading={generateHeading(id)} />
<h4 className={classNames(styles.moduleSectionHeader)}>Module Aims</h4> <h4 className={classNames(styles.moduleSectionHeader)}>Module Aims</h4>
<div className={styles.moduleDashboardText} style={{ paddingTop: "0.75rem" }}> <div
className={styles.moduleDashboardText}
style={{ paddingTop: "0.75rem" }}
>
<span>In this module you will have the opportunity to:</span> <span>In this module you will have the opportunity to:</span>
<ul> <ul>
<li> <li>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment