Move first_name and last_name to only be displayed for user importer. Also sort items alphabetically regardless of their source. (#5292)

This commit is contained in:
Daniel Meltzer 2018-03-30 22:32:43 -04:00 committed by snipe
parent 4786c1c59f
commit 79f061be93
6 changed files with 21 additions and 9 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
public/js/dist/all.js vendored

Binary file not shown.

View file

@ -1,14 +1,14 @@
{
"/js/build/vue.js": "/js/build/vue.js?id=1de38b37fbbd0382cab3",
"/js/build/vue.js": "/js/build/vue.js?id=cd8def41b04c6707fc9e",
"/css/AdminLTE.css": "/css/AdminLTE.css?id=b8be19a285eaf44eec37",
"/css/app.css": "/css/app.css?id=407edb63cc6b6dc62405",
"/css/overrides.css": "/css/overrides.css?id=c289c71c08df753ebc45",
"/js/build/vue.js.map": "/js/build/vue.js.map?id=cc8a76b6d73986f89391",
"/js/build/vue.js.map": "/js/build/vue.js.map?id=ae61f2fa91bc184b92a9",
"/css/AdminLTE.css.map": "/css/AdminLTE.css.map?id=99f5a5a03c4155cf69f6",
"/css/app.css.map": "/css/app.css.map?id=bdbe05e6ecd70ccfac72",
"/css/overrides.css.map": "/css/overrides.css.map?id=898c91d4a425b01b589b",
"/css/dist/all.css": "/css/dist/all.css?id=5fdad90c2d445e4a1a2c",
"/js/dist/all.js": "/js/dist/all.js?id=6769a7c5085ca8147451",
"/js/dist/all.js": "/js/dist/all.js?id=dc00b6ea982000d41b0e",
"/css/build/all.css": "/css/build/all.css?id=5fdad90c2d445e4a1a2c",
"/js/build/all.js": "/js/build/all.js?id=6769a7c5085ca8147451"
"/js/build/all.js": "/js/build/all.js?id=dc00b6ea982000d41b0e"
}

View file

@ -100,9 +100,7 @@ tr {
{id: 'company', text: 'Company' },
{id: 'checkout_to', text: 'Checked out to' },
{id: 'email', text: 'Email' },
{id: 'first_name', text: 'First Name' },
{id: 'item_name', text: 'Item Name' },
{id: 'last_name', text: 'Last Name' },
{id: 'location', text: 'Location' },
{id: 'maintained', text: 'Maintained' },
{id: 'manufacturer', text: 'Manufacturer' },
@ -135,8 +133,11 @@ tr {
],
users: [
{id: 'employee_num', text: 'Employee Number' },
{id: 'first_name', text: 'First Name' },
{id: 'jobtitle', text: 'Job Title' },
{id: 'last_name', text: 'Last Name' },
{id: 'phone_number', text: 'Phone Number' },
],
customFields: this.customFields,
},
@ -150,13 +151,24 @@ tr {
},
computed: {
columns() {
// function to sort objects by their display text.
function sorter(a,b) {
if (a.text < b.text)
return -1;
if (a.text > b.text)
return 1;
return 0;
}
switch(this.options.importType) {
case 'asset':
return this.columnOptions.general.concat(this.columnOptions.assets).concat(this.columnOptions.customFields);
return this.columnOptions.general
.concat(this.columnOptions.assets)
.concat(this.columnOptions.customFields)
.sort(sorter);
case 'license':
return this.columnOptions.general.concat(this.columnOptions.licenses);
return this.columnOptions.general.concat(this.columnOptions.licenses).sort(sorter);
case 'user':
return this.columnOptions.general.concat(this.columnOptions.users);
return this.columnOptions.general.concat(this.columnOptions.users).sort(sorter);
}
return this.columnOptions.general;
},