Skip to content

Commit

Permalink
fix download file name
Browse files Browse the repository at this point in the history
  • Loading branch information
satellitestudiodesign committed Aug 30, 2024
1 parent 8fdad53 commit 0f0788a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.graph {
width: 100%;
height: 30rem;
margin-bottom: var(--space-S);
margin-block: var(--space-S);
}

.graph tspan {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,7 @@ export default function VesselGroupReportVesselsTable() {
})}
</div>
</div>
{/* TODO */}
<VesselGroupReportVesselsTableFooter reportName={'TODO'} />
<VesselGroupReportVesselsTableFooter />
</Fragment>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,19 @@ import { useLocationConnect } from 'routes/routes.hook'
import { selectTimeRange } from 'features/app/selectors/app.timebar.selectors'
import { REPORT_SHOW_MORE_VESSELS_PER_PAGE, REPORT_VESSELS_PER_PAGE } from 'data/config'
import { TrackCategory, trackEvent } from 'features/app/analytics.hooks'
import { selectVesselGroupReportData } from 'features/vessel-group-report/vessel-group-report.slice'
import { formatInfoField } from 'utils/info'
import { selectVesselGroupReportVesselFilter } from '../vessel-group.config.selectors'
import styles from './VesselGroupReportVesselsTableFooter.module.css'
import {
selectVesselGroupReportVesselsFiltered,
selectVesselGroupReportVesselsPagination,
} from './vessel-group-report-vessels.selectors'

type ReportVesselsTableFooterProps = {
reportName: string
}

export default function VesselGroupReportVesselsTableFooter({
reportName,
}: ReportVesselsTableFooterProps) {
export default function VesselGroupReportVesselsTableFooter() {
const { t } = useTranslation()
const { dispatchQueryParams } = useLocationConnect()
const vesselGroup = useSelector(selectVesselGroupReportData)
const allVessels = useSelector(selectVesselGroupReportVesselsFiltered)
const reportVesselFilter = useSelector(selectVesselGroupReportVesselFilter)
const pagination = useSelector(selectVesselGroupReportVesselsPagination)
Expand All @@ -46,7 +43,7 @@ export default function VesselGroupReportVesselsTableFooter({
// })
const csv = unparseCSV(vessels)
const blob = new Blob([csv], { type: 'text/plain;charset=utf-8' })
saveAs(blob, `${reportName}-${start}-${end}.csv`)
saveAs(blob, `${formatInfoField(vesselGroup?.name, 'name')}-${start}-${end}.csv`)
}
}

Expand Down

0 comments on commit 0f0788a

Please sign in to comment.