Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* docs(data): update documentation * docs(results): display search syntax hint * docs(search): display search syntax hint * feat(hint): new component to display hints * style: resolve responsive style issues * feat(search): display fulltext search hint * style(hint): resolve highlight style * style(search): resolve responsive design issue
- Loading branch information
1 parent
404f1f6
commit f54dafc
Showing
16 changed files
with
198 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<div class="hint" [innerHtml]="content"></div> | ||
|
||
<a mat-button [href]="documentation" target="_blank" color="primary" class="external-url"> | ||
Read more in the user guide<mat-icon class="suffix">launch</mat-icon> | ||
</a> |
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,7 @@ | ||
a { | ||
margin: 16px auto; | ||
|
||
.mat-icon.suffix { | ||
margin-left: 16px; | ||
} | ||
} |
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,31 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { MatIconModule } from '@angular/material/icon'; | ||
|
||
import { HintComponent } from './hint.component'; | ||
|
||
describe('HintComponent', () => { | ||
let component: HintComponent; | ||
let fixture: ComponentFixture<HintComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ | ||
HintComponent | ||
], | ||
imports: [ | ||
MatIconModule | ||
] | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(HintComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
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,52 @@ | ||
import { Component, Input, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-hint', | ||
templateUrl: './hint.component.html', | ||
styleUrls: ['./hint.component.scss'] | ||
}) | ||
export class HintComponent implements OnInit { | ||
|
||
@Input() topic: string; | ||
|
||
content: string; | ||
|
||
documentation: string; | ||
|
||
constructor() { } | ||
|
||
ngOnInit(): void { | ||
this.content = this._getHint(this.topic); | ||
} | ||
|
||
/** | ||
* get correct hint depending on the topic | ||
* @param topic | ||
* @returns hint as html | ||
* | ||
* todo: the hint should be written in markdown in different languages. Maybe stored in docs. | ||
*/ | ||
private _getHint(topic: string): string { | ||
switch(topic) { | ||
case 'search': | ||
this.documentation = 'https://docs.dasch.swiss/DSP-APP/user-guide/data/#search-and-browse'; | ||
return `<p>Use special syntax:</p> | ||
<ul> | ||
<li>question mark<strong>?</strong> can be used as wildcard symbol for a single character.<br> | ||
<code class="">Example: <i>be?r</i> will find <i>beer</i> but also <i>bear</i></code> | ||
</li><br> | ||
<li>asterisk<strong>*</strong> can be used as a wildcard symbol for zero, one or multiple characters.<br> | ||
<code class="">Example: <i>b*r</i> will find <i>beer</i> but also <i>bear</i></code> | ||
</li><br> | ||
<li><strong>"</strong>quotation marks<strong>"</strong> searches for the whole pattern.<br> | ||
<code class="">Example: <i>"Lorem ipsum"</i> will find texts with exact content <i>Lorem ipsum</i></code> | ||
</li> | ||
</ul>`; | ||
break; | ||
|
||
default: | ||
return `There's no hint implemented for the topic <strong>${topic}<strong>.`; | ||
} | ||
} | ||
|
||
} |
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 |
---|---|---|
|
@@ -53,7 +53,7 @@ | |
a { | ||
margin: 0 auto; | ||
|
||
.mat-icon { | ||
.mat-icon.suffix { | ||
margin-left: 16px; | ||
} | ||
} | ||
|
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
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
Oops, something went wrong.