Skip to content
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

Merged
merged 1 commit into from
Aug 18, 2020
Merged

Conversation

jma
Copy link
Contributor

@jma jma commented Aug 13, 2020

  • 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

Why are you opening this PR?

  • Which task/US does it implement?
  • Which issue does it fix?

How to test?

  • What command should I have to run to test your PR?
  • What should I test through the UI?

Code review check list

  • Commit message template compliance.
  • Commit message without typos.
  • File names.
  • Functions names.
  • Functions docstrings.
  • Unnecessary commited files?
  • Extracted translations?

@jma jma force-pushed the maj-autocomplete branch 3 times, most recently from 52297f9 to 6a0c872 Compare August 13, 2020 09:04
@jma jma marked this pull request as ready for review August 17, 2020 07:26
@jma jma requested a review from sebdeleze August 17, 2020 07:26
Comment on lines 18 to 20
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';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imports are not sorted

Comment on lines 48 to 51
get groupField(): string | null {
const enableGF = this._remoteTypeaheadService.enableGroupField(this._rtOptions);
return enableGF ? 'group' : null;
}

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

Comment on lines 18 to 23
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';

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}`;

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.

@jma jma force-pushed the maj-autocomplete branch 2 times, most recently from 2e3f65b to 08b1596 Compare August 17, 2020 13:07
@jma jma requested a review from sebdeleze August 17, 2020 13:08
@jma jma force-pushed the maj-autocomplete branch 2 times, most recently from 2d2994f to 87b465c Compare August 17, 2020 14:29
Copy link

@iGormilhit iGormilhit left a 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.

Comment on lines 2 to 15
 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/>.

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.

@iGormilhit iGormilhit added this to the v0.12.0 (rero-ils) milestone Aug 18, 2020
@iGormilhit iGormilhit added the f: editor Concerns editor based on JSON schema AND custom editor label Aug 18, 2020
* 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>
@sebdeleze sebdeleze merged commit 1490994 into rero:dev Aug 18, 2020
@jma jma deleted the maj-autocomplete branch December 13, 2021 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
f: editor Concerns editor based on JSON schema AND custom editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants