Skip to content

Commit 73aef95

Browse files
committed
Add more readable filenames
1 parent 56317c8 commit 73aef95

3 files changed

Lines changed: 14 additions & 7 deletions

File tree

package-lock.json

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "advanced-export",
3-
"version": "0.2.5",
3+
"version": "0.2.6",
44
"private": true,
55
"dependencies": {
66
"@devexpress/dx-react-core": "^1.4.0",
@@ -22,6 +22,7 @@
2222
"lodash": "^4.17.10",
2323
"material-ui": "0.20.1",
2424
"material-ui-icons": "^1.0.0-beta.36",
25+
"moment": "^2.22.2",
2526
"pouchdb": "^7.0.0",
2627
"prop-types": "latest",
2728
"react": "^16.4.1",
@@ -48,7 +49,7 @@
4849
"manifest.webapp": {
4950
"name": "Advanced Export",
5051
"description": "Export App with recursive metadata fetching",
51-
"version": "0.2.5",
52+
"version": "0.2.6",
5253
"developer": {
5354
"name": "Alexis Rico",
5455
"url": "https://github.com/SferaDev"

src/logic/extractor.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import _ from 'lodash';
22
import axios from "axios";
33
import * as traverse from 'traverse';
44
import * as FileSaver from 'file-saver';
5-
6-
import * as configuration from "./configuration";
5+
import moment from "moment";
76

87
import {store} from '../store';
98
import * as actionTypes from '../actions/actionTypes';
109
import * as settingsAction from "../actions/settingsAction";
10+
import * as configuration from "./configuration";
1111

1212
const DEBUG = process.env.REACT_APP_DEBUG;
1313
let totalRequests = 0, completedRequests = 0;
@@ -145,10 +145,11 @@ export function handleCreatePackage(builder, elements) {
145145
store.dispatch({type: actionTypes.LOADING, loading: true});
146146
initialFetchAndRetrieve(builder, elements).then(() => {
147147
createPackage(builder, elements).then((result) => {
148+
let fileName = 'extraction-' + moment().format('YYMMDDHHmm') + '.json';
148149
FileSaver.saveAs(new Blob([JSON.stringify(result, null, 4)], {
149150
type: 'application/json',
150-
name: 'extraction.json'
151-
}), 'extraction.json');
151+
name: fileName
152+
}), fileName);
152153
store.dispatch({type: actionTypes.LOADING, loading: false});
153154
});
154155
});

0 commit comments

Comments
 (0)