Fix a typo

This commit is contained in:
Kai S. K. Engelbart 2021-01-08 13:25:35 +01:00
parent 8fd0ca1bd5
commit 2aad393c0d
2 changed files with 14 additions and 14 deletions

View File

@ -188,9 +188,9 @@ export class SamplesComponent implements OnInit {
} }
// set toPage to null to reload first page, queues calls // set toPage to null to reload first page, queues calls
loadSamples(options: LoadSamplesOptions = {}, event = null, categorie?) { loadSamples(options: LoadSamplesOptions = {}, event = null, category?) {
if (event) { // adjust active keys if (event) { // adjust active keys
this.categories[categorie].forEach(key => { this.categories[category].forEach(key => {
if (event.hasOwnProperty(key.id)) { if (event.hasOwnProperty(key.id)) {
key.active = event[key.id]; key.active = event[key.id];
} }
@ -271,8 +271,8 @@ export class SamplesComponent implements OnInit {
query.push('key=' + this.d.d.userKey.key); query.push('key=' + this.d.d.userKey.key);
} }
for (let categorie in this.categories) { for (let category in this.categories) {
this.categories[categorie].forEach(key => { this.categories[category].forEach(key => {
if (key.active && (options.export || (!options.export && key.id.indexOf('material.') < 0))) { if (key.active && (options.export || (!options.export && key.id.indexOf('material.') < 0))) {
query.push('fields[]=' + key.id); query.push('fields[]=' + key.id);
} }
@ -339,8 +339,8 @@ export class SamplesComponent implements OnInit {
storePreferences() { storePreferences() {
let keys = []; let keys = [];
for (let categorie in this.categories) { for (let category in this.categories) {
keys.push(...this.categories[categorie].map(e => pick(e, ['id', 'active']))); keys.push(...this.categories[category].map(e => pick(e, ['id', 'active'])));
} }
const store = { const store = {
@ -366,10 +366,10 @@ export class SamplesComponent implements OnInit {
}); });
store.keys.forEach(key => { store.keys.forEach(key => {
for (let categorie in this.categories) { for (let category in this.categories) {
const keyIndex = this.categories[categorie].findIndex(e => e.id === key.id); const keyIndex = this.categories[category].findIndex(e => e.id === key.id);
if (keyIndex >= 0) { if (keyIndex >= 0) {
this.categories[categorie][keyIndex].active = key.active; this.categories[category][keyIndex].active = key.active;
} }
} }
}); });
@ -395,8 +395,8 @@ export class SamplesComponent implements OnInit {
updateActiveKeys() { // array with all activeKeys updateActiveKeys() { // array with all activeKeys
this.activeKeys = []; this.activeKeys = [];
for (let categorie in this.categories) { for (let category in this.categories) {
this.activeKeys.push(...this.categories[categorie].filter(e => e.active)); this.activeKeys.push(...this.categories[category].filter(e => e.active));
this.filters.filters.forEach(filter => { // disable filters of fields not displayed this.filters.filters.forEach(filter => { // disable filters of fields not displayed
if (!this.isActiveKey[filter.field]) { if (!this.isActiveKey[filter.field]) {
filter.active = false; filter.active = false;
@ -406,8 +406,8 @@ export class SamplesComponent implements OnInit {
} }
calcFieldSelectKeys() { calcFieldSelectKeys() {
for (let categorie in this.categories) { for (let category in this.categories) {
this.categories[categorie].forEach(key => { this.categories[category].forEach(key => {
this.isActiveKey[key.id] = key.active; this.isActiveKey[key.id] = key.active;
}); });
} }