Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
aeropuertov2-front-framework
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Charles Torres
aeropuertov2-front-framework
Commits
1f689361
Commit
1f689361
authored
Sep 14, 2020
by
huriarte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Asincrono validación
parent
ecfc6a97
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
ca-file-upload-modal.component.html
.../ca-file-upload-modal/ca-file-upload-modal.component.html
+1
-1
ca-file-upload-modal.component.ts
...ts/ca-file-upload-modal/ca-file-upload-modal.component.ts
+10
-0
No files found.
projects/bytebot-html/src/app/modules/agent/view/components/ca-file-upload-modal/ca-file-upload-modal.component.html
View file @
1f689361
...
...
@@ -40,5 +40,5 @@
<mat-dialog-actions
align=
"end"
>
<button
mat-button
mat-dialog-close
>
{{'btn.cancel' | translate}}
</button>
<button
mat-button
(
click
)="
ok
()"
cdkFocusInitial
[
disabled
]="
formGroup
.
invalid
"
>
{{'btn.accept' | translate}}
</button>
[
disabled
]="
formGroup
.
invalid
||
!
enabledOK
"
>
{{'btn.accept' | translate}}
</button>
</mat-dialog-actions>
\ No newline at end of file
projects/bytebot-html/src/app/modules/agent/view/components/ca-file-upload-modal/ca-file-upload-modal.component.ts
View file @
1f689361
...
...
@@ -29,6 +29,8 @@ export class CaFileUploadModalComponent implements OnInit {
accept
=
'.xls,.xlsx'
;
enabledOK
=
false
;
fileInfo
=
new
FileUploadModel
();
constructor
(
...
...
@@ -91,6 +93,7 @@ export class CaFileUploadModalComponent implements OnInit {
})
).
subscribe
((
event
:
any
)
=>
{
if
(
typeof
(
event
)
===
'object'
)
{
this
.
enabledOK
=
false
;
let
info
=
event
.
body
;
this
.
fileInfo
=
new
FileUploadModel
();
if
(
info
)
{
...
...
@@ -98,27 +101,34 @@ export class CaFileUploadModalComponent implements OnInit {
if
(
"OK"
===
status
)
{
this
.
fileInfo
.
id
=
info
.
id
;
this
.
fileInfo
.
description
=
this
.
formGroup
.
controls
.
description
.
value
;
this
.
fileInfo
.
uuid
=
info
.
uuid
;
this
.
fileInfo
.
filename
=
info
.
fileName
;
this
.
fileInfo
.
status
=
info
.
status
;
this
.
fileInfo
.
user
=
info
.
user
;
this
.
fileInfo
.
uploadDate
=
info
.
uploadDate
;
this
.
enabledOK
=
true
;
}
else
if
(
"INCOMPATIBLE_EXTENSION"
===
status
)
{
this
.
formGroup
.
controls
.
file
.
setValue
(
null
);
let
message
=
"label.file.incompatible.extension"
;
this
.
enabledOK
=
false
;
this
.
_notificationService
.
showMessage
(
this
.
_translateService
.
instant
(
message
)
+
"["
+
this
.
accept
+
"]"
,
null
,
NotificationType
.
error
);
}
else
if
(
"CONTENT_ERROR"
===
status
)
{
this
.
formGroup
.
controls
.
file
.
setValue
(
null
);
this
.
enabledOK
=
false
;
console
.
log
(
info
.
fileValidationResult
);
}
else
if
(
"HEADER_ERROR"
===
status
)
{
this
.
formGroup
.
controls
.
file
.
setValue
(
null
);
this
.
enabledOK
=
false
;
console
.
log
(
info
.
fileValidationResult
);
}
}
else
{
this
.
enabledOK
=
false
;
this
.
formGroup
.
controls
.
file
.
setValue
(
null
);
}
}
...
...
Write
Preview
Markdown
is supported
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