-
Notifications
You must be signed in to change notification settings - Fork 0
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 #8 from camptocamp/favorite-card
feat(DH): Add favorite card
- Loading branch information
Showing
11 changed files
with
179 additions
and
25 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
32 changes: 32 additions & 0 deletions
32
apps/datahub/src/app/common/metadata-quality/mel-datahub-metadata-quality.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,32 @@ | ||
@if(metadataQualityDisplay){ | ||
<div | ||
class="flex metadata-quality" | ||
(mouseenter)="showMenu()" | ||
(mouseleave)="hideMenu()" | ||
> | ||
<div class="flex gap-1 items-center"> | ||
<div class="flex h-[8px] w-[56px] bg-gray-6 rounded-t-lg rounded-b-lg"> | ||
<div | ||
[style.width.%]="qualityScore" | ||
class="flex bg-primary transition-width duration-500 ease-in-out rounded-t-md rounded-b-md shadow-xl" | ||
></div> | ||
</div> | ||
<span class="text-[12px] font-bold">{{ | ||
(qualityScore / 10).toFixed(1) | ||
}}</span> | ||
<img [src]="'/assets/info.svg'" [alt]="'info'" /> | ||
</div> | ||
|
||
<div | ||
class="absolute z-10 bg-white border border-black border-opacity-35 rounded-lg shadow-lg p-5 whitespace-nowrap" | ||
[class]="isMenuShown ? 'block' : 'hidden'" | ||
> | ||
<div class="mb-4 font-bold" translate>record.metadata.quality.details</div> | ||
@for(e of items; track e.name){<gn-ui-metadata-quality-item | ||
[name]="e.name" | ||
[value]="e.value" | ||
></gn-ui-metadata-quality-item | ||
>} | ||
</div> | ||
</div> | ||
} |
10 changes: 10 additions & 0 deletions
10
apps/datahub/src/app/common/metadata-quality/mel-datahub-metadata-quality.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,10 @@ | ||
import { ChangeDetectionStrategy, Component } from '@angular/core' | ||
import { MetadataQualityComponent } from 'geonetwork-ui' | ||
|
||
@Component({ | ||
selector: 'mel-datahub-mel-datahub-metadata-quality', | ||
templateUrl: './mel-datahub-metadata-quality.component.html', | ||
styles: ``, | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class MelDatahubMetadataQualityComponent extends MetadataQualityComponent {} |
55 changes: 40 additions & 15 deletions
55
...c/app/common/results-list-item/results-card-favorite/results-card-favorite.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 |
---|---|---|
@@ -1,16 +1,41 @@ | ||
<div | ||
class="h-full border bg-green-200 rounded-sm overflow-hidden transition duration-200 transform hover:scale-105 hover:bg-gray-50 border-gray-300 hover:border-primary hover:text-primary" | ||
> | ||
<a [title]="record.abstract" (click)="mdSelect.emit(record)"> | ||
<div class="flex flex-col min-h-full cursor-pointer"> | ||
<div class="grow p-4"> | ||
<h1 class="title-font text-lg font-medium mb-3 clamp-2"> | ||
{{ record.title }} | ||
</h1> | ||
<p class="leading-relaxed text-sm text-gray-700 clamp-3"> | ||
{{ record.abstract }} | ||
</p> | ||
</div> | ||
<a | ||
[title]="record.title" | ||
[tabIndex]="0" | ||
(click)="mdSelect.emit(record)" | ||
(keyup.enter)="mdSelect.emit(record)" | ||
class="bg-gray-8 group flex flex-col gap-[9px] justify-between h-[110px] py-3 px-4 w-[330px] rounded-lg border border-gray-6 filter hover:drop-shadow-lg z-0" | ||
><div class="flex justify-between"> | ||
<h1 class="font-bold text-[17px] line-clamp-1"> | ||
{{ record.title }} | ||
</h1> | ||
</div> | ||
|
||
<div class="flex flex-col justify-between"> | ||
@if(record.keywords?.length) { | ||
<div class="flex gap-1"> | ||
@for(keyword of record.keywords.slice(0, 2); track | ||
record?.uniqueIdentifier){<button | ||
type="button" | ||
[attr.aria-label]="keyword" | ||
[title]="keyword" | ||
class="mel-badge-button truncate" | ||
(click)="onKeywordClick(keyword, $event)" | ||
(keyup.enter)="$event.stopPropagation()" | ||
> | ||
{{ keyword }}</button | ||
>} | ||
</div> | ||
</a> | ||
</div> | ||
} | ||
</div> | ||
<div class="flex items-center gap-1"> | ||
<div class="basis-1/2 text-[12px] font-semibold"> | ||
<span translate>record.metadata.quality</span> | ||
<span> :</span> | ||
</div> | ||
<mel-datahub-mel-datahub-metadata-quality | ||
[metadata]="record" | ||
[metadataQualityDisplay]="true" | ||
[smaller]="true" | ||
></mel-datahub-mel-datahub-metadata-quality> | ||
</div> | ||
</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
3 changes: 2 additions & 1 deletion
3
...ub/src/app/common/results-list/results-list-carousel/results-list-carousel.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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.