-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/bulk/all #2020
Feat/bulk/all #2020
Changes from 22 commits
32f2105
59f8fdb
178ea8d
ffa73e3
601171e
6126853
77c294a
07845ec
e97a41c
40dcf3a
65ffbcb
e3ec1e3
c802416
657ac2f
5b35d05
0f98c28
75a55d4
4039da8
f177fad
d573930
d547c9c
89a1143
52b7a6b
49f23dd
3d9f8da
72fd798
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
FROM maildev/maildev:1.1.0 | ||
WORKDIR /usr/src/app | ||
RUN echo "maildev.on('new', ({ html }) => console.log('Login OTP: ' + html.match(/\d{6}/)[0]))" >> bin/maildev | ||
RUN echo "maildev.on('new', ({ html }) => { if(html.includes('OTP')) { console.log('Login OTP: ' + html.match(/\d{6}/)[0]) } else { console.log(html) } } )" >> bin/maildev |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,26 @@ import { GAEvent } from './ga' | |
import { UrlTableConfig } from '../../user/reducers/types' | ||
import queryObjFromTableConfig from '../helpers/urlQueryHelper' | ||
|
||
export const downloadCsv = (csvString: string, filename: string) => { | ||
const blob = new Blob([csvString], { | ||
type: 'text/csv;charset=utf-8', | ||
}) | ||
|
||
if (useIsIE()) { | ||
navigator.msSaveBlob(blob, filename) | ||
} else { | ||
saveAs(blob, filename) | ||
} | ||
} | ||
|
||
export const downloadSampleBulkCsv = () => { | ||
const headers = 'Original links to be shortened' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: could this be taken from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes 52b7a6b |
||
const body = ['https://www.link1.com', 'https://www.link2.com'] | ||
const content = [headers, ...body].join('\r\n') | ||
downloadCsv(content, 'sample_bulk.csv') | ||
GAEvent('modal page', 'downloaded bulk sample', 'successful') | ||
} | ||
|
||
export const downloadUrls = async (tableConfig: UrlTableConfig) => { | ||
const urlsArr = [] | ||
// set headers to csv | ||
|
@@ -59,22 +79,14 @@ export const downloadUrls = async (tableConfig: UrlTableConfig) => { | |
rootActions.setErrorMessage('Error downloading urls.') | ||
return null | ||
} | ||
|
||
const blob = new Blob([urlsArr.join('')], { | ||
type: 'text/csv;charset=utf-8', | ||
}) | ||
|
||
if (useIsIE()) { | ||
navigator.msSaveBlob(blob, 'urls.csv') | ||
} else { | ||
saveAs(blob, 'urls.csv') | ||
} | ||
downloadCsv(urlsArr.join(''), 'urls.csv') | ||
|
||
// Google Analytics: Download links button events | ||
GAEvent('user page', 'download links button', 'successful') | ||
return null | ||
} | ||
|
||
export default { | ||
downloadSampleBulkCsv, | ||
downloadUrls, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
REPLICA_URI
here appears to be a duplicateThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3d9f8da