97049: Minor refactor // adding docs

This commit is contained in:
Jens Vannerum
2022-12-05 15:13:13 +01:00
parent eb15368197
commit acbff2e6b4
6 changed files with 36 additions and 15 deletions

View File

@@ -296,3 +296,11 @@ info:
markdown: markdown:
enabled: false enabled: false
mathjax: false mathjax: false
# Which vocabularies should be used for which search filters
# and whether to show the filter in the search sidebar
# Take a look at the filter-vocabulary-config.ts file for documentation on how the options are obtained
vocabularies:
- filter: 'subject'
vocabulary: 'srsc'
enabled: true

View File

@@ -3,8 +3,3 @@ rest:
host: api7.dspace.org host: api7.dspace.org
port: 443 port: 443
nameSpace: /server nameSpace: /server
vocabularies:
- filter: 'subject'
vocabulary: 'srsc'
enabled: true

View File

@@ -1,7 +0,0 @@
import { Config } from './config.interface';
export interface FilterVocabularyConfig extends Config {
filter: string;
vocabulary: string;
enabled: boolean;
}

View File

@@ -20,7 +20,7 @@ import { InfoConfig } from './info-config.interface';
import { CommunityListConfig } from './community-list-config.interface'; import { CommunityListConfig } from './community-list-config.interface';
import { HomeConfig } from './homepage-config.interface'; import { HomeConfig } from './homepage-config.interface';
import { MarkdownConfig } from './markdown-config.interface'; import { MarkdownConfig } from './markdown-config.interface';
import { FilterVocabularyConfig } from './FilterVocabularyConfig'; import { FilterVocabularyConfig } from './filter-vocabulary-config';
interface AppConfig extends Config { interface AppConfig extends Config {
ui: UIServerConfig; ui: UIServerConfig;

View File

@@ -20,7 +20,7 @@ import { InfoConfig } from './info-config.interface';
import { CommunityListConfig } from './community-list-config.interface'; import { CommunityListConfig } from './community-list-config.interface';
import { HomeConfig } from './homepage-config.interface'; import { HomeConfig } from './homepage-config.interface';
import { MarkdownConfig } from './markdown-config.interface'; import { MarkdownConfig } from './markdown-config.interface';
import { FilterVocabularyConfig } from './FilterVocabularyConfig'; import { FilterVocabularyConfig } from './filter-vocabulary-config';
export class DefaultAppConfig implements AppConfig { export class DefaultAppConfig implements AppConfig {
production = false; production = false;
@@ -378,6 +378,9 @@ export class DefaultAppConfig implements AppConfig {
mathjax: false, mathjax: false,
}; };
// Which vocabularies should be used for which search filters
// and whether to show the filter in the search sidebar
// Take a look at the filter-vocabulary-config.ts file for documentation on how the options are obtained
vocabularies: FilterVocabularyConfig[] = [ vocabularies: FilterVocabularyConfig[] = [
{ {
filter: 'subject', filter: 'subject',

View File

@@ -0,0 +1,22 @@
import { Config } from './config.interface';
/**
* Configuration that can be used to enable a vocabulary tree to be used as search filter
*/
export interface FilterVocabularyConfig extends Config {
/**
* The name of the filter where the vocabulary tree should be used
* This is the name of the filter as it's configured in the facet in discovery.xml
* (can also be seen on the /server/api/discover/facets endpoint)
*/
filter: string;
/**
* name of the vocabulary tree to use
* ( name of the file as stored in the dspace/config/controlled-vocabularies folder without file extension )
*/
vocabulary: string;
/**
* Whether to show the vocabulary tree in the sidebar
*/
enabled: boolean;
}