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
851dd92d
Commit
851dd92d
authored
Sep 29, 2020
by
Nicolò Maria Mezzopera
Committed by
Jose Ivan Vargas
Sep 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor Packagetitle to be store agnostic
- package title - package list wiring - package list tests - snapshots
parent
82f7405e
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
567 additions
and
411 deletions
+567
-411
app/assets/javascripts/packages/list/components/package_title.vue
...ts/javascripts/packages/list/components/package_title.vue
+47
-0
app/assets/javascripts/packages/list/components/packages_list_app.vue
...avascripts/packages/list/components/packages_list_app.vue
+43
-35
app/assets/javascripts/packages/list/constants.js
app/assets/javascripts/packages/list/constants.js
+6
-0
app/helpers/packages_helper.rb
app/helpers/packages_helper.rb
+2
-1
changelogs/unreleased/225164-add-a-title-section-to-the-package-registry-ui.yml
...225164-add-a-title-section-to-the-package-registry-ui.yml
+5
-0
locale/gitlab.pot
locale/gitlab.pot
+11
-0
spec/frontend/packages/list/components/__snapshots__/packages_list_app_spec.js.snap
...t/components/__snapshots__/packages_list_app_spec.js.snap
+381
-375
spec/frontend/packages/list/components/packages_list_app_spec.js
...ontend/packages/list/components/packages_list_app_spec.js
+1
-0
spec/frontend/packages/list/components/packages_title_spec.js
.../frontend/packages/list/components/packages_title_spec.js
+71
-0
No files found.
app/assets/javascripts/packages/list/components/package_title.vue
0 → 100644
View file @
851dd92d
<
script
>
import
{
n__
}
from
'
~/locale
'
;
import
TitleArea
from
'
~/vue_shared/components/registry/title_area.vue
'
;
import
MetadataItem
from
'
~/vue_shared/components/registry/metadata_item.vue
'
;
import
{
LIST_INTRO_TEXT
,
LIST_TITLE_TEXT
}
from
'
../constants
'
;
export
default
{
name
:
'
PackageTitle
'
,
components
:
{
TitleArea
,
MetadataItem
,
},
props
:
{
packagesCount
:
{
type
:
Number
,
required
:
false
,
default
:
null
,
},
packageHelpUrl
:
{
type
:
String
,
required
:
true
,
},
},
computed
:
{
showPackageCount
()
{
return
Number
.
isInteger
(
this
.
packagesCount
);
},
packageAmountText
()
{
return
n__
(
`%d Package`
,
`%d Packages`
,
this
.
packagesCount
);
},
infoMessages
()
{
return
[{
text
:
LIST_INTRO_TEXT
,
link
:
this
.
packageHelpUrl
}];
},
},
i18n
:
{
LIST_TITLE_TEXT
,
},
};
</
script
>
<
template
>
<title-area
:title=
"$options.i18n.LIST_TITLE_TEXT"
:info-messages=
"infoMessages"
>
<template
#metadata_amount
>
<metadata-item
v-if=
"showPackageCount"
icon=
"package"
:text=
"packageAmountText"
/>
</
template
>
</title-area>
</template>
app/assets/javascripts/packages/list/components/packages_list_app.vue
View file @
851dd92d
...
@@ -3,13 +3,14 @@ import { mapActions, mapState } from 'vuex';
...
@@ -3,13 +3,14 @@ import { mapActions, mapState } from 'vuex';
import
{
GlEmptyState
,
GlTab
,
GlTabs
,
GlLink
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
GlEmptyState
,
GlTab
,
GlTabs
,
GlLink
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
s__
,
sprintf
}
from
'
~/locale
'
;
import
{
s__
,
sprintf
}
from
'
~/locale
'
;
import
createFlash
from
'
~/flash
'
;
import
createFlash
from
'
~/flash
'
;
import
{
historyReplaceState
}
from
'
~/lib/utils/common_utils
'
;
import
{
SHOW_DELETE_SUCCESS_ALERT
}
from
'
~/packages/shared/constants
'
;
import
PackageFilter
from
'
./packages_filter.vue
'
;
import
PackageFilter
from
'
./packages_filter.vue
'
;
import
PackageList
from
'
./packages_list.vue
'
;
import
PackageList
from
'
./packages_list.vue
'
;
import
PackageSort
from
'
./packages_sort.vue
'
;
import
PackageSort
from
'
./packages_sort.vue
'
;
import
{
PACKAGE_REGISTRY_TABS
,
DELETE_PACKAGE_SUCCESS_MESSAGE
}
from
'
../constants
'
;
import
{
PACKAGE_REGISTRY_TABS
,
DELETE_PACKAGE_SUCCESS_MESSAGE
}
from
'
../constants
'
;
import
PackagesComingSoon
from
'
../coming_soon/packages_coming_soon.vue
'
;
import
PackagesComingSoon
from
'
../coming_soon/packages_coming_soon.vue
'
;
import
{
SHOW_DELETE_SUCCESS_ALERT
}
from
'
~/packages/shared/constants
'
;
import
PackageTitle
from
'
./package_title.vue
'
;
import
{
historyReplaceState
}
from
'
~/lib/utils/common_utils
'
;
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -22,6 +23,7 @@ export default {
...
@@ -22,6 +23,7 @@ export default {
PackageList
,
PackageList
,
PackageSort
,
PackageSort
,
PackagesComingSoon
,
PackagesComingSoon
,
PackageTitle
,
},
},
computed
:
{
computed
:
{
...
mapState
({
...
mapState
({
...
@@ -30,6 +32,8 @@ export default {
...
@@ -30,6 +32,8 @@ export default {
comingSoon
:
state
=>
state
.
config
.
comingSoon
,
comingSoon
:
state
=>
state
.
config
.
comingSoon
,
filterQuery
:
state
=>
state
.
filterQuery
,
filterQuery
:
state
=>
state
.
filterQuery
,
selectedType
:
state
=>
state
.
selectedType
,
selectedType
:
state
=>
state
.
selectedType
,
packageHelpUrl
:
state
=>
state
.
config
.
packageHelpUrl
,
packagesCount
:
state
=>
state
.
pagination
?.
total
,
}),
}),
tabsToRender
()
{
tabsToRender
()
{
return
PACKAGE_REGISTRY_TABS
;
return
PACKAGE_REGISTRY_TABS
;
...
@@ -89,39 +93,43 @@ export default {
...
@@ -89,39 +93,43 @@ export default {
</
script
>
</
script
>
<
template
>
<
template
>
<gl-tabs
@
input=
"tabChanged"
>
<div>
<template
#tabs-end
>
<package-title
:package-help-url=
"packageHelpUrl"
:packages-count=
"packagesCount"
/>
<div
class=
"gl-display-flex gl-align-self-center gl-py-2 gl-flex-grow-1 gl-justify-content-end"
<gl-tabs
@
input=
"tabChanged"
>
>
<template
#tabs-end
>
<package-filter
class=
"mr-1"
@
filter=
"requestPackagesList"
/>
<div
<package-sort
@
sort:changed=
"requestPackagesList"
/>
class=
"gl-display-flex gl-align-self-center gl-py-2 gl-flex-grow-1 gl-justify-content-end"
</div>
>
</
template
>
<package-filter
class=
"gl-mr-2"
@
filter=
"requestPackagesList"
/>
<package-sort
@
sort:changed=
"requestPackagesList"
/>
</div>
</
template
>
<gl-tab
v-for=
"(tab, index) in tabsToRender"
:key=
"index"
:title=
"tab.title"
>
<gl-tab
v-for=
"(tab, index) in tabsToRender"
:key=
"index"
:title=
"tab.title"
>
<package-list
@
page:changed=
"onPageChanged"
@
package:delete=
"onPackageDeleteRequest"
>
<package-list
@
page:changed=
"onPageChanged"
@
package:delete=
"onPackageDeleteRequest"
>
<
template
#empty-state
>
<
template
#empty-state
>
<gl-empty-state
:title=
"emptyStateTitle(tab)"
:svg-path=
"emptyListIllustration"
>
<gl-empty-state
:title=
"emptyStateTitle(tab)"
:svg-path=
"emptyListIllustration"
>
<template
#description
>
<template
#description
>
<gl-sprintf
v-if=
"filterQuery"
:message=
"$options.i18n.widenFilters"
/>
<gl-sprintf
v-if=
"filterQuery"
:message=
"$options.i18n.widenFilters"
/>
<gl-sprintf
v-else
:message=
"$options.i18n.noResults"
>
<gl-sprintf
v-else
:message=
"$options.i18n.noResults"
>
<template
#noPackagesLink
="
{content}">
<template
#noPackagesLink
="
{content}">
<gl-link
:href=
"emptyListHelpUrl"
target=
"_blank"
>
{{
content
}}
</gl-link>
<gl-link
:href=
"emptyListHelpUrl"
target=
"_blank"
>
{{
content
}}
</gl-link>
</
template
>
</
template
>
</gl-sprintf>
</gl-sprintf>
</template>
</template>
</gl-empty-state>
</gl-empty-state>
</template>
</template>
</package-list>
</package-list>
</gl-tab>
</gl-tab>
<gl-tab
v-if=
"comingSoon"
:title=
"__('Coming soon')"
lazy
>
<gl-tab
v-if=
"comingSoon"
:title=
"__('Coming soon')"
lazy
>
<packages-coming-soon
<packages-coming-soon
:illustration=
"emptyListIllustration"
:illustration=
"emptyListIllustration"
:project-path=
"comingSoon.projectPath"
:project-path=
"comingSoon.projectPath"
:suggested-contributions-path=
"comingSoon.suggestedContributions"
:suggested-contributions-path=
"comingSoon.suggestedContributions"
/>
/>
</gl-tab>
</gl-tab>
</gl-tabs>
</gl-tabs>
</div>
</template>
</template>
app/assets/javascripts/packages/list/constants.js
View file @
851dd92d
...
@@ -86,3 +86,9 @@ export const PACKAGE_REGISTRY_TABS = [
...
@@ -86,3 +86,9 @@ export const PACKAGE_REGISTRY_TABS = [
type
:
PackageType
.
PYPI
,
type
:
PackageType
.
PYPI
,
},
},
];
];
export
const
LIST_TITLE_TEXT
=
s__
(
'
PackageRegistry|Package Registry
'
);
export
const
LIST_INTRO_TEXT
=
s__
(
'
PackageRegistry|Publish and share packages for a variety of common package managers. %{docLinkStart}More information%{docLinkEnd}
'
,
);
app/helpers/packages_helper.rb
View file @
851dd92d
...
@@ -53,7 +53,8 @@ module PackagesHelper
...
@@ -53,7 +53,8 @@ module PackagesHelper
page_type:
type
,
page_type:
type
,
empty_list_help_url:
help_page_path
(
'user/packages/package_registry/index'
),
empty_list_help_url:
help_page_path
(
'user/packages/package_registry/index'
),
empty_list_illustration:
image_path
(
'illustrations/no-packages.svg'
),
empty_list_illustration:
image_path
(
'illustrations/no-packages.svg'
),
coming_soon_json:
packages_coming_soon_data
(
resource
).
to_json
coming_soon_json:
packages_coming_soon_data
(
resource
).
to_json
,
package_help_url:
help_page_path
(
'user/packages/index'
)
}
}
end
end
end
end
changelogs/unreleased/225164-add-a-title-section-to-the-package-registry-ui.yml
0 → 100644
View file @
851dd92d
---
title
:
Add a title section to the Package Registry UI
merge_request
:
42963
author
:
type
:
changed
locale/gitlab.pot
View file @
851dd92d
...
@@ -84,6 +84,11 @@ msgid_plural "%d Approvals"
...
@@ -84,6 +84,11 @@ msgid_plural "%d Approvals"
msgstr[0] ""
msgstr[0] ""
msgstr[1] ""
msgstr[1] ""
msgid "%d Package"
msgid_plural "%d Packages"
msgstr[0] ""
msgstr[1] ""
msgid "%d Scanned URL"
msgid "%d Scanned URL"
msgid_plural "%d Scanned URLs"
msgid_plural "%d Scanned URLs"
msgstr[0] ""
msgstr[0] ""
...
@@ -18173,12 +18178,18 @@ msgstr ""
...
@@ -18173,12 +18178,18 @@ msgstr ""
msgid "PackageRegistry|NuGet Command"
msgid "PackageRegistry|NuGet Command"
msgstr ""
msgstr ""
msgid "PackageRegistry|Package Registry"
msgstr ""
msgid "PackageRegistry|Pip Command"
msgid "PackageRegistry|Pip Command"
msgstr ""
msgstr ""
msgid "PackageRegistry|Pipeline %{link} triggered %{datetime} by %{author}"
msgid "PackageRegistry|Pipeline %{link} triggered %{datetime} by %{author}"
msgstr ""
msgstr ""
msgid "PackageRegistry|Publish and share packages for a variety of common package managers. %{docLinkStart}More information%{docLinkEnd}"
msgstr ""
msgid "PackageRegistry|Published to the %{project} Package Registry %{datetime}"
msgid "PackageRegistry|Published to the %{project} Package Registry %{datetime}"
msgstr ""
msgstr ""
...
...
spec/frontend/packages/list/components/__snapshots__/packages_list_app_spec.js.snap
View file @
851dd92d
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`packages_list_app renders 1`] = `
exports[`packages_list_app renders 1`] = `
<b-tabs-stub
<div>
activenavitemclass="gl-tab-nav-item-active gl-tab-nav-item-active-indigo"
<package-title-stub
class="gl-tabs"
packagehelpurl="foo"
contentclass=",gl-tab-content"
/>
navclass="gl-tabs-nav"
nofade="true"
<b-tabs-stub
nonavstyle="true"
activenavitemclass="gl-tab-nav-item-active gl-tab-nav-item-active-indigo"
tag="div"
class="gl-tabs"
>
contentclass=",gl-tab-content"
<template>
navclass="gl-tabs-nav"
nofade="true"
<b-tab-stub
nonavstyle="true"
tag="div"
tag="div"
title="All"
>
titlelinkclass="gl-tab-nav-item"
<template>
>
<template>
<b-tab-stub
<div>
tag="div"
<section
title="All"
class="row empty-state text-center"
titlelinkclass="gl-tab-nav-item"
>
>
<div
<template>
class="col-12"
<div>
<section
class="row empty-state text-center"
>
>
<div
<div
class="
svg-250 svg-content
"
class="
col-12
"
>
>
<img
<div
alt="There are no packages yet"
class="svg-250 svg-content"
class="gl-max-w-full"
>
src="helpSvg"
<img
/>
alt="There are no packages yet"
class="gl-max-w-full"
src="helpSvg"
/>
</div>
</div>
</div>
</div>
<div
class="col-12"
>
<div
<div
class="
text-content gl-mx-auto gl-my-0 gl-p-5
"
class="
col-12
"
>
>
<
h1
<
div
class="
h4
"
class="
text-content gl-mx-auto gl-my-0 gl-p-5
"
>
>
There are no packages yet
<h1
</h1>
class="h4"
<p>
Learn how to
<b-link-stub
class="gl-link"
event="click"
href="helpUrl"
routertag="a"
target="_blank"
>
>
publish and share your packages
There are no packages yet
</b-link-stub>
</h1>
with GitLab.
</p>
<div>
<!---->
<!---->
<p>
Learn how to
<b-link-stub
class="gl-link"
event="click"
href="helpUrl"
routertag="a"
target="_blank"
>
publish and share your packages
</b-link-stub>
with GitLab.
</p>
<div>
<!---->
<!---->
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</section>
</div>
</div>
</template>
</template>
</b-tab-stub>
</b-tab-stub>
<b-tab-stub
<b-tab-stub
tag="div"
tag="div"
title="Composer"
title="Composer"
titlelinkclass="gl-tab-nav-item"
titlelinkclass="gl-tab-nav-item"
>
>
<template>
<template>
<div>
<div>
<section
<section
class="row empty-state text-center"
class="row empty-state text-center"
>
<div
class="col-12"
>
>
<div
<div
class="
svg-250 svg-content
"
class="
col-12
"
>
>
<img
<div
alt="There are no Composer packages yet"
class="svg-250 svg-content"
class="gl-max-w-full"
>
src="helpSvg"
<img
/>
alt="There are no Composer packages yet"
class="gl-max-w-full"
src="helpSvg"
/>
</div>
</div>
</div>
</div>
<div
class="col-12"
>
<div
<div
class="
text-content gl-mx-auto gl-my-0 gl-p-5
"
class="
col-12
"
>
>
<
h1
<
div
class="
h4
"
class="
text-content gl-mx-auto gl-my-0 gl-p-5
"
>
>
There are no Composer packages yet
<h1
</h1>
class="h4"
<p>
Learn how to
<b-link-stub
class="gl-link"
event="click"
href="helpUrl"
routertag="a"
target="_blank"
>
>
publish and share your packages
There are no Composer packages yet
</b-link-stub>
</h1>
with GitLab.
</p>
<div>
<!---->
<!---->
<p>
Learn how to
<b-link-stub
class="gl-link"
event="click"
href="helpUrl"
routertag="a"
target="_blank"
>
publish and share your packages
</b-link-stub>
with GitLab.
</p>
<div>
<!---->
<!---->
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</section>
</div>
</div>
</template>
</template>
</b-tab-stub>
</b-tab-stub>
<b-tab-stub
<b-tab-stub
tag="div"
tag="div"
title="Conan"
title="Conan"
titlelinkclass="gl-tab-nav-item"
titlelinkclass="gl-tab-nav-item"
>
>
<template>
<template>
<div>
<div>
<section
<section
class="row empty-state text-center"
class="row empty-state text-center"
>
<div
class="col-12"
>
>
<div
<div
class="
svg-250 svg-content
"
class="
col-12
"
>
>
<img
<div
alt="There are no Conan packages yet"
class="svg-250 svg-content"
class="gl-max-w-full"
>
src="helpSvg"
<img
/>
alt="There are no Conan packages yet"
class="gl-max-w-full"
src="helpSvg"
/>
</div>
</div>
</div>
</div>
<div
class="col-12"
>
<div
<div
class="
text-content gl-mx-auto gl-my-0 gl-p-5
"
class="
col-12
"
>
>
<
h1
<
div
class="
h4
"
class="
text-content gl-mx-auto gl-my-0 gl-p-5
"
>
>
There are no Conan packages yet
<h1
</h1>
class="h4"
<p>
Learn how to
<b-link-stub
class="gl-link"
event="click"
href="helpUrl"
routertag="a"
target="_blank"
>
>
publish and share your packages
There are no Conan packages yet
</b-link-stub>
</h1>
with GitLab.
</p>
<div>
<!---->
<!---->
<p>
Learn how to
<b-link-stub
class="gl-link"
event="click"
href="helpUrl"
routertag="a"
target="_blank"
>
publish and share your packages
</b-link-stub>
with GitLab.
</p>
<div>
<!---->
<!---->
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</section>
</div>
</div>
</template>
</template>
</b-tab-stub>
</b-tab-stub>
<b-tab-stub
<b-tab-stub
tag="div"
tag="div"
title="Maven"
title="Maven"
titlelinkclass="gl-tab-nav-item"
titlelinkclass="gl-tab-nav-item"
>
>
<template>
<template>
<div>
<div>
<section
<section
class="row empty-state text-center"
class="row empty-state text-center"
>
<div
class="col-12"
>
>
<div
<div
class="
svg-250 svg-content
"
class="
col-12
"
>
>
<img
<div
alt="There are no Maven packages yet"
class="svg-250 svg-content"
class="gl-max-w-full"
>
src="helpSvg"
<img
/>
alt="There are no Maven packages yet"
class="gl-max-w-full"
src="helpSvg"
/>
</div>
</div>
</div>
</div>
<div
class="col-12"
>
<div
<div
class="
text-content gl-mx-auto gl-my-0 gl-p-5
"
class="
col-12
"
>
>
<
h1
<
div
class="
h4
"
class="
text-content gl-mx-auto gl-my-0 gl-p-5
"
>
>
There are no Maven packages yet
<h1
</h1>
class="h4"
<p>
Learn how to
<b-link-stub
class="gl-link"
event="click"
href="helpUrl"
routertag="a"
target="_blank"
>
>
publish and share your packages
There are no Maven packages yet
</b-link-stub>
</h1>
with GitLab.
</p>
<p>
Learn how to
<div>
<b-link-stub
<!---->
class="gl-link"
event="click"
href="helpUrl"
routertag="a"
target="_blank"
>
publish and share your packages
</b-link-stub>
with GitLab.
</p>
<!---->
<div>
<!---->
<!---->
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</section>
</div>
</div>
</template>
</template>
</b-tab-stub>
</b-tab-stub>
<b-tab-stub
<b-tab-stub
tag="div"
tag="div"
title="NPM"
title="NPM"
titlelinkclass="gl-tab-nav-item"
titlelinkclass="gl-tab-nav-item"
>
>
<template>
<template>
<div>
<div>
<section
<section
class="row empty-state text-center"
class="row empty-state text-center"
>
<div
class="col-12"
>
>
<div
<div
class="
svg-250 svg-content
"
class="
col-12
"
>
>
<img
<div
alt="There are no NPM packages yet"
class="svg-250 svg-content"
class="gl-max-w-full"
>
src="helpSvg"
<img
/>
alt="There are no NPM packages yet"
class="gl-max-w-full"
src="helpSvg"
/>
</div>
</div>
</div>
</div>
<div
class="col-12"
>
<div
<div
class="
text-content gl-mx-auto gl-my-0 gl-p-5
"
class="
col-12
"
>
>
<
h1
<
div
class="
h4
"
class="
text-content gl-mx-auto gl-my-0 gl-p-5
"
>
>
There are no NPM packages yet
<h1
</h1>
class="h4"
<p>
Learn how to
<b-link-stub
class="gl-link"
event="click"
href="helpUrl"
routertag="a"
target="_blank"
>
>
publish and share your packages
There are no NPM packages yet
</b-link-stub>
</h1>
with GitLab.
</p>
<p>
Learn how to
<div>
<b-link-stub
<!---->
class="gl-link"
event="click"
href="helpUrl"
routertag="a"
target="_blank"
>
publish and share your packages
</b-link-stub>
with GitLab.
</p>
<!---->
<div>
<!---->
<!---->
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</section>
</div>
</div>
</template>
</template>
</b-tab-stub>
</b-tab-stub>
<b-tab-stub
<b-tab-stub
tag="div"
tag="div"
title="NuGet"
title="NuGet"
titlelinkclass="gl-tab-nav-item"
titlelinkclass="gl-tab-nav-item"
>
>
<template>
<template>
<div>
<div>
<section
<section
class="row empty-state text-center"
class="row empty-state text-center"
>
<div
class="col-12"
>
>
<div
<div
class="
svg-250 svg-content
"
class="
col-12
"
>
>
<img
<div
alt="There are no NuGet packages yet"
class="svg-250 svg-content"
class="gl-max-w-full"
>
src="helpSvg"
<img
/>
alt="There are no NuGet packages yet"
class="gl-max-w-full"
src="helpSvg"
/>
</div>
</div>
</div>
</div>
<div
class="col-12"
>
<div
<div
class="
text-content gl-mx-auto gl-my-0 gl-p-5
"
class="
col-12
"
>
>
<
h1
<
div
class="
h4
"
class="
text-content gl-mx-auto gl-my-0 gl-p-5
"
>
>
There are no NuGet packages yet
<h1
</h1>
class="h4"
<p>
Learn how to
<b-link-stub
class="gl-link"
event="click"
href="helpUrl"
routertag="a"
target="_blank"
>
>
publish and share your packages
There are no NuGet packages yet
</b-link-stub>
</h1>
with GitLab.
</p>
<div>
<!---->
<!---->
<p>
Learn how to
<b-link-stub
class="gl-link"
event="click"
href="helpUrl"
routertag="a"
target="_blank"
>
publish and share your packages
</b-link-stub>
with GitLab.
</p>
<div>
<!---->
<!---->
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</section>
</div>
</div>
</template>
</template>
</b-tab-stub>
</b-tab-stub>
<b-tab-stub
<b-tab-stub
tag="div"
tag="div"
title="PyPi"
title="PyPi"
titlelinkclass="gl-tab-nav-item"
titlelinkclass="gl-tab-nav-item"
>
>
<template>
<template>
<div>
<div>
<section
<section
class="row empty-state text-center"
class="row empty-state text-center"
>
<div
class="col-12"
>
>
<div
<div
class="
svg-250 svg-content
"
class="
col-12
"
>
>
<img
<div
alt="There are no PyPi packages yet"
class="svg-250 svg-content"
class="gl-max-w-full"
>
src="helpSvg"
<img
/>
alt="There are no PyPi packages yet"
class="gl-max-w-full"
src="helpSvg"
/>
</div>
</div>
</div>
</div>
<div
class="col-12"
>
<div
<div
class="
text-content gl-mx-auto gl-my-0 gl-p-5
"
class="
col-12
"
>
>
<
h1
<
div
class="
h4
"
class="
text-content gl-mx-auto gl-my-0 gl-p-5
"
>
>
There are no PyPi packages yet
<h1
</h1>
class="h4"
<p>
Learn how to
<b-link-stub
class="gl-link"
event="click"
href="helpUrl"
routertag="a"
target="_blank"
>
>
publish and share your packages
There are no PyPi packages yet
</b-link-stub>
</h1>
with GitLab.
</p>
<p>
Learn how to
<div>
<b-link-stub
<!---->
class="gl-link"
event="click"
href="helpUrl"
routertag="a"
target="_blank"
>
publish and share your packages
</b-link-stub>
with GitLab.
</p>
<!---->
<div>
<!---->
<!---->
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</section>
</div>
</div>
</template>
</template>
</b-tab-stub>
</b-tab-stub>
<!---->
</template>
<template>
<div
class="gl-display-flex gl-align-self-center gl-py-2 gl-flex-grow-1 gl-justify-content-end"
>
<package-filter-stub
class="mr-1"
/>
<package-sort-stub />
<!---->
</div>
</template>
</template>
<template>
</b-tabs-stub>
<div
class="gl-display-flex gl-align-self-center gl-py-2 gl-flex-grow-1 gl-justify-content-end"
>
<package-filter-stub
class="gl-mr-2"
/>
<package-sort-stub />
</div>
</template>
</b-tabs-stub>
</div>
`;
`;
spec/frontend/packages/list/components/packages_list_app_spec.js
View file @
851dd92d
...
@@ -36,6 +36,7 @@ describe('packages_list_app', () => {
...
@@ -36,6 +36,7 @@ describe('packages_list_app', () => {
resourceId
:
'
project_id
'
,
resourceId
:
'
project_id
'
,
emptyListIllustration
:
'
helpSvg
'
,
emptyListIllustration
:
'
helpSvg
'
,
emptyListHelpUrl
,
emptyListHelpUrl
,
packageHelpUrl
:
'
foo
'
,
},
},
filterQuery
,
filterQuery
,
},
},
...
...
spec/frontend/packages/list/components/packages_title_spec.js
0 → 100644
View file @
851dd92d
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
PackageTitle
from
'
~/packages/list/components/package_title.vue
'
;
import
TitleArea
from
'
~/vue_shared/components/registry/title_area.vue
'
;
import
MetadataItem
from
'
~/vue_shared/components/registry/metadata_item.vue
'
;
import
{
LIST_INTRO_TEXT
,
LIST_TITLE_TEXT
}
from
'
~/packages/list//constants
'
;
describe
(
'
PackageTitle
'
,
()
=>
{
let
wrapper
;
let
store
;
const
findTitleArea
=
()
=>
wrapper
.
find
(
TitleArea
);
const
findMetadataItem
=
()
=>
wrapper
.
find
(
MetadataItem
);
const
mountComponent
=
(
propsData
=
{
packageHelpUrl
:
'
foo
'
})
=>
{
wrapper
=
shallowMount
(
PackageTitle
,
{
store
,
propsData
,
stubs
:
{
TitleArea
,
},
});
};
afterEach
(()
=>
{
wrapper
.
destroy
();
wrapper
=
null
;
});
describe
(
'
title area
'
,
()
=>
{
it
(
'
exists
'
,
()
=>
{
mountComponent
();
expect
(
findTitleArea
().
exists
()).
toBe
(
true
);
});
it
(
'
has the correct props
'
,
()
=>
{
mountComponent
();
expect
(
findTitleArea
().
props
()).
toMatchObject
({
title
:
LIST_TITLE_TEXT
,
infoMessages
:
[{
text
:
LIST_INTRO_TEXT
,
link
:
'
foo
'
}],
});
});
});
describe
.
each
`
packagesCount | exist | text
${
null
}
|
${
false
}
|
${
''
}
${
undefined
}
|
${
false
}
|
${
''
}
${
0
}
|
${
true
}
|
${
'
0 Packages
'
}
${
1
}
|
${
true
}
|
${
'
1 Package
'
}
${
2
}
|
${
true
}
|
${
'
2 Packages
'
}
`
(
'
when packagesCount is $packagesCount metadata item
'
,
({
packagesCount
,
exist
,
text
})
=>
{
beforeEach
(()
=>
{
mountComponent
({
packagesCount
,
packageHelpUrl
:
'
foo
'
});
});
it
(
`is
${
exist
}
that it exists`
,
()
=>
{
expect
(
findMetadataItem
().
exists
()).
toBe
(
exist
);
});
if
(
exist
)
{
it
(
'
has the correct props
'
,
()
=>
{
expect
(
findMetadataItem
().
props
()).
toMatchObject
({
icon
:
'
package
'
,
text
,
});
});
}
});
});
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