Delete team start times, fix download link style, fix download file name

This commit is contained in:
John Lyon-Smith
2018-04-29 12:12:03 -07:00
parent a3f96bbb6c
commit 16006e933e
4 changed files with 7 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
import passport from "passport"
import createError from "http-errors"
import autobind from "autobind-decorator"
import { catchAll } from "."
import { catchAll, TeamRoutes } from "."
@autobind
export class ActivityRoutes {
@@ -166,8 +166,10 @@ export class ActivityRoutes {
async deleteAllActivities(req, res, next) {
const Activity = this.db.Activity
const Team = this.db.Team
await Activity.remove({})
await Team.updateMany({}, { $set: { start: null } })
res.json({})
}

View File

@@ -179,6 +179,7 @@ export class TeamRoutes {
res.writeHead(200, {
"Content-Type": "application/gzip",
"Content-Disposition": 'attachment; filename="team-scores.gzip"',
})
readable.pipe(gzip).pipe(res)
}

View File

@@ -204,6 +204,7 @@ export class WorkItemRoutes {
const WorkItem = this.db.WorkItem
await Activity.remove({})
await Team.updateMany({}, { $set: { start: null } })
await WorkItem.remove({})
res.json({})

View File

@@ -1,6 +1,6 @@
import React, { Component, Fragment } from "react"
import PropTypes from "prop-types"
import { Box, Image, Column, Row, Button, Link, Text } from "ui"
import { Box, Image, Column, Row, Button, Link } from "ui"
import { MessageModal, WaitModal, YesNoMessageModal } from "../Modal"
import { sizeInfo, colorInfo } from "ui/style"
import headerLogo from "images/deighton.png"
@@ -187,7 +187,7 @@ export class System extends Component {
<Row.Item grow />
<Row.Item>
<Link to={api.makeTeamStatusUrl()}>
<Text>Download Team Data</Text>
Download Team Data
</Link>
</Row.Item>
<Row.Item grow />