From 4376adc1ebcae2d6bbb109cc07c6308ce19eb140 Mon Sep 17 00:00:00 2001 From: VLE2FE Date: Thu, 6 Aug 2020 14:08:11 +0200 Subject: [PATCH] changed device_name to devices --- src/app/models/user.model.ts | 4 +- src/app/sample/sample.component.ts | 2 +- src/app/samples/samples.component.ts | 1 + src/app/settings/settings.component.html | 11 +- src/app/users/users.component.html | 32 +- src/assets/imgs/db_structure_latest.svg | 3749 +++++++++++++++++++++- 6 files changed, 3778 insertions(+), 21 deletions(-) diff --git a/src/app/models/user.model.ts b/src/app/models/user.model.ts index 5e1488f..a3f7cd7 100644 --- a/src/app/models/user.model.ts +++ b/src/app/models/user.model.ts @@ -9,7 +9,7 @@ export class UserModel extends BaseModel{ email = ''; level = ''; location = ''; - device_name = ''; + devices = ['']; edit = false; deserialize(input: any): this { @@ -19,7 +19,7 @@ export class UserModel extends BaseModel{ } sendFormat(mode = 'user') { - const keys = ['name', 'email', 'location', 'device_name']; + const keys = ['name', 'email', 'location', 'devices']; if (mode === 'admin') { keys.push('level'); } diff --git a/src/app/sample/sample.component.ts b/src/app/sample/sample.component.ts index e484f4f..5388889 100644 --- a/src/app/sample/sample.component.ts +++ b/src/app/sample/sample.component.ts @@ -137,7 +137,7 @@ export class SampleComponent implements OnInit, AfterContentChecked { this.loading--; }); this.d.load('user', () => { - this.defaultDevice = this.d.d.user.device_name; + this.defaultDevice = this.d.d.user.devices[0]; }); if (!this.new) { this.loading++; diff --git a/src/app/samples/samples.component.ts b/src/app/samples/samples.component.ts index 0bfc48a..45a7ee6 100644 --- a/src/app/samples/samples.component.ts +++ b/src/app/samples/samples.component.ts @@ -97,6 +97,7 @@ export class SamplesComponent implements OnInit { this.filters.filters.find(e => e.field === 'color').autocomplete = [...new Set(this.d.arr.materials.reduce((s, e) => {s.push(...e.numbers.map(el => el.color)); return s; }, []))]; this.loadSamples(); + console.log(this.d.id.materials); }); this.d.load('materialSuppliers', () => { this.filters.filters.find(e => e.field === 'material.supplier').autocomplete = this.d.arr.materialSuppliers; diff --git a/src/app/settings/settings.component.html b/src/app/settings/settings.component.html index 8e73ba1..2b5b9b4 100644 --- a/src/app/settings/settings.component.html +++ b/src/app/settings/settings.component.html @@ -15,10 +15,13 @@ {{locationInput.errors.failure}} Cannot be empty - - {{deviceInput.errors.failure}} - + + + {{deviceInput.errors.failure}} + + Save change diff --git a/src/app/users/users.component.html b/src/app/users/users.component.html index b176428..fbff322 100644 --- a/src/app/users/users.component.html +++ b/src/app/users/users.component.html @@ -21,10 +21,13 @@ {{locationInput.errors.failure}} Cannot be empty - - {{deviceInput.errors.failure}} - + + + {{deviceInput.errors.failure}} + + {{passAInput.errors.failure}} @@ -54,12 +57,13 @@ {{user.email}} {{user.level}} {{user.location}} - {{user.device_name}} + {{user.devices}} - + {{nameInput.errors.failure}} Cannot be empty @@ -83,12 +87,18 @@ - - {{deviceInput.errors.failure}} - + + + + + + + + Save + - Save diff --git a/src/assets/imgs/db_structure_latest.svg b/src/assets/imgs/db_structure_latest.svg index 5dccaf4..e5f79fc 100644 --- a/src/assets/imgs/db_structure_latest.svg +++ b/src/assets/imgs/db_structure_latest.svg @@ -1,3 +1,3746 @@ - - -
measurements
measurements
materials
materials
samples
samples
_id
_id
_id
_id
values
values
_id
_id
number
number
numbers
numbers
material_name
material_name
batch
batch
comment
comment
location
location
models
models
name
name
status
status
notes
notes
data
data
_id
_id
users
users
name
name
pass
pass
level
level
_id
_id
type
type
measurement_templates
measurement_templates
_id
_id
parameters
parameters
range
range
name
name
name
name
color
color
sample_references
sample_references
device_name
device_name
condition_templates
condition_templates
_id
_id
parameters
parameters
range
range
name
name
name
name
custom fields
custom fields
key
key
email
email
note_fields
note_fields
name
name
qty
qty
sample_id
sample_id
relation
relation
version
version
version
version
status
status
status
status
condition
condition
parameters
parameters
material_groups
material_groups
material_suppliers
material_suppliers
_id
_id
name
name
_id
_id
name
name
first_id
first_id
first_id
first_id
changelog
changelog
_id
_id
collection
collection
data
data
condition
condition
action
action
material_templates
material_templates
_id
_id
parameters
parameters
range
range
name
name
name
name
version
version
first_id
first_id
properties
properties
parameters
parameters
Viewer does not support full SVG 1.1
\ No newline at end of file + + + + + + image/svg+xml + + + + + + + + + + + + + + + measurements + + + + measurements + + + + + + + + + materials + + + + materials + + + + + + + + + samples + + + + samples + + + + + + + + + _id + + + + _id + + + + + + + + + _id + + + + _id + + + + + + + + + values + + + + values + + + + + + + + + _id + + + + _id + + + + + + + + + number + + + + number + + + + + + + + + numbers + + + + numbers + + + + + + + + + material_name + + + + material_name + + + + + + + + + batch + + + + batch + + + + + + + + + comment + + + + comment + + + + + + + + + location + + + + location + + + + + + + + + + + models + + + + models + + + + + + + + + name + + + + name + + + + + + + + + status + + + + status + + + + + + + + + notes + + + + notes + + + + + + + + + + data + + + + data + + + + + + + + + _id + + + + _id + + + + + + + + + users + + + + users + + + + + + + + + name + + + + name + + + + + + + + + pass + + + + pass + + + + + + + + + level + + + + level + + + + + + + + + + + _id + + + + _id + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + type + + + + type + + + + + + + + + + measurement_templates + + + + measurement_templates + + + + + + + + + + + _id + + + + _id + + + + + + + + + + parameters + + + + parameters + + + + + + + + + range + + + + range + + + + + + + + + name + + + + name + + + + + + + + + name + + + + name + + + + + + + + + + + + + color + + + + color + + + + + + + + + + sample_references + + + + sample_references + + + + + + + + + devices + + + + devices + + + + + + + + + + + + + + condition_templates + + + + condition_templates + + + + + + + + + _id + + + + _id + + + + + + + + + + parameters + + + + parameters + + + + + + + + + range + + + + range + + + + + + + + + name + + + + name + + + + + + + + + name + + + + name + + + + + + + + + + + + + + custom fields + + + + custom fields + + + + + + + + + key + + + + key + + + + + + + + + email + + + + email + + + + + + + + + note_fields + + + + note_fields + + + + + + + + + name + + + + name + + + + + + + + + qty + + + + qty + + + + + + + + + + + + + sample_id + + + + sample_id + + + + + + + + + relation + + + + relation + + + + + + + + + + + + + version + + + + version + + + + + + + + + + + version + + + + version + + + + + + + + + + + status + + + + status + + + + + + + + + status + + + + status + + + + + + + + + + + condition + + + + condition + + + + + + + + + + + + parameters + + + + parameters + + + + + + + + + + material_groups + + + + material_groups + + + + + + + + + material_suppliers + + + + material_suppliers + + + + + + + + + _id + + + + _id + + + + + + + + + name + + + + name + + + + + + + + + _id + + + + _id + + + + + + + + + name + + + + name + + + + + + + + + + + + + first_id + + + + first_id + + + + + + + + + + first_id + + + + first_id + + + + + + + + + + changelog + + + + changelog + + + + + + + + + _id + + + + _id + + + + + + + + + collection + + + + collection + + + + + + + + + data + + + + data + + + + + + + + + + + + + + condition + + + + condition + + + + + + + + + action + + + + action + + + + + + + + + + + + + + material_templates + + + + material_templates + + + + + + + + + _id + + + + _id + + + + + + + + + + parameters + + + + parameters + + + + + + + + + range + + + + range + + + + + + + + + name + + + + name + + + + + + + + + name + + + + name + + + + + + + + + + + + + version + + + + version + + + + + + + + + + + first_id + + + + first_id + + + + + + + + + + properties + + + + properties + + + + + + + + + + parameters + + + + parameters + + + + +