Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
DLCM
UI
DLCM-Portal
Commits
f6ca9768
Commit
f6ca9768
authored
Mar 17, 2020
by
Alicia.DeDiosFuente
Committed by
Florent POITTEVIN
Mar 18, 2020
Browse files
fix: fix validation metadata type
parent
c1f67c9a
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/app/features/admin/metadata-type/components/presentationals/admin-metadata-type-form/admin-metadata-type-form.presentational.html
View file @
f6ca9768
...
...
@@ -10,7 +10,6 @@
[solidifyValidation]=
"errors"
autofocus
[solidifyFocusFirstElement]=
"true"
(blur)=
"checkAvailable(formDefinition.name, fd)"
[formControl]=
"fd"
[required]=
"formValidationHelper.hasRequiredField(fd)"
>
...
...
@@ -118,14 +117,13 @@
></code>
</ng-container>
</ng-container>
<div
class=
"submit-button"
>
<button
*ngIf=
"!readonly"
mat-flat-button
color=
"primary"
type=
"submit"
(keydown.enter)=
"onSubmit()"
[disabled]=
"!
form.valid || !form.dirty
"
[disabled]=
"!
(this.uploadedOrChangedFile && form.valid || this.isEditAction && form.valid && form.dirty) && !(this.uploadedOrChangedFile && !this.isEditAction && form.valid )
"
>
{{'admin.metadataType.form.submit' | translate }}
</button>
...
...
src/app/features/admin/metadata-type/components/presentationals/admin-metadata-type-form/admin-metadata-type-form.presentational.ts
View file @
f6ca9768
...
...
@@ -3,6 +3,7 @@ import {
ChangeDetectionStrategy
,
ChangeDetectorRef
,
Component
,
Input
,
Output
,
}
from
"
@angular/core
"
;
import
{
...
...
@@ -38,12 +39,16 @@ export class AdminMetadataTypeFormPresentational extends SharedAbstractFormPrese
readonly
filesAccepted
:
string
[]
=
[
"
.xml
"
,
"
.json
"
,
"
.xsd
"
,
"
.txt
"
];
readonly
maxSizeFile
:
number
=
25000000
;
@
Input
()
isEditAction
:
boolean
=
false
;
metadataFormatEnum
:
KeyValue
[]
=
MetadataTypeFormatEnumHelper
.
getListKeyValue
();
private
readonly
_fileUploadBS
:
BehaviorSubject
<
File
|
undefined
>
=
new
BehaviorSubject
<
File
|
undefined
>
(
undefined
);
@
Output
(
"
fileUploadChange
"
)
readonly
fileUploadObs
:
Observable
<
File
|
undefined
>
=
ObservableUtil
.
asObservable
(
this
.
_fileUploadBS
);
constructor
(
protected
readonly
_changeDetectorRef
:
ChangeDetectorRef
,
private
readonly
_notificationService
:
NotificationService
,
private
readonly
_fb
:
FormBuilder
)
{
...
...
@@ -95,6 +100,7 @@ export class AdminMetadataTypeFormPresentational extends SharedAbstractFormPrese
this
.
_notificationService
.
showInformation
(
TRANSLATE
(
"
admin.metadataType.readUploadedFileSuccessfully
"
));
};
fileReader
.
readAsText
(
file
);
this
.
uploadedOrChangedFile
=
true
;
}
onTestFileUpload
(
event
:
Event
&
any
):
void
{
...
...
src/app/features/admin/metadata-type/components/routables/admin-metadata-type-create/admin-metadata-type-create.routable.html
View file @
f6ca9768
...
...
@@ -18,5 +18,4 @@
(dirtyChange)=
"updateCanDeactivate($event)"
></dlcm-admin-metadata-type-form>
</div>
</div>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment