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
35cb1c8c
Commit
35cb1c8c
authored
Sep 09, 2020
by
huriarte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avances preguntas frecuentes
parent
0aeae9d9
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
411 additions
and
87 deletions
+411
-87
agent.module.ts
projects/bytebot-html/src/app/modules/agent/agent.module.ts
+3
-1
agent.component.html
...tml/src/app/modules/agent/view/agent/agent.component.html
+10
-10
agent.component.ts
...-html/src/app/modules/agent/view/agent/agent.component.ts
+8
-3
ca-frequent-questions.component.html
...a-frequent-questions/ca-frequent-questions.component.html
+55
-0
ca-frequent-questions.component.scss
...a-frequent-questions/ca-frequent-questions.component.scss
+3
-0
ca-frequent-questions.component.spec.ts
...requent-questions/ca-frequent-questions.component.spec.ts
+25
-0
ca-frequent-questions.component.ts
.../ca-frequent-questions/ca-frequent-questions.component.ts
+89
-0
ca-general-information.component.html
...general-information/ca-general-information.component.html
+125
-71
ca-general-information.component.scss
...general-information/ca-general-information.component.scss
+8
-0
ca-general-information.component.ts
...a-general-information/ca-general-information.component.ts
+85
-2
No files found.
projects/bytebot-html/src/app/modules/agent/agent.module.ts
View file @
35cb1c8c
...
...
@@ -16,6 +16,7 @@ import { AgentDetailComponent } from './view/agent-detail/agent-detail.component
import
{
EsStepsProcessorsModalComponent
}
from
'./view/components/es-steps-processors-modal/es-steps-processors-modal.component'
;
import
{
DynamicTranslatePipe
}
from
'./pipe/dynamic-translate.pipe'
;
import
{
CaGeneralInformationComponent
}
from
'./view/components/ca-general-information/ca-general-information.component'
;
import
{
CaFrequentQuestionsComponent
}
from
'./view/components/ca-frequent-questions/ca-frequent-questions.component'
;
@
NgModule
({
...
...
@@ -27,7 +28,8 @@ import { CaGeneralInformationComponent } from './view/components/ca-general-info
AgentDetailComponent
,
EsStepsProcessorsModalComponent
,
DynamicTranslatePipe
,
CaGeneralInformationComponent
],
CaGeneralInformationComponent
,
CaFrequentQuestionsComponent
],
imports
:
[
FormsModule
,
ReactiveFormsModule
,
...
...
projects/bytebot-html/src/app/modules/agent/view/agent/agent.component.html
View file @
35cb1c8c
...
...
@@ -17,17 +17,17 @@
</ng-template>
<byte-ca-general-information
[
stepper
]="
stepper
"
></byte-ca-general-information>
</mat-step>
<!--
<mat-step state="
connec
tions">
<mat-step
state=
"
ques
tions"
>
<ng-template
matStepLabel
>
<span class="font-bold">{{'label.
connec
tions.title' | translate}}</span>
<div class="font-size-description" [title]="'label.
connec
tions.description' | translate">
{{'label.
connec
tions.description' | translate}}
<span
class=
"font-bold"
>
{{'label.
ques
tions.title' | translate}}
</span>
<div
class=
"font-size-description"
[
title
]="'
label
.
ques
tions
.
description
'
|
translate
"
>
{{'label.
ques
tions.description' | translate}}
</div>
</ng-template>
<byte-
es-connections [stepper]="stepper" (onDeleteConnection)="onDeleteConnection($event)"></byte-es-connec
tions>
<byte-
ca-frequent-questions
[
stepper
]="
stepper
"
></byte-ca-frequent-ques
tions>
</mat-step>
<!--
<mat-step state="steps">
<ng-template matStepLabel>
<span class="font-bold">{{'label.steps.title' | translate}}</span>
...
...
@@ -51,11 +51,11 @@
<ng-template
matStepperIcon=
"info"
>
<mat-icon>
info
</mat-icon>
</ng-template>
<!--
<ng-template matStepperIcon="connections">
</ng-template>
<ng-template
matStepperIcon=
"questions"
>
<mat-icon>
dns
</mat-icon>
</ng-template>
<!--
<ng-template matStepperIcon="steps">
<mat-icon>device_hub</mat-icon>
</ng-template>
...
...
projects/bytebot-html/src/app/modules/agent/view/agent/agent.component.ts
View file @
35cb1c8c
...
...
@@ -11,6 +11,7 @@ import { NavigationService } from '@xdf/layouts';
import
{
IDirty
}
from
'@xdf/gallery'
;
//import { ExternalSystemService } from '../../service/external-system.service';
import
{
first
}
from
'rxjs/operators'
;
import
{
CaFrequentQuestionsComponent
}
from
'../components/ca-frequent-questions/ca-frequent-questions.component'
;
@
Component
({
...
...
@@ -22,11 +23,14 @@ import { first } from 'rxjs/operators';
}]
})
export
class
AgentComponent
implements
OnInit
{
export
class
AgentComponent
implements
OnInit
,
IDirty
{
@
ViewChild
(
CaGeneralInformationComponent
,
{
static
:
true
})
generalInformationComponent
:
CaGeneralInformationComponent
;
@
ViewChild
(
CaFrequentQuestionsComponent
,
{
static
:
true
})
frequentQuestionsComponent
:
CaFrequentQuestionsComponent
;
externalSystemDetail
:
any
;
isLinear
=
true
;
...
...
@@ -51,6 +55,7 @@ export class AgentComponent implements OnInit {
let
dirty
=
false
;
dirty
=
this
.
generalInformationComponent
.
isDirty
()
||
this
.
frequentQuestionsComponent
.
isDirty
()
;
/* if (dirty) {
...
...
@@ -90,12 +95,12 @@ export class AgentComponent implements OnInit {
let
dataForWizard
=
this
.
_activatedRoute
.
snapshot
.
data
.
dataForWizard
;
//this.connec
tionsComponent.setDataForWizard(dataForWizard);
this
.
frequentQues
tionsComponent
.
setDataForWizard
(
dataForWizard
);
//this.stepsComponent.setDataForWizard(dataForWizard);
//this.entitiesComponent.setDataForWizard(dataForWizard);
this
.
generalInformationComponent
.
buildForm
(
this
.
externalSystemDetail
);
//this.connectionsComponent.buildForm(this.externalSystemDetail, this.resourceAuth
);
this
.
frequentQuestionsComponent
.
buildForm
(
this
.
externalSystemDetail
);
//this.stepsComponent.buildForm(this.externalSystemDetail, this.resourceAuth);
//this.entitiesComponent.buildForm(this.externalSystemDetail);
//this.summaryComponent.buildForm(this.externalSystemDetail);
...
...
projects/bytebot-html/src/app/modules/agent/view/components/ca-frequent-questions/ca-frequent-questions.component.html
0 → 100644
View file @
35cb1c8c
<div
class=
"panel-viewer-wrapper"
>
<div
class=
"panel-viewer-title"
>
<i
class=
"fa fa-info-circle"
></i>
{{'label.frequent-questions.title' | translate}}
</div>
<form
[
formGroup
]="
formGroup
"
autocomplete=
"off"
>
<div
class=
"panel-viewer-body"
>
<div
class=
"row pt-3 pb-4"
>
<div
class=
"col-3"
></div>
<div
class=
"col-6 border-all"
>
<div
class=
"row pt-2"
>
<div
class=
"col-12"
>
<table
mat-table
[
dataSource
]="
dataSource
"
class=
"mat-elevation-z8"
>
<!--- Note that these columns can be defined in any order.
The actual rendered columns are set as a property on the row definition" -->
<!-- Position Column -->
<ng-container
matColumnDef=
"position"
>
<th
mat-header-cell
*
matHeaderCellDef
>
No.
</th>
<td
mat-cell
*
matCellDef=
"let element"
>
{{element.position}}
</td>
</ng-container>
<!-- Name Column -->
<ng-container
matColumnDef=
"name"
>
<th
mat-header-cell
*
matHeaderCellDef
>
Name
</th>
<td
mat-cell
*
matCellDef=
"let element"
>
{{element.name}}
</td>
</ng-container>
<!-- Weight Column -->
<ng-container
matColumnDef=
"weight"
>
<th
mat-header-cell
*
matHeaderCellDef
>
Weight
</th>
<td
mat-cell
*
matCellDef=
"let element"
>
{{element.weight}}
</td>
</ng-container>
<!-- Symbol Column -->
<ng-container
matColumnDef=
"symbol"
>
<th
mat-header-cell
*
matHeaderCellDef
>
Symbol
</th>
<td
mat-cell
*
matCellDef=
"let element"
>
{{element.symbol}}
</td>
</ng-container>
<tr
mat-header-row
*
matHeaderRowDef=
"displayedColumns"
></tr>
<tr
mat-row
*
matRowDef=
"let row; columns: displayedColumns;"
></tr>
</table>
</div>
</div>
</div>
<div
class=
"col-3"
></div>
</div>
</div>
</form>
</div>
projects/bytebot-html/src/app/modules/agent/view/components/ca-frequent-questions/ca-frequent-questions.component.scss
0 → 100644
View file @
35cb1c8c
table
{
width
:
100%
;
}
\ No newline at end of file
projects/bytebot-html/src/app/modules/agent/view/components/ca-frequent-questions/ca-frequent-questions.component.spec.ts
0 → 100644
View file @
35cb1c8c
import
{
async
,
ComponentFixture
,
TestBed
}
from
'@angular/core/testing'
;
import
{
CaFrequentQuestionsComponent
}
from
'./ca-frequent-questions.component'
;
describe
(
'CaFrequentQuestionsComponent'
,
()
=>
{
let
component
:
CaFrequentQuestionsComponent
;
let
fixture
:
ComponentFixture
<
CaFrequentQuestionsComponent
>
;
beforeEach
(
async
(()
=>
{
TestBed
.
configureTestingModule
({
declarations
:
[
CaFrequentQuestionsComponent
]
})
.
compileComponents
();
}));
beforeEach
(()
=>
{
fixture
=
TestBed
.
createComponent
(
CaFrequentQuestionsComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'should create'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
projects/bytebot-html/src/app/modules/agent/view/components/ca-frequent-questions/ca-frequent-questions.component.ts
0 → 100644
View file @
35cb1c8c
import
{
Component
,
OnInit
,
Input
,
ViewContainerRef
}
from
'@angular/core'
;
import
{
Subscription
,
of
}
from
'rxjs'
;
import
{
FormGroup
,
FormBuilder
,
FormControl
}
from
'@angular/forms'
;
import
{
MatStepper
}
from
'@angular/material'
;
import
{
ActivatedRoute
}
from
'@angular/router'
;
import
{
animate
,
trigger
,
state
,
transition
,
style
}
from
'@angular/animations'
;
import
{
DomSanitizer
}
from
'@angular/platform-browser'
;
export
interface
PeriodicElement
{
name
:
string
;
position
:
number
;
weight
:
number
;
symbol
:
string
;
}
const
ELEMENT_DATA
:
PeriodicElement
[]
=
[
{
position
:
1
,
name
:
'Hydrogen'
,
weight
:
1.0079
,
symbol
:
'H'
},
{
position
:
2
,
name
:
'Helium'
,
weight
:
4.0026
,
symbol
:
'He'
},
{
position
:
3
,
name
:
'Lithium'
,
weight
:
6.941
,
symbol
:
'Li'
},
{
position
:
4
,
name
:
'Beryllium'
,
weight
:
9.0122
,
symbol
:
'Be'
},
{
position
:
5
,
name
:
'Boron'
,
weight
:
10.811
,
symbol
:
'B'
},
{
position
:
6
,
name
:
'Carbon'
,
weight
:
12.0107
,
symbol
:
'C'
},
{
position
:
7
,
name
:
'Nitrogen'
,
weight
:
14.0067
,
symbol
:
'N'
},
{
position
:
8
,
name
:
'Oxygen'
,
weight
:
15.9994
,
symbol
:
'O'
},
{
position
:
9
,
name
:
'Fluorine'
,
weight
:
18.9984
,
symbol
:
'F'
},
{
position
:
10
,
name
:
'Neon'
,
weight
:
20.1797
,
symbol
:
'Ne'
},
];
@
Component
({
selector
:
'byte-ca-frequent-questions'
,
templateUrl
:
'./ca-frequent-questions.component.html'
,
styleUrls
:
[
'./ca-frequent-questions.component.scss'
],
animations
:
[
trigger
(
'fadeInOut'
,
[
state
(
'in'
,
style
({
opacity
:
100
})),
transition
(
'* => void'
,
[
animate
(
300
,
style
({
opacity
:
0
}))
])
])
]
})
export
class
CaFrequentQuestionsComponent
implements
OnInit
{
@
Input
()
stepper
:
MatStepper
;
viewMode
:
boolean
;
formGroup
:
FormGroup
;
questions
:
any
;
displayedColumns
:
string
[]
=
[
'position'
,
'name'
,
'weight'
,
'symbol'
];
dataSource
=
ELEMENT_DATA
;
constructor
()
{
}
ngOnInit
()
{
}
isDirty
()
{
return
this
.
formGroup
.
dirty
;
}
buildForm
(
questions
:
any
)
{
this
.
questions
=
questions
;
if
(
questions
)
{
/*
this.formGroup.patchValue({
name: agentDetail.name,
description: agentDetail.description
});
*/
}
}
setDataForWizard
(
result
:
any
)
{
console
.
log
(
result
)
/*
this.protocols = result.connectionProtocolOptions;
this.generalProperties = result.generalProperties;
this.alias = result.alias;
this.maxNumberOfConnectionsByExternalSystem = result.maxNumberOfConnectionsByExternalSystem;
this.columnsForEntity = result.columnsForEntity;
*/
}
}
projects/bytebot-html/src/app/modules/agent/view/components/ca-general-information/ca-general-information.component.html
View file @
35cb1c8c
This diff is collapsed.
Click to expand it.
projects/bytebot-html/src/app/modules/agent/view/components/ca-general-information/ca-general-information.component.scss
View file @
35cb1c8c
...
...
@@ -99,4 +99,12 @@ li {
.without-image
{
text-align
:
inherit
;
height
:
calc
(
100%
-
36px
);
}
.h-85
{
height
:
85%
;
}
.h-100
{
height
:
85%
;
}
\ No newline at end of file
projects/bytebot-html/src/app/modules/agent/view/components/ca-general-information/ca-general-information.component.ts
View file @
35cb1c8c
...
...
@@ -30,7 +30,6 @@ export class CaGeneralInformationComponent implements OnInit {
agentDetail
:
any
;
formGroup
:
FormGroup
;
types
:
any
;
viewMode
:
boolean
;
allowDragAndDrop
=
false
;
...
...
@@ -41,6 +40,44 @@ export class CaGeneralInformationComponent implements OnInit {
//urlBase = './service/file/download/';
urlBase
=
''
;
countries
=
[
{
"name"
:
"Perú"
,
"timezones"
:
[
"GMT-5"
]
},
{
"name"
:
"Argentina"
,
"timezones"
:
[
"GMT-3"
]
},
{
"name"
:
"Brazil"
,
"timezones"
:
[
"GMT-5"
,
"GMT-4"
,
"GMT-3"
,
"GMT-2"
]
}
];
timezones
=
[];
languages
=
[
{
"name"
:
"Español"
}
];
types
=
[
{
"name"
:
"Agente de preguntas frecuentes"
}
];
constructor
(
private
formBuilder
:
FormBuilder
,
private
_activatedRoute
:
ActivatedRoute
,
...
...
@@ -53,7 +90,11 @@ export class CaGeneralInformationComponent implements OnInit {
name
:
new
FormControl
({
value
:
""
,
disabled
:
this
.
viewMode
}),
description
:
new
FormControl
({
value
:
""
,
disabled
:
this
.
viewMode
}),
version
:
new
FormControl
({
value
:
""
,
disabled
:
this
.
viewMode
}),
imageAvatar
:
new
FormControl
({
value
:
""
,
disabled
:
this
.
viewMode
})
imageAvatar
:
new
FormControl
({
value
:
""
,
disabled
:
this
.
viewMode
}),
country
:
new
FormControl
({
value
:
""
,
disabled
:
this
.
viewMode
}),
timezone
:
new
FormControl
({
value
:
""
,
disabled
:
this
.
viewMode
}),
language
:
new
FormControl
({
value
:
""
,
disabled
:
this
.
viewMode
}),
type
:
new
FormControl
({
value
:
""
,
disabled
:
this
.
viewMode
})
});
}
...
...
@@ -151,6 +192,48 @@ export class CaGeneralInformationComponent implements OnInit {
}
}
onCountryChange
(
obj
)
{
console
.
log
(
'Country changed...'
);
let
selectedCountry
=
obj
.
value
;
console
.
log
(
selectedCountry
);
this
.
timezones
=
[];
console
.
log
(
this
.
formGroup
.
controls
[
'timezone'
].
value
);
this
.
formGroup
.
controls
[
'timezone'
].
setValue
(
null
);
if
(
selectedCountry
)
{
this
.
timezones
=
selectedCountry
.
timezones
;
}
}
saveConnection
(
validateForm
:
boolean
):
boolean
{
if
(
validateForm
&&
!
this
.
formGroup
.
valid
)
{
return
false
;
}
/*
this.externalSystemDetail.abbreviation = this.formGroup.controls.abbreviation.value;
this.externalSystemDetail.name = this.formGroup.controls.name.value;
this.externalSystemDetail.description = this.formGroup.controls.description.value;
this.externalSystemDetail.status = this.formGroup.controls.status.value ? 'AC' : 'IN';
this.externalSystemDetail.inputType = this.formGroup.controls.inputType.value;
this.externalSystemDetail.type = this.formGroup.controls.type.value;
*/
return
true
;
}
next
()
{
if
(
this
.
viewMode
)
{
this
.
stepper
.
next
();
return
;
}
if
(
this
.
saveConnection
(
true
))
{
this
.
stepper
.
next
();
}
}
}
export
class
FileUploadModel
{
...
...
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