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
88d4c0b4
Commit
88d4c0b4
authored
Sep 15, 2020
by
Sebastian Chicoma
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://git.tbs.com:8888/ByteBot/web/bytebot-workspace
into developer
parents
e636d452
5c457902
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
73 additions
and
13 deletions
+73
-13
ca-file-upload-modal.component.html
.../ca-file-upload-modal/ca-file-upload-modal.component.html
+15
-5
ca-file-upload-modal.component.scss
.../ca-file-upload-modal/ca-file-upload-modal.component.scss
+3
-0
ca-file-upload-modal.component.ts
...ts/ca-file-upload-modal/ca-file-upload-modal.component.ts
+19
-4
ca-frequent-questions.component.html
...a-frequent-questions/ca-frequent-questions.component.html
+8
-1
ca-frequent-questions.component.ts
.../ca-frequent-questions/ca-frequent-questions.component.ts
+24
-1
en.json
projects/bytebot-html/src/assets/i18n/en.json
+2
-1
es.json
projects/bytebot-html/src/assets/i18n/es.json
+2
-1
No files found.
projects/bytebot-html/src/app/modules/agent/view/components/ca-file-upload-modal/ca-file-upload-modal.component.html
View file @
88d4c0b4
...
...
@@ -10,7 +10,7 @@
</div>
</div>
<mat-dialog-content>
<mat-dialog-content
class=
"none-overflow"
>
<h4>
{{'label.file-upload.description' | translate}}
</h4>
...
...
@@ -24,7 +24,7 @@
</mat-form-field>
</div>
</div>
<div
class=
"row pt-2"
>
<div
class=
"row pt-2"
*
ngIf=
"createMode"
>
<div
class=
"col-12"
>
<mat-form-field
class=
"amd-form-control"
>
<ngx-mat-file-input
formControlName=
"file"
[
placeholder
]="'
label
.
file
'
|
translate
"
...
...
@@ -53,7 +53,17 @@
<tr
mat-row
*
matRowDef=
"let row; columns: displayedColumns;"
></tr>
</table>
</div>
</div>
</div>
<div
class=
"row pt-2"
*
ngIf=
"!createMode"
>
<div
class=
"col-12"
>
<mat-form-field
class=
"amd-form-control"
>
<input
matInput
[
placeholder
]="'
label
.
file
'
|
translate
"
formControlName=
"filename"
required
>
<mat-icon
matSuffix
[
matTooltip
]="'
label
.
file
.
tooltip
'
|
translate
"
matTooltipPosition=
"above"
>
help_icon
</mat-icon>
</mat-form-field>
</div>
</div>
</form>
...
...
@@ -61,6 +71,6 @@
</mat-dialog-content>
<mat-dialog-actions
align=
"end"
>
<button
mat-button
mat-dialog-close
>
{{'btn.cancel' | translate}}
</button>
<button
mat-button
(
click
)="
ok
()"
cdkFocusInitial
[
disabled
]="
formGroup
.
invalid
||
!
enabledOK
"
>
{{'btn.accept' | translate}}
</button>
</mat-dialog-actions>
\ No newline at end of file
<button
mat-button
(
click
)="
ok
()"
cdkFocusInitial
[
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.scss
View file @
88d4c0b4
...
...
@@ -7,3 +7,6 @@
table
{
width
:
100%
;
}
.none-overflow
{
overflow
:
hidden
;
}
projects/bytebot-html/src/app/modules/agent/view/components/ca-file-upload-modal/ca-file-upload-modal.component.ts
View file @
88d4c0b4
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
,
Inject
}
from
'@angular/core'
;
import
{
FormGroup
,
FormBuilder
,
FormControl
,
Validators
}
from
'@angular/forms'
;
import
{
HttpEventType
,
HttpErrorResponse
}
from
'@angular/common/http'
;
import
{
of
}
from
'rxjs'
;
import
{
map
,
catchError
}
from
'rxjs/operators'
;
import
{
AgentService
}
from
'../../../service/agent.service'
;
import
{
MatDialogRef
,
MatTableDataSource
}
from
'@angular/material'
;
import
{
MatDialogRef
,
MatTableDataSource
,
MAT_DIALOG_DATA
}
from
'@angular/material'
;
import
{
NotificationService
,
NotificationType
}
from
'@xdf/commons'
;
import
{
TranslateService
}
from
'@ngx-translate/core'
;
...
...
@@ -31,6 +31,8 @@ export class CaFileUploadModalComponent implements OnInit {
enabledOK
=
false
;
createMode
=
true
;
fileInfo
=
new
FileUploadModel
();
fileErrorDetail
:
any
;
...
...
@@ -44,12 +46,23 @@ export class CaFileUploadModalComponent implements OnInit {
private
agentService
:
AgentService
,
private
_notificationService
:
NotificationService
,
private
_translateService
:
TranslateService
,
public
dialogRef
:
MatDialogRef
<
CaFileUploadModalComponent
>
public
dialogRef
:
MatDialogRef
<
CaFileUploadModalComponent
>
,
@
Inject
(
MAT_DIALOG_DATA
)
public
data
:
any
)
{
this
.
formGroup
=
this
.
formBuilder
.
group
({
description
:
new
FormControl
({
value
:
""
,
disabled
:
false
}),
file
:
new
FormControl
({
value
:
''
,
disabled
:
false
})
file
:
new
FormControl
({
value
:
''
,
disabled
:
false
}),
filename
:
new
FormControl
({
value
:
''
,
disabled
:
true
})
});
if
(
data
)
{
this
.
fileInfo
=
data
;
this
.
formGroup
.
controls
.
description
.
setValue
(
this
.
fileInfo
.
description
);
this
.
formGroup
.
controls
.
filename
.
setValue
(
this
.
fileInfo
.
filename
);
this
.
createMode
=
false
;
this
.
enabledOK
=
true
;
}
}
ngOnInit
()
{
...
...
@@ -131,10 +144,12 @@ export class CaFileUploadModalComponent implements OnInit {
}
validateFile
(
file
)
{
const
formData
=
new
FormData
();
formData
.
append
(
'file'
,
file
.
data
);
file
.
inProgress
=
true
;
this
.
enabledOK
=
false
;
this
.
agentService
.
upload
(
formData
).
pipe
(
map
(
event
=>
{
...
...
projects/bytebot-html/src/app/modules/agent/view/components/ca-frequent-questions/ca-frequent-questions.component.html
View file @
88d4c0b4
...
...
@@ -68,6 +68,13 @@
<th
mat-header-cell
*
matHeaderCellDef
class=
"w-actions"
></th>
<td
mat-cell
*
matCellDef=
"let element; let $index = index"
class=
"w-actions text-center"
>
<div
class=
"btn-group"
>
<button
type=
"button"
class=
"btn btn-default btn-sm"
(
click
)="
onEditRecord
(
element
,
$
index
)"
[
disabled
]="!
resourceAuth
['
edit
']
||
viewMode
"
>
<i
class=
"fa fa-edit"
></i>
<span
class=
"visible-md-inline visible-lg-inline visible-xl-inline"
>
{{'btn.edit' | translate}}
</span>
</button>
<button
type=
"button"
class=
"btn btn-default btn-sm"
(
click
)="
onDeleteRecord
(
element
,
$
index
)"
[
disabled
]="!
resourceAuth
['
delete
']
||
viewMode
"
>
<i
class=
"fa fa-trash"
></i>
...
...
@@ -83,8 +90,8 @@
</table>
</div>
</div>
<div
class=
"col-1"
></div>
</div>
<div
class=
"col-1"
></div>
</div>
<div
class=
"footer-bar"
>
...
...
projects/bytebot-html/src/app/modules/agent/view/components/ca-frequent-questions/ca-frequent-questions.component.ts
View file @
88d4c0b4
...
...
@@ -110,7 +110,8 @@ export class CaFrequentQuestionsComponent implements OnInit {
addFile
()
{
let
dialog
=
this
.
matDialog
.
open
(
CaFileUploadModalComponent
,
{
width
:
'600px'
width
:
'600px'
,
data
:
null
});
dialog
.
afterClosed
().
subscribe
(
result
=>
{
...
...
@@ -123,6 +124,28 @@ export class CaFrequentQuestionsComponent implements OnInit {
});
}
onEditRecord
(
item
,
index
)
{
item
.
editable
=
true
;
let
dialog
=
this
.
matDialog
.
open
(
CaFileUploadModalComponent
,
{
width
:
'500px'
,
data
:
item
});
dialog
.
afterClosed
().
subscribe
(
result
=>
{
if
(
result
)
{
let
fileEdited
=
{
...
result
};
let
listTemp
=
this
.
dataSource
.
data
;
listTemp
[
index
]
=
fileEdited
;
this
.
dataSource
.
data
=
listTemp
;
}
});
}
saveQuestions
(
validateForm
:
boolean
)
{
let
success
=
true
;
...
...
projects/bytebot-html/src/assets/i18n/en.json
View file @
88d4c0b4
...
...
@@ -49,5 +49,6 @@
"label.file-upload.description"
:
"The question file will be used as material training"
,
"label.file"
:
"File"
,
"label.file.incompatible.extension"
:
"Invalid file. Just accept the following file extensions "
,
"label.imageAvatar.incompatible.extension"
:
"Invalid file. Just accept the followeing image types "
"label.imageAvatar.incompatible.extension"
:
"Invalid file. Just accept the followeing image types "
,
"label.file.tooltip"
:
"For security reasones, you cannot edit uploaded files. Please delete and upload a new file"
}
\ No newline at end of file
projects/bytebot-html/src/assets/i18n/es.json
View file @
88d4c0b4
...
...
@@ -54,5 +54,6 @@
"label.delete-channel"
:
"Borrar canal"
,
"agent.edit.success"
:
"El agente fue editado correctamente"
,
"agent.create.success"
:
"El agente fue creado correctamente"
,
"error.message.complete-form"
:
"Complete correctamente el formulario"
"error.message.complete-form"
:
"Complete correctamente el formulario"
,
"label.file.tooltip"
:
"Por seguridad, no se pueden editar los archivos validados"
}
\ No newline at end of file
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