Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
Requirement Formalization Tool
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
Thodoris Nestoridis
Requirement Formalization Tool
Commits
32edaadd
Commit
32edaadd
authored
Feb 24, 2021
by
Thodoris Nestoridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
autocomplete prefix (progress 70%)
parent
720ef70a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
9 deletions
+30
-9
prefix-details.component.ts
...app/components/prefix-details/prefix-details.component.ts
+30
-9
No files found.
reqtool/ReqmanAngular11/src/app/components/prefix-details/prefix-details.component.ts
View file @
32edaadd
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
ActivatedRoute
,
Router
}
from
'@angular/router'
;
import
{
Prefix
}
from
'src/app/models/prefix.model'
;
import
{
PrefixService
}
from
'src/app/services/prefix.service'
;
import
{
FormControl
}
from
'@angular/forms'
;
import
{
Observable
}
from
'rxjs'
;
import
{
map
,
startWith
}
from
'rxjs/operators'
;
import
{
NotifierService
}
from
"angular-notifier"
;
@
Component
({
selector
:
'app-prefix-details'
,
...
...
@@ -24,6 +27,9 @@ export class PrefixDetailsComponent implements OnInit {
objects
=
[];
logic_con
=
[];
public
static
id
:
any
[]
=
[];
private
readonly
notifier
:
NotifierService
;
//for the moment only one prefix can showed/updates
currentprefix
:
Prefix
=
{
prefix
:
""
,
...
...
@@ -37,7 +43,8 @@ export class PrefixDetailsComponent implements OnInit {
message
=
''
;
constructor
(
private
prefixService
:
PrefixService
)
{
constructor
(
private
prefixService
:
PrefixService
,
private
route
:
ActivatedRoute
,
private
router
:
Router
,
notifierService
:
NotifierService
)
{
this
.
notifier
=
notifierService
;
this
.
simpleprefixfilteredOptions
=
this
.
simpleprefixControl
.
valueChanges
.
pipe
(
startWith
(
""
),
map
(
value
=>
this
.
_filter
(
this
.
simpleprefix
,
value
))
...
...
@@ -48,31 +55,44 @@ export class PrefixDetailsComponent implements OnInit {
);
}
ngOnInit
():
void
{
this
.
getchoices
();
}
ngOnInit
():
void
{
this
.
getchoices
();
for
(
let
i
=
0
;
i
<
PrefixDetailsComponent
.
id
.
length
;
i
++
)
{
this
.
getPrefix
(
this
.
route
.
snapshot
.
params
.
id
,
PrefixDetailsComponent
.
id
[
i
]);
};
}
private
_filter
(
data
:
string
[],
value
:
string
):
string
[]
{
const
filterValue
=
value
.
toLowerCase
();
this
.
currentprefix
.
prefix
=
this
.
simpleprefixControl
.
value
;
this
.
currentprefix
.
system_fun_item
=
this
.
subjectsControl
.
value
;
return
data
.
filter
(
option
=>
option
.
toLowerCase
().
indexOf
(
filterValue
)
===
0
);
}
getPrefix
(
prefix
:
any
,
id
:
string
):
void
{
//PrefixDetailsComponent.id = id;
this
.
prefixService
.
get
(
prefix
,
id
)
.
subscribe
(
data
=>
{
this
.
currentprefix
=
data
;
console
.
log
(
data
);
console
.
log
(
data
)
this
.
simpleprefixControl
.
setValue
(
this
.
currentprefix
.
prefix
);
//make it null need solution
//this.subjectsControl.setValue(this.currentprefix.system_fun_item);
},
error
=>
{
console
.
log
(
error
);
});
}
// to be done
update
Boilerplate
():
void
{
//this.simpleprefix =
/*this.prefixService.update(
)
update
Prefix
():
void
{
for
(
let
i
=
0
;
i
<
PrefixDetailsComponent
.
id
.
length
;
i
++
){
this
.
prefixService
.
update
(
this
.
route
.
snapshot
.
params
.
id
,
PrefixDetailsComponent
.
id
[
i
],
this
.
currentprefix
)
.
subscribe
(
response
=>
{
console
.
log
(
response
);
...
...
@@ -80,7 +100,8 @@ export class PrefixDetailsComponent implements OnInit {
},
error
=>
{
console
.
log
(
error
);
});*/
this
.
notifier
.
notify
(
"warning"
,(
JSON
.
stringify
(
error
[
"error"
])));
});}
}
...
...
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