-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
editor: add a typeahead component #236
Conversation
52297f9
to
6a0c872
Compare
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { RemoteTypeaheadComponent } from './remote-typeahead.component'; | ||
import { RecordModule } from '../../record.module'; | ||
import { CoreModule } from '../../../core.module'; | ||
import { HttpClientTestingModule } from '@angular/common/http/testing'; | ||
import { TranslateModule } from '@ngx-translate/core'; | ||
import { ReactiveFormsModule } from '@angular/forms'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imports are not sorted
get groupField(): string | null { | ||
const enableGF = this._remoteTypeaheadService.enableGroupField(this._rtOptions); | ||
return enableGF ? 'group' : null; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getter should be placed after ngOn*
methods
import { TestBed } from '@angular/core/testing'; | ||
|
||
import { RemoteTypeaheadService } from './remote-typeahead.service'; | ||
import { RecordService } from '../../record.service'; | ||
import { ApiService } from '../../../api/api.service'; | ||
import { HttpClientTestingModule } from '@angular/common/http/testing'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imports are not sorted.
if (!query) { | ||
return of([]); | ||
} | ||
const apiQuery = `${options.field}:${query}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String could be used directly used in getRecords
instead of storing it in a const.
2e3f65b
to
08b1596
Compare
2d2994f
to
87b465c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit message approved.
But a change requested in the license header of a file.
RERO angular core | ||
Copyright (C) 2020 RERO | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published by | ||
the Free Software Foundation, version 3 of the License. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird blank char to be removed.
* Adds a new typeahead component to be able to search a list of suggestion using the backend. Co-Authored-by: Johnny Mariéthoz <Johnny.Mariethoz@rero.ch> Co-Authored-by: Bertrand Zuchuat <bertrand.zuchuat@rero.ch> Co-Authored-by: Renaud Michotte <renaud.michotte@gmail.com>
using the backend.
Co-Authored-by: Johnny Mariéthoz Johnny.Mariethoz@rero.ch
Co-Authored-by: Bertrand Zuchuat bertrand.zuchuat@rero.ch
Co-Authored-by: Renaud Michotte renaud.michotte@gmail.com
Why are you opening this PR?
How to test?
Code review check list