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

Organisation preview component #284

Merged
merged 4 commits into from
Jul 5, 2022

Conversation

akhelouat
Copy link
Contributor

Added organization preview component GSHDF-550

image

Copy link
Member

@fgravin fgravin left a comment

Choose a reason for hiding this comment

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

Thank you, good start.
Some details to be sure the layout has a fixed sized, it should not depend on the content.
The story is not available cause the storybook configuration only include stories in the /lib folder.

Thanks for the work I will take over it now.

@Input() logo: string
@Input() nRecords: number

constructor() {}
Copy link
Member

Choose a reason for hiding this comment

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

lint error even appear in there
you forgot npm run lint :)

changeDetection: ChangeDetectionStrategy.OnPush,
})
export class OrganizationPreviewDatahubComponent {
@Input() title: string
Copy link
Member

Choose a reason for hiding this comment

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

It's preferable to create a model for this.
Probably in the shared lib.

@Input() title: string
@Input() description: string
@Input() logo: string
@Input() nRecords: number
Copy link
Member

Choose a reason for hiding this comment

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

recordCount instead.

<div
class="border p-3 rounded-lg my-2 w-full h-48 flex justify-center items-center my-3"
>
<img [src]="logo" alt="title" />
Copy link
Member

Choose a reason for hiding this comment

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

Should not work does it ?

Suggested change
<img [src]="logo" alt="title" />
<img [src]="logo" [alt]="title" />

<div class="px-3 capitalize">
<span class="font-bold my-2 text-lg"> {{ title }}</span>
<p class="text-gray-800 my-2">{{ description }}</p>
<button
Copy link
Member

Choose a reason for hiding this comment

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

Remove the button (comment it maybe), the follow and favorite things are not implemented.

moduleMetadata({
imports: [
BrowserAnimationsModule,
HttpClientModule,
Copy link
Member

Choose a reason for hiding this comment

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

I think it's useless

import { OrganizationPreviewDatahubComponent } from './organization-preview-datahub.component'
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'

export default {
Copy link
Member

Choose a reason for hiding this comment

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

your story is not available in storybook

</div>
<div class="px-3 capitalize">
<span class="font-bold my-2 text-lg"> {{ title }}</span>
<p class="text-gray-800 my-2">{{ description }}</p>
Copy link
Member

Choose a reason for hiding this comment

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

I don't see the clamp thing ?
What happens if the text is very long ? Should be cropped

<img [src]="logo" alt="title" />
</div>
<div class="px-3 capitalize">
<span class="font-bold my-2 text-lg"> {{ title }}</span>
Copy link
Member

Choose a reason for hiding this comment

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

Should be cropped if too long

@fgravin fgravin changed the title Organization preview component Organisation preview component Jul 4, 2022
@fgravin fgravin requested a review from tkohr July 4, 2022 19:05
Copy link
Collaborator

@tkohr tkohr left a comment

Choose a reason for hiding this comment

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

LGTM, just left some comments. Thanks @akhelouat @fgravin !

Comment on lines +10 to +13
@Input() title: string
@Input() description: string
@Input() logo: string
@Input() nRecords: number
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe create model and rename nRecords as suggested earlier ?

Copy link
Member

Choose a reason for hiding this comment

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

Yes but you create an Organisation model in your PR no ?

BrowserAnimationsModule,
HttpClientModule,
MatIconModule,
TranslateModule.forRoot(TRANSLATE_DEFAULT_CONFIG),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Import UtilSharedModule as well (I get The pipe 'safe' could not be found in the 'RecordThumbnailComponent' error)

<div class="text-primary opacity-25 flex leading-6">
<mat-icon class="text-primary opacity-25 mr-1">folder_open </mat-icon>
<span class="mx-1">{{ nRecords }}</span>
<span translate>record.metadata.publications</span>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could be cropped as well to be sure it does not break the design, even though it shouldn't, regarding its expected length.

Copy link
Member

Choose a reason for hiding this comment

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

I think it's fine, the translation should not be long, and it's meant to be on the same line

@fgravin
Copy link
Member

fgravin commented Jul 5, 2022

@tkohr thanks for the review. I fixed the story.
For the model, let's merge this one when the CI is ok.
Then integrate this component within your work on #283 and adapt the model.
Thanks
Great job

@sonarcloud
Copy link

sonarcloud bot commented Jul 5, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.5% 0.5% Duplication

@tkohr tkohr merged commit 83eacb7 into geonetwork:master Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants