Fixed a number of bugs; added a few fields.

This commit is contained in:
2022-08-08 22:15:55 -07:00
parent 4560d7203d
commit c96b4a6901
10 changed files with 3791 additions and 160 deletions

View File

@@ -1,7 +1,7 @@
<script>
import {Meteor} from "meteor/meteor";
import {onMount} from "svelte";
import {writable} from "svelte/store";
import {writable, derived} from "svelte/store";
import TextField from '@smui/textfield';
import HelperText from '@smui/textfield/helper-text';
import Select, { Option } from '@smui/select';
@@ -16,8 +16,13 @@
Meteor.subscribe('assets');
});
let assetTypes;
$: assetTypes = AssetTypes.find({});
$: assetTypes = AssetTypes.find({}, {sort: {year: -1}});
$: assetTypeNameMap = derived(assetTypes, $assetTypes => $assetTypes.reduce((map, obj) => {
map[obj._id] = obj.name;
return map;
}, {}));
// Asset Table //
const assetColumns = [
@@ -35,6 +40,17 @@
minWidth: 100,
weight: 1,
cls: "serial",
}, {
key: "asset",
title: "Asset Type",
value: v => {
$: {
return v.assetTypeId ? $assetTypeNameMap[v.assetTypeId] : "-"
}
},
minWidth: 100,
weight: 1,
cls: "serial",
},
];
const assetActions = {