forked from vivo-community/scholars-angular
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from TAMULib/sprint14-staging
Sprint 14 Staging
- Loading branch information
Showing
20 changed files
with
161 additions
and
11 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
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
22 changes: 22 additions & 0 deletions
22
src/app/shared/dialog/search-tips/search-tips.component.html
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,22 @@ | ||
<scholars-dialog [dialog]="dialog"> | ||
<ul> | ||
<li>Searches are not case-sensitive</li> | ||
<li>Type keywords using AND or OR logic (AND or OR must be capitalized) | ||
<ul> | ||
<li>eg., nutrition AND protein</li> | ||
<li>eg., nutrition OR protein</li> | ||
</ul> | ||
</li> | ||
<li>Type your phrase with double quotation marks | ||
<ul> | ||
<li>eg., "glucose absorption"</li> | ||
<li>eg., "glucose absorption" AND nutrition</li> | ||
</ul> | ||
</li> | ||
<li>Use wildcard * character to search variations | ||
<ul> | ||
<li>eg., bio*</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</scholars-dialog> |
Empty file.
45 changes: 45 additions & 0 deletions
45
src/app/shared/dialog/search-tips/search-tips.component.spec.ts
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,45 @@ | ||
import { NoopAnimationsModule } from '@angular/platform-browser/animations'; | ||
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { TranslateModule } from '@ngx-translate/core'; | ||
import { StoreModule } from '@ngrx/store'; | ||
|
||
import { SharedModule } from '../../shared.module'; | ||
|
||
import { SearchTipsComponent } from './search-tips.component'; | ||
|
||
import { metaReducers, reducers } from '../../../core/store'; | ||
import { testAppConfig } from '../../../../test.config'; | ||
|
||
describe('SearchTipsComponent', () => { | ||
let component: SearchTipsComponent; | ||
let fixture: ComponentFixture<SearchTipsComponent>; | ||
|
||
beforeEach(waitForAsync(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [ | ||
NoopAnimationsModule, | ||
SharedModule, | ||
StoreModule.forRoot(reducers(testAppConfig), { | ||
metaReducers, | ||
runtimeChecks: { | ||
strictStateImmutability: false, | ||
strictActionImmutability: false, | ||
strictStateSerializability: false, | ||
strictActionSerializability: false, | ||
}, | ||
}), | ||
TranslateModule.forRoot(), | ||
], | ||
}).compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(SearchTipsComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
35 changes: 35 additions & 0 deletions
35
src/app/shared/dialog/search-tips/search-tips.component.ts
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,35 @@ | ||
import { Component, OnInit, Input } from '@angular/core'; | ||
import { TranslateService } from '@ngx-translate/core'; | ||
import { Store } from '@ngrx/store'; | ||
|
||
import { scheduled } from 'rxjs'; | ||
import { queueScheduler } from 'rxjs'; | ||
|
||
import { AppState } from '../../../core/store'; | ||
import { DialogButtonType, DialogControl } from '../../../core/model/dialog'; | ||
|
||
import * as fromDialog from '../../../core/store/dialog/dialog.actions'; | ||
|
||
@Component({ | ||
selector: 'scholars-search-tips', | ||
templateUrl: './search-tips.component.html', | ||
styleUrls: ['./search-tips.component.scss'], | ||
}) | ||
export class SearchTipsComponent implements OnInit { | ||
|
||
public dialog: DialogControl; | ||
|
||
constructor(private translate: TranslateService, private store: Store<AppState>) {} | ||
|
||
ngOnInit() { | ||
this.dialog = { | ||
title: this.translate.get('SHARED.DIALOG.SEARCH_TIPS.TITLE'), | ||
close: { | ||
type: DialogButtonType.OUTLINE_INFO, | ||
label: this.translate.get('SHARED.DIALOG.SEARCH_TIPS.CANCEL'), | ||
action: () => this.store.dispatch(new fromDialog.CloseDialogAction()), | ||
disabled: () => scheduled([false], queueScheduler), | ||
}, | ||
}; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -36,5 +36,8 @@ | |
opacity: 0; | ||
margin-top: -2px; | ||
} | ||
.open-search-tips:hover { | ||
text-decoration: underline; | ||
} | ||
} | ||
} | ||
} |
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