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
c9fd6f23
Commit
c9fd6f23
authored
Feb 15, 2021
by
Thodoris Nestoridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add (unique) title for Boilerplate
parent
7f58fd01
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
41 additions
and
11 deletions
+41
-11
add-boilerplate.component.html
...components/add-boilerplate/add-boilerplate.component.html
+11
-1
add-boilerplate.component.ts
...p/components/add-boilerplate/add-boilerplate.component.ts
+3
-0
boilerplate-list.component.html
...mponents/boilerplate-list/boilerplate-list.component.html
+8
-6
boilerplate-list.component.ts
...components/boilerplate-list/boilerplate-list.component.ts
+14
-1
boilerplate.model.ts
reqtool/ReqmanAngular11/src/app/models/boilerplate.model.ts
+1
-0
boilerplate.service.ts
...l/ReqmanAngular11/src/app/services/boilerplate.service.ts
+2
-2
requirements.py
...ool/reqman/api/reqman/apps/reqtool/models/requirements.py
+1
-0
requirements.py
.../reqman/apps/reqtool/rest_api/serializers/requirements.py
+1
-1
No files found.
reqtool/ReqmanAngular11/src/app/components/add-boilerplate/add-boilerplate.component.html
View file @
c9fd6f23
<div>
<div
class=
"submit-form"
>
<div
*
ngIf=
"!submitted"
>
<div
class=
"form-group"
>
<label
for=
"title"
>
Requirement Title
</label>
<input
type=
"text"
class=
"form-control"
id=
"title"
required
[(
ngModel
)]="
boilerplate
.
title
"
name=
"title"
/>
</div>
<div
class=
"form-group"
>
<label
for=
"has_prefix"
>
Prefix
</label>
<input
...
...
@@ -39,7 +50,6 @@
<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>
...
...
reqtool/ReqmanAngular11/src/app/components/add-boilerplate/add-boilerplate.component.ts
View file @
c9fd6f23
...
...
@@ -9,6 +9,7 @@ import { BoilerplateService } from 'src/app/services/boilerplate.service';
})
export
class
AddBoilerplateComponent
implements
OnInit
{
boilerplate
:
Boilerplate
=
{
title
:
""
,
has_prefix
:
false
,
has_main
:
false
,
has_suffix
:
false
...
...
@@ -22,6 +23,7 @@ export class AddBoilerplateComponent implements OnInit {
saveBoilerplate
():
void
{
const
data
=
{
title
:
this
.
boilerplate
.
title
,
has_prefix
:
this
.
boilerplate
.
has_prefix
,
has_main
:
this
.
boilerplate
.
has_main
,
has_suffix
:
this
.
boilerplate
.
has_suffix
...
...
@@ -41,6 +43,7 @@ export class AddBoilerplateComponent implements OnInit {
newBoilerplate
():
void
{
this
.
submitted
=
false
;
this
.
boilerplate
=
{
title
:
""
,
has_prefix
:
false
,
has_main
:
false
,
has_suffix
:
false
...
...
reqtool/ReqmanAngular11/src/app/components/boilerplate-list/boilerplate-list.component.html
View file @
c9fd6f23
...
...
@@ -8,18 +8,18 @@
[(
ngModel
)]="
boilerplates
"
/>
<div
class=
"input-group-append"
>
<
!-- <
button
<button
class=
"btn btn-outline-secondary"
type=
"button"
(click)=""
(
click
)="
SearchTitle
()
"
>
Search
</button>
-->
</button>
</div>
</div>
</div>
<div
class=
"col-md-6"
>
<h4>
Boilerplate
List
</h4>
<h4>
Tutorials
List
</h4>
<ul
class=
"list-group"
>
<li
class=
"list-group-item"
...
...
@@ -27,14 +27,16 @@
[
class
.
active
]="
i =
=
currentIndex
"
(
click
)="
setActiveBoilerplate
(
boilerplate
,
i
)"
>
{{boilerplate.title }}
</li>
</ul>
</div>
<div
class=
"col-md-6"
>
<div
*
ngIf=
"currentBoilerplate"
>
<h4>
Boilerplate
</h4>
<div>
<label><strong>
Title:
</strong></label>
{{ currentBoilerplate.title }}
</div>
<div>
<label><strong>
Prefix:
</strong></label>
{{ currentBoilerplate.has_prefix }}
...
...
reqtool/ReqmanAngular11/src/app/components/boilerplate-list/boilerplate-list.component.ts
View file @
c9fd6f23
...
...
@@ -12,7 +12,7 @@ export class BoilerplateListComponent implements OnInit {
boilerplates
?:
Boilerplate
[];
currentBoilerplate
?:
Boilerplate
;
currentIndex
=
-
1
;
//
title = '';
title
=
''
;
constructor
(
private
boilerplateService
:
BoilerplateService
)
{
}
...
...
@@ -43,4 +43,17 @@ export class BoilerplateListComponent implements OnInit {
this
.
currentIndex
=
index
;
}
SearchTitle
():
void
{
this
.
boilerplateService
.
findByTitle
(
this
.
title
)
.
subscribe
(
data
=>
{
this
.
boilerplates
=
data
;
console
.
log
(
data
);
},
error
=>
{
console
.
log
(
error
);
});
}
}
reqtool/ReqmanAngular11/src/app/models/boilerplate.model.ts
View file @
c9fd6f23
export
class
Boilerplate
{
id
?:
any
;
title
?:
string
;
has_prefix
?:
boolean
;
has_main
?:
boolean
;
has_suffix
?:
boolean
;
...
...
reqtool/ReqmanAngular11/src/app/services/boilerplate.service.ts
View file @
c9fd6f23
...
...
@@ -33,8 +33,8 @@ export class BoilerplateService {
}
//In case we want to find by something
/*
findByTitle(title: any): Observable<Boilerplate[]> {
findByTitle
(
title
:
any
):
Observable
<
Boilerplate
[]
>
{
return
this
.
http
.
get
<
Boilerplate
[]
>
(
`
${
baseUrl
}
?title=
${
title
}
`
);
}
*/
}
}
reqtool/reqman/api/reqman/apps/reqtool/models/requirements.py
View file @
c9fd6f23
...
...
@@ -64,6 +64,7 @@ def create_extra_prefix(instance, now_prefix):
class
Boilerplate
(
models
.
Model
):
owner
=
models
.
ForeignKey
(
User
,
related_name
=
'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
)
has_main
=
models
.
BooleanField
(
default
=
False
)
has_suffix
=
models
.
BooleanField
(
default
=
False
)
...
...
reqtool/reqman/api/reqman/apps/reqtool/rest_api/serializers/requirements.py
View file @
c9fd6f23
...
...
@@ -5,7 +5,7 @@ class BoilerplateSerializer(serializers.ModelSerializer):
owner
=
serializers
.
ReadOnlyField
(
source
=
'owner.username'
)
class
Meta
:
model
=
Boilerplate
fields
=
(
'id'
,
'owner'
,
'has_prefix'
,
'has_main'
,
'has_suffix'
)
fields
=
(
'id'
,
'owner'
,
'
title'
,
'
has_prefix'
,
'has_main'
,
'has_suffix'
)
class
PrefixSerializer
(
serializers
.
ModelSerializer
):
...
...
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