Skip to content

Commit

Permalink
Merge pull request geonetwork#984 from geonetwork/ME-max-upload-size
Browse files Browse the repository at this point in the history
chore: put max upload size in field config
  • Loading branch information
jahow authored Sep 5, 2024
2 parents aa68983 + f60b198 commit 6f312e6
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<gn-ui-file-input
[maxSizeMB]="10"
[maxSizeMB]="MAX_UPLOAD_SIZE_MB"
(fileChange)="handleFileChange($event)"
(uploadCancel)="handleUploadCancel()"
[uploadProgress]="uploadProgress"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { TranslateModule, TranslateService } from '@ngx-translate/core'
import { PlatformServiceInterface } from '@geonetwork-ui/common/domain/platform.service.interface'
import { Subscription } from 'rxjs'
import { MatDialog } from '@angular/material/dialog'
import { MAX_UPLOAD_SIZE_MB } from '../../../../fields.config'

@Component({
selector: 'gn-ui-form-field-online-link-resources',
Expand Down Expand Up @@ -63,6 +64,8 @@ export class FormFieldOnlineLinkResourcesComponent {
uploadProgress = undefined
uploadSubscription: Subscription = null

protected MAX_UPLOAD_SIZE_MB = MAX_UPLOAD_SIZE_MB

constructor(
private notificationsService: NotificationsService,
private translateService: TranslateService,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<gn-ui-image-input
[maxSizeMB]="5"
[maxSizeMB]="MAX_UPLOAD_SIZE_MB"
[previewUrl]="firstOverview.url"
[altText]="firstOverview.description"
(fileChange)="handleFileChange($event)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { PlatformServiceInterface } from '@geonetwork-ui/common/domain/platform.
import { NotificationsService } from '@geonetwork-ui/feature/notifications'
import { TranslateService } from '@ngx-translate/core'
import { Subscription } from 'rxjs'
import { MAX_UPLOAD_SIZE_MB } from '../../../../fields.config'

@Component({
selector: 'gn-ui-form-field-overviews',
Expand All @@ -31,6 +32,8 @@ export class FormFieldOverviewsComponent {
uploadProgress = undefined
uploadSubscription: Subscription = null

protected MAX_UPLOAD_SIZE_MB = MAX_UPLOAD_SIZE_MB

get firstOverview() {
return (
this.value[0] ?? {
Expand Down
2 changes: 2 additions & 0 deletions libs/feature/editor/src/lib/fields.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,5 @@ export const OPEN_DATA_LICENSES: string[] = [
'odc-by',
'pddl',
]

export const MAX_UPLOAD_SIZE_MB = 10

0 comments on commit 6f312e6

Please sign in to comment.