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
2fa98641
Commit
2fa98641
authored
Feb 26, 2021
by
Thodoris Nestoridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
angular main update
parent
b5b3130b
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
674 additions
and
16 deletions
+674
-16
app.module.ts
reqtool/ReqmanAngular11/src/app/app.module.ts
+4
-0
boilerplate-details.component.html
...ts/boilerplate-details/boilerplate-details.component.html
+10
-9
main-details.component.html
...c/app/components/main-details/main-details.component.html
+183
-0
main-details.component.scss
...c/app/components/main-details/main-details.component.scss
+0
-0
main-details.component.spec.ts
...pp/components/main-details/main-details.component.spec.ts
+25
-0
main-details.component.ts
...src/app/components/main-details/main-details.component.ts
+267
-0
main-list.component.html
...r11/src/app/components/main-list/main-list.component.html
+0
-0
main-list.component.scss
...r11/src/app/components/main-list/main-list.component.scss
+0
-0
main-list.component.spec.ts
.../src/app/components/main-list/main-list.component.spec.ts
+25
-0
main-list.component.ts
...lar11/src/app/components/main-list/main-list.component.ts
+45
-0
prefix-details.component.ts
...app/components/prefix-details/prefix-details.component.ts
+0
-4
main.model.spec.ts
reqtool/ReqmanAngular11/src/app/models/main.model.spec.ts
+7
-0
main.model.ts
reqtool/ReqmanAngular11/src/app/models/main.model.ts
+16
-0
main.service.spec.ts
...ool/ReqmanAngular11/src/app/services/main.service.spec.ts
+16
-0
main.service.ts
reqtool/ReqmanAngular11/src/app/services/main.service.ts
+72
-0
prefix.service.ts
reqtool/ReqmanAngular11/src/app/services/prefix.service.ts
+0
-1
main_req.py
reqtool/reqman/api/reqman/apps/reqtool/models/main_req.py
+2
-1
main_req_views.py
.../api/reqman/apps/reqtool/rest_api/views/main_req_views.py
+2
-1
No files found.
reqtool/ReqmanAngular11/src/app/app.module.ts
View file @
2fa98641
...
...
@@ -26,6 +26,8 @@ import { FlexLayoutModule } from '@angular/flex-layout';
import
{
HeaderComponent
}
from
'./navigation/header/header.component'
;
import
{
SidenavListComponent
}
from
'./navigation/sidenav-list/sidenav-list.component'
;
import
{
MainListComponent
}
from
'./components/main-list/main-list.component'
;
import
{
MainDetailsComponent
}
from
'./components/main-details/main-details.component'
;
...
...
@@ -42,6 +44,8 @@ import { SidenavListComponent } from './navigation/sidenav-list/sidenav-list.com
PrefixListComponent
,
HeaderComponent
,
SidenavListComponent
,
MainListComponent
,
MainDetailsComponent
,
],
imports
:
[
BrowserModule
,
...
...
reqtool/ReqmanAngular11/src/app/components/boilerplate-details/boilerplate-details.component.html
View file @
2fa98641
<app-prefix-list></app-prefix-list>
<app-main-list></app-main-list>
<div>
<div
*
ngIf=
"currentboilerplate.id"
class=
"edit-form"
>
<h4>
Boilerplate
</h4>
...
...
@@ -23,15 +24,15 @@
</form>
<app-prefix-details></app-prefix-details>
</div>
<div
class=
"form-group
"
>
<
label
for=
"has_main"
>
Main
</label
>
<input
type=
"checkbox
"
class=
"form-control
"
id=
"has_main"
[(
ngModel
)]="
currentboilerplate
.
has_main
"
name=
"has_main"
/
>
<div
style=
"display: flex; flex-grow: grow
"
>
<
form
class=
"form-group form-inline "
>
<mat-checkbox
class=
"example-full-width"
[(
ngModel
)]="
currentboilerplate
.
has_main
"
name=
"has_prefix
"
>
Main
</mat-checkbox>
</form>
<app-main-details></app-main-details
>
</div>
<div
class=
"form-group"
>
<label
for=
"has_suffix"
>
Suffix
</label>
...
...
reqtool/ReqmanAngular11/src/app/components/main-details/main-details.component.html
0 → 100644
View file @
2fa98641
<div
class=
"form-row"
>
<div
class=
"col"
>
<form
class=
"form-group form-inline"
>
<mat-form-field
class=
"example-full-width"
>
<mat-label>
Subject
</mat-label>
<input
type=
"text"
placeholder=
"Pick one"
aria-label=
"Number"
matInput
[
formControl
]="
subjectsControl
"
[
matAutocomplete
]="
automainsub
"
>
<mat-autocomplete
autoActiveFirstOption
#
automainsub=
"matAutocomplete"
>
<mat-option
*
ngFor=
"let option of subjectsfilteredOptions | async"
[
value
]="
option
"
>
{{option}}
</mat-option>
</mat-autocomplete>
</mat-form-field>
</form>
</div>
<div
class=
"col"
>
<form
class=
"form-group form-inline"
>
<mat-form-field
class=
"example-full-width"
>
<mat-label>
State or Item
</mat-label>
<input
type=
"text"
placeholder=
"Pick one"
aria-label=
"Number"
matInput
[
formControl
]="
stateitemControl
"
[
matAutocomplete
]="
autostateitem
"
>
<mat-autocomplete
autoActiveFirstOption
#
autostateitem=
"matAutocomplete"
>
<mat-option
*
ngFor=
"let option of stateitemfilteredOptions | async"
[
value
]="
option
"
>
{{option}}
</mat-option>
</mat-autocomplete>
</mat-form-field>
</form>
</div>
<div
class=
"col"
>
<form
class=
"form-group form-inline"
>
<mat-form-field
class=
"example-full-width"
>
<mat-label>
State Value
</mat-label>
<input
type=
"text"
placeholder=
"Pick one"
aria-label=
"Number"
matInput
[
formControl
]="
statevalueControl
"
[
matAutocomplete
]="
autostatevalue
"
>
<mat-autocomplete
autoActiveFirstOption
#
autostatevalue=
"matAutocomplete"
>
<mat-option
*
ngFor=
"let option of statevaluefilteredOptions | async"
[
value
]="
option
"
>
{{option}}
</mat-option>
</mat-autocomplete>
</mat-form-field>
</form>
</div>
<div
class=
"col"
>
<form
class=
"form-group form-inline"
>
<mat-form-field
class=
"example-full-width"
>
<mat-label>
Shall/shall not
</mat-label>
<input
type=
"text"
placeholder=
"Pick one"
aria-label=
"Number"
matInput
[
formControl
]="
shallControl
"
[
matAutocomplete
]="
autoshall
"
>
<mat-autocomplete
autoActiveFirstOption
#
autoshall =
"matAutocomplete"
>
<mat-option
*
ngFor=
"let option of shallfilteredOptions | async"
[
value
]="
option
"
>
{{option}}
</mat-option>
</mat-autocomplete>
</mat-form-field>
</form>
</div>
<div
class=
"col"
>
<form
class=
"form-group form-inline"
>
<mat-form-field
class=
"example-full-width"
>
<mat-label>
Verb
</mat-label>
<input
type=
"text"
placeholder=
"Pick one"
aria-label=
"Number"
matInput
[
formControl
]="
verbControl
"
[
matAutocomplete
]="
autoverb
"
>
<mat-autocomplete
autoActiveFirstOption
#
autoverb =
"matAutocomplete"
>
<mat-option
*
ngFor=
"let option of verbfilteredOptions | async"
[
value
]="
option
"
>
{{option}}
</mat-option>
</mat-autocomplete>
</mat-form-field>
</form>
</div>
<div
class=
"col"
>
<form
class=
"form-group form-inline"
>
<mat-form-field
class=
"example-full-width"
>
<mat-label>
Quantifier
</mat-label>
<input
type=
"text"
placeholder=
"Pick one"
aria-label=
"Number"
matInput
[
formControl
]="
quantifierControl
"
[
matAutocomplete
]="
autoquantifier
"
>
<mat-autocomplete
autoActiveFirstOption
#
autoquantifier =
"matAutocomplete"
>
<mat-option
*
ngFor=
"let option of quantifierfilteredOptions | async"
[
value
]="
option
"
>
{{option}}
</mat-option>
</mat-autocomplete>
</mat-form-field>
</form>
</div>
<!--NUmber Value-->
<div
class=
"col"
>
<form
class=
"form-group form-inline"
>
<mat-form-field
class=
"example-full-width"
>
<mat-label>
Number Unit
</mat-label>
<input
type=
"text"
placeholder=
"Pick one"
aria-label=
"Number"
matInput
[
formControl
]="
numunitControl
"
[
matAutocomplete
]="
autonumunit
"
>
<mat-autocomplete
autoActiveFirstOption
#
autonumunit =
"matAutocomplete"
>
<mat-option
*
ngFor=
"let option of numunitfilteredOptions | async"
[
value
]="
option
"
>
{{option}}
</mat-option>
</mat-autocomplete>
</mat-form-field>
</form>
</div>
<div
class=
"col"
>
<form
class=
"form-group form-inline"
>
<mat-form-field
class=
"example-full-width"
>
<mat-label>
Object
</mat-label>
<input
type=
"text"
placeholder=
"Pick one"
aria-label=
"Number"
matInput
[
formControl
]="
fifuintsysstatsetControl
"
[
matAutocomplete
]="
autofifuintsysstatset
"
>
<mat-autocomplete
autoActiveFirstOption
#
autofifuintsysstatset =
"matAutocomplete"
>
<mat-option
*
ngFor=
"let option of fifuintsysstatsetfilteredOptions | async"
[
value
]="
option
"
>
{{option}}
</mat-option>
</mat-autocomplete>
</mat-form-field>
</form>
</div>
<div
class=
"col"
>
<form
class=
"form-group form-inline"
>
<mat-form-field
class=
"example-full-width"
>
<mat-label>
Connection
</mat-label>
<input
type=
"text"
placeholder=
"Pick one"
aria-label=
"Number"
matInput
[
formControl
]="
stsysconsetControl
"
[
matAutocomplete
]="
autostsysconset
"
>
<mat-autocomplete
autoActiveFirstOption
#
autostsysconset =
"matAutocomplete"
>
<mat-option
*
ngFor=
"let option of stsysconsetfilteredOptions | async"
[
value
]="
option
"
>
{{option}}
</mat-option>
</mat-autocomplete>
</mat-form-field>
</form>
</div>
<div
class=
"col"
>
<button
type=
"submit"
class=
"badge badge-success mb-2"
(
click
)="
updateMain
()"
>
Update Main
</button>
</div>
</div>
\ No newline at end of file
reqtool/ReqmanAngular11/src/app/components/main-details/main-details.component.scss
0 → 100644
View file @
2fa98641
reqtool/ReqmanAngular11/src/app/components/main-details/main-details.component.spec.ts
0 → 100644
View file @
2fa98641
import
{
ComponentFixture
,
TestBed
}
from
'@angular/core/testing'
;
import
{
MainDetailsComponent
}
from
'./main-details.component'
;
describe
(
'MainDetailsComponent'
,
()
=>
{
let
component
:
MainDetailsComponent
;
let
fixture
:
ComponentFixture
<
MainDetailsComponent
>
;
beforeEach
(
async
()
=>
{
await
TestBed
.
configureTestingModule
({
declarations
:
[
MainDetailsComponent
]
})
.
compileComponents
();
});
beforeEach
(()
=>
{
fixture
=
TestBed
.
createComponent
(
MainDetailsComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'should create'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
reqtool/ReqmanAngular11/src/app/components/main-details/main-details.component.ts
0 → 100644
View file @
2fa98641
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
ActivatedRoute
,
Router
}
from
'@angular/router'
;
import
{
Main
}
from
'src/app/models/main.model'
;
import
{
MainService
}
from
'src/app/services/main.service'
;
import
{
FormControl
}
from
'@angular/forms'
;
import
{
Observable
}
from
'rxjs'
;
import
{
map
,
startWith
}
from
'rxjs/operators'
;
import
{
NotifierService
}
from
"angular-notifier"
;
@
Component
({
selector
:
'app-main-details'
,
templateUrl
:
'./main-details.component.html'
,
styleUrls
:
[
'./main-details.component.scss'
]
})
export
class
MainDetailsComponent
implements
OnInit
{
subjectsControl
=
new
FormControl
();
subjects
:
string
[]
=
[];
subjectsfilteredOptions
:
Observable
<
string
[]
>
;
stateitemControl
=
new
FormControl
();
stateitem
:
string
[]
=
[];
stateitemfilteredOptions
:
Observable
<
string
[]
>
;
statevalueControl
=
new
FormControl
();
statevalue
:
string
[]
=
[];
statevaluefilteredOptions
:
Observable
<
string
[]
>
;
shallControl
=
new
FormControl
();
shall
:
string
[]
=
[];
shallfilteredOptions
:
Observable
<
string
[]
>
;
verbControl
=
new
FormControl
();
verb
:
string
[]
=
[];
verbfilteredOptions
:
Observable
<
string
[]
>
;
quantifierControl
=
new
FormControl
();
quantifier
:
string
[]
=
[];
quantifierfilteredOptions
:
Observable
<
string
[]
>
;
numunitControl
=
new
FormControl
();
numunit
:
string
[]
=
[];
numunitfilteredOptions
:
Observable
<
string
[]
>
;
fifuintsysstatsetControl
=
new
FormControl
();
fifuintsysstatset
:
string
[]
=
[];
fifuintsysstatsetfilteredOptions
:
Observable
<
string
[]
>
;
stsysconsetControl
=
new
FormControl
();
stsysconset
:
string
[]
=
[];
stsysconsetfilteredOptions
:
Observable
<
string
[]
>
;
public
static
id
:
any
[]
=
[];
private
readonly
notifier
:
NotifierService
;
currentmain
:
Main
=
{
sys_fun_inter
:
""
,
state_item_before_verb
:
""
,
statevalue_before_verb
:
""
,
shall
:
""
,
verb
:
""
,
quantifier
:
""
,
numerical
:
""
,
mumerical_units
:
""
,
flow_function_interface_item_system_state_stateset
:
""
,
statevalue_system_connection_stateset
:
""
,
};
message
=
''
;
constructor
(
private
mainService
:
MainService
,
private
route
:
ActivatedRoute
,
private
router
:
Router
,
notifierService
:
NotifierService
)
{
this
.
notifier
=
notifierService
;
this
.
subjectsfilteredOptions
=
this
.
subjectsControl
.
valueChanges
.
pipe
(
startWith
(
""
),
map
(
value
=>
this
.
_filter
(
this
.
subjects
,
value
))
);
this
.
stateitemfilteredOptions
=
this
.
stateitemControl
.
valueChanges
.
pipe
(
startWith
(
""
),
map
(
value
=>
this
.
_filter
(
this
.
stateitem
,
value
))
);
this
.
statevaluefilteredOptions
=
this
.
statevalueControl
.
valueChanges
.
pipe
(
startWith
(
""
),
map
(
value
=>
this
.
_filter
(
this
.
statevalue
,
value
))
);
this
.
shallfilteredOptions
=
this
.
shallControl
.
valueChanges
.
pipe
(
startWith
(
""
),
map
(
value
=>
this
.
_filter
(
this
.
shall
,
value
))
);
this
.
verbfilteredOptions
=
this
.
verbControl
.
valueChanges
.
pipe
(
startWith
(
""
),
map
(
value
=>
this
.
_filter
(
this
.
verb
,
value
))
);
this
.
quantifierfilteredOptions
=
this
.
quantifierControl
.
valueChanges
.
pipe
(
startWith
(
""
),
map
(
value
=>
this
.
_filter
(
this
.
quantifier
,
value
))
);
this
.
numunitfilteredOptions
=
this
.
numunitControl
.
valueChanges
.
pipe
(
startWith
(
""
),
map
(
value
=>
this
.
_filter
(
this
.
numunit
,
value
))
);
this
.
fifuintsysstatsetfilteredOptions
=
this
.
fifuintsysstatsetControl
.
valueChanges
.
pipe
(
startWith
(
""
),
map
(
value
=>
this
.
_filter
(
this
.
fifuintsysstatset
,
value
))
);
this
.
stsysconsetfilteredOptions
=
this
.
stsysconsetControl
.
valueChanges
.
pipe
(
startWith
(
""
),
map
(
value
=>
this
.
_filter
(
this
.
stsysconset
,
value
))
);
}
ngOnInit
():
void
{
this
.
getchoices
();
for
(
let
i
=
0
;
i
<
MainDetailsComponent
.
id
.
length
;
i
++
)
{
this
.
getMain
(
this
.
route
.
snapshot
.
params
.
id
,
MainDetailsComponent
.
id
[
i
]);
};
}
private
_filter
(
data
:
string
[],
value
:
string
):
string
[]
{
const
filterValue
=
value
.
toLowerCase
();
return
data
.
filter
(
option
=>
option
.
toLowerCase
().
indexOf
(
filterValue
)
===
0
);
}
getMain
(
main
:
any
,
id
:
string
):
void
{
//PrefixDetailsComponent.id = id;
this
.
mainService
.
get
(
main
,
id
)
.
subscribe
(
data
=>
{
this
.
currentmain
=
data
;
console
.
log
(
data
)
this
.
subjectsControl
.
setValue
(
this
.
currentmain
.
sys_fun_inter
);
this
.
stateitemControl
.
setValue
(
this
.
currentmain
.
state_item_before_verb
);
this
.
statevalueControl
.
setValue
(
this
.
currentmain
.
statevalue_before_verb
);
this
.
shallControl
.
setValue
(
this
.
currentmain
.
shall
);
this
.
verbControl
.
setValue
(
this
.
currentmain
.
verb
);
this
.
quantifierControl
.
setValue
(
this
.
currentmain
.
quantifier
);
// num
this
.
numunitControl
.
setValue
(
this
.
currentmain
.
mumerical_units
);
this
.
fifuintsysstatsetControl
.
setValue
(
this
.
currentmain
.
flow_function_interface_item_system_state_stateset
);
this
.
stsysconsetControl
.
setValue
(
this
.
currentmain
.
statevalue_system_connection_stateset
);
},
error
=>
{
console
.
log
(
error
);
});
}
updateMain
():
void
{
this
.
currentmain
.
sys_fun_inter
=
this
.
subjectsControl
.
value
;
this
.
currentmain
.
state_item_before_verb
=
this
.
stateitemControl
.
value
;
this
.
currentmain
.
statevalue_before_verb
=
this
.
statevalueControl
.
value
;
this
.
currentmain
.
shall
=
this
.
shallControl
.
value
;
this
.
currentmain
.
verb
=
this
.
verbControl
.
value
;
this
.
currentmain
.
quantifier
=
this
.
quantifierControl
.
value
;
//num
this
.
currentmain
.
mumerical_units
=
this
.
numunitControl
.
value
;
this
.
currentmain
.
flow_function_interface_item_system_state_stateset
=
this
.
fifuintsysstatsetControl
.
value
;
this
.
currentmain
.
statevalue_system_connection_stateset
=
this
.
stsysconsetControl
.
value
;
for
(
let
i
=
0
;
i
<
MainDetailsComponent
.
id
.
length
;
i
++
){
this
.
mainService
.
update
(
this
.
route
.
snapshot
.
params
.
id
,
MainDetailsComponent
.
id
[
i
],
this
.
currentmain
)
.
subscribe
(
response
=>
{
this
.
notifier
.
notify
(
"success"
,
JSON
.
stringify
(
"Prefix updated"
));
this
.
message
=
response
.
message
;
},
error
=>
{
console
.
log
(
error
);
this
.
notifier
.
notify
(
"warning"
,(
JSON
.
stringify
(
error
[
"error"
])));
});}
}
getchoices
():
void
{
this
.
mainService
.
getsubject
()
.
subscribe
(
data
=>
{
for
(
let
x
=
0
;
x
<
data
.
length
;
x
++
){
this
.
subjects
.
push
(
data
[
x
][
1
]);}
},
error
=>
{
console
.
log
(
error
);
});
this
.
mainService
.
getstateitem
()
.
subscribe
(
data
=>
{
//no data from State and Item
console
.
log
(
data
);
for
(
let
x
=
0
;
x
<
data
.
length
;
x
++
){
this
.
stateitem
.
push
(
data
[
x
][
1
]);}
},
error
=>
{
console
.
log
(
error
);
});
this
.
mainService
.
getstatevalue
()
.
subscribe
(
data
=>
{
for
(
let
x
=
0
;
x
<
data
.
length
;
x
++
){
this
.
statevalue
.
push
(
data
[
x
][
1
]);}
},
error
=>
{
console
.
log
(
error
);
});
this
.
mainService
.
getshall
()
.
subscribe
(
data
=>
{
for
(
let
x
=
0
;
x
<
data
.
length
;
x
++
){
this
.
shall
.
push
(
data
[
x
][
1
]);}
},
error
=>
{
console
.
log
(
error
);
});
this
.
mainService
.
getverb
()
.
subscribe
(
data
=>
{
for
(
let
x
=
0
;
x
<
data
.
length
;
x
++
){
this
.
verb
.
push
(
data
[
x
][
1
]);}
},
error
=>
{
console
.
log
(
error
);
});
this
.
mainService
.
getquantifier
()
.
subscribe
(
data
=>
{
for
(
let
x
=
0
;
x
<
data
.
length
;
x
++
){
this
.
quantifier
.
push
(
data
[
x
][
1
]);}
},
error
=>
{
console
.
log
(
error
);
});
//num
this
.
mainService
.
getnumunit
()
.
subscribe
(
data
=>
{
for
(
let
x
=
0
;
x
<
data
.
length
;
x
++
){
this
.
numunit
.
push
(
data
[
x
][
1
]);}
},
error
=>
{
console
.
log
(
error
);
});
this
.
mainService
.
getfifuintsysstatset
()
.
subscribe
(
data
=>
{
for
(
let
x
=
0
;
x
<
data
.
length
;
x
++
){
this
.
fifuintsysstatset
.
push
(
data
[
x
][
1
]);}
},
error
=>
{
console
.
log
(
error
);
});
this
.
mainService
.
getstsysconset
()
.
subscribe
(
data
=>
{
for
(
let
x
=
0
;
x
<
data
.
length
;
x
++
){
this
.
stsysconset
.
push
(
data
[
x
][
1
]);}
},
error
=>
{
console
.
log
(
error
);
});
}
}
reqtool/ReqmanAngular11/src/app/components/main-list/main-list.component.html
0 → 100644
View file @
2fa98641
reqtool/ReqmanAngular11/src/app/components/main-list/main-list.component.scss
0 → 100644
View file @
2fa98641
reqtool/ReqmanAngular11/src/app/components/main-list/main-list.component.spec.ts
0 → 100644
View file @
2fa98641
import
{
ComponentFixture
,
TestBed
}
from
'@angular/core/testing'
;
import
{
MainListComponent
}
from
'./main-list.component'
;
describe
(
'MainListComponent'
,
()
=>
{
let
component
:
MainListComponent
;
let
fixture
:
ComponentFixture
<
MainListComponent
>
;
beforeEach
(
async
()
=>
{
await
TestBed
.
configureTestingModule
({
declarations
:
[
MainListComponent
]
})
.
compileComponents
();
});
beforeEach
(()
=>
{
fixture
=
TestBed
.
createComponent
(
MainListComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'should create'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
reqtool/ReqmanAngular11/src/app/components/main-list/main-list.component.ts
0 → 100644
View file @
2fa98641
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
ActivatedRoute
,
Router
}
from
'@angular/router'
;
import
{
Main
}
from
'src/app/models/main.model'
;
import
{
MainService
}
from
'src/app/services/main.service'
;
import
{
MainDetailsComponent
}
from
'src/app/components/main-details/main-details.component'
;
@
Component
({
selector
:
'app-main-list'
,
providers
:
[
MainDetailsComponent
],
templateUrl
:
'./main-list.component.html'
,
styleUrls
:
[
'./main-list.component.scss'
]
})
export
class
MainListComponent
implements
OnInit
{
mains
?:
Main
[];
constructor
(
private
mainService
:
MainService
,
private
mainDetails
:
MainDetailsComponent
,
private
route
:
ActivatedRoute
,
private
router
:
Router
)
{
}
ngOnInit
():
void
{
this
.
getAllMain
(
this
.
route
.
snapshot
.
params
.
id
);
}
getAllMain
(
id
:
string
):
void
{
this
.
mainService
.
getAll
(
id
)
.
subscribe
(
data
=>
{
MainDetailsComponent
.
id
.
length
=
0
;
this
.
mains
=
data
;
console
.
log
(
data
);
for
(
var
val
of
data
)
{
this
.
mainDetails
.
getMain
(
id
,
val
.
id
);
MainDetailsComponent
.
id
.
push
(
val
.
id
);
}
},
error
=>
{
console
.
log
(
error
);
});
}
}
reqtool/ReqmanAngular11/src/app/components/prefix-details/prefix-details.component.ts
View file @
2fa98641
...
...
@@ -38,7 +38,6 @@ export class PrefixDetailsComponent implements OnInit {
public
static
id
:
any
[]
=
[];
private
readonly
notifier
:
NotifierService
;
disable
=
true
;
//for the moment only one prefix can showed/updates
currentprefix
:
Prefix
=
{
...
...
@@ -103,9 +102,6 @@ export class PrefixDetailsComponent implements OnInit {
this
.
verbsControl
.
setValue
(
this
.
currentprefix
.
state_or_verb
);
this
.
objectsControl
.
setValue
(
this
.
currentprefix
.
item_function_flow_statevalue
);
this
.
logic_conControl
.
setValue
(
this
.
currentprefix
.
logic_connective
);
},
error
=>
{
console
.
log
(
error
);
...
...
reqtool/ReqmanAngular11/src/app/models/main.model.spec.ts
0 → 100644
View file @
2fa98641
import
{
Main
}
from
'./main.model'
;
describe
(
'Main'
,
()
=>
{
it
(
'should create an instance'
,
()
=>
{
expect
(
new
Main
()).
toBeTruthy
();
});
});
reqtool/ReqmanAngular11/src/app/models/main.model.ts
0 → 100644
View file @
2fa98641
export
class
Main
{
id
?:
any
;
boilerplate_of_main
?:
any
;
main_owner
?:
any
;
sys_fun_inter
?:
string
;
state_item_before_verb
?:
string
;
statevalue_before_verb
?:
string
;
shall
?:
string
;
verb
?:
string
;
quantifier
?:
string
;
numerical
?:
string
;
mumerical_units
?:
string
;
flow_function_interface_item_system_state_stateset
?:
string
;
statevalue_system_connection_stateset
?:
string
;
main_choices
?:
string
;
}
reqtool/ReqmanAngular11/src/app/services/main.service.spec.ts
0 → 100644
View file @
2fa98641
import
{
TestBed
}
from
'@angular/core/testing'
;
import
{
MainService
}
from
'./main.service'
;
describe
(
'MainService'
,
()
=>
{
let
service
:
MainService
;
beforeEach
(()
=>
{
TestBed
.
configureTestingModule
({});
service
=
TestBed
.
inject
(
MainService
);
});
it
(
'should be created'
,
()
=>
{
expect
(
service
).
toBeTruthy
();
});
});
reqtool/ReqmanAngular11/src/app/services/main.service.ts
0 → 100644
View file @
2fa98641
import
{
Injectable
}
from
'@angular/core'
;
import
{
HttpClient
}
from
'@angular/common/http'
;
import
{
Observable
}
from
'rxjs'
;
import
{
Main
}
from
'../models/main.model'
;
const
baseUrl
=
'http://155.207.131.19:8000/api-auth/boilerplates/'
;
const
Url
=
'/main/'
;
@
Injectable
({
providedIn
:
'root'
})
export
class
MainService
{
constructor
(
private
http
:
HttpClient
)
{
}
getAll
(
boilerplate
:
any
):
Observable
<
Main
[]
>
{
return
this
.
http
.
get
<
Main
[]
>
(
`
${
baseUrl
}${
boilerplate
}${
Url
}
`
);
}
get
(
boilerplate
:
any
,
id
:
any
):
Observable
<
Main
>
{
return
this
.
http
.
get
(
`
${
baseUrl
}${
boilerplate
}${
Url
}${
id
}
`
);
}
create
(
boilerplate
:
any
,
data
:
any
):
Observable
<
any
>
{
return
this
.
http
.
post
(
`
${
baseUrl
}${
boilerplate
}${
Url
}
`
,
data
);
}
update
(
boilerplate
:
any
,
id
:
any
,
data
:
any
):
Observable
<
any
>
{
return
this
.
http
.
put
(
`
${
baseUrl
}${
boilerplate
}${
Url
}${
id
}
/`
,
data
);
}
delete
(
boilerplate
:
any
,
id
:
any
):
Observable
<
any
>
{
return
this
.
http
.
delete
(
`
${
baseUrl
}${
boilerplate
}${
Url
}${
baseUrl
}${
id
}
`
);
}
getsubject
():
Observable
<
any
>
{
return
this
.
http
.
get
(
`http://155.207.131.19:8000/api-auth/main/choices/subject/`
);
}
getstateitem
():
Observable
<
any
>
{
return
this
.
http
.
get
(
`http://155.207.131.19:8000/api-auth/main/choices/stateitem/`
);
}
getstatevalue
():
Observable
<
any
>
{
return
this
.
http
.
get
(
`http://155.207.131.19:8000/api-auth/main/choices/statevalue/`
);
}
getshall
():
Observable
<
any
>
{
return
this
.
http
.
get
(
`http://155.207.131.19:8000/api-auth/main/choices/shall/`
);
}
getverb
():
Observable
<
any
>
{
return
this
.
http
.
get
(
`http://155.207.131.19:8000/api-auth/main/choices/verb/`
);
}
getquantifier
():
Observable
<
any
>
{
return
this
.
http
.
get
(
`http://155.207.131.19:8000/api-auth/main/choices/quantifier/`
);
}
getnumunit
():
Observable
<
any
>
{
return
this
.
http
.
get
(
`http://155.207.131.19:8000/api-auth/main/choices/numunit/`
);
}
getfifuintsysstatset
():
Observable
<
any
>
{
return
this
.
http
.
get
(
`http://155.207.131.19:8000/api-auth/main/choices/fifuintsysstatset/`
);
}
getstsysconset
():
Observable
<
any
>
{
return
this
.
http
.
get
(
`http://155.207.131.19:8000/api-auth/main/choices/stsysconset/`
);
}
}
reqtool/ReqmanAngular11/src/app/services/prefix.service.ts
View file @
2fa98641
import
{
Injectable
}
from
'@angular/core'
;
import
{
HttpClient
}
from
'@angular/common/http'
;
import
{
HttpHeaders
}
from
'@angular/common/http'
;
import
{
Observable
}
from
'rxjs'
;
import
{
Prefix
}
from
'../models/prefix.model'
;
...
...
reqtool/reqman/api/reqman/apps/reqtool/models/main_req.py
View file @
2fa98641
...
...
@@ -31,13 +31,14 @@ MAIN_CHOICES = ( ("",""), ("M1", "M1 : system/function shall [not] set [<quant
#to be updated with domains from DSO
SYSTEM_CHOICES
=
get_instances
(
"SAO#System"
)
#+get_i_instances("SAO#System")
FUNCTION_CHOICES
=
get_instances
(
"SAO#Function"
)
SHALL_CHOICES
=
(
(
"shall"
,
"
SHALL"
),
(
"shall not"
,
"SHALL NOT
"
))
SHALL_CHOICES
=
(
(
"shall"
,
"
shall"
),
(
"shall not"
,
"shall not
"
))
QUANTIFIER_CHOICES
=
(
(
"none"
,
"NONE"
),
(
"all"
,
"ALL"
),
(
"only"
,
"ONLY"
),
(
"more than"
,
"MORE THAN"
),
(
"less than"
,
"LESS THAN"
),
(
"exactly"
,
"EXACTLY"
),
(
"at least"
,
"AT LEAST"
),
(
"at most"
,
"AT MOST"
)
)
NUMBER_UNITS_CHOICES
=
((
""
,
""
),
(
"meters"
,
"METERS"
),
(
"kilometers"
,
"KILOMETERS"
),
(
"volt"
,
"VOLT"
))
ITEM_CHOICES
=
get_instances
(
"SAO#Item"
)
#NO ITEM returned
STATE_VALUE_CHOICES
=
get_i_instances
(
"SAO#StateValue"
)
#print(STATE_VALUE_CHOICES)
STATE_CHOICES
=
get_instances
(
"SAO#State"
)
...
...
reqtool/reqman/api/reqman/apps/reqtool/rest_api/views/main_req_views.py
View file @
2fa98641
...
...
@@ -16,7 +16,7 @@ from rest_framework.views import APIView
from
reqman.apps.reqtool.models.main_req
import
SYSTEM_CHOICES
,
FUNCTION_CHOICES
,
INTERFACE_CHOICES
,
STATE_CHOICES
,
ITEM_CHOICES
from
reqman.apps.reqtool.models.main_req
import
STATE_VALUE_CHOICES
,
SHALL_CHOICES
,
VERB_CHOICES
,
QUANTIFIER_CHOICES
,
NUMBER_UNITS_CHOICES
from
reqman.apps.reqtool.models.main_req
import
FLOW_CHOICES
,
CONNECTION_CHOICES
from
reqman.apps.reqtool.models.main_req
import
FLOW_CHOICES
,
CONNECTION_CHOICES
,
STATE_SET_CHOICES
class
MainListAPIView
(
ListAPIView
):
"""
...
...
@@ -85,6 +85,7 @@ class StatItemChoicesViewSet(APIView):
class
StatevalueChoicesViewSet
(
APIView
):
def
get
(
self
,
request
):
print
(
STATE_VALUE_CHOICES
)
response
=
Response
(
STATE_VALUE_CHOICES
)
return
response
...
...
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