Skip to content

Commit

Permalink
Merge pull request #961 from geonetwork/ME/fix-rich-text-preview-over…
Browse files Browse the repository at this point in the history
…flow

ME: rework markdown parser display to be more generic
  • Loading branch information
LHBruneton-C2C authored Aug 13, 2024
2 parents e079151 + b836a6f commit caf9e4e
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div id="organization-details-left" class="w-2/3 mt-14">
<div class="flex flex-col gap-11">
<gn-ui-max-lines [maxLines]="2" *ngIf="organization.description">
<div>
<div class="mb-6">
<gn-ui-markdown-parser
data-test="organizationDescription"
[textContent]="organization.description"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<div class="h-full flex flex-col">
<p class="flex-none mb-2 font-medium text-sm text-gray-900">
<p
*ngIf="helperText"
class="flex-none mb-2 font-medium text-sm text-gray-900"
>
{{ helperText }}
</p>
<div class="flex-1" [hidden]="preview">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
:host ::ng-deep .markdown-body {
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
margin: 0px 0px 1.5rem 0px;
margin: 0;
line-height: 1.5;
word-wrap: break-word;
height: 100%;
}

/** Emphasis **/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="mb-6 md-description sm:mb-4 sm:pr-16">
<gn-ui-content-ghost ghostClass="h-32" [showContent]="fieldReady('abstract')">
<gn-ui-max-lines [maxLines]="6" *ngIf="metadata.abstract">
<div>
<div class="mb-6">
<gn-ui-markdown-parser
[textContent]="metadata.abstract"
></gn-ui-markdown-parser>
Expand Down Expand Up @@ -47,19 +47,23 @@
</ng-template>
</ng-container>
<ng-container *ngIf="legalConstraints.length">
<gn-ui-markdown-parser
*ngFor="let constraint of legalConstraints"
[textContent]="constraint"
>
</gn-ui-markdown-parser>
<div class="mb-6">
<gn-ui-markdown-parser
*ngFor="let constraint of legalConstraints"
[textContent]="constraint"
>
</gn-ui-markdown-parser>
</div>
</ng-container>
<ng-container *ngIf="otherConstraints.length">
<div gnUiLinkify *ngFor="let constraint of otherConstraints">
<h5 translate class="font-medium text-black text-sm mb-[2px] mt-[16px]">
record.metadata.otherConstraints
</h5>
<gn-ui-markdown-parser [textContent]="constraint">
</gn-ui-markdown-parser>
<div class="mb-6">
<gn-ui-markdown-parser [textContent]="constraint">
</gn-ui-markdown-parser>
</div>
</div>
</ng-container>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</span>
</div>
</div>
<div class="flex-1">
<div class="flex-1 overflow-y-auto">
<ng-content></ng-content>
</div>
</div>

0 comments on commit caf9e4e

Please sign in to comment.