geonetwork-ui 2.4.0-dev.ac57b75b → 2.4.0-dev.c5f4c491

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,7 +12,7 @@ export declare class OverviewUploadComponent implements OnInit, OnChanges {
12
12
  altTextChange: EventEmitter<string>;
13
13
  resourceAltText: string;
14
14
  resourceFileName: string;
15
- resourceUrl: URL;
15
+ resourceUrl: string;
16
16
  constructor(recordsApiService: RecordsApiService, cd: ChangeDetectorRef);
17
17
  ngOnInit(): void;
18
18
  handleFileChange(file: File): void;
@@ -1 +1 @@
1
- {"version":3,"file":"overview-upload.component.d.ts","sourceRoot":"","sources":["../../../../../../../src/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAEjB,YAAY,EAEZ,SAAS,EACT,MAAM,EAEN,aAAa,EACd,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAA;AAEjF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;;AAQ9F,qBAQa,uBAAwB,YAAW,MAAM,EAAE,SAAS;IAW7D,OAAO,CAAC,iBAAiB;IACzB,OAAO,CAAC,EAAE;IAXH,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAG,WAAW,CAAA;IACxB,cAAc,gCAA6C;IAC3D,aAAa,EAAE,YAAY,CAAC,MAAM,CAAC,CAAqB;IAElE,eAAe,SAAK;IACpB,gBAAgB,SAAK;IACrB,WAAW,EAAE,GAAG,CAAA;gBAGN,iBAAiB,EAAE,iBAAiB,EACpC,EAAE,EAAE,iBAAiB;IAG/B,QAAQ,IAAI,IAAI;IAsBhB,gBAAgB,CAAC,IAAI,EAAE,IAAI;IAmB3B,eAAe,CAAC,GAAG,EAAE,MAAM;IAmB3B,mBAAmB,CAAC,UAAU,EAAE,MAAM;IAUtC,YAAY;IAgBZ,OAAO,CAAC,WAAW,CAUlB;IAED,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;yCAjH9B,uBAAuB;2CAAvB,uBAAuB;CAsInC"}
1
+ {"version":3,"file":"overview-upload.component.d.ts","sourceRoot":"","sources":["../../../../../../../src/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAEjB,YAAY,EAEZ,SAAS,EACT,MAAM,EAEN,aAAa,EACd,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAA;AAEjF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;;AAE9F,qBAQa,uBAAwB,YAAW,MAAM,EAAE,SAAS;IAW7D,OAAO,CAAC,iBAAiB;IACzB,OAAO,CAAC,EAAE;IAXH,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAG,WAAW,CAAA;IACxB,cAAc,gCAA6C;IAC3D,aAAa,EAAE,YAAY,CAAC,MAAM,CAAC,CAAqB;IAElE,eAAe,EAAE,MAAM,CAAA;IACvB,gBAAgB,EAAE,MAAM,CAAA;IACxB,WAAW,EAAE,MAAM,CAAA;gBAGT,iBAAiB,EAAE,iBAAiB,EACpC,EAAE,EAAE,iBAAiB;IAG/B,QAAQ,IAAI,IAAI;IAqBhB,gBAAgB,CAAC,IAAI,EAAE,IAAI;IAmB3B,eAAe,CAAC,GAAG,EAAE,MAAM;IAmB3B,mBAAmB,CAAC,UAAU,EAAE,MAAM;IAWtC,YAAY;IAiBZ,OAAO,CAAC,WAAW,CAUlB;IAED,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;yCAlH9B,uBAAuB;2CAAvB,uBAAuB;CAuInC"}
@@ -1 +1 @@
1
- {"version":3,"file":"record-form.component.d.ts","sourceRoot":"","sources":["../../../../../../../src/libs/feature/editor/src/lib/components/record-form/record-form.component.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAG/C,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACxB,MAAM,4BAA4B,CAAA;;AAEnC,qBAQa,mBAAmB;IACX,MAAM,EAAE,YAAY;gBAApB,MAAM,EAAE,YAAY;IAEvC,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB;IAQhE,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,oBAAoB,GAAG,GAAG;IAI7D,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,GAAG,GAAG;yCAfzD,mBAAmB;2CAAnB,mBAAmB;CAkB/B"}
1
+ {"version":3,"file":"record-form.component.d.ts","sourceRoot":"","sources":["../../../../../../../src/libs/feature/editor/src/lib/components/record-form/record-form.component.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAG/C,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACxB,MAAM,4BAA4B,CAAA;;AAEnC,qBAQa,mBAAmB;IACX,MAAM,EAAE,YAAY;gBAApB,MAAM,EAAE,YAAY;IAEvC,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB;IAOhE,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,oBAAoB,GAAG,GAAG;IAI7D,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,GAAG,GAAG;yCAdzD,mBAAmB;2CAAnB,mBAAmB;CAiB/B"}
@@ -1,13 +1,11 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
2
  import { ChangeDetectorRef, EventEmitter } from '@angular/core';
3
- import { FormControl } from '@angular/forms';
4
3
  import * as i0 from "@angular/core";
5
4
  export declare class ImageInputComponent {
6
5
  private http;
7
6
  private cd;
8
- formControl: FormControl;
9
7
  maxSizeMB: number;
10
- previewUrl?: URL;
8
+ previewUrl?: string;
11
9
  altText?: string;
12
10
  uploadProgress?: number;
13
11
  uploadError?: boolean;
@@ -41,6 +39,6 @@ export declare class ImageInputComponent {
41
39
  private filterTypeImage;
42
40
  private resizeAndEmit;
43
41
  static ɵfac: i0.ɵɵFactoryDeclaration<ImageInputComponent, never>;
44
- static ɵcmp: i0.ɵɵComponentDeclaration<ImageInputComponent, "gn-ui-image-input", never, { "formControl": { "alias": "formControl"; "required": false; }; "maxSizeMB": { "alias": "maxSizeMB"; "required": false; }; "previewUrl": { "alias": "previewUrl"; "required": false; }; "altText": { "alias": "altText"; "required": false; }; "uploadProgress": { "alias": "uploadProgress"; "required": false; }; "uploadError": { "alias": "uploadError"; "required": false; }; }, { "fileChange": "fileChange"; "urlChange": "urlChange"; "uploadCancel": "uploadCancel"; "delete": "delete"; "altTextChange": "altTextChange"; }, never, never, true, never>;
42
+ static ɵcmp: i0.ɵɵComponentDeclaration<ImageInputComponent, "gn-ui-image-input", never, { "maxSizeMB": { "alias": "maxSizeMB"; "required": false; }; "previewUrl": { "alias": "previewUrl"; "required": false; }; "altText": { "alias": "altText"; "required": false; }; "uploadProgress": { "alias": "uploadProgress"; "required": false; }; "uploadError": { "alias": "uploadError"; "required": false; }; }, { "fileChange": "fileChange"; "urlChange": "urlChange"; "uploadCancel": "uploadCancel"; "delete": "delete"; "altTextChange": "altTextChange"; }, never, never, true, never>;
45
43
  }
46
44
  //# sourceMappingURL=image-input.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"image-input.component.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/ui/inputs/src/lib/image-input/image-input.component.ts"],"names":[],"mappings":"AACA,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BAAkB;IAIlB,mBAAmB,CAAC,KAAK,EAAE,KAAK;IAKhC,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,aAAa;yCA1JV,mBAAmB;2CAAnB,mBAAmB;CAiK/B"}
1
+ {"version":3,"file":"image-input.component.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/ui/inputs/src/lib/image-input/image-input.component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAEL,iBAAiB,EAEjB,YAAY,EAGb,MAAM,eAAe,CAAA;;AAUtB,qBAea,mBAAmB;IAqBlB,OAAO,CAAC,IAAI;IAAc,OAAO,CAAC,EAAE;IApBvC,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,WAAW,CAAC,EAAE,OAAO,CAAA;IACpB,UAAU,EAAE,YAAY,CAAC,IAAI,CAAC,CAAqB;IACnD,SAAS,EAAE,YAAY,CAAC,MAAM,CAAC,CAAqB;IACpD,YAAY,EAAE,YAAY,CAAC,IAAI,CAAC,CAAqB;IACrD,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC,CAAqB;IAC/C,aAAa,EAAE,YAAY,CAAC,MAAM,CAAC,CAAqB;IAElE,aAAa,UAAQ;IACrB,YAAY,UAAQ;IACpB,aAAa,UAAQ;IACrB,gBAAgB,UAAQ;IAExB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,cAAc,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;IAC/B,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;gBAEb,IAAI,EAAE,UAAU,EAAU,EAAE,EAAE,iBAAiB;IAEnE,cAAc;IAUd,gBAAgB;IAUhB,mBAAmB,CAAC,aAAa,EAAE,OAAO;IAO1C,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE;IAS7B,eAAe,CAAC,KAAK,EAAE,KAAK;IAQ5B,eAAe;IAKf,eAAe,CAAC,KAAK,EAAE,KAAK;IAKtB,WAAW;IAgCjB,wBAAwB;IAQxB,YAAY;IAIZ,WAAW;IAWX,YAAY;IAIZ,kBAAkB;IAIlB,mBAAmB,CAAC,KAAK,EAAE,KAAK;IAKhC,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,aAAa;yCAvJV,mBAAmB;2CAAnB,mBAAmB;CA8J/B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geonetwork-ui",
3
- "version": "2.4.0-dev.ac57b75b",
3
+ "version": "2.4.0-dev.c5f4c491",
4
4
  "engines": {
5
5
  "node": ">=14.17.0"
6
6
  },
@@ -2,7 +2,6 @@
2
2
  [maxSizeMB]="5"
3
3
  [previewUrl]="resourceUrl"
4
4
  [altText]="resourceAltText"
5
- [formControl]="formControl"
6
5
  (fileChange)="handleFileChange($event)"
7
6
  (urlChange)="handleUrlChange($event)"
8
7
  (altTextChange)="handleAltTextChange($event)"
@@ -15,12 +15,6 @@ import { UiInputsModule } from '../../../../../../../libs/ui/inputs/src'
15
15
  import { FormControl } from '@angular/forms'
16
16
  import { GraphicOverview } from '../../../../../../../libs/common/domain/src/lib/model/record'
17
17
 
18
- const extractFileNameFromUrl = (url: string): string => {
19
- const pattern = new RegExp(`attachments/([^/?#]+)(?:[/?#]|$)`, 'i')
20
- const match = url.match(pattern)
21
- return match ? match[1] : ''
22
- }
23
-
24
18
  @Component({
25
19
  selector: 'gn-ui-overview-upload',
26
20
  standalone: true,
@@ -35,9 +29,9 @@ export class OverviewUploadComponent implements OnInit, OnChanges {
35
29
  @Output() overviewChange = new EventEmitter<GraphicOverview | null>()
36
30
  @Output() altTextChange: EventEmitter<string> = new EventEmitter()
37
31
 
38
- resourceAltText = '' // = ressourceFileName by default
39
- resourceFileName = ''
40
- resourceUrl: URL
32
+ resourceAltText: string
33
+ resourceFileName: string
34
+ resourceUrl: string
41
35
 
42
36
  constructor(
43
37
  private recordsApiService: RecordsApiService,
@@ -48,14 +42,13 @@ export class OverviewUploadComponent implements OnInit, OnChanges {
48
42
  this.recordsApiService.getAllResources(this.metadataUuid).subscribe({
49
43
  next: (resources) => {
50
44
  if (resources && resources.length > 0) {
51
- this.resourceUrl = new URL(resources[0]?.url)
52
- this.resourceAltText =
53
- this.resourceAltText === ''
54
- ? resources[0].filename
55
- : this.resourceAltText
56
- this.resourceFileName = extractFileNameFromUrl(resources[0]?.url)
45
+ this.resourceUrl = resources[0].url
46
+ this.resourceFileName = resources[0].filename
47
+ if (!this.resourceAltText) {
48
+ this.resourceAltText = this.resourceFileName
49
+ }
57
50
  } else {
58
- this.resourceUrl = null
51
+ this.resourceUrl = ''
59
52
  this.resourceAltText = ''
60
53
  this.resourceFileName = ''
61
54
  }
@@ -71,7 +64,7 @@ export class OverviewUploadComponent implements OnInit, OnChanges {
71
64
  .putResource(this.metadataUuid, file, 'public')
72
65
  .subscribe({
73
66
  next: (resource) => {
74
- this.resourceUrl = new URL(resource.url)
67
+ this.resourceUrl = resource.url
75
68
  this.resourceAltText = resource.filename
76
69
 
77
70
  this.overviewChange.emit({
@@ -90,7 +83,7 @@ export class OverviewUploadComponent implements OnInit, OnChanges {
90
83
  .putResourceFromURL(this.metadataUuid, url, 'public')
91
84
  .subscribe({
92
85
  next: (resource) => {
93
- this.resourceUrl = new URL(resource.url)
86
+ this.resourceUrl = resource.url
94
87
  this.resourceAltText = resource.filename
95
88
 
96
89
  this.overviewChange.emit({
@@ -108,19 +101,21 @@ export class OverviewUploadComponent implements OnInit, OnChanges {
108
101
  this.resourceAltText = newAltText
109
102
 
110
103
  this.overviewChange.emit({
111
- url: this.resourceUrl,
104
+ url: new URL(this.resourceUrl),
112
105
  description: this.resourceAltText,
113
106
  })
107
+
114
108
  this.cd.markForCheck()
115
109
  }
116
110
 
117
111
  handleDelete() {
112
+ //this.formControl.markAsDirty()
118
113
  this.recordsApiService
119
114
  .delResource(this.metadataUuid, this.resourceFileName)
120
115
  .subscribe({
121
116
  next: () => {
122
- this.resourceAltText = null
123
- this.resourceUrl = null
117
+ this.resourceAltText = ''
118
+ this.resourceUrl = ''
124
119
 
125
120
  this.overviewChange.emit(null)
126
121
 
@@ -133,7 +128,7 @@ export class OverviewUploadComponent implements OnInit, OnChanges {
133
128
  private errorHandle = (error: never) => {
134
129
  console.error(error)
135
130
 
136
- this.resourceUrl = null
131
+ this.resourceUrl = ''
137
132
  this.resourceAltText = ''
138
133
  this.resourceFileName = ''
139
134
 
@@ -157,7 +152,7 @@ export class OverviewUploadComponent implements OnInit, OnChanges {
157
152
  } else {
158
153
  return
159
154
  }
160
- if (overview.description && overview.description !== '') {
155
+ if (overview.description) {
161
156
  this.resourceAltText = overview.description
162
157
  this.cd.markForCheck()
163
158
  }
@@ -24,7 +24,6 @@ export class RecordFormComponent {
24
24
  if (!model) {
25
25
  return
26
26
  }
27
- console.log(newValue)
28
27
  this.facade.updateRecordField(model, newValue)
29
28
  }
30
29
 
@@ -51,7 +51,7 @@
51
51
  <div class="w-full h-full flex flex-col gap-2">
52
52
  <label
53
53
  gnUiFilesDrop
54
- class="block flex-1 border-2 border-dashed border-gray-300 rounded-lg p-6 flex flex-col items-center justify-center gap-4 hover:cursor-pointer"
54
+ class="block flex-1 border-2 border-dashed border-gray-300 rounded-lg p-6 flex flex-col items-center justify-center gap-4"
55
55
  (dragFilesOver)="handleDragFilesOver($event)"
56
56
  (dropFiles)="handleDropFiles($event)"
57
57
  >
@@ -16,7 +16,6 @@ import { ButtonComponent } from '../button/button.component'
16
16
  import { FilesDropDirective } from '../files-drop/files-drop.directive'
17
17
  import { TranslateModule } from '@ngx-translate/core'
18
18
  import { marker } from '@biesbjerg/ngx-translate-extract-marker'
19
- import { FormControl, ReactiveFormsModule } from '@angular/forms'
20
19
 
21
20
  @Component({
22
21
  selector: 'gn-ui-image-input',
@@ -31,13 +30,11 @@ import { FormControl, ReactiveFormsModule } from '@angular/forms'
31
30
  FilesDropDirective,
32
31
  MatProgressSpinnerModule,
33
32
  TranslateModule,
34
- ReactiveFormsModule,
35
33
  ],
36
34
  })
37
35
  export class ImageInputComponent {
38
- @Input() formControl!: FormControl
39
36
  @Input() maxSizeMB: number
40
- @Input() previewUrl?: URL
37
+ @Input() previewUrl?: string
41
38
  @Input() altText?: string
42
39
  @Input() uploadProgress?: number
43
40
  @Input() uploadError?: boolean
@@ -130,8 +127,7 @@ export class ImageInputComponent {
130
127
  const file = new File([blob], name)
131
128
  this.fileChange.emit(file)
132
129
  },
133
- error: (error) => {
134
- console.error(error)
130
+ error: () => {
135
131
  this.downloadError = true
136
132
  this.cd.markForCheck()
137
133
  this.urlChange.emit(this.urlInputValue)
@@ -169,7 +165,6 @@ export class ImageInputComponent {
169
165
  }
170
166
 
171
167
  handleDelete() {
172
- this.formControl.markAsDirty()
173
168
  this.delete.emit()
174
169
  }
175
170