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
11f7574f
Commit
11f7574f
authored
Feb 26, 2021
by
Thodoris Nestoridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added suffix details (needs work)
parent
2fa98641
Changes
22
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
451 additions
and
42 deletions
+451
-42
app.module.ts
reqtool/ReqmanAngular11/src/app/app.module.ts
+4
-0
boilerplate-details.component.html
...ts/boilerplate-details/boilerplate-details.component.html
+22
-13
boilerplate-details.component.ts
...ents/boilerplate-details/boilerplate-details.component.ts
+14
-11
main-details.component.html
...c/app/components/main-details/main-details.component.html
+9
-1
main-details.component.ts
...src/app/components/main-details/main-details.component.ts
+2
-2
main-list.component.ts
...lar11/src/app/components/main-list/main-list.component.ts
+1
-2
suffix-details.component.html
...p/components/suffix-details/suffix-details.component.html
+76
-0
suffix-details.component.scss
...p/components/suffix-details/suffix-details.component.scss
+0
-0
suffix-details.component.spec.ts
...omponents/suffix-details/suffix-details.component.spec.ts
+25
-0
suffix-details.component.ts
...app/components/suffix-details/suffix-details.component.ts
+142
-0
suffix-list.component.html
...src/app/components/suffix-list/suffix-list.component.html
+0
-0
suffix-list.component.scss
...src/app/components/suffix-list/suffix-list.component.scss
+0
-0
suffix-list.component.spec.ts
.../app/components/suffix-list/suffix-list.component.spec.ts
+25
-0
suffix-list.component.ts
...1/src/app/components/suffix-list/suffix-list.component.ts
+44
-0
main.model.ts
reqtool/ReqmanAngular11/src/app/models/main.model.ts
+1
-1
suffix.model.spec.ts
reqtool/ReqmanAngular11/src/app/models/suffix.model.spec.ts
+7
-0
suffix.model.ts
reqtool/ReqmanAngular11/src/app/models/suffix.model.ts
+10
-0
suffix.service.spec.ts
...l/ReqmanAngular11/src/app/services/suffix.service.spec.ts
+16
-0
suffix.service.ts
reqtool/ReqmanAngular11/src/app/services/suffix.service.ts
+48
-0
suffix_req.py
reqtool/reqman/api/reqman/apps/reqtool/models/suffix_req.py
+4
-3
urls.py
reqtool/reqman/api/reqman/apps/reqtool/rest_api/urls.py
+0
-1
suffix_req_views.py
...pi/reqman/apps/reqtool/rest_api/views/suffix_req_views.py
+1
-8
No files found.
reqtool/ReqmanAngular11/src/app/app.module.ts
View file @
11f7574f
...
@@ -28,6 +28,8 @@ import { HeaderComponent } from './navigation/header/header.component';
...
@@ -28,6 +28,8 @@ import { HeaderComponent } from './navigation/header/header.component';
import
{
SidenavListComponent
}
from
'./navigation/sidenav-list/sidenav-list.component'
;
import
{
SidenavListComponent
}
from
'./navigation/sidenav-list/sidenav-list.component'
;
import
{
MainListComponent
}
from
'./components/main-list/main-list.component'
;
import
{
MainListComponent
}
from
'./components/main-list/main-list.component'
;
import
{
MainDetailsComponent
}
from
'./components/main-details/main-details.component'
;
import
{
MainDetailsComponent
}
from
'./components/main-details/main-details.component'
;
import
{
SuffixListComponent
}
from
'./components/suffix-list/suffix-list.component'
;
import
{
SuffixDetailsComponent
}
from
'./components/suffix-details/suffix-details.component'
;
...
@@ -46,6 +48,8 @@ import { MainDetailsComponent } from './components/main-details/main-details.com
...
@@ -46,6 +48,8 @@ import { MainDetailsComponent } from './components/main-details/main-details.com
SidenavListComponent
,
SidenavListComponent
,
MainListComponent
,
MainListComponent
,
MainDetailsComponent
,
MainDetailsComponent
,
SuffixListComponent
,
SuffixDetailsComponent
,
],
],
imports
:
[
imports
:
[
BrowserModule
,
BrowserModule
,
...
...
reqtool/ReqmanAngular11/src/app/components/boilerplate-details/boilerplate-details.component.html
View file @
11f7574f
<app-prefix-list></app-prefix-list>
<app-prefix-list></app-prefix-list>
<app-main-list></app-main-list>
<app-main-list></app-main-list>
<app-suffix-list></app-suffix-list>
<div>
<div>
<div
*
ngIf=
"currentboilerplate.id"
class=
"edit-form"
>
<div
*
ngIf=
"currentboilerplate.id"
class=
"edit-form"
>
<h4>
Boilerplate
</h4>
<h4>
Boilerplate
</h4>
...
@@ -14,7 +15,7 @@
...
@@ -14,7 +15,7 @@
name=
"title"
name=
"title"
/>
/>
</div>
</div>
<div
style=
"display: flex; flex-grow: grow
"
>
<div
style=
"display: flex; flex-grow: grow; margin-top: 50px;
"
>
<form
class=
"form-group form-inline "
>
<form
class=
"form-group form-inline "
>
<mat-checkbox
class=
"example-full-width"
<mat-checkbox
class=
"example-full-width"
[(
ngModel
)]="
currentboilerplate
.
has_prefix
"
[(
ngModel
)]="
currentboilerplate
.
has_prefix
"
...
@@ -22,9 +23,12 @@
...
@@ -22,9 +23,12 @@
>
Prefix
>
Prefix
</mat-checkbox>
</mat-checkbox>
</form>
</form>
<div
*
ngIf=
"this.currentboilerplate.has_prefix"
>
<app-prefix-details></app-prefix-details>
<app-prefix-details></app-prefix-details>
</div>
</div>
<div
style=
"display: flex; flex-grow: grow"
>
</div>
<mat-divider></mat-divider>
<div
style=
"display: flex; flex-grow: grow; margin-top: 50px;"
>
<form
class=
"form-group form-inline "
>
<form
class=
"form-group form-inline "
>
<mat-checkbox
class=
"example-full-width"
<mat-checkbox
class=
"example-full-width"
[(
ngModel
)]="
currentboilerplate
.
has_main
"
[(
ngModel
)]="
currentboilerplate
.
has_main
"
...
@@ -32,22 +36,27 @@
...
@@ -32,22 +36,27 @@
>
Main
>
Main
</mat-checkbox>
</mat-checkbox>
</form>
</form>
<div
*
ngIf=
"this.currentboilerplate.has_main"
>
<app-main-details></app-main-details>
<app-main-details></app-main-details>
</div>
</div>
<div
class=
"form-group"
>
</div>
<label
for=
"has_suffix"
>
Suffix
</label>
<mat-divider></mat-divider>
<input
<div
style=
"display: flex; flex-grow: grow; margin-top: 50px;"
>
type=
"checkbox"
<form
class=
"form-group form-inline "
>
class=
"form-control"
<mat-checkbox
class=
"example-full-width"
id=
"has_suffix"
[(
ngModel
)]="
this
.
currentboilerplate
.
has_suffix
"
[(
ngModel
)]="
currentboilerplate
.
has_suffix
"
name=
"has_suffix"
name=
"has_suffix"
/>
>
Suffix
</mat-checkbox>
</form>
<div
*
ngIf=
"this.currentboilerplate.has_suffix"
>
<app-suffix-details></app-suffix-details>
</div>
</div>
</div>
</form>
</form>
<button
class=
"badge badge-danger mr-2"
(
click
)="
deleteBoilerplate
()"
>
<button
class=
"badge badge-danger mr-2"
(
click
)="
deleteBoilerplate
()"
>
Delete
Delete
Boilerplate
</button>
</button>
<button
<button
...
@@ -55,7 +64,7 @@
...
@@ -55,7 +64,7 @@
class=
"badge badge-success mb-2"
class=
"badge badge-success mb-2"
(
click
)="
updateBoilerplate
()"
(
click
)="
updateBoilerplate
()"
>
>
Update
Update
Boilerplate
</button>
</button>
<p>
{{ message }}
</p>
<p>
{{ message }}
</p>
</div>
</div>
...
...
reqtool/ReqmanAngular11/src/app/components/boilerplate-details/boilerplate-details.component.ts
View file @
11f7574f
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
ActivatedRoute
,
Router
}
from
'@angular/router'
;
import
{
ActivatedRoute
,
Router
}
from
'@angular/router'
;
import
{
Boilerplate
}
from
'src/app/models/boilerplate.model'
;
import
{
Boilerplate
}
from
'src/app/models/boilerplate.model'
;
import
{
BoilerplateService
}
from
'src/app/services/boilerplate.service'
;
import
{
BoilerplateService
}
from
'src/app/services/boilerplate.service'
;
@
Component
({
@
Component
({
selector
:
'app-boilerplate-details'
,
selector
:
'app-boilerplate-details'
,
templateUrl
:
'./boilerplate-details.component.html'
,
templateUrl
:
'./boilerplate-details.component.html'
,
...
@@ -33,7 +35,7 @@ export class BoilerplateDetailsComponent implements OnInit {
...
@@ -33,7 +35,7 @@ export class BoilerplateDetailsComponent implements OnInit {
.
subscribe
(
.
subscribe
(
data
=>
{
data
=>
{
this
.
currentboilerplate
=
data
;
this
.
currentboilerplate
=
data
;
//
console.log(data);
console
.
log
(
data
);
},
},
error
=>
{
error
=>
{
console
.
log
(
error
);
console
.
log
(
error
);
...
@@ -53,6 +55,7 @@ export class BoilerplateDetailsComponent implements OnInit {
...
@@ -53,6 +55,7 @@ export class BoilerplateDetailsComponent implements OnInit {
}
}
deleteBoilerplate
():
void
{
deleteBoilerplate
():
void
{
if
(
confirm
(
"Αre you sure you want to delete this Boilerplate?"
))
{
this
.
boilerplateService
.
delete
(
this
.
currentboilerplate
.
id
)
this
.
boilerplateService
.
delete
(
this
.
currentboilerplate
.
id
)
.
subscribe
(
.
subscribe
(
response
=>
{
response
=>
{
...
@@ -63,5 +66,5 @@ export class BoilerplateDetailsComponent implements OnInit {
...
@@ -63,5 +66,5 @@ export class BoilerplateDetailsComponent implements OnInit {
console
.
log
(
error
);
console
.
log
(
error
);
});
});
}
}
}
}
}
reqtool/ReqmanAngular11/src/app/components/main-details/main-details.component.html
View file @
11f7574f
...
@@ -114,6 +114,14 @@
...
@@ -114,6 +114,14 @@
</form>
</form>
</div>
</div>
<!--NUmber Value-->
<!--NUmber Value-->
<div
class=
"col"
>
<form
class=
"form-group form-inline"
>
<mat-form-field
class=
"example-full-width"
>
<mat-label>
Numerical Value
</mat-label>
<input
type=
"number"
matInput
value=
0
[(
ngModel
)]="
currentmain
.
numerical
"
name=
"numerical"
>
</mat-form-field>
</form>
</div>
<div
class=
"col"
>
<div
class=
"col"
>
<form
class=
"form-group form-inline"
>
<form
class=
"form-group form-inline"
>
<mat-form-field
class=
"example-full-width"
>
<mat-form-field
class=
"example-full-width"
>
...
...
reqtool/ReqmanAngular11/src/app/components/main-details/main-details.component.ts
View file @
11f7574f
...
@@ -60,7 +60,7 @@ export class MainDetailsComponent implements OnInit {
...
@@ -60,7 +60,7 @@ export class MainDetailsComponent implements OnInit {
shall
:
""
,
shall
:
""
,
verb
:
""
,
verb
:
""
,
quantifier
:
""
,
quantifier
:
""
,
numerical
:
""
,
numerical
:
0
,
mumerical_units
:
""
,
mumerical_units
:
""
,
flow_function_interface_item_system_state_stateset
:
""
,
flow_function_interface_item_system_state_stateset
:
""
,
statevalue_system_connection_stateset
:
""
,
statevalue_system_connection_stateset
:
""
,
...
@@ -132,7 +132,7 @@ export class MainDetailsComponent implements OnInit {
...
@@ -132,7 +132,7 @@ export class MainDetailsComponent implements OnInit {
.
subscribe
(
.
subscribe
(
data
=>
{
data
=>
{
this
.
currentmain
=
data
;
this
.
currentmain
=
data
;
console
.
log
(
data
)
//
console.log(data)
this
.
subjectsControl
.
setValue
(
this
.
currentmain
.
sys_fun_inter
);
this
.
subjectsControl
.
setValue
(
this
.
currentmain
.
sys_fun_inter
);
this
.
stateitemControl
.
setValue
(
this
.
currentmain
.
state_item_before_verb
);
this
.
stateitemControl
.
setValue
(
this
.
currentmain
.
state_item_before_verb
);
this
.
statevalueControl
.
setValue
(
this
.
currentmain
.
statevalue_before_verb
);
this
.
statevalueControl
.
setValue
(
this
.
currentmain
.
statevalue_before_verb
);
...
...
reqtool/ReqmanAngular11/src/app/components/main-list/main-list.component.ts
View file @
11f7574f
...
@@ -31,9 +31,8 @@ export class MainListComponent implements OnInit {
...
@@ -31,9 +31,8 @@ export class MainListComponent implements OnInit {
data
=>
{
data
=>
{
MainDetailsComponent
.
id
.
length
=
0
;
MainDetailsComponent
.
id
.
length
=
0
;
this
.
mains
=
data
;
this
.
mains
=
data
;
console
.
log
(
data
);
for
(
var
val
of
data
)
{
for
(
var
val
of
data
)
{
this
.
mainDetails
.
getMain
(
id
,
val
.
id
);
//
this.mainDetails.getMain(id, val.id);
MainDetailsComponent
.
id
.
push
(
val
.
id
);
MainDetailsComponent
.
id
.
push
(
val
.
id
);
}
}
},
},
...
...
reqtool/ReqmanAngular11/src/app/components/suffix-details/suffix-details.component.html
0 → 100644
View file @
11f7574f
<div
class=
"form-row"
>
<div
class=
"col"
>
<form
class=
"form-group form-inline"
>
<mat-form-field
class=
"example-full-width"
>
<mat-label>
Suffix
</mat-label>
<input
type=
"text"
placeholder=
"Pick one"
aria-label=
"Number"
matInput
[
formControl
]="
suffixControl
"
[
matAutocomplete
]="
autosuffix
"
>
<mat-autocomplete
autoActiveFirstOption
#
autosuffix=
"matAutocomplete"
>
<mat-option
*
ngFor=
"let option of suffixfilteredOptions | 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>
Numerical Value
</mat-label>
<input
type=
"number"
matInput
value=
0
[(
ngModel
)]="
currentsuffix
.
numerical
"
name=
"numerical"
>
</mat-form-field>
</form>
</div>
<div
class=
"col"
>
<form
class=
"form-group form-inline"
>
<mat-form-field
class=
"example-full-width"
>
<mat-label>
Unit
</mat-label>
<input
type=
"text"
placeholder=
"Pick one"
aria-label=
"Number"
matInput
[
formControl
]="
mumerical_unitsControl
"
[
matAutocomplete
]="
automumerical_units
"
>
<mat-autocomplete
autoActiveFirstOption
#
automumerical_units=
"matAutocomplete"
>
<mat-option
*
ngFor=
"let option of mumerical_unitsfilteredOptions | 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>
Unit
</mat-label>
<input
type=
"text"
placeholder=
"Pick one"
aria-label=
"Number"
matInput
[
formControl
]="
flowControl
"
[
matAutocomplete
]="
autoflow
"
>
<mat-autocomplete
autoActiveFirstOption
#
autoflow=
"matAutocomplete"
>
<mat-option
*
ngFor=
"let option of flowfilteredOptions | 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
)="
updateSuffix
()"
>
Update Suffix
</button>
</div>
</div>
\ No newline at end of file
reqtool/ReqmanAngular11/src/app/components/suffix-details/suffix-details.component.scss
0 → 100644
View file @
11f7574f
reqtool/ReqmanAngular11/src/app/components/suffix-details/suffix-details.component.spec.ts
0 → 100644
View file @
11f7574f
import
{
ComponentFixture
,
TestBed
}
from
'@angular/core/testing'
;
import
{
SuffixDetailsComponent
}
from
'./suffix-details.component'
;
describe
(
'SuffixDetailsComponent'
,
()
=>
{
let
component
:
SuffixDetailsComponent
;
let
fixture
:
ComponentFixture
<
SuffixDetailsComponent
>
;
beforeEach
(
async
()
=>
{
await
TestBed
.
configureTestingModule
({
declarations
:
[
SuffixDetailsComponent
]
})
.
compileComponents
();
});
beforeEach
(()
=>
{
fixture
=
TestBed
.
createComponent
(
SuffixDetailsComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'should create'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
reqtool/ReqmanAngular11/src/app/components/suffix-details/suffix-details.component.ts
0 → 100644
View file @
11f7574f
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
ActivatedRoute
,
Router
}
from
'@angular/router'
;
import
{
Suffix
}
from
'src/app/models/suffix.model'
;
import
{
SuffixService
}
from
'src/app/services/suffix.service'
;
import
{
FormControl
}
from
'@angular/forms'
;
import
{
Observable
}
from
'rxjs'
;
import
{
map
,
startWith
}
from
'rxjs/operators'
;
import
{
NotifierService
}
from
"angular-notifier"
;
@
Component
({
selector
:
'app-suffix-details'
,
templateUrl
:
'./suffix-details.component.html'
,
styleUrls
:
[
'./suffix-details.component.scss'
]
})
export
class
SuffixDetailsComponent
implements
OnInit
{
suffixControl
=
new
FormControl
();
suffix
:
string
[]
=
[];
suffixfilteredOptions
:
Observable
<
string
[]
>
;
mumerical_unitsControl
=
new
FormControl
();
mumerical_units
:
string
[]
=
[];
mumerical_unitsfilteredOptions
:
Observable
<
string
[]
>
;
flowControl
=
new
FormControl
();
flow
:
string
[]
=
[];
flowfilteredOptions
:
Observable
<
string
[]
>
;
public
static
id
:
any
[]
=
[];
private
readonly
notifier
:
NotifierService
;
currentsuffix
:
Suffix
=
{
s_choices
:
""
,
numerical
:
0
,
mumerical_units
:
""
,
flow
:
""
,
};
message
=
''
;
constructor
(
private
suffixService
:
SuffixService
,
private
route
:
ActivatedRoute
,
private
router
:
Router
,
notifierService
:
NotifierService
)
{
this
.
notifier
=
notifierService
;
this
.
suffixfilteredOptions
=
this
.
suffixControl
.
valueChanges
.
pipe
(
startWith
(
""
),
map
(
value
=>
this
.
_filter
(
this
.
suffix
,
value
))
);
this
.
mumerical_unitsfilteredOptions
=
this
.
mumerical_unitsControl
.
valueChanges
.
pipe
(
startWith
(
""
),
map
(
value
=>
this
.
_filter
(
this
.
mumerical_units
,
value
))
);
this
.
flowfilteredOptions
=
this
.
flowControl
.
valueChanges
.
pipe
(
startWith
(
""
),
map
(
value
=>
this
.
_filter
(
this
.
flow
,
value
))
);
}
ngOnInit
():
void
{
this
.
getchoices
();
for
(
let
i
=
0
;
i
<
SuffixDetailsComponent
.
id
.
length
;
i
++
)
{
this
.
getSuffix
(
this
.
route
.
snapshot
.
params
.
id
,
SuffixDetailsComponent
.
id
[
i
]);
};
}
private
_filter
(
data
:
string
[],
value
:
string
):
string
[]
{
const
filterValue
=
value
.
toLowerCase
();
return
data
.
filter
(
option
=>
option
.
toLowerCase
().
indexOf
(
filterValue
)
===
0
);
}
getSuffix
(
main
:
any
,
id
:
string
):
void
{
//PrefixDetailsComponent.id = id;
this
.
suffixService
.
get
(
main
,
id
)
.
subscribe
(
data
=>
{
this
.
currentsuffix
=
data
;
//console.log(data)
this
.
suffixControl
.
setValue
(
this
.
currentsuffix
.
s_choices
);
this
.
mumerical_unitsControl
.
setValue
(
this
.
currentsuffix
.
mumerical_units
);
this
.
flowControl
.
setValue
(
this
.
currentsuffix
.
flow
);
},
error
=>
{
console
.
log
(
error
);
});
}
updateSuffix
():
void
{
this
.
currentsuffix
.
s_choices
=
this
.
suffixControl
.
value
;
this
.
currentsuffix
.
mumerical_units
=
this
.
mumerical_unitsControl
.
value
;
this
.
currentsuffix
.
flow
=
this
.
flowControl
.
value
;
for
(
let
i
=
0
;
i
<
SuffixDetailsComponent
.
id
.
length
;
i
++
){
this
.
suffixService
.
update
(
this
.
route
.
snapshot
.
params
.
id
,
SuffixDetailsComponent
.
id
[
i
],
this
.
currentsuffix
)
.
subscribe
(
response
=>
{
this
.
notifier
.
notify
(
"success"
,
JSON
.
stringify
(
"Suffix updated"
));
this
.
message
=
response
.
message
;
},
error
=>
{
console
.
log
(
error
);
this
.
notifier
.
notify
(
"warning"
,(
JSON
.
stringify
(
error
[
"error"
])));
});}
}
getchoices
():
void
{
this
.
suffixService
.
getsuffix
()
.
subscribe
(
data
=>
{
for
(
let
x
=
0
;
x
<
data
.
length
;
x
++
){
this
.
suffix
.
push
(
data
[
x
][
1
]);}
},
error
=>
{
console
.
log
(
error
);
});
this
.
suffixService
.
getnumunits
()
.
subscribe
(
data
=>
{
for
(
let
x
=
0
;
x
<
data
.
length
;
x
++
){
this
.
mumerical_units
.
push
(
data
[
x
][
1
]);}
},
error
=>
{
console
.
log
(
error
);
});
this
.
suffixService
.
getflow
()
.
subscribe
(
data
=>
{
for
(
let
x
=
0
;
x
<
data
.
length
;
x
++
){
this
.
flow
.
push
(
data
[
x
][
1
]);}
},
error
=>
{
console
.
log
(
error
);
});
}
}
reqtool/ReqmanAngular11/src/app/components/suffix-list/suffix-list.component.html
0 → 100644
View file @
11f7574f
reqtool/ReqmanAngular11/src/app/components/suffix-list/suffix-list.component.scss
0 → 100644
View file @
11f7574f
reqtool/ReqmanAngular11/src/app/components/suffix-list/suffix-list.component.spec.ts
0 → 100644
View file @
11f7574f
import
{
ComponentFixture
,
TestBed
}
from
'@angular/core/testing'
;
import
{
SuffixListComponent
}
from
'./suffix-list.component'
;
describe
(
'SuffixListComponent'
,
()
=>
{
let
component
:
SuffixListComponent
;
let
fixture
:
ComponentFixture
<
SuffixListComponent
>
;
beforeEach
(
async
()
=>
{
await
TestBed
.
configureTestingModule
({
declarations
:
[
SuffixListComponent
]
})
.
compileComponents
();
});
beforeEach
(()
=>
{
fixture
=
TestBed
.
createComponent
(
SuffixListComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'should create'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
reqtool/ReqmanAngular11/src/app/components/suffix-list/suffix-list.component.ts
0 → 100644
View file @
11f7574f
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
ActivatedRoute
,
Router
}
from
'@angular/router'
;
import
{
Suffix
}
from
'src/app/models/suffix.model'
;
import
{
SuffixService
}
from
'src/app/services/suffix.service'
;
import
{
SuffixDetailsComponent
}
from
'src/app/components/suffix-details/suffix-details.component'
;
import
{
PrefixDetailsComponent
}
from
'../prefix-details/prefix-details.component'
;
@
Component
({
selector
:
'app-suffix-list'
,
providers
:
[
SuffixDetailsComponent
],
templateUrl
:
'./suffix-list.component.html'
,
styleUrls
:
[
'./suffix-list.component.scss'
]
})
export
class
SuffixListComponent
implements
OnInit
{
suffixs
?:
Suffix
[];
constructor
(
private
suffixService
:
SuffixService
,
private
suffixDetails
:
SuffixDetailsComponent
,
private
route
:
ActivatedRoute
,
private
router
:
Router
)
{
}
ngOnInit
():
void
{
this
.
getAllSuffix
(
this
.
route
.
snapshot
.
params
.
id
);
}
getAllSuffix
(
id
:
string
):
void
{
this
.
suffixService
.
getAll
(
id
)
.
subscribe
(
data
=>
{
SuffixDetailsComponent
.
id
.
length
=
0
;
this
.
suffixs
=
data
;
for
(
var
val
of
data
)
{
//this.mainDetails.getMain(id, val.id);
SuffixDetailsComponent
.
id
.
push
(
val
.
id
);
}
},
error
=>
{
console
.
log
(
error
);
});
}
}
reqtool/ReqmanAngular11/src/app/models/main.model.ts
View file @
11f7574f
...
@@ -8,7 +8,7 @@ export class Main {
...
@@ -8,7 +8,7 @@ export class Main {
shall
?:
string
;
shall
?:
string
;
verb
?:
string
;
verb
?:
string
;
quantifier
?:
string
;
quantifier
?:
string
;
numerical
?:
string
;
numerical
?:
any
;
mumerical_units
?:
string
;
mumerical_units
?:
string
;
flow_function_interface_item_system_state_stateset
?:
string
;
flow_function_interface_item_system_state_stateset
?:
string
;
statevalue_system_connection_stateset
?:
string
;
statevalue_system_connection_stateset
?:
string
;
...
...
reqtool/ReqmanAngular11/src/app/models/suffix.model.spec.ts
0 → 100644
View file @
11f7574f
import
{
Suffix
}
from
'./suffix.model'
;
describe
(
'Suffix'
,
()
=>
{
it
(
'should create an instance'
,
()
=>
{
expect
(
new
Suffix
()).
toBeTruthy
();
});
});
reqtool/ReqmanAngular11/src/app/models/suffix.model.ts
0 → 100644
View file @
11f7574f
export
class
Suffix
{
id
?:
any
boilerplate_of_suffix
?:
any
;
suffix_owner
?:
any
;
s_choices
?:
string
;
numerical
?:
any
;
mumerical_units
?:
string
;
flow
?:
string
;
suffix_choices
?:
string
;
}
reqtool/ReqmanAngular11/src/app/services/suffix.service.spec.ts
0 → 100644
View file @
11f7574f
import
{
TestBed
}
from
'@angular/core/testing'
;
import
{
SuffixService
}
from
'./suffix.service'
;
describe
(
'SuffixService'
,
()
=>
{
let
service
:
SuffixService
;
beforeEach
(()
=>
{
TestBed
.
configureTestingModule
({});
service
=
TestBed
.
inject
(
SuffixService
);
});
it
(
'should be created'
,
()
=>
{
expect
(
service
).
toBeTruthy
();
});
});
reqtool/ReqmanAngular11/src/app/services/suffix.service.ts
0 → 100644
View file @
11f7574f
import
{
Injectable
}
from
'@angular/core'
;
import
{
HttpClient
}
from
'@angular/common/http'
;
import
{
Observable
}
from
'rxjs'
;
import
{
Suffix
}
from
'../models/suffix.model'
;
const
baseUrl
=
'http://155.207.131.19:8000/api-auth/boilerplates/'
;
const
Url
=
'/suffix/'
;
@
Injectable
({
providedIn
:
'root'
})
export
class
SuffixService
{
constructor
(
private
http
:
HttpClient
)
{
}
getAll
(
boilerplate
:
any
):
Observable
<
Suffix
[]
>
{
return
this
.
http
.
get
<
Suffix
[]
>
(
`
${
baseUrl
}${
boilerplate
}${
Url
}
`
);
}
get
(
boilerplate
:
any
,
id
:
any
):
Observable
<
Suffix
>
{
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
}
`
);
}
getsuffix
():
Observable
<
any
>
{
return
this
.
http
.
get
(
`http://155.207.131.19:8000/api-auth/suffix/choices/suffix/`
);
}
getnumunits
():
Observable
<
any
>
{
return
this
.
http
.
get
(
`http://155.207.131.19:8000/api-auth/suffix/choices/numunits/`
);
}
getflow
():
Observable
<
any
>
{
return
this
.
http
.
get
(
`http://155.207.131.19:8000/api-auth/suffix/choices/flow/`
);
}
}
reqtool/reqman/api/reqman/apps/reqtool/models/suffix_req.py
View file @
11f7574f
...
@@ -19,8 +19,9 @@ SUFFIX_CHOICES = (("",""), ('S1', 'S1: <numerical-affirmative> j <closed-interva
...
@@ -19,8 +19,9 @@ SUFFIX_CHOICES = (("",""), ('S1', 'S1: <numerical-affirmative> j <closed-interva
NUMERICAL_AFFIRMATIVE_CHOICES
=
((
"more than"
,
"MORE THAN"
),
(
"less than"
,
"LESS THAN"
),
(
"exactly"
,
"EXACTLY"
),
NUMERICAL_AFFIRMATIVE_CHOICES
=
((
"more than"
,
"MORE THAN"
),
(
"less than"
,
"LESS THAN"
),
(
"exactly"
,
"EXACTLY"
),
(
"at least"
,
"AT LEAST"
),
(
"at most"
,
"AT MOST"
))
(
"at least"
,
"AT LEAST"
),
(
"at most"
,
"AT MOST"
))
NUMBER_UNITS_CHOICES
=
((
""
,
""
),
(
"meters"
,
"METERS"
),
(
"kilometers"
,
"KILOMETERS"
),
(
"volt"
,
"VOLT"
))
NUMBER_UNITS_CHOICES
=
((
""
,
""
),
(
"meters"
,
"METERS"
),
(
"kilometers"
,
"KILOMETERS"
),
(
"volt"
,
"VOLT"
))
TIME_UNITS_CHOICES
=
((
"
"
,
""
),
(
"
seconds"
,
"SECONDS"
),
(
"minutes"
,
"MINUTES"
),
(
"milliseconds"
,
"MILLISECONDS"
))
TIME_UNITS_CHOICES
=
((
"seconds"
,
"SECONDS"
),
(
"minutes"
,
"MINUTES"
),
(
"milliseconds"
,
"MILLISECONDS"
))
FLOW_CHOICES
=
get_instances
(
"SAO#Flow"
)
FLOW_CHOICES
=
get_instances
(
"SAO#Flow"
)
# FLOW returns ()
S2_CHOICES
=
((
"before"
,
"BEFORE"
),
(
"after"
,
"AFTER"
))
S2_CHOICES
=
((
"before"
,
"BEFORE"
),
(
"after"
,
"AFTER"
))
S3_CHOICES
=
((
"every"
,
"EVERY"
),
(
"for a period of"
,
"FOR A PERIOD OF"
),
(
"within"
,
"WITHIN"
),
(
"for at least"
,
"FOR AT LEAST"
))
S3_CHOICES
=
((
"every"
,
"EVERY"
),
(
"for a period of"
,
"FOR A PERIOD OF"
),
(
"within"
,
"WITHIN"
),
(
"for at least"
,
"FOR AT LEAST"
))
S4_CHOICES
=
((
"at the beginning"
,
"AT THE BEGINNING"
),
(
"at the end"
,
"AT THE END"
))
S4_CHOICES
=
((
"at the beginning"
,
"AT THE BEGINNING"
),
(
"at the end"
,
"AT THE END"
))
...
@@ -51,8 +52,8 @@ class Suffix(models.Model):
...
@@ -51,8 +52,8 @@ class Suffix(models.Model):
s_choices
=
models
.
CharField
(
choices
=
S_CHOICES
,
max_length
=
100
,
blank
=
True
)
s_choices
=
models
.
CharField
(
choices
=
S_CHOICES
,
max_length
=
100
,
blank
=
True
)
#if S1
#if S1
numerical
=
models
.
IntegerField
(
blank
=
True
,
null
=
True
)
numerical
=
models
.
IntegerField
(
blank
=
True
,
null
=
True
)
mumerical_units
=
models
.
CharField
(
choices
=
NUMBER_UNITS_CHOICES
,
max_length
=
100
,
blank
=
True
)
mumerical_units
=
models
.
CharField
(
choices
=
NUMBER_UNITS_CHOICES
+
TIME_UNITS_CHOICES
,
max_length
=
100
,
blank
=
True
)
time_units
=
models
.
CharField
(
choices
=
TIME_UNITS_CHOICES
,
max_length
=
100
,
blank
=
True
)
#
time_units = models.CharField(choices=TIME_UNITS_CHOICES, max_length=100, blank=True)
#if S2/S3
#if S2/S3
flow
=
models
.
CharField
(
choices
=
FLOW_CHOICES
,
max_length
=
100
,
blank
=
True
)
flow
=
models
.
CharField
(
choices
=
FLOW_CHOICES
,
max_length
=
100
,
blank
=
True
)
#find suffix
#find suffix
...
...
reqtool/reqman/api/reqman/apps/reqtool/rest_api/urls.py
View file @
11f7574f
...
@@ -43,7 +43,6 @@ urlpatterns = [
...
@@ -43,7 +43,6 @@ urlpatterns = [
#SUFFIX CHOICES DATA
#SUFFIX CHOICES DATA
path
(
'suffix/choices/suffix/'
,
suffix_req_views
.
SuffixChoicesViewSet
.
as_view
(),
name
=
'suffixsuffix'
),
path
(
'suffix/choices/suffix/'
,
suffix_req_views
.
SuffixChoicesViewSet
.
as_view
(),
name
=
'suffixsuffix'
),
path
(
'suffix/choices/numunits/'
,
suffix_req_views
.
NumChoicesViewSet
.
as_view
(),
name
=
'suffixnum'
),
path
(
'suffix/choices/numunits/'
,
suffix_req_views
.
NumChoicesViewSet
.
as_view
(),
name
=
'suffixnum'
),
path
(
'suffix/choices/timeunits/'
,
suffix_req_views
.
TimeChoicesViewSet
.
as_view
(),
name
=
'suffixtime'
),
path
(
'suffix/choices/flow/'
,
suffix_req_views
.
FlowChoicesViewSet
.
as_view
(),
name
=
'suffixflow'
),
path
(
'suffix/choices/flow/'
,
suffix_req_views
.
FlowChoicesViewSet
.
as_view
(),
name
=
'suffixflow'
),
...
...
reqtool/reqman/api/reqman/apps/reqtool/rest_api/views/suffix_req_views.py
View file @
11f7574f
...
@@ -77,14 +77,7 @@ class SuffixChoicesViewSet(APIView):
...
@@ -77,14 +77,7 @@ class SuffixChoicesViewSet(APIView):
class
NumChoicesViewSet
(
APIView
):
class
NumChoicesViewSet
(
APIView
):
def
get
(
self
,
request
):
def
get
(
self
,
request
):
response
=
Response
(
NUMBER_UNITS_CHOICES
)
response
=
Response
(
NUMBER_UNITS_CHOICES
+
TIME_UNITS_CHOICES
)
return
response
class
TimeChoicesViewSet
(
APIView
):
def
get
(
self
,
request
):
response
=
Response
(
TIME_UNITS_CHOICES
)
return
response
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