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
3a5dedaf
Commit
3a5dedaf
authored
Sep 04, 2020
by
Nicolò Maria Mezzopera
Committed by
Kushal Pandya
Sep 04, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move details_row to vue_shared
- source - tests
parent
30761ab0
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
42 additions
and
27 deletions
+42
-27
app/assets/javascripts/packages/details/components/additional_metadata.vue
...ripts/packages/details/components/additional_metadata.vue
+1
-1
app/assets/javascripts/packages/details/components/package_history.vue
...vascripts/packages/details/components/package_history.vue
+12
-12
app/assets/javascripts/registry/explorer/components/details_page/tags_list_row.vue
...gistry/explorer/components/details_page/tags_list_row.vue
+1
-1
app/assets/javascripts/vue_shared/components/registry/details_row.vue
...avascripts/vue_shared/components/registry/details_row.vue
+0
-0
app/assets/javascripts/vue_shared/components/registry/history_item.vue
...vascripts/vue_shared/components/registry/history_item.vue
+4
-3
spec/frontend/packages/details/components/additional_metadata_spec.js
...d/packages/details/components/additional_metadata_spec.js
+1
-1
spec/frontend/packages/details/components/package_history_spec.js
...ntend/packages/details/components/package_history_spec.js
+3
-3
spec/frontend/registry/explorer/components/details_page/tags_list_row_spec.js
...ry/explorer/components/details_page/tags_list_row_spec.js
+1
-1
spec/frontend/vue_shared/components/registry/__snapshots__/history_item_spec.js.snap
...mponents/registry/__snapshots__/history_item_spec.js.snap
+6
-2
spec/frontend/vue_shared/components/registry/details_row_spec.js
...ontend/vue_shared/components/registry/details_row_spec.js
+1
-1
spec/frontend/vue_shared/components/registry/history_item_spec.js
...ntend/vue_shared/components/registry/history_item_spec.js
+12
-2
No files found.
app/assets/javascripts/packages/details/components/additional_metadata.vue
View file @
3a5dedaf
<
script
>
<
script
>
import
{
GlLink
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
GlLink
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
s__
}
from
'
~/locale
'
;
import
{
s__
}
from
'
~/locale
'
;
import
DetailsRow
from
'
~/
registry/shared/components
/details_row.vue
'
;
import
DetailsRow
from
'
~/
vue_shared/components/registry
/details_row.vue
'
;
import
{
generateConanRecipe
}
from
'
../utils
'
;
import
{
generateConanRecipe
}
from
'
../utils
'
;
import
{
PackageType
}
from
'
../../shared/constants
'
;
import
{
PackageType
}
from
'
../../shared/constants
'
;
...
...
app/assets/javascripts/packages/details/components/package_history.vue
View file @
3a5dedaf
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
import
{
GlLink
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
GlLink
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
s__
}
from
'
~/locale
'
;
import
{
s__
}
from
'
~/locale
'
;
import
TimeAgoTooltip
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
import
TimeAgoTooltip
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
import
History
Element
from
'
./history_element
.vue
'
;
import
History
Item
from
'
~/vue_shared/components/registry/history_item
.vue
'
;
export
default
{
export
default
{
name
:
'
PackageHistory
'
,
name
:
'
PackageHistory
'
,
...
@@ -16,7 +16,7 @@ export default {
...
@@ -16,7 +16,7 @@ export default {
components
:
{
components
:
{
GlLink
,
GlLink
,
GlSprintf
,
GlSprintf
,
History
Element
,
History
Item
,
TimeAgoTooltip
,
TimeAgoTooltip
,
},
},
props
:
{
props
:
{
...
@@ -46,7 +46,7 @@ export default {
...
@@ -46,7 +46,7 @@ export default {
<div
class=
"issuable-discussion"
>
<div
class=
"issuable-discussion"
>
<h3
class=
"gl-font-lg"
data-testid=
"title"
>
{{
__
(
'
History
'
)
}}
</h3>
<h3
class=
"gl-font-lg"
data-testid=
"title"
>
{{
__
(
'
History
'
)
}}
</h3>
<ul
class=
"timeline main-notes-list notes gl-mb-4"
data-testid=
"timeline"
>
<ul
class=
"timeline main-notes-list notes gl-mb-4"
data-testid=
"timeline"
>
<history-
element
icon=
"clock"
data-testid=
"created-on"
>
<history-
item
icon=
"clock"
data-testid=
"created-on"
>
<gl-sprintf
:message=
"$options.i18n.createdOn"
>
<gl-sprintf
:message=
"$options.i18n.createdOn"
>
<template
#name
>
<template
#name
>
<strong>
{{
packageEntity
.
name
}}
</strong>
<strong>
{{
packageEntity
.
name
}}
</strong>
...
@@ -58,8 +58,8 @@ export default {
...
@@ -58,8 +58,8 @@ export default {
<time-ago-tooltip
:time=
"packageEntity.created_at"
/>
<time-ago-tooltip
:time=
"packageEntity.created_at"
/>
</
template
>
</
template
>
</gl-sprintf>
</gl-sprintf>
</history-
element
>
</history-
item
>
<history-
element
icon=
"pencil"
data-testid=
"updated-at"
>
<history-
item
icon=
"pencil"
data-testid=
"updated-at"
>
<gl-sprintf
:message=
"$options.i18n.updatedAtText"
>
<gl-sprintf
:message=
"$options.i18n.updatedAtText"
>
<
template
#name
>
<
template
#name
>
<strong>
{{
packageEntity
.
name
}}
</strong>
<strong>
{{
packageEntity
.
name
}}
</strong>
...
@@ -71,9 +71,9 @@ export default {
...
@@ -71,9 +71,9 @@ export default {
<time-ago-tooltip
:time=
"packageEntity.updated_at"
/>
<time-ago-tooltip
:time=
"packageEntity.updated_at"
/>
</
template
>
</
template
>
</gl-sprintf>
</gl-sprintf>
</history-
element
>
</history-
item
>
<
template
v-if=
"packagePipeline"
>
<
template
v-if=
"packagePipeline"
>
<history-
element
icon=
"commit"
data-testid=
"commit"
>
<history-
item
icon=
"commit"
data-testid=
"commit"
>
<gl-sprintf
:message=
"$options.i18n.commitText"
>
<gl-sprintf
:message=
"$options.i18n.commitText"
>
<template
#link
>
<template
#link
>
<gl-link
:href=
"packagePipeline.project.commit_url"
>
{{
<gl-link
:href=
"packagePipeline.project.commit_url"
>
{{
...
@@ -84,8 +84,8 @@ export default {
...
@@ -84,8 +84,8 @@ export default {
<strong>
{{
packagePipeline
.
ref
}}
</strong>
<strong>
{{
packagePipeline
.
ref
}}
</strong>
</
template
>
</
template
>
</gl-sprintf>
</gl-sprintf>
</history-
element
>
</history-
item
>
<history-
element
icon=
"pipeline"
data-testid=
"pipeline"
>
<history-
item
icon=
"pipeline"
data-testid=
"pipeline"
>
<gl-sprintf
:message=
"$options.i18n.pipelineText"
>
<gl-sprintf
:message=
"$options.i18n.pipelineText"
>
<
template
#link
>
<
template
#link
>
<gl-link
:href=
"packagePipeline.project.pipeline_url"
<gl-link
:href=
"packagePipeline.project.pipeline_url"
...
@@ -97,9 +97,9 @@ export default {
...
@@ -97,9 +97,9 @@ export default {
</
template
>
</
template
>
<
template
#author
>
{{
packagePipeline
.
user
.
name
}}
</
template
>
<
template
#author
>
{{
packagePipeline
.
user
.
name
}}
</
template
>
</gl-sprintf>
</gl-sprintf>
</history-
element
>
</history-
item
>
</template>
</template>
<history-
element
icon=
"package"
data-testid=
"published"
>
<history-
item
icon=
"package"
data-testid=
"published"
>
<gl-sprintf
:message=
"$options.i18n.publishText"
>
<gl-sprintf
:message=
"$options.i18n.publishText"
>
<
template
#project
>
<
template
#project
>
<strong>
{{
projectName
}}
</strong>
<strong>
{{
projectName
}}
</strong>
...
@@ -108,7 +108,7 @@ export default {
...
@@ -108,7 +108,7 @@ export default {
<time-ago-tooltip
:time=
"packageEntity.created_at"
/>
<time-ago-tooltip
:time=
"packageEntity.created_at"
/>
</
template
>
</
template
>
</gl-sprintf>
</gl-sprintf>
</history-
element
>
</history-
item
>
</ul>
</ul>
</div>
</div>
</template>
</template>
app/assets/javascripts/registry/explorer/components/details_page/tags_list_row.vue
View file @
3a5dedaf
...
@@ -7,7 +7,7 @@ import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
...
@@ -7,7 +7,7 @@ import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
import
{
formatDate
}
from
'
~/lib/utils/datetime_utility
'
;
import
{
formatDate
}
from
'
~/lib/utils/datetime_utility
'
;
import
ListItem
from
'
~/vue_shared/components/registry/list_item.vue
'
;
import
ListItem
from
'
~/vue_shared/components/registry/list_item.vue
'
;
import
DeleteButton
from
'
../delete_button.vue
'
;
import
DeleteButton
from
'
../delete_button.vue
'
;
import
DetailsRow
from
'
~/
registry/shared/components
/details_row.vue
'
;
import
DetailsRow
from
'
~/
vue_shared/components/registry
/details_row.vue
'
;
import
{
import
{
REMOVE_TAG_BUTTON_TITLE
,
REMOVE_TAG_BUTTON_TITLE
,
DIGEST_LABEL
,
DIGEST_LABEL
,
...
...
app/assets/javascripts/
registry/shared/components
/details_row.vue
→
app/assets/javascripts/
vue_shared/components/registry
/details_row.vue
View file @
3a5dedaf
File moved
app/assets/javascripts/
packages/details/components/history_element
.vue
→
app/assets/javascripts/
vue_shared/components/registry/history_item
.vue
View file @
3a5dedaf
...
@@ -3,12 +3,11 @@ import { GlIcon } from '@gitlab/ui';
...
@@ -3,12 +3,11 @@ import { GlIcon } from '@gitlab/ui';
import
TimelineEntryItem
from
'
~/vue_shared/components/notes/timeline_entry_item.vue
'
;
import
TimelineEntryItem
from
'
~/vue_shared/components/notes/timeline_entry_item.vue
'
;
export
default
{
export
default
{
name
:
'
History
Element
'
,
name
:
'
History
Item
'
,
components
:
{
components
:
{
GlIcon
,
GlIcon
,
TimelineEntryItem
,
TimelineEntryItem
,
},
},
props
:
{
props
:
{
icon
:
{
icon
:
{
type
:
String
,
type
:
String
,
...
@@ -29,7 +28,9 @@ export default {
...
@@ -29,7 +28,9 @@ export default {
<slot></slot>
<slot></slot>
</span>
</span>
</div>
</div>
<div
class=
"note-body"
></div>
<div
class=
"note-body"
>
<slot
name=
"body"
></slot>
</div>
</div>
</div>
</timeline-entry-item>
</timeline-entry-item>
</
template
>
</
template
>
spec/frontend/packages/details/components/additional_metadata_spec.js
View file @
3a5dedaf
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlLink
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
GlLink
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
DetailsRow
from
'
~/
registry/shared/components
/details_row.vue
'
;
import
DetailsRow
from
'
~/
vue_shared/components/registry
/details_row.vue
'
;
import
component
from
'
~/packages/details/components/additional_metadata.vue
'
;
import
component
from
'
~/packages/details/components/additional_metadata.vue
'
;
import
{
mavenPackage
,
conanPackage
,
nugetPackage
,
npmPackage
}
from
'
../../mock_data
'
;
import
{
mavenPackage
,
conanPackage
,
nugetPackage
,
npmPackage
}
from
'
../../mock_data
'
;
...
...
spec/frontend/packages/details/components/package_history_spec.js
View file @
3a5dedaf
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlLink
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
GlLink
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
TimeAgoTooltip
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
import
TimeAgoTooltip
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
import
History
Element
from
'
~/packages/details/components/history_element
.vue
'
;
import
History
Item
from
'
~/vue_shared/components/registry/history_item
.vue
'
;
import
component
from
'
~/packages/details/components/package_history.vue
'
;
import
component
from
'
~/packages/details/components/package_history.vue
'
;
import
{
mavenPackage
,
mockPipelineInfo
}
from
'
../../mock_data
'
;
import
{
mavenPackage
,
mockPipelineInfo
}
from
'
../../mock_data
'
;
...
@@ -17,8 +17,8 @@ describe('Package History', () => {
...
@@ -17,8 +17,8 @@ describe('Package History', () => {
wrapper
=
shallowMount
(
component
,
{
wrapper
=
shallowMount
(
component
,
{
propsData
:
{
...
defaultProps
,
...
props
},
propsData
:
{
...
defaultProps
,
...
props
},
stubs
:
{
stubs
:
{
History
Element
:
{
History
Item
:
{
props
:
History
Element
.
props
,
props
:
History
Item
.
props
,
template
:
'
<div data-testid="history-element"><slot></slot></div>
'
,
template
:
'
<div data-testid="history-element"><slot></slot></div>
'
,
},
},
GlSprintf
,
GlSprintf
,
...
...
spec/frontend/registry/explorer/components/details_page/tags_list_row_spec.js
View file @
3a5dedaf
...
@@ -6,7 +6,7 @@ import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
...
@@ -6,7 +6,7 @@ import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
import
TimeAgoTooltip
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
import
TimeAgoTooltip
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
import
component
from
'
~/registry/explorer/components/details_page/tags_list_row.vue
'
;
import
component
from
'
~/registry/explorer/components/details_page/tags_list_row.vue
'
;
import
DeleteButton
from
'
~/registry/explorer/components/delete_button.vue
'
;
import
DeleteButton
from
'
~/registry/explorer/components/delete_button.vue
'
;
import
DetailsRow
from
'
~/
registry/shared/components
/details_row.vue
'
;
import
DetailsRow
from
'
~/
vue_shared/components/registry
/details_row.vue
'
;
import
{
import
{
REMOVE_TAG_BUTTON_TITLE
,
REMOVE_TAG_BUTTON_TITLE
,
REMOVE_TAG_BUTTON_DISABLE_TOOLTIP
,
REMOVE_TAG_BUTTON_DISABLE_TOOLTIP
,
...
...
spec/frontend/
packages/details/components/__snapshots__/history_element
_spec.js.snap
→
spec/frontend/
vue_shared/components/registry/__snapshots__/history_item
_spec.js.snap
View file @
3a5dedaf
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`History
Element
renders the correct markup 1`] = `
exports[`History
Item
renders the correct markup 1`] = `
<li
<li
class="timeline-entry system-note note-wrapper gl-mb-6!"
class="timeline-entry system-note note-wrapper gl-mb-6!"
>
>
...
@@ -31,7 +31,11 @@ exports[`History Element renders the correct markup 1`] = `
...
@@ -31,7 +31,11 @@ exports[`History Element renders the correct markup 1`] = `
<div
<div
class="note-body"
class="note-body"
/>
>
<div
data-testid="body-slot"
/>
</div>
</div>
</div>
</div>
</div>
</li>
</li>
...
...
spec/frontend/
registry/shared/components
/details_row_spec.js
→
spec/frontend/
vue_shared/components/registry
/details_row_spec.js
View file @
3a5dedaf
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
GlIcon
}
from
'
@gitlab/ui
'
;
import
component
from
'
~/
registry/shared/components
/details_row.vue
'
;
import
component
from
'
~/
vue_shared/components/registry
/details_row.vue
'
;
describe
(
'
DetailsRow
'
,
()
=>
{
describe
(
'
DetailsRow
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
...
spec/frontend/
packages/details/components/history_element
_spec.js
→
spec/frontend/
vue_shared/components/registry/history_item
_spec.js
View file @
3a5dedaf
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
GlIcon
}
from
'
@gitlab/ui
'
;
import
component
from
'
~/packages/details/components/history_element.vue
'
;
import
TimelineEntryItem
from
'
~/vue_shared/components/notes/timeline_entry_item.vue
'
;
import
TimelineEntryItem
from
'
~/vue_shared/components/notes/timeline_entry_item.vue
'
;
import
component
from
'
~/vue_shared/components/registry/history_item.vue
'
;
describe
(
'
History
Element
'
,
()
=>
{
describe
(
'
History
Item
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
const
defaultProps
=
{
const
defaultProps
=
{
icon
:
'
pencil
'
,
icon
:
'
pencil
'
,
...
@@ -17,6 +17,7 @@ describe('History Element', () => {
...
@@ -17,6 +17,7 @@ describe('History Element', () => {
},
},
slots
:
{
slots
:
{
default
:
'
<div data-testid="default-slot"></div>
'
,
default
:
'
<div data-testid="default-slot"></div>
'
,
body
:
'
<div data-testid="body-slot"></div>
'
,
},
},
});
});
};
};
...
@@ -29,6 +30,7 @@ describe('History Element', () => {
...
@@ -29,6 +30,7 @@ describe('History Element', () => {
const
findTimelineEntry
=
()
=>
wrapper
.
find
(
TimelineEntryItem
);
const
findTimelineEntry
=
()
=>
wrapper
.
find
(
TimelineEntryItem
);
const
findGlIcon
=
()
=>
wrapper
.
find
(
GlIcon
);
const
findGlIcon
=
()
=>
wrapper
.
find
(
GlIcon
);
const
findDefaultSlot
=
()
=>
wrapper
.
find
(
'
[data-testid="default-slot"]
'
);
const
findDefaultSlot
=
()
=>
wrapper
.
find
(
'
[data-testid="default-slot"]
'
);
const
findBodySlot
=
()
=>
wrapper
.
find
(
'
[data-testid="body-slot"]
'
);
it
(
'
renders the correct markup
'
,
()
=>
{
it
(
'
renders the correct markup
'
,
()
=>
{
mountComponent
();
mountComponent
();
...
@@ -41,11 +43,19 @@ describe('History Element', () => {
...
@@ -41,11 +43,19 @@ describe('History Element', () => {
expect
(
findDefaultSlot
().
exists
()).
toBe
(
true
);
expect
(
findDefaultSlot
().
exists
()).
toBe
(
true
);
});
});
it
(
'
has a body slot
'
,
()
=>
{
mountComponent
();
expect
(
findBodySlot
().
exists
()).
toBe
(
true
);
});
it
(
'
has a timeline entry
'
,
()
=>
{
it
(
'
has a timeline entry
'
,
()
=>
{
mountComponent
();
mountComponent
();
expect
(
findTimelineEntry
().
exists
()).
toBe
(
true
);
expect
(
findTimelineEntry
().
exists
()).
toBe
(
true
);
});
});
it
(
'
has an icon
'
,
()
=>
{
it
(
'
has an icon
'
,
()
=>
{
mountComponent
();
mountComponent
();
...
...
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