Skip to content

Commit

Permalink
refactor: enum is good enough
Browse files Browse the repository at this point in the history
  • Loading branch information
tpluscode committed Nov 14, 2024
1 parent ae1f5f0 commit 33ed6b3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { LibraryConfigurationService } from '@blueprint/service/library-configur

import { Observable, tap } from 'rxjs';
import { environment } from '../../../../environments/environment';
import {FullTextSearchDialectName} from "@blueprint/service/sparql/sparql.service";
import { FullTextSearchDialect } from "@blueprint/service/sparql/sparql.service";
@Injectable({
providedIn: 'root'
})
Expand Down Expand Up @@ -52,5 +52,5 @@ export type FluxConfig = {
readonly endpointUrl: string,
readonly sparqlConsoleUrl: string,
readonly graphExplorerUrl: string,
readonly fullTextSearchDialect: FullTextSearchDialectName
readonly fullTextSearchDialect: FullTextSearchDialect
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { LibraryConfiguration } from './library-configuration.model';
import {FullTextSearchDialect, FullTextSearchDialectName} from '../sparql/sparql.service';
import { FullTextSearchDialect } from '../sparql/sparql.service';

@Injectable({
providedIn: 'root'
Expand All @@ -22,7 +22,7 @@ export class LibraryConfigurationService {
return this.configuration.fullTextSearchDialect;
}

set fullTextSearchDialect(value: FullTextSearchDialectName) {
set fullTextSearchDialect(value: FullTextSearchDialect) {
switch (value) {
case 'fuseki':
this.configuration.fullTextSearchDialect = FullTextSearchDialect.FUSEKI;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,3 @@ export enum FullTextSearchDialect {
NEPTUNE = 'neptune',
GRAPHDB = 'graphdb'
}

export type FullTextSearchDialectName = FullTextSearchDialect[keyof FullTextSearchDialect];
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
// `ng build --configuration production` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.

import { FullTextSearchDialectName } from "@blueprint/service/sparql/sparql.service";
import { FullTextSearchDialect } from "@blueprint/service/sparql/sparql.service";

export const environment = {
production: false,
endpointUrl: 'http://localhost:4200/query', // this will be overwritten by /src/config.json
sparqlConsoleUrl: null, // e.g. yasgui -> will be overwritten by /src/config.json
graphExplorerUrl: null, // this will be overwritten by /src/config.json
fullTextSearchDialect: 'neptune' as FullTextSearchDialectName, // this will be overwritten by /src/config.json
fullTextSearchDialect: 'neptune' as FullTextSearchDialect, // this will be overwritten by /src/config.json
neptune: {
ftsEndpoint: "https://vpc-opensearch-zazuko-blueprint-glbaecqrcqwr5om3z5jj2duuiq.eu-central-1.es.amazonaws.com"
} // this will be overwritten by /src/config.json// this will be overwritten by /src/config.json
Expand Down
4 changes: 2 additions & 2 deletions projects/blueprint/src/environments/environment.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type {FullTextSearchDialectName} from "@blueprint/service/sparql/sparql.service";
import type { FullTextSearchDialect } from "@blueprint/service/sparql/sparql.service";

export const environment = {
production: true,
endpointUrl: 'https://ld.flux.zazuko.com/query', // this will be overwritten by /src/config.json
sparqlConsoleUrl: null, // e.g. yasgui -> will be overwritten by /src/config.json
graphExplorerUrl: null, // this will be overwritten by /src/config.json
fullTextSearchDialect: 'neptune' as FullTextSearchDialectName, // this will be overwritten by /src/config.json
fullTextSearchDialect: 'neptune' as FullTextSearchDialect, // this will be overwritten by /src/config.json
neptune: {
ftsEndpoint: "https://vpc-opensearch-zazuko-blueprint-glbaecqrcqwr5om3z5jj2duuiq.eu-central-1.es.amazonaws.com"
} // this will be overwritten by /src/config.json
Expand Down

0 comments on commit 33ed6b3

Please sign in to comment.