Compare commits

..

20 Commits

Author SHA1 Message Date
dependabot[bot]
edc0519a1c Merge 2d8ae3e301 into b9cbd610a9 2021-03-31 16:51:28 +00:00
dependabot[bot]
2d8ae3e301 Bump y18n from 3.2.1 to 3.2.2 in /functions
Bumps [y18n](https://github.com/yargs/y18n) from 3.2.1 to 3.2.2.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-31 16:51:27 +00:00
DreamCoder23
b9cbd610a9 Update README.md 2020-10-11 23:17:34 -07:00
daabbf80f6 Actually fix deploy error 2019-12-06 14:58:51 -05:00
f9acefaafb Fixed deploy error 2019-12-06 14:55:01 -05:00
948eff32c2 Fix 2019-12-06 14:26:42 -05:00
6de219505a Fix admin alert posts displaying 2019-12-06 14:25:05 -05:00
7132a2ab45 Fix error in getOtherUsersPosts 2019-12-06 14:10:17 -05:00
5474543af4 add catch in addSubscription 2019-12-06 13:56:48 -05:00
6f77d03e2d Add back verify button for Admin 2019-12-06 13:51:21 -05:00
da6e7436ea Merge branch 'master' of https://github.com/ClaytonWWilson/CS307-Team24 2019-12-06 13:35:32 -05:00
e7afac9a19 Fix post topics being added to followed topics list 2019-12-06 13:35:28 -05:00
Aditya Sankaran
9449d3544b Merge branch 'master' of https://github.com/ClaytonWWilson/CS307-Team24 2019-12-06 13:06:52 -05:00
4f2e07756d tell the user if they aren't following anybody 2019-12-06 13:04:59 -05:00
Aditya Sankaran
f2cf7542a8 fix 2019-12-06 13:04:43 -05:00
ff7677bfb3 Merge pull request #113 from ClaytonWWilson/admin-delete
Admin delete
2019-12-06 12:56:40 -05:00
978af53a74 Merge pull request #114 from ClaytonWWilson/temp-branch
Display disabled DMs as red and fix errors in login and signup
2019-12-06 12:53:57 -05:00
a0a522f1d2 Display disabled DMs as red and fix errors in login and signup 2019-12-06 12:53:27 -05:00
Aditya Sankaran
988c807af2 Merge branch 'master' of https://github.com/ClaytonWWilson/CS307-Team24 2019-12-06 12:27:00 -05:00
Aditya Sankaran
01b449d01d separated list of topics by comma and space 2019-12-06 12:26:29 -05:00
10 changed files with 85 additions and 50 deletions

View File

@@ -1,2 +1,2 @@
# CS307-Team24 # CS307-Team24
CS307 Team 24 Twistter website. CS307 Team 24 Twistter website

View File

@@ -178,10 +178,10 @@ exports.getOtherUsersPosts = (req, res) => {
.collection("posts") .collection("posts")
.where("userHandle", "==", req.body.handle); .where("userHandle", "==", req.body.handle);
post_query += admin // post_query += admin
.firestore() // .firestore()
.collection("posts") // .collection("posts")
.where("microBlogTitle", "==", "Alert").where("userHandle", "==", "Admin"); // .where("microBlogTitle", "==", "Alert").where("userHandle", "==", "Admin");
post_query post_query
.get() .get()

View File

@@ -1,5 +1,6 @@
/* eslint-disable promise/catch-or-return */ /* eslint-disable promise/catch-or-return */
/* eslint-disable promise/always-return */ /* eslint-disable promise/always-return */
/* eslint-disable prefer-promise-reject-error */
const { admin, db } = require("../util/admin"); const { admin, db } = require("../util/admin");
const config = require("../util/config"); const config = require("../util/config");
@@ -866,10 +867,10 @@ oneWayCheck = (userA, userB) => {
if (dmRecipient === userB) { if (dmRecipient === userB) {
console.log(`You already have a DM with ${userB}`); console.log(`You already have a DM with ${userB}`);
// reject(new Error(`You already have a DM with ${userB}`)); // reject(new Error(`You already have a DM with ${userB}`));
reject({ let e = new Error(`You already have a DM with that user`);
code: 400, e.code = 400,
message: `You already have a DM with that user` e.message = `You already have a DM with that user`
}); reject(e);
return; return;
} }
}); });
@@ -1212,7 +1213,10 @@ exports.addSubscription = (req, res) => {
return res.status(500).json({ err }); return res.status(500).json({ err });
}); });
// return res.status(200).json({ message: "ok" }); // return res.status(200).json({ message: "ok" });
}); })
.catch((error) => {
return res.status(400).json({message: "That user doesn't exist", error});
})
}; };
exports.getSubs = (req, res) => { exports.getSubs = (req, res) => {

View File

@@ -673,6 +673,14 @@
"readable-stream": "~1.0.32" "readable-stream": "~1.0.32"
} }
}, },
"busboy": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/busboy/-/busboy-0.3.1.tgz",
"integrity": "sha512-y7tTxhGKXcyBxRKAni+awqx8uqaJKrSFSNFSeRG5CsWNdmy2BIK+6VGWEW7TZnIO/533mtMEA4rOevQV815YJw==",
"requires": {
"dicer": "0.3.0"
}
},
"bytebuffer": { "bytebuffer": {
"version": "5.0.1", "version": "5.0.1",
"resolved": "https://registry.npmjs.org/bytebuffer/-/bytebuffer-5.0.1.tgz", "resolved": "https://registry.npmjs.org/bytebuffer/-/bytebuffer-5.0.1.tgz",
@@ -3707,9 +3715,9 @@
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="
}, },
"y18n": { "y18n": {
"version": "3.2.1", "version": "3.2.2",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz",
"integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ=="
}, },
"yallist": { "yallist": {
"version": "3.0.3", "version": "3.0.3",

View File

@@ -84,23 +84,23 @@ class Writing_Microblogs extends Component {
console.error(err); console.error(err);
}); });
console.log(postData.microBlogTopics); console.log(postData.microBlogTopics);
let topicPromises = []; // let topicPromises = [];
postData.microBlogTopics.forEach(topic => { // postData.microBlogTopics.forEach(topic => {
topicPromises.push(axios // topicPromises.push(axios
.post("/putTopic", { // .post("/putTopic", {
following: topic // following: topic
}) // })
.then(res => { // .then(res => {
console.log(res.data); // console.log(res.data);
}) // })
.catch(err => { // .catch(err => {
console.error(err); // console.error(err);
}) // })
) // )
}); // });
event.preventDefault(); event.preventDefault();
topicPromises.push(postPromise); // topicPromises.push(postPromise);
Promise.all(topicPromises) Promise.all([postPromise])
.then(() => { .then(() => {
this.setState({ this.setState({
value: "", value: "",

View File

@@ -57,14 +57,28 @@ class Home extends Component {
}) })
.catch(err => console.log(err)); .catch(err => console.log(err));
let allPosts;
let postPromise = axios let postPromise = axios
.get("/getallPosts") .get("/getallPosts")
.then(res => { .then(res => {
// console.log(res.data); // console.log(res.data);
// this.setState({
// posts: res.data
// });
allPosts = res.data;
// console.log(allPosts)
return axios.get("/getAlert")
})
.then((res) => {
// console.log(res.data)
// res.data.forEach((adminAlert) => {
// allPosts.push(adminAlert);
// })
this.setState({ this.setState({
posts: res.data posts: allPosts
}); });
}) })
.catch(err => console.log(err)); .catch(err => console.log(err));
Promise.all([userPromise, postPromise]) Promise.all([userPromise, postPromise])
@@ -140,9 +154,8 @@ class Home extends Component {
} }
console.log(hiddenBool); console.log(hiddenBool);
let postMarkup = this.state.posts ? ( let postMarkup = this.state.posts ? ( this.state.following === undefined || this.state.following === null ? <Typography>You aren't following anybody right now</Typography> :
// <<<<<<< admin-delete this.state.posts.map(post => !post.hidden && this.state.following && (this.state.following.includes(post.userHandle) || post.userHandle === "Admin") ? (
this.state.posts.map(post => !post.hidden && this.state.following && this.state.following.includes(post.userHandle) ? (
<Card className={classes.card} key={post.postId}> <Card className={classes.card} key={post.postId}>
<CardContent> <CardContent>
<Typography> <Typography>
@@ -191,7 +204,7 @@ class Home extends Component {
{/* <button>Quote</button> */} {/* <button>Quote</button> */}
<Typography variant="body2" color={"textSecondary"}>Likes {post.likeCount} Comments {post.commentCount}</Typography> {/* <Typography variant="body2" color={"textSecondary"}>Likes {post.likeCount} Comments {post.commentCount}</Typography> */}
</CardContent> </CardContent>
</Card> </Card>
@@ -199,18 +212,6 @@ class Home extends Component {
<p></p> <p></p>
) )
) )
// =======
// this.state.posts.map(post =>
// this.state.following ? (
// this.state.following.includes(post.userHandle) ? (
// ) : (
// <p></p>
// )
// ) : (
// <p></p>
// )
// >>>>>>> master
) : ( ) : (
<p>Loading post...</p> <p>Loading post...</p>
); );

View File

@@ -83,6 +83,10 @@ const styles = {
wordBreak: "break-all", wordBreak: "break-all",
color: 'black' color: 'black'
}, },
dmRecentMessageDisabled: {
wordBreak: "break-all",
color: 'red'
},
dmListItemContainer: { dmListItemContainer: {
height: 100 height: 100
}, },
@@ -105,7 +109,7 @@ const styles = {
fontSize: 20, fontSize: 20,
backgroundColor: '#1da1f2', backgroundColor: '#1da1f2',
width: 300 width: 300
}, },
messagesGrid: { messagesGrid: {
// // margin: "auto" // // margin: "auto"
// height: "auto", // height: "auto",
@@ -426,9 +430,15 @@ export class directMessages extends Component {
<Typography <Typography
className={ className={
this.state.selectedChannel && this.state.selectedChannel.dmId === channel.dmId ? ( this.state.selectedChannel && this.state.selectedChannel.dmId === channel.dmId ? (
classes.dmRecentMessageSelected channel.hasDirectMessagesEnabled ?
classes.dmRecentMessageSelected
:
classes.dmRecentMessageDisabled
) : ( ) : (
classes.dmRecentMessageUnselected channel.hasDirectMessagesEnabled ?
classes.dmRecentMessageUnselected
:
classes.dmRecentMessageDisabled
) )
} }
> >

View File

@@ -312,7 +312,7 @@ class user extends Component {
<Typography variant="body2">{post.body}</Typography> <Typography variant="body2">{post.body}</Typography>
<br /> <br />
<Typography variant="body2"> <Typography variant="body2">
<b>Topics:</b> {post.microBlogTopics} <b>Topics:</b> {post.microBlogTopics.join(", ")}
</Typography> </Typography>
<br /> <br />
<Typography variant="body2" color={"textSecondary"}> <Typography variant="body2" color={"textSecondary"}>

View File

@@ -269,6 +269,15 @@ class user extends Component {
</Link> </Link>
) : null; ) : null;
let verifyButtonMarkup = this.state.profile === "Admin" ?
<Link to="/verify">
<Button className={classes.button} variant="outlined" color="primary">
Verify Users
</Button>
</Link>
:
null
return ( return (
this.state.loading ? <CircularProgress size={60} style={{marginTop: "300px"}}></CircularProgress> : this.state.loading ? <CircularProgress size={60} style={{marginTop: "300px"}}></CircularProgress> :
<div> <div>
@@ -278,6 +287,7 @@ class user extends Component {
<Grid container> <Grid container>
<Grid item sm> <Grid item sm>
{editButtonMarkup} {editButtonMarkup}
{verifyButtonMarkup}
</Grid> </Grid>
<Grid item sm> <Grid item sm>
{/* <Grid container direction="column"> */} {/* <Grid container direction="column"> */}

View File

@@ -36,6 +36,7 @@ export const getUserData = () => (dispatch) => {
// Sends login data to firebase and sets the user data in Redux // Sends login data to firebase and sets the user data in Redux
export const loginUser = (loginData, history) => (dispatch) => { export const loginUser = (loginData, history) => (dispatch) => {
dispatch({type: CLEAR_ERRORS});
dispatch({ type: LOADING_UI }); dispatch({ type: LOADING_UI });
axios axios
.post("/login", loginData) .post("/login", loginData)
@@ -57,6 +58,7 @@ export const loginUser = (loginData, history) => (dispatch) => {
// Sends signup data to firebase and sets the user data in Redux // Sends signup data to firebase and sets the user data in Redux
export const signupUser = (newUserData, history) => (dispatch) => { export const signupUser = (newUserData, history) => (dispatch) => {
dispatch({type: CLEAR_ERRORS});
dispatch({ type: LOADING_UI }); dispatch({ type: LOADING_UI });
axios axios
.post("/signup", newUserData) .post("/signup", newUserData)