Skip to content

Commit

Permalink
Extend duplicate check when creating new seed (#345)
Browse files Browse the repository at this point in the history
* Functions for removing duplicates from input should include url without schema.
  • Loading branch information
andrbo authored May 6, 2022
1 parent e9bfa84 commit e00746a
Show file tree
Hide file tree
Showing 6 changed files with 384 additions and 89 deletions.
40 changes: 20 additions & 20 deletions src/modules/config/components/seed-meta/seed-meta.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,26 @@
<mat-progress-bar matHint mode="indeterminate" *ngIf="this.name.pending"></mat-progress-bar>
</mat-form-field>

<mat-action-list *ngIf="name.hasError('seedExistsOnEntity')" dense>
<button mat-list-item
*ngIf="name.errors.seedExistsOnEntity?.length > 1"
(click)="onRemoveExistingUrls(name.errors.seedExistsOnEntity)">
<mat-icon mat-list-icon>remove_circle</mat-icon>
<span i18n="@@seedMetaRemoveAlreadyExistingSeedsButton">Remove all from list</span>
</button>

<button mat-list-item
*ngFor="let seed of name.errors.seedExistsOnEntity"
(click)="onRemoveExistingUrl(seed)"
matTooltip="Remove url from list" i18n-matTooltip="@@seedMetaRemoveSeedFromListTooltip">
<mat-icon mat-list-icon>remove_circle_outline</mat-icon>
{{seed.meta.name}}
</button>

<mat-action-list *ngIf="name.hasError('seedExistsOnEntity')" dense data-testid="seedExistsOnEntityList">
<button mat-list-item
*ngIf="name.errors.seedExistsOnEntity?.length > 1"
(click)="onRemoveExistingUrls(name.errors.seedExistsOnEntity)">
<mat-icon mat-list-icon>remove_circle</mat-icon>
<span i18n="@@seedMetaRemoveAlreadyExistingSeedsButton">Remove all from list</span>
</button>

</mat-action-list>
<button mat-list-item
*ngFor="let seed of name.errors.seedExistsOnEntity"
(click)="onRemoveExistingUrl(seed)"
matTooltip="Remove url from list" i18n-matTooltip="@@seedMetaRemoveSeedFromListTooltip">
<mat-icon mat-list-icon>remove_circle_outline</mat-icon>
{{seed.meta.name}}
</button>
</mat-action-list>

<mat-list *ngIf="name.hasError('seedExists') && entityRef.id">
<mat-list *ngIf="name.hasError('seedExists') && entityRef.id" data-testid="seedExistsList">
<mat-list-item *ngIf="name.errors.seedExists.length">
<button mat-stroked-button
<button mat-stroked-button data-testid="moveAllExistingSeedsToCurrentEntity"
(click)="onMoveSeedsToCurrentEntity(name.errors.seedExists)">
<mat-icon mat-list-icon>swap_vert</mat-icon>
<span i18n="@@seedMetaMoveAllExistingSeedsToEntityButton">Move all to this entity</span>
Expand All @@ -69,7 +67,9 @@
<button mat-icon-button
(click)="onMoveSeedToCurrentEntity(seed)"
matTooltip="Move seed to this entity"
i18n-matTooltip="@@seedMetaMoveExistingSeedToEntityButtonTooltip">
i18n-matTooltip="@@seedMetaMoveExistingSeedToEntityButtonTooltip"
data-testid="seedExistsListMoveSeedToEntityButton"
>
<mat-icon mat-list-icon>swap_horiz</mat-icon>
</button>

Expand Down
Loading

0 comments on commit e00746a

Please sign in to comment.