Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
hvarg committed Mar 23, 2020
1 parent ed43529 commit 6ec07b8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 7 additions & 0 deletions src/screens/models/configure/new-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,13 @@ export class ModelsNewSetup extends connect(store)(PageViewElement) {
this._setup = { ...db.configurations[this._selectedConfig] } as ModelConfigurationSetup;
this._setup.author = [];
this._setup.hasRegion = [];
if (this._region && this._region.model_catalog_uri) {
if (db.regions && db.regions[this._region.model_catalog_uri]) {
this._setup.hasRegion.push( db.regions[this._region.model_catalog_uri] );
} else {
this._setup.hasRegion.push( {id: this._region.model_catalog_uri, label: [this._region.name]} );
}
}

// Fetching not loaded parameters
(this._setup.hasParameter || []).forEach((p:Parameter) => {
Expand Down
6 changes: 2 additions & 4 deletions src/screens/models/configure/region.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { showNotification, showDialog, hideDialog } from 'util/ui_functions';
import { RegionCategory } from "screens/regions/reducers";

import { regionsGet, regionPost, regionDelete } from 'model-catalog/actions';
import { isSubregion } from 'model-catalog/util';

import { renderExternalLink } from './util';

Expand Down Expand Up @@ -187,10 +188,7 @@ export class ModelsConfigureRegion extends connect(store)(PageViewElement) {

_renderSelectTab () {
let subregions : Region[] = Object.values(this._regions || {}).filter((region:Region) =>
region.partOf &&
region.partOf.length > 0 &&
region.partOf.some((obj:Region) => obj.id === this._region.model_catalog_uri) &&
region.label.join().toLowerCase().includes(this._filter.toLowerCase())
isSubregion(this._region.model_catalog_uri, region)
);

return html`
Expand Down

0 comments on commit 6ec07b8

Please sign in to comment.