Assorted fixed (#3332)

* Better error handling of failed file uploads.  Also improve formatting of modal dialog

* Readd app.js to the js build, fixes collapsing sidebar

* Update JS

* Fix font size.  We need to explicitly set the font size for the table because everywhere else that comes from bootstrap-tables
This commit is contained in:
Daniel Meltzer 2017-02-23 00:49:06 -06:00 committed by snipe
parent 381526e488
commit ad9470b6f8
12 changed files with 1590 additions and 189 deletions

View file

@ -79,8 +79,7 @@ class ImportController extends Controller
'files' => $results
];
}
$results['error']=trans('general.feature_disabled');
return $results;
return response()->json(Helper::formatStandardApiResponse('error', null, trans('general.feature_disabled')), 500);
}
/**
* Processes the specified Import.

View file

@ -53,7 +53,8 @@ elixir(function(mix) {
bowerPath + '/iCheck/icheck.js',
bowerPath + '/select2/dist/js/select2.full.js',
bowerPath + '/ekko-lightbox/dist/ekko-lightbox.js',
'snipeit.js'
'snipeit.js',
'app.js'
],'public/assets/js');
mix.version(['assets/css/app.css','assets/js/all.js']);

0
public/assets/css/app.css Normal file → Executable file
View file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

0
public/build/assets/css/app-97b46ba110.css Normal file → Executable file
View file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,4 +1,4 @@
{
"assets/css/app.css": "assets/css/app-97b46ba110.css",
"assets/js/all.js": "assets/js/all-e871790407.js"
"assets/js/all.js": "assets/js/all-cedefbcf04.js"
}

View file

@ -691,11 +691,3 @@ function _init() {
};
})(jQuery);
const app = new Vue({
el: '#app'
});

View file

@ -1,13 +1,16 @@
<style scoped>
td {
font-size: 14px;
}
</style>
<template>
<div>
<div class="row">
<alert v-show="alert.visible" :alertType="alert.type" v-on:hide="alert.visible = false">{{ alert.message }}</alert>
<errors :errors="importErrors"></errors>
<modal v-model="displayImportModal" effect="fade">
<div slot="modal-header" class="modal-title">Import File:</div>
<div slot="modal-header" class="modal-header">
<h4 class="modal-title">Import File:</h4>
</div>
<div slot="modal-body" class="modal-body">
<div class="dynamic-form-row">
<div class="col-md-4 col-xs-12">
@ -29,18 +32,16 @@
</div>
</div>
<div slot="modal-footer" class="modal-footer">
<div class="row">
<div class="alert alert-success col-md-5 col-md-offset-1" style="text-align:left" v-if="modal.statusText">{{ this.modal.statusText }}</div>
<button type="button" class="btn btn-default" @click="displayImportModal = false">Cancel</button>
<button type="submit" class="btn btn-primary" @click="postSave">Save</button>
</div>
<div class="modal-footer" slot="modal-footer">
<div class="alert alert-success col-md-5 col-md-offset-1" style="text-align:left" v-if="modal.statusText">{{ this.modal.statusText }}</div>
<button type="button" class="btn btn-default" @click="displayImportModal = false">Cancel</button>
<button type="submit" class="btn btn-primary" @click="postSave">Process</button>
</div>
</modal>
<div class="row">
<div class="col-md-12">
<div class="box">
<div class="box-body">
<div class="col-md-12">
<div class="box">
<div class="box-body">
<div class="row">
<div class="col-md-3">
<!-- The fileinput-button span is used to style the file input field as button -->
<span class="btn btn-info fileinput-button">
@ -58,28 +59,28 @@
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<table class="table table-striped" id="upload-table">
<thead>
<th>File</th>
<th>Created</th>
<th>Size</th>
<th></th>
</thead>
<tbody>
<tr v-for="file in files">
<td>{{ file.file_path }}</td>
<td>{{ file.created_at }} </td>
<td>{{ file.filesize }}</td>
<td>
<button class="btn btn-sm btn-info" @click="showModal(file)"><i class="fa fa-spinner process"></i>Process</button>
<button class="btn btn-sm btn-danger" @click="deleteFile(file)"><i class="fa fa-trash icon-white"></i></button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="col-md-12">
<table class="table table-striped" id="upload-table">
<thead>
<th>File</th>
<th>Created</th>
<th>Size</th>
<th></th>
</thead>
<tbody>
<tr v-for="file in files">
<td>{{ file.file_path }}</td>
<td>{{ file.created_at }} </td>
<td>{{ file.filesize }}</td>
<td>
<button class="btn btn-sm btn-info" @click="showModal(file)"><i class="fa fa-spinner process"></i>Process</button>
<button class="btn btn-sm btn-danger" @click="deleteFile(file)"><i class="fa fa-trash icon-white"></i></button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
@ -155,7 +156,8 @@
},
fail(e, data) {
vm.progress.currentClass = "progress-bar-danger";
vm.progress.statusText = data.errorThrown;
// Display any errors returned from the $.ajax()
vm.progress.statusText = data.jqXHR.responseJSON.messages;
}
})
},
@ -187,6 +189,7 @@
},
postSave() {
this.modal.statusText = "Processing...";
this.$http.post('/api/v1/imports/process/'+this.activeFile.id, {
'import-update': this.modal.update,
'import-type': this.modal.importType

File diff suppressed because one or more lines are too long