feat(apis): ajout champs de documentation enrichie sur les API entries
- Nouveaux champs : functionalDoc, technicalDoc, externalDocUrl, contactFunctional, contactTechnical, accessRights - Entity, DTOs, service et seeder mis à jour côté backend - Page upload et api-detail mis à jour côté frontend Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -111,6 +111,81 @@ import { ApiEntry } from '@datacat/shared';
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Documentation fonctionnelle -->
|
||||
@if (entry.functionalDoc) {
|
||||
<div class="fr-card fr-mb-4w">
|
||||
<div class="fr-card__body">
|
||||
<div class="fr-card__content">
|
||||
<h2 class="fr-h5 fr-mb-2w">Documentation fonctionnelle</h2>
|
||||
<p style="white-space: pre-wrap">{{ entry.functionalDoc }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<!-- Documentation technique -->
|
||||
@if (entry.technicalDoc) {
|
||||
<div class="fr-card fr-mb-4w">
|
||||
<div class="fr-card__body">
|
||||
<div class="fr-card__content">
|
||||
<h2 class="fr-h5 fr-mb-2w">Documentation technique</h2>
|
||||
<p style="white-space: pre-wrap">{{ entry.technicalDoc }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<!-- Contacts -->
|
||||
@if (entry.contactFunctional || entry.contactTechnical) {
|
||||
<div class="fr-card fr-mb-4w">
|
||||
<div class="fr-card__body">
|
||||
<div class="fr-card__content">
|
||||
<h2 class="fr-h5 fr-mb-2w">Contacts</h2>
|
||||
<dl class="fr-grid-row fr-grid-row--gutters">
|
||||
@if (entry.contactFunctional) {
|
||||
<div class="fr-col-12 fr-col-md-6">
|
||||
<dt class="fr-text--bold">Contact fonctionnel</dt>
|
||||
<dd>{{ entry.contactFunctional }}</dd>
|
||||
</div>
|
||||
}
|
||||
@if (entry.contactTechnical) {
|
||||
<div class="fr-col-12 fr-col-md-6">
|
||||
<dt class="fr-text--bold">Contact technique</dt>
|
||||
<dd>{{ entry.contactTechnical }}</dd>
|
||||
</div>
|
||||
}
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<!-- Droits d'accès -->
|
||||
@if (entry.accessRights) {
|
||||
<div class="fr-card fr-mb-4w">
|
||||
<div class="fr-card__body">
|
||||
<div class="fr-card__content">
|
||||
<h2 class="fr-h5 fr-mb-2w">Droits d'accès</h2>
|
||||
<p style="white-space: pre-wrap">{{ entry.accessRights }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<!-- Documentation externe -->
|
||||
@if (entry.externalDocUrl) {
|
||||
<div class="fr-mb-4w">
|
||||
<a
|
||||
[href]="entry.externalDocUrl"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="fr-btn fr-btn--secondary fr-icon-external-link-line fr-btn--icon-left"
|
||||
>
|
||||
Documentation externe
|
||||
</a>
|
||||
</div>
|
||||
}
|
||||
|
||||
<!-- Actions -->
|
||||
<div class="fr-btns-group fr-btns-group--inline-sm">
|
||||
<a
|
||||
|
||||
@@ -158,7 +158,7 @@ import { Category } from '@datacat/shared';
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="fr-input-group fr-mb-4w">
|
||||
<div class="fr-input-group fr-mb-3w">
|
||||
<label class="fr-label" for="description-input">
|
||||
Description <span class="fr-hint-text">Optionnel</span>
|
||||
</label>
|
||||
@@ -171,6 +171,84 @@ import { Category } from '@datacat/shared';
|
||||
></textarea>
|
||||
</div>
|
||||
|
||||
<div class="fr-input-group fr-mb-3w">
|
||||
<label class="fr-label" for="functional-doc-input">
|
||||
Documentation fonctionnelle <span class="fr-hint-text">Optionnel</span>
|
||||
</label>
|
||||
<textarea
|
||||
id="functional-doc-input"
|
||||
class="fr-input"
|
||||
formControlName="functionalDoc"
|
||||
rows="4"
|
||||
placeholder="Cas d'usage, contexte métier..."
|
||||
></textarea>
|
||||
</div>
|
||||
|
||||
<div class="fr-input-group fr-mb-3w">
|
||||
<label class="fr-label" for="technical-doc-input">
|
||||
Documentation technique <span class="fr-hint-text">Optionnel</span>
|
||||
</label>
|
||||
<textarea
|
||||
id="technical-doc-input"
|
||||
class="fr-input"
|
||||
formControlName="technicalDoc"
|
||||
rows="4"
|
||||
placeholder="Guide d'intégration technique..."
|
||||
></textarea>
|
||||
</div>
|
||||
|
||||
<div class="fr-input-group fr-mb-3w">
|
||||
<label class="fr-label" for="external-doc-url-input">
|
||||
URL documentation externe <span class="fr-hint-text">Optionnel</span>
|
||||
</label>
|
||||
<input
|
||||
id="external-doc-url-input"
|
||||
class="fr-input"
|
||||
formControlName="externalDocUrl"
|
||||
type="text"
|
||||
placeholder="https://..."
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="fr-input-group fr-mb-3w">
|
||||
<label class="fr-label" for="contact-functional-input">
|
||||
Contact fonctionnel <span class="fr-hint-text">Optionnel</span>
|
||||
</label>
|
||||
<input
|
||||
id="contact-functional-input"
|
||||
class="fr-input"
|
||||
formControlName="contactFunctional"
|
||||
type="text"
|
||||
placeholder="Nom, email, téléphone..."
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="fr-input-group fr-mb-3w">
|
||||
<label class="fr-label" for="contact-technical-input">
|
||||
Contact technique <span class="fr-hint-text">Optionnel</span>
|
||||
</label>
|
||||
<input
|
||||
id="contact-technical-input"
|
||||
class="fr-input"
|
||||
formControlName="contactTechnical"
|
||||
type="text"
|
||||
placeholder="Nom, email, téléphone..."
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="fr-input-group fr-mb-4w">
|
||||
<label class="fr-label" for="access-rights-input">
|
||||
Droits d'accès <span class="fr-hint-text">Optionnel</span>
|
||||
</label>
|
||||
<textarea
|
||||
id="access-rights-input"
|
||||
class="fr-input"
|
||||
formControlName="accessRights"
|
||||
rows="3"
|
||||
placeholder="Processus d'habilitation, conditions d'accès..."
|
||||
></textarea>
|
||||
</div>
|
||||
|
||||
<div class="fr-btns-group fr-btns-group--inline-sm">
|
||||
<button type="submit" class="fr-btn" [disabled]="metaForm.invalid">Suivant</button>
|
||||
<button type="button" class="fr-btn fr-btn--secondary" (click)="step.set(1)">
|
||||
@@ -283,6 +361,12 @@ export class UploadComponent implements OnInit {
|
||||
type: ['ASYNCAPI', Validators.required],
|
||||
categoryId: [''],
|
||||
description: [''],
|
||||
functionalDoc: [''],
|
||||
technicalDoc: [''],
|
||||
externalDocUrl: [''],
|
||||
contactFunctional: [''],
|
||||
contactTechnical: [''],
|
||||
accessRights: [''],
|
||||
});
|
||||
|
||||
titleInvalid = computed(
|
||||
@@ -374,6 +458,24 @@ export class UploadComponent implements OnInit {
|
||||
if (this.metaForm.value.description) {
|
||||
formData.append('description', this.metaForm.value.description);
|
||||
}
|
||||
if (this.metaForm.value.functionalDoc) {
|
||||
formData.append('functionalDoc', this.metaForm.value.functionalDoc);
|
||||
}
|
||||
if (this.metaForm.value.technicalDoc) {
|
||||
formData.append('technicalDoc', this.metaForm.value.technicalDoc);
|
||||
}
|
||||
if (this.metaForm.value.externalDocUrl) {
|
||||
formData.append('externalDocUrl', this.metaForm.value.externalDocUrl);
|
||||
}
|
||||
if (this.metaForm.value.contactFunctional) {
|
||||
formData.append('contactFunctional', this.metaForm.value.contactFunctional);
|
||||
}
|
||||
if (this.metaForm.value.contactTechnical) {
|
||||
formData.append('contactTechnical', this.metaForm.value.contactTechnical);
|
||||
}
|
||||
if (this.metaForm.value.accessRights) {
|
||||
formData.append('accessRights', this.metaForm.value.accessRights);
|
||||
}
|
||||
|
||||
this.apiService.upload(formData).subscribe({
|
||||
next: (entry) => {
|
||||
|
||||
Reference in New Issue
Block a user