mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2026-03-11 05:35:05 +00:00
Compare commits
14 Commits
admin-dele
...
branch-692
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5a7f80ab34 | ||
|
|
db6b147c40 | ||
|
|
e3593e2f29 | ||
|
|
4b440d28de | ||
|
|
81593cee52 | ||
|
|
1482830131 | ||
|
|
ad0b21e629 | ||
|
|
e1343d503c | ||
|
|
54ba36abeb | ||
|
|
953d58ea12 | ||
|
|
b9ca0dc492 | ||
|
|
4d4b085a2b | ||
|
|
1a2f269466 | ||
|
|
6184a22607 |
@@ -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()
|
||||||
|
|||||||
@@ -1212,7 +1212,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) => {
|
||||||
|
|||||||
1153
twistter-frontend/package-lock.json
generated
1153
twistter-frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -45,5 +45,5 @@
|
|||||||
"last 1 safari version"
|
"last 1 safari version"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"proxy": "http://localhost:5001/twistter-e4649/us-central1/api"
|
"proxy": "https://us-central1-twistter-e4649.cloudfunctions.net/api"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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: "",
|
||||||
|
|||||||
@@ -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>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -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
|
||||||
},
|
},
|
||||||
@@ -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 ? (
|
||||||
|
channel.hasDirectMessagesEnabled ?
|
||||||
classes.dmRecentMessageSelected
|
classes.dmRecentMessageSelected
|
||||||
|
:
|
||||||
|
classes.dmRecentMessageDisabled
|
||||||
) : (
|
) : (
|
||||||
|
channel.hasDirectMessagesEnabled ?
|
||||||
classes.dmRecentMessageUnselected
|
classes.dmRecentMessageUnselected
|
||||||
|
:
|
||||||
|
classes.dmRecentMessageDisabled
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -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"}>
|
||||||
|
|||||||
@@ -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"> */}
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user