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>
<div
class=
"submit-form"
>
<div
class=
"submit-form"
>
<div
*
ngIf=
"!submitted"
>
<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"
>
<div
class=
"form-group"
>
<label
for=
"has_prefix"
>
Prefix
</label>
<label
for=
"has_prefix"
>
Prefix
</label>
<input
<input
...
@@ -39,7 +50,6 @@
...
@@ -39,7 +50,6 @@
<button
(
click
)="
saveBoilerplate
()"
class=
"btn btn-success"
>
Submit
</button>
<button
(
click
)="
saveBoilerplate
()"
class=
"btn btn-success"
>
Submit
</button>
</div>
</div>
<div
*
ngIf=
"submitted"
>
<div
*
ngIf=
"submitted"
>
<h4>
Tutorial was submitted successfully!
</h4>
<h4>
Tutorial was submitted successfully!
</h4>
<button
class=
"btn btn-success"
(
click
)="
newBoilerplate
()"
>
Add
</button>
<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';
...
@@ -9,6 +9,7 @@ import { BoilerplateService } from 'src/app/services/boilerplate.service';
})
})
export
class
AddBoilerplateComponent
implements
OnInit
{
export
class
AddBoilerplateComponent
implements
OnInit
{
boilerplate
:
Boilerplate
=
{
boilerplate
:
Boilerplate
=
{
title
:
""
,
has_prefix
:
false
,
has_prefix
:
false
,
has_main
:
false
,
has_main
:
false
,
has_suffix
:
false
has_suffix
:
false
...
@@ -22,6 +23,7 @@ export class AddBoilerplateComponent implements OnInit {
...
@@ -22,6 +23,7 @@ export class AddBoilerplateComponent implements OnInit {
saveBoilerplate
():
void
{
saveBoilerplate
():
void
{
const
data
=
{
const
data
=
{
title
:
this
.
boilerplate
.
title
,
has_prefix
:
this
.
boilerplate
.
has_prefix
,
has_prefix
:
this
.
boilerplate
.
has_prefix
,
has_main
:
this
.
boilerplate
.
has_main
,
has_main
:
this
.
boilerplate
.
has_main
,
has_suffix
:
this
.
boilerplate
.
has_suffix
has_suffix
:
this
.
boilerplate
.
has_suffix
...
@@ -41,6 +43,7 @@ export class AddBoilerplateComponent implements OnInit {
...
@@ -41,6 +43,7 @@ export class AddBoilerplateComponent implements OnInit {
newBoilerplate
():
void
{
newBoilerplate
():
void
{
this
.
submitted
=
false
;
this
.
submitted
=
false
;
this
.
boilerplate
=
{
this
.
boilerplate
=
{
title
:
""
,
has_prefix
:
false
,
has_prefix
:
false
,
has_main
:
false
,
has_main
:
false
,
has_suffix
:
false
has_suffix
:
false
...
...
reqtool/ReqmanAngular11/src/app/components/boilerplate-list/boilerplate-list.component.html
View file @
c9fd6f23
...
@@ -8,18 +8,18 @@
...
@@ -8,18 +8,18 @@
[(
ngModel
)]="
boilerplates
"
[(
ngModel
)]="
boilerplates
"
/>
/>
<div
class=
"input-group-append"
>
<div
class=
"input-group-append"
>
<
!-- <
button
<button
class=
"btn btn-outline-secondary"
class=
"btn btn-outline-secondary"
type=
"button"
type=
"button"
(click)=""
(
click
)="
SearchTitle
()
"
>
>
Search
Search
</button>
-->
</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"col-md-6"
>
<div
class=
"col-md-6"
>
<h4>
Boilerplate
List
</h4>
<h4>
Tutorials
List
</h4>
<ul
class=
"list-group"
>
<ul
class=
"list-group"
>
<li
<li
class=
"list-group-item"
class=
"list-group-item"
...
@@ -27,14 +27,16 @@
...
@@ -27,14 +27,16 @@
[
class
.
active
]="
i =
=
currentIndex
"
[
class
.
active
]="
i =
=
currentIndex
"
(
click
)="
setActiveBoilerplate
(
boilerplate
,
i
)"
(
click
)="
setActiveBoilerplate
(
boilerplate
,
i
)"
>
>
{{boilerplate.title }}
</li>
</li>
</ul>
</ul>
</div>
</div>
<div
class=
"col-md-6"
>
<div
class=
"col-md-6"
>
<div
*
ngIf=
"currentBoilerplate"
>
<div
*
ngIf=
"currentBoilerplate"
>
<h4>
Boilerplate
</h4>
<h4>
Boilerplate
</h4>
<div>
<label><strong>
Title:
</strong></label>
{{ currentBoilerplate.title }}
</div>
<div>
<div>
<label><strong>
Prefix:
</strong></label>
<label><strong>
Prefix:
</strong></label>
{{ currentBoilerplate.has_prefix }}
{{ 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 {
...
@@ -12,7 +12,7 @@ export class BoilerplateListComponent implements OnInit {
boilerplates
?:
Boilerplate
[];
boilerplates
?:
Boilerplate
[];
currentBoilerplate
?:
Boilerplate
;
currentBoilerplate
?:
Boilerplate
;
currentIndex
=
-
1
;
currentIndex
=
-
1
;
//
title = '';
title
=
''
;
constructor
(
private
boilerplateService
:
BoilerplateService
)
{
}
constructor
(
private
boilerplateService
:
BoilerplateService
)
{
}
...
@@ -43,4 +43,17 @@ export class BoilerplateListComponent implements OnInit {
...
@@ -43,4 +43,17 @@ export class BoilerplateListComponent implements OnInit {
this
.
currentIndex
=
index
;
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
{
export
class
Boilerplate
{
id
?:
any
;
id
?:
any
;
title
?:
string
;
has_prefix
?:
boolean
;
has_prefix
?:
boolean
;
has_main
?:
boolean
;
has_main
?:
boolean
;
has_suffix
?:
boolean
;
has_suffix
?:
boolean
;
...
...
reqtool/ReqmanAngular11/src/app/services/boilerplate.service.ts
View file @
c9fd6f23
...
@@ -33,8 +33,8 @@ export class BoilerplateService {
...
@@ -33,8 +33,8 @@ export class BoilerplateService {
}
}
//In case we want to find by something
//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
}
`
);
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):
...
@@ -64,6 +64,7 @@ def create_extra_prefix(instance, now_prefix):
class
Boilerplate
(
models
.
Model
):
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
)
created
=
models
.
DateTimeField
(
auto_now_add
=
True
)
created
=
models
.
DateTimeField
(
auto_now_add
=
True
)
title
=
models
.
CharField
(
max_length
=
30
,
unique
=
True
)
has_prefix
=
models
.
BooleanField
(
default
=
False
)
has_prefix
=
models
.
BooleanField
(
default
=
False
)
has_main
=
models
.
BooleanField
(
default
=
False
)
has_main
=
models
.
BooleanField
(
default
=
False
)
has_suffix
=
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):
...
@@ -5,7 +5,7 @@ class BoilerplateSerializer(serializers.ModelSerializer):
owner
=
serializers
.
ReadOnlyField
(
source
=
'owner.username'
)
owner
=
serializers
.
ReadOnlyField
(
source
=
'owner.username'
)
class
Meta
:
class
Meta
:
model
=
Boilerplate
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
):
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