Skip to content

Commit

Permalink
Merge pull request #47 from TID-Lab/report-to-incident-ui
Browse files Browse the repository at this point in the history
Report to incident UI & misc features + bugfixes
  • Loading branch information
codelastnight authored Oct 3, 2024
2 parents 07d933a + cf6e739 commit 219de72
Show file tree
Hide file tree
Showing 27 changed files with 756 additions and 487 deletions.
4 changes: 3 additions & 1 deletion backend/api/controllers/groupController.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ exports.group_create = (req, res) => {
});
};

// lean option means only return name and id
exports.group_all_groups = (req, res) => {
Group.find({}, (err, groups) => {
const projection = req.query.lean === "true" ? 'title' : '';
Group.find({}, projection, {}, (err, groups) => {
if (err) res.status(err.status).send(err.message);
else res.status(200).send(groups);
});
Expand Down
129 changes: 119 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
"graceful-fs": "^4.2.4",
"javascript-time-ago": "^2.5.11",
"jsonwebtoken": "^9.0.0",
"linkify-react": "^3.0.4",
"linkifyjs": "^3.0.5",
"linkify-react": "^4.1.3",
"linkifyjs": "^4.1.3",
"locale": "^0.1.0",
"lodash": "^4.17.21",
"migrate-mongoose": "^4.0.0",
Expand Down Expand Up @@ -104,6 +104,7 @@
"request": "^2.88.2",
"request-promise": "^4.2.6",
"rwlock": "^5.0.0",
"sanitize-html": "^2.13.0",
"single-line-log": "^1.1.2",
"socket.io": "^4.5.1",
"socket.io-client": "^4.5.1",
Expand Down Expand Up @@ -139,6 +140,7 @@
"@types/react-router-bootstrap": "^0.24.5",
"@types/react-router-dom": "^5.1.7",
"@types/react-tagcloud": "^1.1.7",
"@types/sanitize-html": "^2.13.0",
"chai": "^3.3.0",
"clarinet": "^0.12.4",
"cross-env": "^7.0.3",
Expand Down
6 changes: 4 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Aggie is a social media monitoring application. " />
<meta
name="description"
content="Aggie is a social media monitoring application. "
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
Expand Down
63 changes: 0 additions & 63 deletions src/App.css

This file was deleted.

1 change: 0 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { getSession } from "./api/session";
import type { AxiosError } from "axios";
import type { Session } from "./api/session/types";

import "./App.css";
//import "@yaireo/tagify/dist/tagify.css";

import AggieNavbar from "./components/AggieNavbar";
Expand Down
1 change: 1 addition & 0 deletions src/api/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const MEDIA_OPTIONS = [
"RSS",
// "elmo",
// "SMS GH",
"truthsocial",
"youtube",
"facebook",
] as const;
Expand Down
19 changes: 17 additions & 2 deletions src/api/groups/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,23 @@ export const getGroups_old = async (
}
};

export const getAllGroups = async () => {
const { data } = await axios.get("/api/group/all");
const defaultAllGroups = {
lean: "true",
};

interface LeanGroups {
total: number;
results: Pick<Group, "title" | "_id">[];
}
export const getAllGroups = async (
options: Partial<typeof defaultAllGroups> = defaultAllGroups
) => {
options = { ...defaultAllGroups, ...options };
const params = new URLSearchParams(options);
const { data } = await axios.get<
Pick<Group, "title" | "_id">[] | Groups | undefined
>("/api/group/all?" + params.toString());

return data;
};

Expand Down
Loading

0 comments on commit 219de72

Please sign in to comment.