mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -08:00
Adjust the import controller to return a url to the process path to enable processing an uploaded file without refresh. (#4080)
This commit is contained in:
parent
1e52fb546c
commit
655ca78633
|
@ -29,7 +29,7 @@ class ImportsTransformer
|
|||
'header_row' => $import->header_row,
|
||||
'first_row' => $import->first_row,
|
||||
'field_map' => $import->field_map,
|
||||
|
||||
'process_url'=> route('api.imports.importFile', $import->id),
|
||||
];
|
||||
|
||||
return $array;
|
||||
|
|
File diff suppressed because one or more lines are too long
6882
build/css/app.css
6882
build/css/app.css
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -3,10 +3,6 @@
|
|||
"/css/AdminLTE.css": "/css/AdminLTE.css",
|
||||
"/css/app.css": "/css/app.css",
|
||||
"/css/overrides.css": "/css/overrides.css",
|
||||
"/vue.js.map": "/vue.js.map",
|
||||
"/css/AdminLTE.css.map": "/css/AdminLTE.css.map",
|
||||
"/css/app.css.map": "/css/app.css.map",
|
||||
"/css/overrides.css.map": "/css/overrides.css.map",
|
||||
"/public/css/dist/all.css": "/public/css/dist/all.css",
|
||||
"/public/js/dist/all.js": "/public/js/dist/all.js"
|
||||
}
|
52911
build/vue.js
52911
build/vue.js
File diff suppressed because one or more lines are too long
BIN
public/css/dist/all.css
vendored
BIN
public/css/dist/all.css
vendored
Binary file not shown.
BIN
public/js/dist/all.js
vendored
BIN
public/js/dist/all.js
vendored
Binary file not shown.
|
@ -67,7 +67,7 @@ tr {
|
|||
|
||||
<script>
|
||||
export default {
|
||||
props: ['file', 'customFieldUrl', 'importProcessUrl'],
|
||||
props: ['file', 'customFieldUrl'],
|
||||
data() {
|
||||
return {
|
||||
activeFile: this.file,
|
||||
|
@ -142,12 +142,6 @@ tr {
|
|||
this.populateSelect2ActiveItems();
|
||||
},
|
||||
computed: {
|
||||
processUrl() {
|
||||
// Because we need to pass a parameter to the laravel route function
|
||||
// We get a url 'http://localhost/api/v1/imports/process/DUMMYTEXT'
|
||||
// But we want to customize that to /api/v1/imports/process/this_file
|
||||
return this.importProcessUrl.replace('DUMMYTEXT', this.file.id)
|
||||
},
|
||||
columns() {
|
||||
switch(this.options.importType) {
|
||||
case 'asset':
|
||||
|
@ -175,7 +169,7 @@ tr {
|
|||
},
|
||||
postSave() {
|
||||
this.statusText = "Processing...";
|
||||
this.$http.post(this.processUrl, {
|
||||
this.$http.post(this.file.process_url, {
|
||||
'import-update': this.options.update,
|
||||
'import-type': this.options.importType,
|
||||
'column-mappings': this.columnMappings
|
||||
|
|
|
@ -36,9 +36,6 @@ th {
|
|||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* Prepare the component (Vue 2.x).
|
||||
*/
|
||||
mounted() {
|
||||
window.eventHub.$on('importErrors', this.updateImportErrors);
|
||||
this.fetchFiles();
|
||||
|
|
|
@ -66,7 +66,6 @@
|
|||
:key="currentFile.id"
|
||||
:file="currentFile"
|
||||
customFieldUrl="{{route('api.customfields.index')}}"
|
||||
importProcessUrl="{{route('api.imports.importFile','DUMMYTEXT')}}"
|
||||
@alert="updateAlert(alert)">
|
||||
</import-file>
|
||||
</template>
|
||||
|
|
Loading…
Reference in a new issue