-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(meta-filter): add meta filter config
- Loading branch information
Showing
18 changed files
with
174 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,32 @@ | ||
import Controller from "@ember/controller"; | ||
import { inject as service } from "@ember/service"; | ||
import { tracked } from "@glimmer/tracking"; | ||
|
||
export default class ApplicationController extends Controller { | ||
queryParams = ["category", "tags", "search", "document"]; | ||
|
||
@service config; | ||
|
||
@tracked category; | ||
// Cant use @tracked tags = []; because of https://github.com/emberjs/ember.js/issues/19078 | ||
@tracked tags; | ||
@tracked search; | ||
@tracked document; | ||
|
||
get documentFilters() { | ||
let filters = { | ||
category: this.category, | ||
tags: this.tags, | ||
search: this.serach, | ||
}; | ||
|
||
if (this.config && this.config.modelMetaFilters.document) { | ||
filters = { | ||
...filters, | ||
meta: JSON.stringify(this.config.modelMetaFilters.document), | ||
}; | ||
} | ||
|
||
return filters; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Route from "@ember/routing/route"; | ||
import { inject as service } from "@ember/service"; | ||
|
||
export default class ApplicationRoute extends Route { | ||
@service config; | ||
|
||
model(_, transition) { | ||
this.config.emeisQueryParams = transition.to.parent.params; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import Service from "@ember/service"; | ||
import { tracked } from "@glimmer/tracking"; | ||
|
||
export default class ConfigService extends Service { | ||
@tracked emeisQueryParams = {}; | ||
|
||
/* Defaults so we can lookup | ||
* `this.config.modelMetaFilters.document` | ||
* without an exeption on modelMetaFilters. | ||
*/ | ||
get modelMetaFilters() { | ||
return {}; | ||
} | ||
get defaultModelMeta() { | ||
return {}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from "ember-alexandria/services/config"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import ConfigService from "ember-alexandria/services/config"; | ||
|
||
export default class AlexandriaConfigService extends ConfigService { | ||
get modelMetaFilters() { | ||
return { | ||
document: [ | ||
{ key: "instance_id", value: this.emeisQueryParams.instance_id }, | ||
], | ||
}; | ||
} | ||
|
||
get defaultModelMeta() { | ||
return { | ||
document: { | ||
instance_id: this.emeisQueryParams.instance_id, | ||
}, | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
$global-primary-background: #c00; | ||
|
||
@import "ember-uikit"; | ||
@import "ember-alexandria"; | ||
|
||
#container { | ||
height: 100vh; | ||
max-height: 100vh; | ||
overflow: hidden; | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.