Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vue-cdbp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Markus Opolka
vue-cdbp
Commits
6686bcdd
Commit
6686bcdd
authored
7 years ago
by
Markus Opolka
Browse files
Options
Downloads
Patches
Plain Diff
Fix capitalization in Feature component
parent
08864f42
No related branches found
No related tags found
1 merge request
!6
Feature Refactor
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/Feature.vue
+23
-10
23 additions, 10 deletions
src/components/Feature.vue
with
23 additions
and
10 deletions
src/components/Feature.vue
+
23
−
10
View file @
6686bcdd
<
template
>
<
template
>
<ul
style=
"list-style-type:none; padding:8px;"
>
<ul
style=
"list-style-type:none; padding:8px;"
>
<template
v-for=
"(child, name) in root"
>
<template
v-for=
"(child, name) in root"
>
<li><v-chip
label
outline
small
color=
"blue darken-4"
>
{{
underscore
(
capitalize
(
name
)
)
}}
</v-chip>
<li><v-chip
label
outline
small
color=
"blue darken-4"
>
{{
header
(
name
)
}}
</v-chip>
<span
v-if=
"isText(child)"
>
{{
child
.
_text
}}
</span>
<span
v-if=
"isText(child)"
>
{{
child
.
_text
}}
</span>
<ul
v-if=
"isFeature(child)"
style=
"list-style-type:none; padding:5px;"
>
<ul
v-if=
"isFeature(child)"
style=
"list-style-type:none; padding:5px;"
>
<li
v-for=
"attr in child.feature"
>
<li
v-for=
"attr in child.feature"
>
<span
v-if=
"attr._attributes"
>
<span
v-if=
"attr._attributes"
>
<v-tooltip
right
>
<v-tooltip
right
>
<v-chip
label
small
v-on:click.native=
"mark(attr.ref)"
slot=
"activator"
>
<v-chip
label
small
v-on:click.native=
"mark(attr.ref)"
slot=
"activator"
:color=
"background"
>
<span
v-if=
"attr._attributes.category"
>
Category:
{{
(
attr
.
_attributes
.
category
)
}}
</span>
<span
v-if=
"attr._attributes.category"
>
Category:
{{
(
attr
.
_attributes
.
category
)
}}
</span>
<span
v-if=
"attr._attributes.type"
>
, Type:
{{
(
attr
.
_attributes
.
type
)
}}
</span>
<span
v-if=
"attr._attributes.type"
>
, Type:
{{
(
attr
.
_attributes
.
type
)
}}
</span>
<span
v-if=
"attr._attributes.subtype"
>
, Subtype:
{{
(
attr
.
_attributes
.
subtype
)
}}
</span>
<span
v-if=
"attr._attributes.subtype"
>
, Subtype:
{{
(
attr
.
_attributes
.
subtype
)
}}
</span>
...
@@ -17,16 +17,16 @@
...
@@ -17,16 +17,16 @@
</span>
</span>
<span
v-else-if=
"attr.category"
>
<span
v-else-if=
"attr.category"
>
<v-tooltip
right
>
<v-tooltip
right
>
<v-chip
label
small
v-on:click.native=
"mark(attr.ref)"
slot=
"activator"
>
<v-chip
label
small
v-on:click.native=
"mark(attr.ref)"
slot=
"activator"
:color=
"background"
>
<span
v-if=
"attr.category"
>
Category:
{{
(
attr
.
category
)
}}
</span>
<span
v-if=
"attr.category"
>
Category:
{{
(
attr
.
category
)
}}
</span>
<span
v-if=
"attr.type"
>
, Type:
{{
(
attr
.
type
)
}}
</span>
<span
v-if=
"attr.type"
>
, Type:
{{
(
attr
.
type
)
}}
</span>
<span
v-if=
"attr.subtype"
>
, Subtype:
{{
(
attr
.
subtype
)
}}
</span>
<span
v-if=
"attr.subtype"
>
, Subtype:
{{
(
attr
.
subtype
)
}}
</span>
</v-chip>
</v-chip>
<span
v-if=
"attr.ref"
>
Lines:
{{
attr
.
ref
}}
</span>
<span>
Lines:
{{
attr
.
ref
}}
</span>
</v-tooltip>
</v-tooltip>
</span>
</span>
<span
v-else
>
<span
v-else
>
<v-chip
label
small
>
<v-chip
label
small
:color=
"background"
>
{{
cutoff
(
attr
)
}}
{{
cutoff
(
attr
)
}}
</v-chip>
</v-chip>
</span>
</span>
...
@@ -43,16 +43,15 @@ export default {
...
@@ -43,16 +43,15 @@ export default {
// Recursive Component for Features in a Letter
// Recursive Component for Features in a Letter
data
()
{
data
()
{
return
{
return
{
data
:
null
data
:
null
,
background
:
'
white
'
}
}
},
},
methods
:
{
methods
:
{
mark
(
ref
)
{
// console.log(ref)
},
capitalize
(
str
)
{
capitalize
(
str
)
{
str
=
String
(
str
)
str
=
String
(
str
)
return
str
.
replace
(
/
\w\S
*/g
,
function
(
txt
)
{
return
txt
.
charAt
(
0
).
toUpperCase
()
+
txt
.
substr
(
1
).
toLowerCase
()
})
str
=
str
.
replace
(
/
\b\w
/g
,
l
=>
l
.
toUpperCase
())
return
str
},
},
underscore
(
str
)
{
underscore
(
str
)
{
str
=
String
(
str
)
str
=
String
(
str
)
...
@@ -62,6 +61,20 @@ export default {
...
@@ -62,6 +61,20 @@ export default {
str
=
String
(
str
)
str
=
String
(
str
)
return
str
.
substr
(
0
,
100
)
return
str
.
substr
(
0
,
100
)
},
},
umlaut
(
str
)
{
str
=
String
(
str
)
str
=
str
.
replace
(
/ue/g
,
'
ü
'
)
str
=
str
.
replace
(
/ae/g
,
'
ä
'
)
str
=
str
.
replace
(
/Ae/g
,
'
Ä
'
)
str
=
str
.
replace
(
/oe/g
,
'
ö
'
)
return
str
},
header
(
str
)
{
str
=
this
.
underscore
(
str
)
str
=
this
.
capitalize
(
str
)
str
=
this
.
umlaut
(
str
)
return
str
},
isAttribute
(
obj
)
{
isAttribute
(
obj
)
{
return
Object
.
keys
(
obj
)[
0
]
===
'
_attributes
'
return
Object
.
keys
(
obj
)[
0
]
===
'
_attributes
'
},
},
...
...
This diff is collapsed.
Click to expand it.
Markus Opolka
@bi40resu
mentioned in issue
#9 (closed)
·
7 years ago
mentioned in issue
#9 (closed)
mentioned in issue #9
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment