-
Notifications
You must be signed in to change notification settings - Fork 32
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
create api card and form to request Ign download api #989
base: main
Are you sure you want to change the base?
Conversation
Hi @mmohadIGN, sorry for the late reply but the team is currently busy working on a first version of the Metadata Editor app, so we simply don't have the bandwidth to look into this PR. Is this OK if the review happens later in October? Thanks |
Hi @jahow, it's fine, no problem. |
|
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.
Thanks @mmohadIGN for this contribution and sorry for the delayed review! I haven't tested the feature yet, but the screenshots look good already! :)
There are some minor issues that I think should be addressed.
Also it would be great if we could make the components more generic to fit in this project instead of specifically mentioning IGN. What do you think about this?
Let me know if anything is unclear!
apps/datahub/src/app/app.module.ts
Outdated
@@ -162,6 +166,7 @@ export const metaReducers: MetaReducer[] = !environment.production ? [] : [] | |||
UiWidgetsModule, | |||
RecordMetaComponent, | |||
LetDirective, | |||
MatButtonToggleModule, |
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.
Is this really needed here? I don't see it being used.
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.
No, you're right. I removed it
@@ -36,9 +36,20 @@ | |||
<div class="bg-primary-opacity-10 py-8"> | |||
<div class="flex flex-col px-4 gap-8 container-lg lg:mx-auto"> | |||
<div class="flex flex-wrap justify-between sm:mb-2 ng-star-inserted"> | |||
<p class="text-[21px] text-title font-title" translate> | |||
<p |
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.
It looks like the two paragraphs (line 39 -52) are the same except of their text content. Instead of repeating, you could use one paragraph, like so:
<p | |
<p | |
class="text-[21px] text-title font-title" | |
*ngIf="selectedApiLink?.accessServiceProtocol" | |
translate | |
> | |
{{ selectedApiLink?.accessServiceProtocol === 'GPFDL' | |
? 'record.metadata.api.form.title.gpf' | |
: 'record.metadata.api.form.title' }} | |
</p> |
If we would have to change the paragraph in the future, we would only have to do that in one place :)
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.
Yes, you're right. I have done it.
@@ -57,7 +68,13 @@ | |||
</ng-icon> | |||
</button> | |||
</div> | |||
|
|||
<gn-ui-ign-api-dl |
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.
The name of this component gn-ui-ign-api-dl
is really specific to IGN. Would there be a way to make the component more generic (maybe reflecting the format it is using?)?
Maybe @jahow has a good idea about it.
|
||
:host ::ng-deep gn-ui-copy-text-button button, | ||
host ::ng-deep gn-ui-copy-text-button button:hover { | ||
background-color: var(--color-secondary) !important; |
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.
Is there a way to achieve this without using !important
?
</div> | ||
<div class="flex flex-row flex-wrap justify-between flex-grow gap-5"> | ||
<div class="flex flex-col gap-3"> | ||
<!--<p class="text-sm" translate>record.metadata.api.form.type</p>--> |
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.
Is this still needed as it is commented out?
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.
No, you're right. I removed them.
|
||
listFilteredProduct$ = this.apiQueryUrl$.pipe( | ||
mergeMap((url) => { | ||
console.log(url) |
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.
console.log ;-)
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.
done :)
} | ||
return outputUrl | ||
}) | ||
// startWith(() => this.apiBaseUrl) |
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.
Is this still relevant? See also line 126 and 180.
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.
No, I removed it too.
return choicesTest | ||
} | ||
async getFields() { | ||
this.choices = await this.getCapabilities() |
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.
I see a lot of repetition in this part of the code. But maybe I don't understand the logic behind it.
@jahow could we simplify this?
<div *ngFor="let entry of liste$ | async"> | ||
<a [href]="entry['link'][0]['href']" | ||
>{{ entry['link'][0]['href'].split('/').slice(-1) }} | ||
<mat-icon |
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.
Sorry, we updated our icon library in the meantime and use <ng-icon>
now.
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.
Yes, I made the change.
@@ -75,6 +76,8 @@ export class RecordApisComponent implements OnInit { | |||
} | |||
|
|||
openRecordApiForm(link: DatasetServiceDistribution) { | |||
this.displayApiIgnForm = |
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.
This could be simpliefied, as the expression already evaluates to a boolean.
this.displayApiIgnForm = | |
this.displayApiIgnForm = link.accessServiceProtocol === 'GPFDL'; |
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.
Yes, you're right. I made the change.
Hi, No problem. Thanks! |
Hello @mmohadIGN, thank you for your patience and thanks for addressing the comments! I tried to test the new functionality locally and realized that some of the logic interferes with already existing logic of the "Downloads"-section. As a result, some of the downloads now appear in the "API"-section that were in the "Downloads"-section before. For those download resources, there is now the logic available that you created for the IGN downloads, but they don't provide this functionality (see Screenshot): Therefore I have some questions:
In the meantime, maybe you can adjust the placing of the button ("reset") and text ("create your request") above the dropdowns a bit? But it could look like the other API form (record-api-form.component): Additionally my team had an idea about making the naming more generic: Could you please change the name of the components that contain Let me know if you have any questions. |
Hello @Angi-Kinas, I made the style change you request and rename the file. |
Description
This PR introduces a new component designed to create an API card for requesting the IGN download API. The component simplifies the integration process by providing a form to interact with the IGN download API.
Architectural changes
Screenshots
Quality Assurance Checklist
breaking change
labelbackport <release branch>
labelDetails issues #766