Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c9ba63ee
Commit
c9ba63ee
authored
Oct 08, 2020
by
Nicolò Maria Mezzopera
Committed by
Kushal Pandya
Oct 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix shared component dynamic slot names
- source - tests
parent
9cbbfab1
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
20 additions
and
20 deletions
+20
-20
app/assets/javascripts/packages/details/components/package_title.vue
...javascripts/packages/details/components/package_title.vue
+5
-5
app/assets/javascripts/packages/list/components/package_title.vue
...ts/javascripts/packages/list/components/package_title.vue
+1
-1
app/assets/javascripts/registry/explorer/components/details_page/tags_list_row.vue
...gistry/explorer/components/details_page/tags_list_row.vue
+3
-3
app/assets/javascripts/registry/explorer/components/list_page/registry_header.vue
...egistry/explorer/components/list_page/registry_header.vue
+2
-2
app/assets/javascripts/vue_shared/components/registry/list_item.vue
.../javascripts/vue_shared/components/registry/list_item.vue
+1
-1
app/assets/javascripts/vue_shared/components/registry/title_area.vue
...javascripts/vue_shared/components/registry/title_area.vue
+1
-1
spec/frontend/vue_shared/components/registry/list_item_spec.js
...frontend/vue_shared/components/registry/list_item_spec.js
+4
-4
spec/frontend/vue_shared/components/registry/title_area_spec.js
...rontend/vue_shared/components/registry/title_area_spec.js
+3
-3
No files found.
app/assets/javascripts/packages/details/components/package_title.vue
View file @
c9ba63ee
...
@@ -54,15 +54,15 @@ export default {
...
@@ -54,15 +54,15 @@ export default {
</gl-sprintf>
</gl-sprintf>
</template>
</template>
<
template
v-if=
"packageTypeDisplay"
#metadata
_
type
>
<
template
v-if=
"packageTypeDisplay"
#metadata
-
type
>
<metadata-item
data-testid=
"package-type"
icon=
"package"
:text=
"packageTypeDisplay"
/>
<metadata-item
data-testid=
"package-type"
icon=
"package"
:text=
"packageTypeDisplay"
/>
</
template
>
</
template
>
<
template
#metadata
_
size
>
<
template
#metadata
-
size
>
<metadata-item
data-testid=
"package-size"
icon=
"disk"
:text=
"totalSize"
/>
<metadata-item
data-testid=
"package-size"
icon=
"disk"
:text=
"totalSize"
/>
</
template
>
</
template
>
<
template
v-if=
"packagePipeline"
#metadata
_
pipeline
>
<
template
v-if=
"packagePipeline"
#metadata
-
pipeline
>
<metadata-item
<metadata-item
data-testid=
"pipeline-project"
data-testid=
"pipeline-project"
icon=
"review-list"
icon=
"review-list"
...
@@ -71,11 +71,11 @@ export default {
...
@@ -71,11 +71,11 @@ export default {
/>
/>
</
template
>
</
template
>
<
template
v-if=
"packagePipeline"
#metadata
_
ref
>
<
template
v-if=
"packagePipeline"
#metadata
-
ref
>
<metadata-item
data-testid=
"package-ref"
icon=
"branch"
:text=
"packagePipeline.ref"
/>
<metadata-item
data-testid=
"package-ref"
icon=
"branch"
:text=
"packagePipeline.ref"
/>
</
template
>
</
template
>
<
template
v-if=
"hasTagsToDisplay"
#metadata
_
tags
>
<
template
v-if=
"hasTagsToDisplay"
#metadata
-
tags
>
<package-tags
:tag-display-limit=
"2"
:tags=
"packageEntity.tags"
hide-label
/>
<package-tags
:tag-display-limit=
"2"
:tags=
"packageEntity.tags"
hide-label
/>
</
template
>
</
template
>
...
...
app/assets/javascripts/packages/list/components/package_title.vue
View file @
c9ba63ee
...
@@ -40,7 +40,7 @@ export default {
...
@@ -40,7 +40,7 @@ export default {
<
template
>
<
template
>
<title-area
:title=
"$options.i18n.LIST_TITLE_TEXT"
:info-messages=
"infoMessages"
>
<title-area
:title=
"$options.i18n.LIST_TITLE_TEXT"
:info-messages=
"infoMessages"
>
<template
#metadata
_
amount
>
<template
#metadata
-
amount
>
<metadata-item
v-if=
"showPackageCount"
icon=
"package"
:text=
"packageAmountText"
/>
<metadata-item
v-if=
"showPackageCount"
icon=
"package"
:text=
"packageAmountText"
/>
</
template
>
</
template
>
</title-area>
</title-area>
...
...
app/assets/javascripts/registry/explorer/components/details_page/tags_list_row.vue
View file @
c9ba63ee
...
@@ -171,7 +171,7 @@ export default {
...
@@ -171,7 +171,7 @@ export default {
/>
/>
</
template
>
</
template
>
<
template
v-if=
"!invalidTag"
#details
_
published
>
<
template
v-if=
"!invalidTag"
#details
-
published
>
<details-row
icon=
"clock"
data-testid=
"published-date-detail"
>
<details-row
icon=
"clock"
data-testid=
"published-date-detail"
>
<gl-sprintf
:message=
"$options.i18n.PUBLISHED_DETAILS_ROW_TEXT"
>
<gl-sprintf
:message=
"$options.i18n.PUBLISHED_DETAILS_ROW_TEXT"
>
<template
#repositoryPath
>
<template
#repositoryPath
>
...
@@ -186,7 +186,7 @@ export default {
...
@@ -186,7 +186,7 @@ export default {
</gl-sprintf>
</gl-sprintf>
</details-row>
</details-row>
</template>
</template>
<
template
v-if=
"!invalidTag"
#details
_manifest_
digest
>
<
template
v-if=
"!invalidTag"
#details
-manifest-
digest
>
<details-row
icon=
"log"
data-testid=
"manifest-detail"
>
<details-row
icon=
"log"
data-testid=
"manifest-detail"
>
<gl-sprintf
:message=
"$options.i18n.MANIFEST_DETAILS_ROW_TEST"
>
<gl-sprintf
:message=
"$options.i18n.MANIFEST_DETAILS_ROW_TEST"
>
<template
#digest
>
<template
#digest
>
...
@@ -202,7 +202,7 @@ export default {
...
@@ -202,7 +202,7 @@ export default {
/>
/>
</details-row>
</details-row>
</template>
</template>
<
template
v-if=
"!invalidTag"
#details
_configuration_
digest
>
<
template
v-if=
"!invalidTag"
#details
-configuration-
digest
>
<details-row
icon=
"cloud-gear"
data-testid=
"configuration-detail"
>
<details-row
icon=
"cloud-gear"
data-testid=
"configuration-detail"
>
<gl-sprintf
:message=
"$options.i18n.CONFIGURATION_DETAILS_ROW_TEST"
>
<gl-sprintf
:message=
"$options.i18n.CONFIGURATION_DETAILS_ROW_TEST"
>
<template
#digest
>
<template
#digest
>
...
...
app/assets/javascripts/registry/explorer/components/list_page/registry_header.vue
View file @
c9ba63ee
...
@@ -96,7 +96,7 @@ export default {
...
@@ -96,7 +96,7 @@ export default {
<template
#right-actions
>
<template
#right-actions
>
<slot
name=
"commands"
></slot>
<slot
name=
"commands"
></slot>
</
template
>
</
template
>
<
template
#metadata
_
count
>
<
template
#metadata
-
count
>
<metadata-item
<metadata-item
v-if=
"imagesCount"
v-if=
"imagesCount"
data-testid=
"images-count"
data-testid=
"images-count"
...
@@ -104,7 +104,7 @@ export default {
...
@@ -104,7 +104,7 @@ export default {
:text=
"imagesCountText"
:text=
"imagesCountText"
/>
/>
</
template
>
</
template
>
<
template
#metadata
_exp_
policies
>
<
template
#metadata
-exp-
policies
>
<metadata-item
<metadata-item
v-if=
"!hideExpirationPolicyData"
v-if=
"!hideExpirationPolicyData"
data-testid=
"expiration-policy"
data-testid=
"expiration-policy"
...
...
app/assets/javascripts/vue_shared/components/registry/list_item.vue
View file @
c9ba63ee
...
@@ -39,7 +39,7 @@ export default {
...
@@ -39,7 +39,7 @@ export default {
},
},
},
},
mounted
()
{
mounted
()
{
this
.
detailsSlots
=
Object
.
keys
(
this
.
$slots
).
filter
(
k
=>
k
.
startsWith
(
'
details
_
'
));
this
.
detailsSlots
=
Object
.
keys
(
this
.
$slots
).
filter
(
k
=>
k
.
startsWith
(
'
details
-
'
));
},
},
methods
:
{
methods
:
{
toggleDetails
()
{
toggleDetails
()
{
...
...
app/assets/javascripts/vue_shared/components/registry/title_area.vue
View file @
c9ba63ee
...
@@ -31,7 +31,7 @@ export default {
...
@@ -31,7 +31,7 @@ export default {
};
};
},
},
mounted
()
{
mounted
()
{
this
.
metadataSlots
=
Object
.
keys
(
this
.
$slots
).
filter
(
k
=>
k
.
startsWith
(
'
metadata
_
'
));
this
.
metadataSlots
=
Object
.
keys
(
this
.
$slots
).
filter
(
k
=>
k
.
startsWith
(
'
metadata
-
'
));
},
},
};
};
</
script
>
</
script
>
...
...
spec/frontend/vue_shared/components/registry/list_item_spec.js
View file @
c9ba63ee
...
@@ -58,9 +58,9 @@ describe('list item', () => {
...
@@ -58,9 +58,9 @@ describe('list item', () => {
describe
.
each
`
describe
.
each
`
slotNames
slotNames
${[
'
details
_
foo
'
]}
${[
'
details
-
foo
'
]}
${[
'
details
_foo
'
,
'
details_
bar
'
]}
${[
'
details
-foo
'
,
'
details-
bar
'
]}
${[
'
details
_foo
'
,
'
details_bar
'
,
'
details_
baz
'
]}
${[
'
details
-foo
'
,
'
details-bar
'
,
'
details-
baz
'
]}
`
(
'
$slotNames details slots
'
,
({
slotNames
})
=>
{
`
(
'
$slotNames details slots
'
,
({
slotNames
})
=>
{
const
slotMocks
=
slotNames
.
reduce
((
acc
,
current
)
=>
{
const
slotMocks
=
slotNames
.
reduce
((
acc
,
current
)
=>
{
acc
[
current
]
=
`<div data-testid="
${
current
}
" />`
;
acc
[
current
]
=
`<div data-testid="
${
current
}
" />`
;
...
@@ -89,7 +89,7 @@ describe('list item', () => {
...
@@ -89,7 +89,7 @@ describe('list item', () => {
describe
(
'
details toggle button
'
,
()
=>
{
describe
(
'
details toggle button
'
,
()
=>
{
it
(
'
is visible when at least one details slot exists
'
,
async
()
=>
{
it
(
'
is visible when at least one details slot exists
'
,
async
()
=>
{
mountComponent
({},
{
details_foo
:
'
<span></span>
'
});
mountComponent
({},
{
'
details-foo
'
:
'
<span></span>
'
});
await
wrapper
.
vm
.
$nextTick
();
await
wrapper
.
vm
.
$nextTick
();
expect
(
findToggleDetailsButton
().
exists
()).
toBe
(
true
);
expect
(
findToggleDetailsButton
().
exists
()).
toBe
(
true
);
});
});
...
...
spec/frontend/vue_shared/components/registry/title_area_spec.js
View file @
c9ba63ee
...
@@ -79,9 +79,9 @@ describe('title area', () => {
...
@@ -79,9 +79,9 @@ describe('title area', () => {
describe
.
each
`
describe
.
each
`
slotNames
slotNames
${[
'
metadata
_
foo
'
]}
${[
'
metadata
-
foo
'
]}
${[
'
metadata
_foo
'
,
'
metadata_
bar
'
]}
${[
'
metadata
-foo
'
,
'
metadata-
bar
'
]}
${[
'
metadata
_foo
'
,
'
metadata_bar
'
,
'
metadata_
baz
'
]}
${[
'
metadata
-foo
'
,
'
metadata-bar
'
,
'
metadata-
baz
'
]}
`
(
'
$slotNames metadata slots
'
,
({
slotNames
})
=>
{
`
(
'
$slotNames metadata slots
'
,
({
slotNames
})
=>
{
const
slotMocks
=
slotNames
.
reduce
((
acc
,
current
)
=>
{
const
slotMocks
=
slotNames
.
reduce
((
acc
,
current
)
=>
{
acc
[
current
]
=
`<div data-testid="
${
current
}
" />`
;
acc
[
current
]
=
`<div data-testid="
${
current
}
" />`
;
...
...
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