-
Notifications
You must be signed in to change notification settings - Fork 32
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 #1052 from geonetwork/ME-no-attachement-upload-to-…
…draft-only Editor: No attachement upload to draft only
- Loading branch information
Showing
30 changed files
with
295 additions
and
148 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
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
96 changes: 55 additions & 41 deletions
96
...rm-field/form-field-online-link-resources/form-field-online-link-resources.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,44 +1,58 @@ | ||
<gn-ui-file-input | ||
[maxSizeMB]="MAX_UPLOAD_SIZE_MB" | ||
(fileChange)="handleFileChange($event)" | ||
(uploadCancel)="handleUploadCancel()" | ||
[uploadProgress]="uploadProgress" | ||
(urlChange)="handleUrlChange($event)" | ||
></gn-ui-file-input> | ||
<div class="h-[8px]"></div> | ||
<gn-ui-sortable-list | ||
[items]="linkResources" | ||
(itemsOrderChange)="handleResourcesChange($event)" | ||
[elementTemplate]="template" | ||
> | ||
</gn-ui-sortable-list> | ||
<ng-template #template let-onlineResource let-index="index"> | ||
<gn-ui-online-resource-card | ||
[onlineResource]="onlineResource" | ||
(modifyClick)="handleResourceModify(onlineResource, index)" | ||
></gn-ui-online-resource-card> | ||
</ng-template> | ||
<div class="flex flex-col"> | ||
<gn-ui-file-input | ||
[maxSizeMB]="MAX_UPLOAD_SIZE_MB" | ||
(fileChange)="handleFileChange($event)" | ||
(uploadCancel)="handleUploadCancel()" | ||
[uploadProgress]="uploadProgress" | ||
(urlChange)="handleUrlChange($event)" | ||
[disabled]="disabled$ | async" | ||
></gn-ui-file-input> | ||
<div class="h-[8px]"></div> | ||
<gn-ui-sortable-list | ||
[items]="linkResources" | ||
(itemsOrderChange)="handleResourcesChange($event)" | ||
[elementTemplate]="template" | ||
> | ||
</gn-ui-sortable-list> | ||
<ng-template #template let-onlineResource let-index="index"> | ||
<gn-ui-online-resource-card | ||
[onlineResource]="onlineResource" | ||
(modifyClick)="handleResourceModify(onlineResource, index)" | ||
></gn-ui-online-resource-card> | ||
</ng-template> | ||
|
||
<ng-template #dialogTemplate let-onlineResource> | ||
<div class="flex flex-col gap-[16px]"> | ||
<div> | ||
<h3 class="text-[16px] font-bold text-main mb-[12px]" translate> | ||
editor.record.form.field.onlineResource.edit.title | ||
</h3> | ||
<gn-ui-text-input [(value)]="onlineResource.name"></gn-ui-text-input> | ||
<ng-template #dialogTemplate let-onlineResource> | ||
<div class="flex flex-col gap-[16px]"> | ||
<div> | ||
<h3 class="text-[16px] font-bold text-main mb-[12px]" translate> | ||
editor.record.form.field.onlineResource.edit.title | ||
</h3> | ||
<gn-ui-text-input [(value)]="onlineResource.name"></gn-ui-text-input> | ||
</div> | ||
<div> | ||
<h3 class="text-[16px] font-bold text-main mb-[12px]" translate> | ||
editor.record.form.field.onlineResource.edit.description | ||
</h3> | ||
<gn-ui-text-area | ||
[(value)]="onlineResource.description" | ||
></gn-ui-text-area> | ||
</div> | ||
<span class="w-full border-b border-gray-300"></span> | ||
<gn-ui-url-input | ||
class="w-full" | ||
[disabled]="true" | ||
[value]="onlineResource.url" | ||
[showUploadButton]="false" | ||
[disabled]="disabled$ | async" | ||
></gn-ui-url-input> | ||
</div> | ||
<div> | ||
<h3 class="text-[16px] font-bold text-main mb-[12px]" translate> | ||
editor.record.form.field.onlineResource.edit.description | ||
</h3> | ||
<gn-ui-text-area [(value)]="onlineResource.description"></gn-ui-text-area> | ||
</div> | ||
<span class="w-full border-b border-gray-300"></span> | ||
<gn-ui-url-input | ||
class="w-full" | ||
[disabled]="true" | ||
[value]="onlineResource.url" | ||
[showUploadButton]="false" | ||
></gn-ui-url-input> | ||
</ng-template> | ||
<div | ||
*ngIf="disabled$ | async" | ||
class="p-4 text-sm border border-primary bg-primary-lightest rounded-lg" | ||
translate | ||
data-testid="disabled-message" | ||
> | ||
editor.record.form.field.draft.only.disabled | ||
</div> | ||
</ng-template> | ||
</div> |
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
150 changes: 83 additions & 67 deletions
150
...rd-form/form-field/form-field-online-resources/form-field-online-resources.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,72 +1,88 @@ | ||
<gn-ui-switch-toggle | ||
[options]="typeOptions" | ||
(selectedValue)="onSelectedTypeChange($event.value)" | ||
extraClasses="grow text-sm" | ||
data-cy="online-resources-type" | ||
></gn-ui-switch-toggle> | ||
<div class="h-[8px]"></div> | ||
<gn-ui-file-input | ||
*ngIf="selectedType === 'download'" | ||
[maxSizeMB]="MAX_UPLOAD_SIZE_MB" | ||
(fileChange)="handleFileChange($event)" | ||
(uploadCancel)="handleUploadCancel()" | ||
[uploadProgress]="uploadProgress" | ||
(urlChange)="handleDownloadUrlChange($event)" | ||
></gn-ui-file-input> | ||
<div | ||
*ngIf="selectedType === 'service'" | ||
class="w-full border-2 border-dashed rounded-lg p-6 flex flex-col gap-[16px]" | ||
> | ||
<gn-ui-online-service-resource-input | ||
[service]="newService" | ||
></gn-ui-online-service-resource-input> | ||
<span class="w-full border-b border-gray-300"></span> | ||
<gn-ui-url-input | ||
class="w-full" | ||
[urlCanParse]="true" | ||
(uploadClick)="handleServiceUrlChange($event)" | ||
></gn-ui-url-input> | ||
</div> | ||
<div class="h-[8px]"></div> | ||
<gn-ui-sortable-list | ||
[items]="notLinkResources" | ||
(itemsOrderChange)="handleResourcesChange($event)" | ||
[elementTemplate]="template" | ||
> | ||
</gn-ui-sortable-list> | ||
<ng-template #template let-onlineResource let-index="index"> | ||
<gn-ui-online-resource-card | ||
[onlineResource]="onlineResource" | ||
(modifyClick)="handleResourceModify(onlineResource, index)" | ||
></gn-ui-online-resource-card> | ||
</ng-template> | ||
|
||
<ng-template #dialogTemplate let-onlineResource> | ||
<div class="flex flex-col gap-[16px]"> | ||
<div> | ||
<h3 class="text-[16px] font-bold text-main mb-[12px]" translate> | ||
editor.record.form.field.onlineResource.edit.title | ||
</h3> | ||
<gn-ui-text-input [(value)]="onlineResource.name"></gn-ui-text-input> | ||
</div> | ||
<div> | ||
<h3 class="text-[16px] font-bold text-main mb-[12px]" translate> | ||
editor.record.form.field.onlineResource.edit.description | ||
</h3> | ||
<gn-ui-text-area [(value)]="onlineResource.description"></gn-ui-text-area> | ||
</div> | ||
<ng-container *ngIf="onlineResource.type === 'service'"> | ||
<span class="w-full border-b border-gray-300"></span> | ||
<gn-ui-online-service-resource-input | ||
[service]="onlineResource" | ||
></gn-ui-online-service-resource-input> | ||
</ng-container> | ||
<div class="flex flex-col"> | ||
<gn-ui-switch-toggle | ||
[options]="typeOptions" | ||
(selectedValue)="onSelectedTypeChange($event.value)" | ||
extraClasses="grow text-sm" | ||
data-cy="online-resources-type" | ||
[disabled]="disabled$ | async" | ||
></gn-ui-switch-toggle> | ||
<div class="h-[8px]"></div> | ||
<gn-ui-file-input | ||
*ngIf="selectedType === 'download'" | ||
[maxSizeMB]="MAX_UPLOAD_SIZE_MB" | ||
(fileChange)="handleFileChange($event)" | ||
(uploadCancel)="handleUploadCancel()" | ||
[uploadProgress]="uploadProgress" | ||
(urlChange)="handleDownloadUrlChange($event)" | ||
[disabled]="disabled$ | async" | ||
></gn-ui-file-input> | ||
<div | ||
*ngIf="selectedType === 'service'" | ||
class="w-full border-2 border-dashed rounded-lg p-6 flex flex-col gap-[16px]" | ||
> | ||
<gn-ui-online-service-resource-input | ||
[service]="newService" | ||
[disabled]="disabled$ | async" | ||
></gn-ui-online-service-resource-input> | ||
<span class="w-full border-b border-gray-300"></span> | ||
<gn-ui-url-input | ||
class="w-full" | ||
[disabled]="true" | ||
[value]="onlineResource.url" | ||
[showUploadButton]="false" | ||
(uploadClick)="handleServiceUrlChange($event)" | ||
[disabled]="disabled$ | async" | ||
></gn-ui-url-input> | ||
</div> | ||
</ng-template> | ||
<div class="h-[8px]"></div> | ||
<gn-ui-sortable-list | ||
[items]="notLinkResources" | ||
(itemsOrderChange)="handleResourcesChange($event)" | ||
[elementTemplate]="template" | ||
> | ||
</gn-ui-sortable-list> | ||
<ng-template #template let-onlineResource let-index="index"> | ||
<gn-ui-online-resource-card | ||
[onlineResource]="onlineResource" | ||
(modifyClick)="handleResourceModify(onlineResource, index)" | ||
></gn-ui-online-resource-card> | ||
</ng-template> | ||
|
||
<ng-template #dialogTemplate let-onlineResource> | ||
<div class="flex flex-col gap-[16px]"> | ||
<div> | ||
<h3 class="text-[16px] font-bold text-main mb-[12px]" translate> | ||
editor.record.form.field.onlineResource.edit.title | ||
</h3> | ||
<gn-ui-text-input [(value)]="onlineResource.name"></gn-ui-text-input> | ||
</div> | ||
<div> | ||
<h3 class="text-[16px] font-bold text-main mb-[12px]" translate> | ||
editor.record.form.field.onlineResource.edit.description | ||
</h3> | ||
<gn-ui-text-area | ||
[(value)]="onlineResource.description" | ||
></gn-ui-text-area> | ||
</div> | ||
<ng-container *ngIf="onlineResource.type === 'service'"> | ||
<span class="w-full border-b border-gray-300"></span> | ||
<gn-ui-online-service-resource-input | ||
[service]="onlineResource" | ||
[disabled]="disabled$ | async" | ||
></gn-ui-online-service-resource-input> | ||
</ng-container> | ||
<span class="w-full border-b border-gray-300"></span> | ||
<gn-ui-url-input | ||
class="w-full" | ||
[disabled]="true" | ||
[value]="onlineResource.url" | ||
[showUploadButton]="false" | ||
></gn-ui-url-input> | ||
</div> | ||
</ng-template> | ||
<div | ||
*ngIf="disabled$ | async" | ||
class="p-4 text-sm border border-primary bg-primary-lightest rounded-lg" | ||
translate | ||
data-test="disabled-message" | ||
> | ||
editor.record.form.field.draft.only.disabled | ||
</div> | ||
</div> |
Oops, something went wrong.