diff --git a/.meteor/packages b/.meteor/packages
index e1570ef..ce73cee 100644
--- a/.meteor/packages
+++ b/.meteor/packages
@@ -21,7 +21,6 @@ shell-server@0.5.0 # Server-side component of the `meteor shell` comm
#aldeed:collection2 # Attaches a schema to a collection
#aldeed:schema-index # Allows the schema to specify fields to be indexed
-svelte:compiler
#static-html@1.3.2
rdb:svelte-meteor-data
accounts-ui@1.4.2
@@ -32,7 +31,8 @@ accounts-google@1.4.0
service-configuration@1.3.0
google-config-ui@1.0.3 # Adds the UI for logging in via Google
alanning:roles # Adds roles to the user
-#zodern:melte
#babrahams:constellation # Alternative to MeteorToys - Has problems because it requires jquery 1.11.11 and everything else wants 2.x or 3.x
msavin:mongol # Free version of MeteorToys - Provides access to the client side MongoDB for debugging. (Ctrl-M to activate :: https://atmospherejs.com/msavin/mongol)
+#zodern:melte # Alternative to meteor-svelte (https://github.com/meteor-svelte/meteor-svelte). Was more actively developed.
+svelte:compiler # Switching back to this because of TS errors.
diff --git a/imports/api/assets.js b/imports/api/assets.js
index 3e9785f..8a57ed2 100644
--- a/imports/api/assets.js
+++ b/imports/api/assets.js
@@ -51,32 +51,37 @@ Meteor.methods({
check(assetTypeId, String);
check(assetId, String);
check(serial, String);
+
+ // Convert the asset ID's to uppercase for storage to make searching easier.
+ assetId = assetId.toUpperCase();
if(Roles.userIsInRole(Meteor.userId(), "admin", {anyScope:true})) {
let assetType = AssetTypes.findOne({assetTypeId});
- if(assetType.hasSerial && serial || !assetType.hasSerial && !serial) {
- if(serial) {
- Assets.insert({assetTypeId, assetId, serial});
- }
- else {
- Assets.insert({assetTypeId, assetId});
- }
+ if(serial) {
+ Assets.insert({assetTypeId, assetId, serial});
}
else {
- //Should never get here due to client side validation.
- console.log("Error: Must provide a serial for asset types marked as having one, and may not provide one for asset types not marked as having one.")
+ Assets.insert({assetTypeId, assetId});
}
}
},
'assets.update'(_id, assetId, serial) {
- //TODO:
+ check(_id, String);
+ check(assetId, String);
+ if(serial) check(serial, String);
+
+ if(Roles.userIsInRole(Meteor.userId(), "admin", {anyScope:true})) {
+ //TODO: Need to first verify there are no checked out assets to the staff member.
+ Assets.update({_id}, {$set: {assetId, serial}});
+ }
},
'assets.remove'(_id) {
check(_id, String);
if(Roles.userIsInRole(Meteor.userId(), "admin", {anyScope:true})) {
//TODO: Need to first verify there are no checked out assets to the staff member.
+ Assets.remove({_id});
}
},
});
diff --git a/imports/ui/Admin.svelte b/imports/ui/Admin.svelte
index 006c322..14d774c 100644
--- a/imports/ui/Admin.svelte
+++ b/imports/ui/Admin.svelte
@@ -237,7 +237,7 @@
\ No newline at end of file
diff --git a/imports/ui/Assets/AssetDataEntry.svelte b/imports/ui/Assets/AssetDataEntry.svelte
new file mode 100644
index 0000000..8a88ff0
--- /dev/null
+++ b/imports/ui/Assets/AssetDataEntry.svelte
@@ -0,0 +1,172 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/imports/ui/Assets/AssetList.svelte b/imports/ui/Assets/AssetList.svelte
new file mode 100644
index 0000000..b876bd7
--- /dev/null
+++ b/imports/ui/Assets/AssetList.svelte
@@ -0,0 +1,165 @@
+
+
+