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
e285942c
Commit
e285942c
authored
Feb 17, 2021
by
Thodoris Nestoridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
search bar
parent
faeeecfc
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
91 additions
and
31 deletions
+91
-31
package-lock.json
reqtool/ReqmanAngular11/package-lock.json
+15
-0
package.json
reqtool/ReqmanAngular11/package.json
+1
-0
app.component.html
reqtool/ReqmanAngular11/src/app/app.component.html
+4
-2
app.module.ts
reqtool/ReqmanAngular11/src/app/app.module.ts
+4
-1
add-boilerplate.component.html
...components/add-boilerplate/add-boilerplate.component.html
+3
-7
add-boilerplate.component.ts
...p/components/add-boilerplate/add-boilerplate.component.ts
+9
-1
boilerplate-details.component.html
...ts/boilerplate-details/boilerplate-details.component.html
+10
-0
boilerplate-list.component.html
...mponents/boilerplate-list/boilerplate-list.component.html
+7
-8
boilerplate-list.component.ts
...components/boilerplate-list/boilerplate-list.component.ts
+15
-9
boilerplate.service.ts
...l/ReqmanAngular11/src/app/services/boilerplate.service.ts
+1
-2
styles.scss
reqtool/ReqmanAngular11/src/styles.scss
+3
-0
urls.py
reqtool/reqman/api/reqman/apps/reqtool/rest_api/urls.py
+2
-1
requirements_views.py
.../reqman/apps/reqtool/rest_api/views/requirements_views.py
+17
-0
No files found.
reqtool/ReqmanAngular11/package-lock.json
View file @
e285942c
...
...
@@ -2146,6 +2146,21 @@
"integrity"
:
"sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM="
,
"dev"
:
true
},
"angular-notifier"
:
{
"version"
:
"6.0.1"
,
"resolved"
:
"https://registry.npmjs.org/angular-notifier/-/angular-notifier-6.0.1.tgz"
,
"integrity"
:
"sha512-eC312pNkHfjBU1nflOxtRKbkuxZGthZj23wK1unZ9u+sIhdrUm2Fd2j4Tud8+5z9wQX+ec59v4pBfayO3AFx+Q=="
,
"requires"
:
{
"tslib"
:
"^1.9.0"
},
"dependencies"
:
{
"tslib"
:
{
"version"
:
"1.14.1"
,
"resolved"
:
"https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz"
,
"integrity"
:
"sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
}
}
},
"ansi-colors"
:
{
"version"
:
"4.1.1"
,
"resolved"
:
"https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz"
,
...
...
reqtool/ReqmanAngular11/package.json
View file @
e285942c
...
...
@@ -21,6 +21,7 @@
"@angular/platform-browser-dynamic"
:
"~11.1.2"
,
"@angular/router"
:
"~11.1.2"
,
"@ng-bootstrap/ng-bootstrap"
:
"^9.0.2"
,
"angular-notifier"
:
"^6.0.1"
,
"bootstrap"
:
"^4.6.0"
,
"jwt-decode"
:
"^3.1.2"
,
"moment"
:
"^2.29.1"
,
...
...
reqtool/ReqmanAngular11/src/app/app.component.html
View file @
e285942c
...
...
@@ -341,9 +341,11 @@
<!-- Resources -->
<h2>
Resources
</h2>
<p>
Here are some links to help you get started:
</p>
<router-outlet></router-outlet>
<notifier-container></notifier-container>
<router-outlet></router-outlet>
<!-- Footer -->
<footer>
Love Angular?
...
...
reqtool/ReqmanAngular11/src/app/app.module.ts
View file @
e285942c
...
...
@@ -18,6 +18,8 @@ import { BoilerplateListComponent } from './components/boilerplate-list/boilerpl
import
{
AddPrefixComponent
}
from
'./components/add-prefix/add-prefix.component'
;
import
{
PrefixDetailsComponent
}
from
'./components/prefix-details/prefix-details.component'
;
import
{
PrefixListComponent
}
from
'./components/prefix-list/prefix-list.component'
;
import
{
NotifierModule
}
from
"angular-notifier"
;
...
...
@@ -38,7 +40,8 @@ import { PrefixListComponent } from './components/prefix-list/prefix-list.compon
AppRoutingModule
,
FormsModule
,
HttpClientModule
,
NgbModule
NgbModule
,
NotifierModule
,
],
providers
:
[
AuthService
,
...
...
reqtool/ReqmanAngular11/src/app/components/add-boilerplate/add-boilerplate.component.html
View file @
e285942c
<div>
<div
class=
"submit-form"
>
<div
*
ngIf=
"!submitted"
>
<div
class=
"form-group"
>
<label
for=
"title"
>
Requirement Title
</label>
<input
...
...
@@ -48,12 +48,8 @@
/>
</div>
<button
(
click
)="
saveBoilerplate
()"
class=
"btn btn-success"
>
Submit
</button>
</div>
<div
*
ngIf=
"submitted"
>
<h4>
Tutorial was submitted successfully!
</h4>
<button
class=
"btn btn-success"
(
click
)="
newBoilerplate
()"
>
Add
</button>
</div>
<button
(
click
)="
saveBoilerplate
()"
class=
"btn btn-success"
>
Submit
</button>
</div>
</div>
\ No newline at end of file
reqtool/ReqmanAngular11/src/app/components/add-boilerplate/add-boilerplate.component.ts
View file @
e285942c
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
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'
,
...
...
@@ -15,8 +17,11 @@ export class AddBoilerplateComponent implements OnInit {
has_suffix
:
false
};
submitted
=
false
;
private
readonly
notifier
:
NotifierService
;
constructor
(
private
boilerplatelService
:
BoilerplateService
)
{
}
constructor
(
private
boilerplatelService
:
BoilerplateService
,
private
router
:
Router
,
notifierService
:
NotifierService
)
{
this
.
notifier
=
notifierService
;
}
ngOnInit
():
void
{
}
...
...
@@ -34,9 +39,12 @@ export class AddBoilerplateComponent implements OnInit {
response
=>
{
console
.
log
(
response
);
this
.
submitted
=
true
;
this
.
router
.
navigate
([
'/boilerplates'
]);
},
error
=>
{
console
.
log
(
error
);
//error, warning, success, info, default
this
.
notifier
.
notify
(
"warning"
,(
JSON
.
stringify
(
error
[
"error"
][
"title"
][
0
])));
});
}
...
...
reqtool/ReqmanAngular11/src/app/components/boilerplate-details/boilerplate-details.component.html
View file @
e285942c
...
...
@@ -2,6 +2,16 @@
<div
*
ngIf=
"currentboilerplate.id"
class=
"edit-form"
>
<h4>
Boilerplate
</h4>
<form>
<div
class=
"form-group"
>
<label
for=
"title"
>
Title
</label>
<input
type=
"text"
class=
"form-control"
id=
"title"
[(
ngModel
)]="
currentboilerplate
.
title
"
name=
"title"
/>
</div>
<div
class=
"form-group"
>
<label
for=
"has_prefix"
>
Prefix
</label>
<input
...
...
reqtool/ReqmanAngular11/src/app/components/boilerplate-list/boilerplate-list.component.html
View file @
e285942c
...
...
@@ -4,8 +4,9 @@
<input
type=
"text"
class=
"form-control"
placeholder=
"Search mechanism not working"
[(
ngModel
)]="
boilerplates
"
placeholder=
"Search by title"
[(
ngModel
)]="
title
"
(
keyup
.
enter
)="
SearchTitle
()"
/>
<div
class=
"input-group-append"
>
<button
...
...
@@ -19,7 +20,7 @@
</div>
</div>
<div
class=
"col-md-6"
>
<h4>
Tutorials
List
</h4>
<h4>
Boilerplate
List
</h4>
<ul
class=
"list-group"
>
<li
class=
"list-group-item"
...
...
@@ -53,11 +54,9 @@
Edit
</a>
</div>
<div
*
ngIf=
"!currentBoilerplate"
>
<br
/>
<p>
Please click on a Boilerplate...
</p>
</div>
</div>
<div>
<button
class=
"btn btn-success"
routerLink=
"/add-boilerplate"
>
Add
</button>
</div>
</div>
\ No newline at end of file
reqtool/ReqmanAngular11/src/app/components/boilerplate-list/boilerplate-list.component.ts
View file @
e285942c
...
...
@@ -45,15 +45,21 @@ export class BoilerplateListComponent implements OnInit {
SearchTitle
():
void
{
this
.
boilerplateService
.
findByTitle
(
this
.
title
)
.
subscribe
(
data
=>
{
this
.
boilerplates
=
data
;
console
.
log
(
data
);
},
error
=>
{
console
.
log
(
error
);
});
if
(
this
.
title
!=
''
){
this
.
boilerplateService
.
findByTitle
(
this
.
title
)
.
subscribe
(
data
=>
{
this
.
boilerplates
=
data
;
console
.
log
(
data
);
},
error
=>
{
console
.
log
(
error
);
});
}
else
{
this
.
retrieveBoilerplates
();
}
}
}
reqtool/ReqmanAngular11/src/app/services/boilerplate.service.ts
View file @
e285942c
...
...
@@ -32,9 +32,8 @@ export class BoilerplateService {
return
this
.
http
.
delete
(
`
${
baseUrl
}${
id
}
`
);
}
//In case we want to find by something
findByTitle
(
title
:
any
):
Observable
<
Boilerplate
[]
>
{
return
this
.
http
.
get
<
Boilerplate
[]
>
(
`
${
baseUrl
}
?
title=
${
title
}
`
);
return
this
.
http
.
get
<
Boilerplate
[]
>
(
`
${
baseUrl
}
title=
${
title
}
`
);
}
}
reqtool/ReqmanAngular11/src/styles.scss
View file @
e285942c
...
...
@@ -4,3 +4,6 @@
/* Importing Bootstrap SCSS file. */
@import
'~bootstrap/scss/bootstrap'
;
/* Import angular-notifier. */
@import
'~angular-notifier/styles'
;
\ No newline at end of file
reqtool/reqman/api/reqman/apps/reqtool/rest_api/urls.py
View file @
e285942c
from
django.urls
import
path
from
django.urls
import
path
,
re_path
from
django.conf.urls
import
url
from
.views
import
user_views
,
requirements_views
,
main_req_views
,
suffix_req_views
...
...
@@ -8,6 +8,7 @@ urlpatterns = [
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'
),
re_path
(
'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'
),
...
...
reqtool/reqman/api/reqman/apps/reqtool/rest_api/views/requirements_views.py
View file @
e285942c
...
...
@@ -27,6 +27,23 @@ class BoilerplateListCreateAPIView(ListCreateAPIView):
#write_fuseki = fuseki.FusekiActions()
#write_fuseki.write(serializer.data)
class
BoilerplateList
(
ListAPIView
):
"""
API view to retrieve list of posts based on title of Boilerplate
"""
permission_classes
=
[
permissions
.
IsAuthenticatedOrReadOnly
]
serializer_class
=
BoilerplateSerializer
queryset
=
Boilerplate
.
objects
.
all
()
def
get_queryset
(
self
):
title
=
self
.
kwargs
[
'title_1'
]
#print(title)
queryset_title
=
Boilerplate
.
objects
.
filter
(
title
=
title
)
return
queryset_title
class
BoilerplateDetailsAPIView
(
RetrieveUpdateDestroyAPIView
):
"""
API view to retrieve, update or delete post
...
...
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