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
feaaa807
Commit
feaaa807
authored
Mar 11, 2021
by
Thodoris Nestoridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add groups in Boilerplates(ui needs update)
parent
e3083e2d
Changes
27
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
1412 additions
and
1142 deletions
+1412
-1142
instances.txt
reqtool/Ontologies/instances.txt
+606
-606
instances_subclass.txt
reqtool/Ontologies/instances_subclass.txt
+473
-473
app-routing.module.ts
reqtool/ReqmanAngular11/src/app/app-routing.module.ts
+7
-3
app.module.ts
reqtool/ReqmanAngular11/src/app/app.module.ts
+4
-0
add-boilerplate.component.ts
...p/components/add-boilerplate/add-boilerplate.component.ts
+9
-4
add-groupboil.component.html
...app/components/add-groupboil/add-groupboil.component.html
+19
-0
add-groupboil.component.scss
...app/components/add-groupboil/add-groupboil.component.scss
+0
-0
add-groupboil.component.spec.ts
.../components/add-groupboil/add-groupboil.component.spec.ts
+25
-0
add-groupboil.component.ts
...c/app/components/add-groupboil/add-groupboil.component.ts
+52
-0
boilerplate-details.component.ts
...ents/boilerplate-details/boilerplate-details.component.ts
+5
-5
boilerplate-list.component.html
...mponents/boilerplate-list/boilerplate-list.component.html
+8
-2
boilerplate-list.component.ts
...components/boilerplate-list/boilerplate-list.component.ts
+12
-4
groupboil.component.html
...r11/src/app/components/groupboil/groupboil.component.html
+9
-0
groupboil.component.scss
...r11/src/app/components/groupboil/groupboil.component.scss
+0
-0
groupboil.component.spec.ts
.../src/app/components/groupboil/groupboil.component.spec.ts
+25
-0
groupboil.component.ts
...lar11/src/app/components/groupboil/groupboil.component.ts
+31
-0
login.component.ts
...qmanAngular11/src/app/components/login/login.component.ts
+1
-1
boilerplate.model.ts
reqtool/ReqmanAngular11/src/app/models/boilerplate.model.ts
+6
-0
header.component.html
...Angular11/src/app/navigation/header/header.component.html
+0
-3
boilerplate.service.ts
...l/ReqmanAngular11/src/app/services/boilerplate.service.ts
+27
-15
main.service.ts
reqtool/ReqmanAngular11/src/app/services/main.service.ts
+1
-1
prefix.service.ts
reqtool/ReqmanAngular11/src/app/services/prefix.service.ts
+1
-1
suffix.service.ts
reqtool/ReqmanAngular11/src/app/services/suffix.service.ts
+1
-1
requirements.py
...ool/reqman/api/reqman/apps/reqtool/models/requirements.py
+28
-4
requirements.py
.../reqman/apps/reqtool/rest_api/serializers/requirements.py
+9
-2
urls.py
reqtool/reqman/api/reqman/apps/reqtool/rest_api/urls.py
+13
-10
requirements_views.py
.../reqman/apps/reqtool/rest_api/views/requirements_views.py
+40
-7
No files found.
reqtool/Ontologies/instances.txt
View file @
feaaa807
This source diff could not be displayed because it is too large. You can
view the blob
instead.
reqtool/Ontologies/instances_subclass.txt
View file @
feaaa807
This diff is collapsed.
Click to expand it.
reqtool/ReqmanAngular11/src/app/app-routing.module.ts
View file @
feaaa807
...
...
@@ -9,6 +9,8 @@ import { SignupComponent } from './components/singup/singup.component';
import
{
BoilerplateListComponent
}
from
'./components/boilerplate-list/boilerplate-list.component'
;
import
{
BoilerplateDetailsComponent
}
from
'./components/boilerplate-details/boilerplate-details.component'
;
import
{
AddBoilerplateComponent
}
from
'./components/add-boilerplate/add-boilerplate.component'
;
import
{
GroupboilComponent
}
from
'./components/groupboil/groupboil.component'
;
import
{
AddGroupboilComponent
}
from
'./components/add-groupboil/add-groupboil.component'
;
/*import { PrefixListComponent } from './components/prefix-list/prefix-list.component';
import { PrefixDetailsComponent } from './components/prefix-details/prefix-details.component';
...
...
@@ -18,9 +20,11 @@ const routes: Routes = [
{
path
:
''
,
redirectTo
:
'login'
,
pathMatch
:
'full'
},
{
path
:
'login'
,
component
:
LoginComponent
},
{
path
:
'signup'
,
component
:
SignupComponent
},
{
path
:
'boilerplates'
,
component
:
BoilerplateListComponent
,
canActivate
:
[
AuthGuard
]
},
{
path
:
'boilerplates/:id'
,
component
:
BoilerplateDetailsComponent
,
canActivate
:
[
AuthGuard
]
},
{
path
:
'add-boilerplate'
,
component
:
AddBoilerplateComponent
,
canActivate
:
[
AuthGuard
]
}
{
path
:
'groupboilerplates'
,
component
:
GroupboilComponent
,
canActivate
:
[
AuthGuard
]
},
{
path
:
'groupboilerplates/:gb/boilerplates'
,
component
:
BoilerplateListComponent
,
canActivate
:
[
AuthGuard
]
},
{
path
:
'groupboilerplates/:gb/boilerplates/:id'
,
component
:
BoilerplateDetailsComponent
,
canActivate
:
[
AuthGuard
]
},
{
path
:
'groupboilerplates/:gb/boilerplates/add-boilerplate'
,
component
:
AddBoilerplateComponent
,
canActivate
:
[
AuthGuard
]
},
{
path
:
'add-groupboil'
,
component
:
AddGroupboilComponent
,
canActivate
:
[
AuthGuard
]
}
/*{ path: '', redirectTo: 'tutorials', pathMatch: 'full' },
{ path: 'prefix', component: PrefixListComponent },
{ path: 'prefix/:id', component: PrefixDetailsComponent },
...
...
reqtool/ReqmanAngular11/src/app/app.module.ts
View file @
feaaa807
...
...
@@ -30,6 +30,8 @@ import { MainListComponent } from './components/main-list/main-list.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'
;
import
{
GroupboilComponent
}
from
'./components/groupboil/groupboil.component'
;
import
{
AddGroupboilComponent
}
from
'./components/add-groupboil/add-groupboil.component'
;
...
...
@@ -50,6 +52,8 @@ import { SuffixDetailsComponent } from './components/suffix-details/suffix-detai
MainDetailsComponent
,
SuffixListComponent
,
SuffixDetailsComponent
,
GroupboilComponent
,
AddGroupboilComponent
,
],
imports
:
[
BrowserModule
,
...
...
reqtool/ReqmanAngular11/src/app/components/add-boilerplate/add-boilerplate.component.ts
View file @
feaaa807
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Router
}
from
'@angular/router'
;
import
{
ActivatedRoute
,
Router
}
from
'@angular/router'
;
import
{
Boilerplate
}
from
'src/app/models/boilerplate.model'
;
import
{
BoilerplateService
}
from
'src/app/services/boilerplate.service'
;
import
{
NotifierService
}
from
"angular-notifier"
;
@
Component
({
selector
:
'app-add-boilerplate'
,
templateUrl
:
'./add-boilerplate.component.html'
,
...
...
@@ -11,6 +12,7 @@ import { NotifierService } from "angular-notifier";
})
export
class
AddBoilerplateComponent
implements
OnInit
{
boilerplate
:
Boilerplate
=
{
group_of_boilerplate
:
this
.
route
.
snapshot
.
params
.
gb
,
title
:
""
,
has_prefix
:
false
,
has_main
:
false
,
...
...
@@ -19,7 +21,8 @@ export class AddBoilerplateComponent implements OnInit {
submitted
=
false
;
private
readonly
notifier
:
NotifierService
;
constructor
(
private
boilerplatelService
:
BoilerplateService
,
private
router
:
Router
,
notifierService
:
NotifierService
)
{
constructor
(
private
boilerplatelService
:
BoilerplateService
,
private
route
:
ActivatedRoute
,
private
router
:
Router
,
notifierService
:
NotifierService
)
{
this
.
notifier
=
notifierService
;
}
...
...
@@ -28,18 +31,19 @@ export class AddBoilerplateComponent implements OnInit {
saveBoilerplate
():
void
{
const
data
=
{
group_of_boilerplate
:
this
.
route
.
snapshot
.
params
.
gb
,
title
:
this
.
boilerplate
.
title
,
has_prefix
:
this
.
boilerplate
.
has_prefix
,
has_main
:
this
.
boilerplate
.
has_main
,
has_suffix
:
this
.
boilerplate
.
has_suffix
};
this
.
boilerplatelService
.
create
(
data
)
this
.
boilerplatelService
.
create
(
this
.
route
.
snapshot
.
params
.
gb
,
data
)
.
subscribe
(
response
=>
{
this
.
notifier
.
notify
(
"success"
,(
JSON
.
stringify
(
response
)));
this
.
submitted
=
true
;
this
.
router
.
navigate
([
'/boilerplates'
]);
this
.
router
.
navigate
([
'/
groupboilerplates/'
+
this
.
route
.
snapshot
.
params
.
gb
+
'/
boilerplates'
]);
},
error
=>
{
console
.
log
(
error
);
...
...
@@ -51,6 +55,7 @@ export class AddBoilerplateComponent implements OnInit {
newBoilerplate
():
void
{
this
.
submitted
=
false
;
this
.
boilerplate
=
{
group_of_boilerplate
:
this
.
route
.
snapshot
.
params
.
gb
,
title
:
""
,
has_prefix
:
false
,
has_main
:
false
,
...
...
reqtool/ReqmanAngular11/src/app/components/add-groupboil/add-groupboil.component.html
0 → 100644
View file @
feaaa807
<div>
<div
class=
"submit-form"
>
<div
class=
"form-group"
>
<label
for=
"title"
>
Requirement Title
</label>
<input
type=
"text"
class=
"form-control"
id=
"title_bgroup"
required
[(
ngModel
)]="
groupboilerplate
.
title_bgroup
"
name=
"title_bgroup"
/>
<button
(
click
)="
saveBoilerplate
()"
class=
"btn btn-success"
>
Submit
</button>
</div>
</div>
\ No newline at end of file
reqtool/ReqmanAngular11/src/app/components/add-groupboil/add-groupboil.component.scss
0 → 100644
View file @
feaaa807
reqtool/ReqmanAngular11/src/app/components/add-groupboil/add-groupboil.component.spec.ts
0 → 100644
View file @
feaaa807
import
{
ComponentFixture
,
TestBed
}
from
'@angular/core/testing'
;
import
{
AddGroupboilComponent
}
from
'./add-groupboil.component'
;
describe
(
'AddGroupboilComponent'
,
()
=>
{
let
component
:
AddGroupboilComponent
;
let
fixture
:
ComponentFixture
<
AddGroupboilComponent
>
;
beforeEach
(
async
()
=>
{
await
TestBed
.
configureTestingModule
({
declarations
:
[
AddGroupboilComponent
]
})
.
compileComponents
();
});
beforeEach
(()
=>
{
fixture
=
TestBed
.
createComponent
(
AddGroupboilComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'should create'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
reqtool/ReqmanAngular11/src/app/components/add-groupboil/add-groupboil.component.ts
0 → 100644
View file @
feaaa807
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Router
}
from
'@angular/router'
;
import
{
GroupBoilerplate
}
from
'src/app/models/boilerplate.model'
;
import
{
BoilerplateService
}
from
'src/app/services/boilerplate.service'
;
import
{
NotifierService
}
from
"angular-notifier"
;
@
Component
({
selector
:
'app-add-groupboil'
,
templateUrl
:
'./add-groupboil.component.html'
,
styleUrls
:
[
'./add-groupboil.component.scss'
]
})
export
class
AddGroupboilComponent
implements
OnInit
{
groupboilerplate
:
GroupBoilerplate
=
{
title_bgroup
:
""
,
};
submitted
=
false
;
private
readonly
notifier
:
NotifierService
;
constructor
(
private
boilerplatelService
:
BoilerplateService
,
private
router
:
Router
,
notifierService
:
NotifierService
)
{
this
.
notifier
=
notifierService
;
}
ngOnInit
():
void
{
}
saveBoilerplate
():
void
{
const
data
=
{
title_bgroup
:
this
.
groupboilerplate
.
title_bgroup
,
};
this
.
boilerplatelService
.
creategroupboil
(
data
)
.
subscribe
(
response
=>
{
this
.
notifier
.
notify
(
"success"
,(
JSON
.
stringify
(
response
)));
this
.
submitted
=
true
;
this
.
router
.
navigate
([
'/groupboilerplates'
]);
},
error
=>
{
console
.
log
(
error
);
//error, warning, success, info, default
this
.
notifier
.
notify
(
"warning"
,(
JSON
.
stringify
(
error
[
"error"
][
"title"
][
0
])));
});
}
newBoilerplate
():
void
{
this
.
submitted
=
false
;
this
.
groupboilerplate
=
{
title_bgroup
:
""
,
};
}
}
reqtool/ReqmanAngular11/src/app/components/boilerplate-details/boilerplate-details.component.ts
View file @
feaaa807
...
...
@@ -27,11 +27,11 @@ export class BoilerplateDetailsComponent implements OnInit {
ngOnInit
():
void
{
this
.
message
=
''
;
this
.
getBoilerplate
(
this
.
route
.
snapshot
.
params
.
id
);
this
.
getBoilerplate
(
this
.
route
.
snapshot
.
params
.
gb
,
this
.
route
.
snapshot
.
params
.
id
);
}
getBoilerplate
(
id
:
string
):
void
{
this
.
boilerplateService
.
get
(
id
)
getBoilerplate
(
gb
:
any
,
id
:
number
):
void
{
this
.
boilerplateService
.
get
(
gb
,
id
)
.
subscribe
(
data
=>
{
this
.
currentboilerplate
=
data
;
...
...
@@ -43,7 +43,7 @@ export class BoilerplateDetailsComponent implements OnInit {
}
updateBoilerplate
():
void
{
this
.
boilerplateService
.
update
(
this
.
currentboilerplate
.
id
,
this
.
currentboilerplate
)
this
.
boilerplateService
.
update
(
this
.
route
.
snapshot
.
params
.
gb
,
this
.
currentboilerplate
.
id
,
this
.
currentboilerplate
)
.
subscribe
(
response
=>
{
console
.
log
(
response
);
...
...
@@ -57,7 +57,7 @@ export class BoilerplateDetailsComponent implements OnInit {
deleteBoilerplate
():
void
{
if
(
confirm
(
"Αre you sure you want to delete this Boilerplate?"
))
{
this
.
boilerplateService
.
delete
(
this
.
currentboilerplate
.
id
)
this
.
boilerplateService
.
delete
(
this
.
route
.
snapshot
.
params
.
gb
,
this
.
currentboilerplate
.
id
)
.
subscribe
(
response
=>
{
console
.
log
(
response
);
...
...
reqtool/ReqmanAngular11/src/app/components/boilerplate-list/boilerplate-list.component.html
View file @
feaaa807
<div>
<div>
<input
type=
"button"
value=
"Add Boilepate"
(
click
)="
GetRoute
()"
/>
</div>
</div>
<div
class=
"list row"
>
<div
class=
"col-md-8"
>
<div
class=
"input-group mb-3"
>
...
...
@@ -19,7 +25,7 @@
</div>
</div>
</div>
</div>
</div>
<table
mat-table
[
dataSource
]="
newdataSource
"
class=
"mat-elevation-z8"
>
...
...
@@ -54,7 +60,7 @@
<ng-container
matColumnDef=
"action"
>
<th
mat-header-cell
*
matHeaderCellDef
>
Action
</th>
<td
mat-cell
*
matCellDef=
"let element"
class=
"action-link"
>
<a
class=
"badge badge-warning"
routerLink=
"
/boilerplates/{{ element.id
}}"
>
Edit
</a>
<a
class=
"badge badge-warning"
routerLink=
"
{{element.id
}}"
>
Edit
</a>
</td>
</ng-container>
...
...
reqtool/ReqmanAngular11/src/app/components/boilerplate-list/boilerplate-list.component.ts
View file @
feaaa807
...
...
@@ -3,6 +3,7 @@ import { Boilerplate } from 'src/app/models/boilerplate.model';
import
{
BoilerplateData
}
from
'src/app/models/boilerplate.model'
;
import
{
BoilerplateService
}
from
'src/app/services/boilerplate.service'
;
import
{
PrefixService
}
from
'src/app/services/prefix.service'
;
import
{
ActivatedRoute
,
Router
}
from
'@angular/router'
;
...
...
@@ -30,7 +31,8 @@ export class BoilerplateListComponent implements OnInit {
main
:
any
;
suffix
:
any
;
constructor
(
private
boilerplateService
:
BoilerplateService
,
private
prefixService
:
PrefixService
)
{
}
constructor
(
private
boilerplateService
:
BoilerplateService
,
private
prefixService
:
PrefixService
,
private
route
:
ActivatedRoute
,
private
router
:
Router
)
{
}
ngOnInit
():
void
{
this
.
retrieveBoilerplates
();
...
...
@@ -38,7 +40,7 @@ export class BoilerplateListComponent implements OnInit {
}
retrieveBoilerplates
():
void
{
this
.
boilerplateService
.
getAll
()
this
.
boilerplateService
.
getAll
(
this
.
route
.
snapshot
.
params
.
gb
)
.
subscribe
(
data
=>
{
this
.
boilerplates
=
data
;
...
...
@@ -52,7 +54,7 @@ export class BoilerplateListComponent implements OnInit {
retrieve
():
void
{
this
.
boilerplateService
.
getAllData
()
this
.
boilerplateService
.
getAllData
(
this
.
route
.
snapshot
.
params
.
gb
)
.
subscribe
(
data
=>
{
this
.
boilerplatesdata
=
data
;
...
...
@@ -79,7 +81,7 @@ export class BoilerplateListComponent implements OnInit {
SearchTitle
():
void
{
if
(
this
.
title
!=
''
){
this
.
boilerplateService
.
findByTitle
(
this
.
title
)
this
.
boilerplateService
.
findByTitle
(
this
.
route
.
snapshot
.
params
.
gb
,
this
.
title
)
.
subscribe
(
data
=>
{
this
.
boilerplates
=
data
;
...
...
@@ -95,5 +97,11 @@ export class BoilerplateListComponent implements OnInit {
this
.
retrieveBoilerplates
();
}
}
GetRoute
():
void
{
this
.
router
.
navigate
([
'/groupboilerplates/'
+
this
.
route
.
snapshot
.
params
.
gb
+
'/boilerplates/add-boilerplate'
])
}
GetRoutedit
(
id
:
any
):
void
{
this
.
router
.
navigate
([
'/groupboilerplates/'
+
this
.
route
.
snapshot
.
params
.
gb
+
'/boilerplates'
+
id
])
}
}
reqtool/ReqmanAngular11/src/app/components/groupboil/groupboil.component.html
0 → 100644
View file @
feaaa807
<p>
groupboil works!
</p>
<div>
<a
routerLink=
"/add-groupboil"
>
Add Boilepate
</a>
</div>
<li
*
ngFor=
"let gb of grouboilerplates"
>
<a
class=
"badge badge-warning"
routerLink=
"/groupboilerplates/{{gb.id}}/boilerplates"
>
"{{gb.title_bgroup}}"
</a>
<span
class=
"badge"
>
{{gb.id}}
</span>
</li>
reqtool/ReqmanAngular11/src/app/components/groupboil/groupboil.component.scss
0 → 100644
View file @
feaaa807
reqtool/ReqmanAngular11/src/app/components/groupboil/groupboil.component.spec.ts
0 → 100644
View file @
feaaa807
import
{
ComponentFixture
,
TestBed
}
from
'@angular/core/testing'
;
import
{
GroupboilComponent
}
from
'./groupboil.component'
;
describe
(
'GroupboilComponent'
,
()
=>
{
let
component
:
GroupboilComponent
;
let
fixture
:
ComponentFixture
<
GroupboilComponent
>
;
beforeEach
(
async
()
=>
{
await
TestBed
.
configureTestingModule
({
declarations
:
[
GroupboilComponent
]
})
.
compileComponents
();
});
beforeEach
(()
=>
{
fixture
=
TestBed
.
createComponent
(
GroupboilComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'should create'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
reqtool/ReqmanAngular11/src/app/components/groupboil/groupboil.component.ts
0 → 100644
View file @
feaaa807
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
GroupBoilerplate
}
from
'src/app/models/boilerplate.model'
;
import
{
BoilerplateService
}
from
'src/app/services/boilerplate.service'
;
@
Component
({
selector
:
'app-groupboil'
,
templateUrl
:
'./groupboil.component.html'
,
styleUrls
:
[
'./groupboil.component.scss'
]
})
export
class
GroupboilComponent
implements
OnInit
{
grouboilerplates
?:
GroupBoilerplate
[];
constructor
(
private
boilerplateService
:
BoilerplateService
)
{
}
ngOnInit
():
void
{
this
.
retrievegroupBoilerplates
();
}
retrievegroupBoilerplates
():
void
{
this
.
boilerplateService
.
getAllgroupboil
()
.
subscribe
(
data
=>
{
console
.
log
(
data
);
this
.
grouboilerplates
=
data
;
},
error
=>
{
console
.
log
(
error
);
});
}
}
reqtool/ReqmanAngular11/src/app/components/login/login.component.ts
View file @
feaaa807
...
...
@@ -35,7 +35,7 @@ export class LoginComponent implements OnInit {
login
(
email
:
string
,
password
:
string
)
{
this
.
authService
.
login
(
email
,
password
).
subscribe
(
success
=>
this
.
router
.
navigate
([
'boilerplates'
]),
success
=>
this
.
router
.
navigate
([
'
group
boilerplates'
]),
error
=>
this
.
notifier
.
notify
(
"warning"
,(
JSON
.
stringify
(
"You have entered an invalid username or password"
)))
);
}
...
...
reqtool/ReqmanAngular11/src/app/models/boilerplate.model.ts
View file @
feaaa807
export
class
Boilerplate
{
id
?:
any
;
group_of_boilerplate
?:
any
;
title
?:
string
;
has_prefix
?:
boolean
;
has_main
?:
boolean
;
...
...
@@ -12,4 +13,9 @@ export class BoilerplateData {
prefix_data
?:
string
;
main_data
?:
string
;
suffix_data
?:
string
;
}
export
class
GroupBoilerplate
{
id
?:
any
;
title_bgroup
?:
string
;
}
\ No newline at end of file
reqtool/ReqmanAngular11/src/app/navigation/header/header.component.html
View file @
feaaa807
...
...
@@ -9,9 +9,6 @@
</div>
<div
fxFlex
fxLayout
fxHide
.
xs
fxLayoutAlign=
"end"
>
<ul
fxLayout
fxLayoutGap=
"15px"
class=
"navigation-items"
>
<div>
<a
routerLink=
"/add-boilerplate"
>
Add Boilepate
</a>
</div>
<div>
<a
mat-menu-item
(
click
)="
LogOut
()"
>
Log out
</a>
</div>
...
...
reqtool/ReqmanAngular11/src/app/services/boilerplate.service.ts
View file @
feaaa807
...
...
@@ -3,8 +3,10 @@ import { HttpClient } from '@angular/common/http';
import
{
HttpHeaders
}
from
'@angular/common/http'
;
import
{
Observable
}
from
'rxjs'
;
import
{
Boilerplate
}
from
'../models/boilerplate.model'
;
import
{
GroupBoilerplate
}
from
'../models/boilerplate.model'
;
const
baseUrl
=
'http://155.207.131.19:8000/api-auth/boilerplates/'
;
const
baseUrl
=
'/boilerplates/'
;
const
baseUrlgb
=
'http://155.207.131.19:8000/api-auth/groupboilerplates/'
;
@
Injectable
({
providedIn
:
'root'
...
...
@@ -13,32 +15,42 @@ export class BoilerplateService {
constructor
(
private
http
:
HttpClient
)
{
}
getAll
():
Observable
<
Boilerplate
[]
>
{
return
this
.
http
.
get
<
Boilerplate
[]
>
(
baseUrl
);
creategroupboil
(
data
:
any
):
Observable
<
any
>
{
return
this
.
http
.
post
(
baseUrlgb
,
data
);
}
getAll
Data
():
Observable
<
Boilerplate
[]
>
{
return
this
.
http
.
get
<
Boilerplate
[]
>
(
baseUrl
+
`boilerplatedata/`
);
getAll
groupboil
():
Observable
<
Boilerplate
[]
>
{
return
this
.
http
.
get
<
[
GroupBoilerplate
]
>
(
baseUrlgb
);
}
get
(
id
:
any
):
Observable
<
Boilerplate
>
{
return
this
.
http
.
get
(
`
${
baseUrl
}${
id
}
`
);
getAll
(
gb
:
any
):
Observable
<
Boilerplate
[]
>
{
//console.log(baseUrlgb + gb + baseUrl)
return
this
.
http
.
get
<
Boilerplate
[]
>
(
baseUrlgb
+
gb
+
baseUrl
);
}
create
(
data
:
any
):
Observable
<
any
>
{
return
this
.
http
.
post
(
baseUrl
,
data
);
getAllData
(
gb
:
any
):
Observable
<
Boilerplate
[]
>
{
return
this
.
http
.
get
<
Boilerplate
[]
>
(
baseUrlgb
+
gb
+
baseUrl
+
`boilerplatedata/`
);
}
update
(
id
:
any
,
data
:
any
):
Observable
<
any
>
{
return
this
.
http
.
put
(
`
${
baseUrl
}${
id
}
/`
,
data
);
get
(
gb
:
any
,
id
:
any
):
Observable
<
Boilerplate
>
{
console
.
log
(
id
)
return
this
.
http
.
get
(
`
${
baseUrlgb
}${
gb
}${
baseUrl
}${
id
}
`
);
}
delete
(
id
:
any
):
Observable
<
any
>
{
return
this
.
http
.
delete
(
`
${
baseUrl
}${
id
}
`
);
create
(
gb
:
any
,
data
:
any
):
Observable
<
any
>
{
return
this
.
http
.
post
(
baseUrlgb
+
gb
+
baseUrl
,
data
);
}
findByTitle
(
title
:
any
):
Observable
<
Boilerplate
[]
>
{
return
this
.
http
.
get
<
Boilerplate
[]
>
(
`
${
baseUrl
}
title=
${
title
}
`
);
update
(
gb
:
any
,
id
:
any
,
data
:
any
):
Observable
<
any
>
{
return
this
.
http
.
put
(
`
${
baseUrlgb
}${
gb
}${
baseUrl
}${
id
}
/`
,
data
);
}
delete
(
gb
:
any
,
id
:
any
):
Observable
<
any
>
{
return
this
.
http
.
delete
(
`
${
baseUrlgb
}${
gb
}${
baseUrl
}${
id
}
`
);
}
findByTitle
(
gb
:
any
,
title
:
any
):
Observable
<
Boilerplate
[]
>
{
return
this
.
http
.
get
<
Boilerplate
[]
>
(
`
${
baseUrlgb
}${
gb
}${
baseUrl
}
title=
${
title
}
`
);
}
}
reqtool/ReqmanAngular11/src/app/services/main.service.ts
View file @
feaaa807
...
...
@@ -3,7 +3,7 @@ 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
baseUrl
=
'http://155.207.131.19:8000/api-auth/
groupboilerplates/0/
boilerplates/'
;
const
Url
=
'/main/'
;
@
Injectable
({
...
...
reqtool/ReqmanAngular11/src/app/services/prefix.service.ts
View file @
feaaa807
...
...
@@ -3,7 +3,7 @@ import { HttpClient } from '@angular/common/http';
import
{
Observable
}
from
'rxjs'
;
import
{
Prefix
}
from
'../models/prefix.model'
;
const
baseUrl
=
'http://155.207.131.19:8000/api-auth/boilerplates/'
;
const
baseUrl
=
'http://155.207.131.19:8000/api-auth/
groupboilerplates/0/
boilerplates/'
;
const
Url
=
'/prefix/'
;
@
Injectable
({
...
...
reqtool/ReqmanAngular11/src/app/services/suffix.service.ts
View file @
feaaa807
...
...
@@ -3,7 +3,7 @@ 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
baseUrl
=
'http://155.207.131.19:8000/api-auth/
groupboilerplates/0/
boilerplates/'
;
const
Url
=
'/suffix/'
;
@
Injectable
({
...
...
reqtool/reqman/api/reqman/apps/reqtool/models/requirements.py
View file @
feaaa807
...
...
@@ -55,17 +55,32 @@ def create_prefix(instance):
prefix
=
Prefix
(
prefix_boilerplate
=
instance
.
boilerplate
,
prefixgroup
=
instance
)
prefix
.
save
()
def
create_data
(
instance
):
data
=
BoilerplateData
(
boilerplate_data_id
=
instance
,
owner_data
=
instance
.
owner
,
title_data
=
instance
.
title
)
data
=
BoilerplateData
(
boilerplate_data_id
=
instance
,
owner_data
=
instance
.
owner
,
title_data
=
instance
.
title
,
group_of_boilerplate_data
=
instance
.
group_of_boilerplate
)
data
.
save
()
def
create_extra_prefix
(
instance
,
now_prefix
):
prefix
=
Prefix
(
prefixgroup
=
instance
.
prefixgroup
,
prefix_boilerplate
=
instance
.
prefix_boilerplate
)
prefix
.
save
()
def
create_infer_result
(
instance
):
pass
class
BoilerplateGroup
(
models
.
Model
):
boilerplate_owner
=
models
.
ForeignKey
(
User
,
related_name
=
'boilerplate_group_owner'
,
on_delete
=
models
.
CASCADE
)
title_bgroup
=
models
.
CharField
(
max_length
=
30
,
unique
=
True
)
def
save
(
self
,
**
kwargs
):
super
(
BoilerplateGroup
,
self
)
.
save
(
**
kwargs
)
class
Boilerplate
(
models
.
Model
):
owner
=
models
.
ForeignKey
(
User
,
related_name
=
'boilerplate'
,
on_delete
=
models
.
CASCADE
)
owner
=
models
.
ForeignKey
(
User
,
related_name
=
'boilerplate'
,
on_delete
=
models
.
CASCADE
)
group_of_boilerplate
=
models
.
ForeignKey
(
BoilerplateGroup
,
related_name
=
'owner_of_boilerplate'
,
on_delete
=
models
.
CASCADE
)
created
=
models
.
DateTimeField
(
auto_now_add
=
True
)
title
=
models
.
CharField
(
max_length
=
30
,
unique
=
True
)
has_prefix
=
models
.
BooleanField
(
default
=
False
)
...
...
@@ -162,7 +177,8 @@ class Prefix(models.Model):
class
BoilerplateData
(
models
.
Model
):
owner_data
=
models
.
ForeignKey
(
User
,
related_name
=
'boilerplate_data'
,
on_delete
=
models
.
CASCADE
)
owner_data
=
models
.
ForeignKey
(
User
,
related_name
=
'boilerplate_data'
,
on_delete
=
models
.
CASCADE
)
group_of_boilerplate_data
=
models
.
ForeignKey
(
BoilerplateGroup
,
related_name
=
'group_of_boilerplate_data'
,
on_delete
=
models
.
CASCADE
)
boilerplate_data_id
=
models
.
ForeignKey
(
Boilerplate
,
related_name
=
'boilerplate_data_id'
,
on_delete
=
models
.
CASCADE
)
title_data
=
models
.
CharField
(
default
=
""
,
max_length
=
30
,
unique
=
True
)
prefix_data
=
models
.
CharField
(
default
=
""
,
max_length
=
100
,
blank
=
True
)
...
...
@@ -170,4 +186,12 @@ class BoilerplateData(models.Model):
suffix_data
=
models
.
CharField
(
max_length
=
100
,
blank
=
True
)
class
Meta
:
ordering
=
[
'boilerplate_data_id'
]
\ No newline at end of file
ordering
=
[
'boilerplate_data_id'
]
#class InferenceResults(models.Model):
# owner_infer = models.ForeignKey(User, related_name='owner_infer', on_delete=models.CASCADE)
# inference_data = models.CharField(default="")
# class Meta:
# ordering = ['owner_infer']
reqtool/reqman/api/reqman/apps/reqtool/rest_api/serializers/requirements.py
View file @
feaaa807
from
rest_framework
import
serializers
from
reqman.apps.reqtool.models.requirements
import
Prefix
,
Boilerplate
,
BoilerplateData
from
reqman.apps.reqtool.models.requirements
import
Prefix
,
Boilerplate
,
BoilerplateData
,
BoilerplateGroup
class
BoilerplateSerializer
(
serializers
.
ModelSerializer
):
owner
=
serializers
.
ReadOnlyField
(
source
=
'owner.username'
)
class
Meta
:
model
=
Boilerplate
fields
=
(
'id'
,
'owner'
,
'title'
,
'has_prefix'
,
'has_main'
,
'has_suffix'
)
fields
=
(
'id'
,
'
group_of_boilerplate'
,
'
owner'
,
'title'
,
'has_prefix'
,
'has_main'
,
'has_suffix'
)
class
PrefixSerializer
(
serializers
.
ModelSerializer
):
...
...
@@ -23,3 +23,10 @@ class BoilerplateDataSerializer(serializers.ModelSerializer):
class
Meta
:
model
=
BoilerplateData
fields
=
'__all__'
class
BoilerplateGroupSerializer
(
serializers
.
ModelSerializer
):
boilerplate_owner
=
serializers
.
ReadOnlyField
(
source
=
'owner.username'
)
class
Meta
:
model
=
BoilerplateGroup
fields
=
(
'id'
,
'boilerplate_owner'
,
'title_bgroup'
)
reqtool/reqman/api/reqman/apps/reqtool/rest_api/urls.py
View file @
feaaa807
...
...
@@ -7,21 +7,24 @@ from .views import user_views, requirements_views, main_req_views, suffix_req_vi
urlpatterns
=
[
path
(
'users/'
,
user_views
.
UserList
.
as_view
(),
name
=
'api-user-list'
),
path
(
'users/<uuid:pk>/'
,
user_views
.
UserDetail
.
as_view
(),
name
=
'api-post-details'
),
path
(
'boilerplates/'
,
requirements_views
.
BoilerplateListCreateAPIView
.
as_view
(),
name
=
'api-requirements-list'
),
path
(
'boilerplates/<int:pk>/'
,
requirements_views
.
BoilerplateDetailsAPIView
.
as_view
(),
name
=
'api-requirements-details'
),
path
(
'boilerplates/boilerplatedata/'
,
requirements_views
.
BoilerplateDataListAPIView
.
as_view
(),
name
=
'api-boilerlplate-list-data'
),
re_path
(
'boilerplates/(?:title=(?P<title_1>
\
w+)/)?$'
,
requirements_views
.
BoilerplateList
.
as_view
(),
name
=
'api-requirements-details-per-title'
),
path
(
'groupboilerplates/'
,
requirements_views
.
BoilerplateGroupCreateAPIView
.
as_view
(),
name
=
'api-groupboilerplates-create'
),
path
(
'groupboilerplates/<int:pk>/'
,
requirements_views
.
BoilerplateGroupList
.
as_view
(),
name
=
'api-groupboilerplates-list'
),
path
(
'groupboilerplates/<int:groupboil>/boilerplates/'
,
requirements_views
.
BoilerplateListCreateAPIView
.
as_view
(),
name
=
'api-requirements-list'
),
path
(
'groupboilerplates/<int:groupboil>/boilerplates/<int:pk>/'
,
requirements_views
.
BoilerplateDetailsAPIView
.
as_view
(),
name
=
'api-requirements-details'
),
path
(
'groupboilerplates/<int:groupboil>/boilerplates/boilerplatedata/'
,
requirements_views
.
BoilerplateDataListAPIView
.
as_view
(),
name
=
'api-boilerlplate-list-data'
),
re_path
(
'groupboilerplates/<int:groupboil>/boilerplates/(?:title=(?P<title_1>
\
w+)/)?$'
,
requirements_views
.
BoilerplateList
.
as_view
(),
name
=
'api-requirements-details-per-title'
),
#'''Prefix'''
path
(
'boilerplates/<int:boilerplate>/prefix/'
,
requirements_views
.
PrefixListAPIView
.
as_view
(),
name
=
'api-prefix-list'
),
path
(
'boilerplates/<int:boilerplate>/prefix/<int:pk>/'
,
requirements_views
.
PrefixDetailsAPIView
.
as_view
(),
name
=
'api-prefix-details'
),
path
(
'
groupboilerplates/<int:groupboil>/
boilerplates/<int:boilerplate>/prefix/'
,
requirements_views
.
PrefixListAPIView
.
as_view
(),
name
=
'api-prefix-list'
),
path
(
'
groupboilerplates/<int:groupboil>/
boilerplates/<int:boilerplate>/prefix/<int:pk>/'
,
requirements_views
.
PrefixDetailsAPIView
.
as_view
(),
name
=
'api-prefix-details'
),
#'''MAIN'''
path
(
'boilerplates/<int:boilerplate>/main/'
,
main_req_views
.
MainListAPIView
.
as_view
(),
name
=
'api-main-list'
),
path
(
'boilerplates/<int:boilerplate>/main/<int:pk>/'
,
main_req_views
.
MainDetailsAPIView
.
as_view
(),
name
=
'api-main-details'
),
path
(
'
groupboilerplates/<int:groupboil>/
boilerplates/<int:boilerplate>/main/'
,
main_req_views
.
MainListAPIView
.
as_view
(),
name
=
'api-main-list'
),
path
(
'
groupboilerplates/<int:groupboil>/
boilerplates/<int:boilerplate>/main/<int:pk>/'
,
main_req_views
.
MainDetailsAPIView
.
as_view
(),
name
=
'api-main-details'
),
#'''SUFFIX'''
path
(
'boilerplates/<int:boilerplate>/suffix/'
,
suffix_req_views
.
SuffixListAPIView
.
as_view
(),
name
=
'api-suffix-list'
),
path
(
'boilerplates/<int:boilerplate>/suffix/<int:pk>/'
,
suffix_req_views
.
SuffixDetailsAPIView
.
as_view
(),
name
=
'api-suffix-details'
),
path
(
'
groupboilerplates/<int:groupboil>/
boilerplates/<int:boilerplate>/suffix/'
,
suffix_req_views
.
SuffixListAPIView
.
as_view
(),
name
=
'api-suffix-list'
),
path
(
'
groupboilerplates/<int:groupboil>/
boilerplates/<int:boilerplate>/suffix/<int:pk>/'
,
suffix_req_views
.
SuffixDetailsAPIView
.
as_view
(),
name
=
'api-suffix-details'
),
#PREFIX CHOICES DATA
path
(
'prefix/choices/simpleprefix/'
,
requirements_views
.
PrefixChoicesViewSet
.
as_view
(),
name
=
'simpleprefixchoices'
),
...
...
reqtool/reqman/api/reqman/apps/reqtool/rest_api/views/requirements_views.py
View file @
feaaa807
...
...
@@ -5,10 +5,10 @@ from django.http import HttpResponse, JsonResponse
from
django.views.decorators.csrf
import
csrf_exempt
from
rest_framework.parsers
import
JSONParser
from
reqman.apps.reqtool.models.requirements
import
Prefix
,
Boilerplate
,
PREFIX_CHOICES
,
LOGIC_CONNECTIVE
,
VERB_CHOICES
from
reqman.apps.reqtool.models.requirements
import
Prefix
,
Boilerplate
,
BoilerplateGroup
,
PREFIX_CHOICES
,
LOGIC_CONNECTIVE
,
VERB_CHOICES
from
reqman.apps.reqtool.models.requirements
import
VERB_CHOICES
,
ITEM_CHOICES
,
SYSTEM_CHOICES
,
FUNCTION_CHOICES
,
STATE_CHOICES
from
reqman.apps.reqtool.models.requirements
import
ITEM_CHOICES
,
FLOW_CHOICES
,
FUNCTION_CHOICES
,
STATE_VALUE_CHOICES
from
reqman.apps.reqtool.rest_api.serializers.requirements
import
BoilerplateSerializer
,
PrefixSerializer
,
BoilerplateDataSerializer
from
reqman.apps.reqtool.rest_api.serializers.requirements
import
BoilerplateSerializer
,
PrefixSerializer
,
BoilerplateDataSerializer
,
BoilerplateGroupSerializer
from
reqman.apps.permissions
import
IsOwnerOrReadOnly
from
reqman.apps.reqtool.rest_api.services
import
fuseki
from
rest_framework.response
import
Response
...
...
@@ -17,6 +17,36 @@ from rest_framework.views import APIView
from
reqman.apps.reqtool.models.requirements
import
BoilerplateData
from
django.shortcuts
import
get_object_or_404
##
class
BoilerplateGroupCreateAPIView
(
ListCreateAPIView
):
"""
API view to retrieve list of posts or create new
"""
permission_classes
=
[
permissions
.
IsAuthenticatedOrReadOnly
]
serializer_class
=
BoilerplateGroupSerializer
def
get_queryset
(
self
):
queryset_boil
=
BoilerplateGroup
.
objects
.
filter
(
boilerplate_owner
=
self
.
request
.
user
)
return
queryset_boil
#Custom actions when POST
def
perform_create
(
self
,
serializer
):
serializer
.
save
(
boilerplate_owner
=
self
.
request
.
user
)
class
BoilerplateGroupList
(
ListAPIView
):
"""
API view to retrieve list of posts based on title of Boilerplate
"""
permission_classes
=
[
permissions
.
IsAuthenticatedOrReadOnly
]
serializer_class
=
BoilerplateGroupSerializer
queryset
=
Boilerplate
.
objects
.
all
()
###
class
BoilerplateListCreateAPIView
(
ListCreateAPIView
):
"""
API view to retrieve list of posts or create new
...
...
@@ -27,7 +57,8 @@ class BoilerplateListCreateAPIView(ListCreateAPIView):
def
get_queryset
(
self
):
#print(title)
queryset_boil
=
Boilerplate
.
objects
.
filter
(
owner
=
self
.
request
.
user
)
group_gb
=
self
.
kwargs
[
'groupboil'
]
queryset_boil
=
Boilerplate
.
objects
.
filter
(
owner
=
self
.
request
.
user
,
group_of_boilerplate
=
group_gb
)
return
queryset_boil
#Custom actions when POST
...
...
@@ -43,13 +74,14 @@ class BoilerplateList(ListAPIView):
"""
permission_classes
=
[
permissions
.
IsAuthenticatedOrReadOnly
]
serializer_class
=
BoilerplateSerializer
queryset
=
Boilerplate
.
objects
.
all
()
#
queryset = Boilerplate.objects.all()
def
get_queryset
(
self
):
group_gb
=
self
.
kwargs
[
'groupboil'
]
title
=
self
.
kwargs
[
'title_1'
]
#print(title)
queryset_title
=
Boilerplate
.
objects
.
filter
(
title
=
title
)
queryset_title
=
Boilerplate
.
objects
.
filter
(
title
=
title
,
group_of_boilerplate
=
group_gb
)
return
queryset_title
...
...
@@ -133,6 +165,7 @@ class PrefixDetailsAPIView(RetrieveUpdateDestroyAPIView):
instance
.
delete
()
class
BoilerplateDataListAPIView
(
ListAPIView
):
"""
API view to retrieve list of posts or create new
...
...
@@ -142,8 +175,8 @@ class BoilerplateDataListAPIView(ListAPIView):
#queryset = Prefix.objects.all()
def
get_queryset
(
self
):
#print(title)
queryset_boil_data
=
BoilerplateData
.
objects
.
filter
(
owner_data
=
self
.
request
.
user
)
group_gb
=
self
.
kwargs
[
'groupboil'
]
queryset_boil_data
=
BoilerplateData
.
objects
.
filter
(
owner_data
=
self
.
request
.
user
,
group_of_boilerplate_data
=
group_gb
)
return
queryset_boil_data
...
...
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