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
56c03d33
Commit
56c03d33
authored
Dec 13, 2021
by
Nicolò Maria Mezzopera
Committed by
Natalia Tepluhina
Dec 13, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move packages/shared to packages_and_registries/shared
parent
bead17ae
Changes
42
Hide whitespace changes
Inline
Side-by-side
Showing
42 changed files
with
180 additions
and
276 deletions
+180
-276
app/assets/javascripts/packages/shared/constants.js
app/assets/javascripts/packages/shared/constants.js
+0
-49
app/assets/javascripts/packages/shared/utils.js
app/assets/javascripts/packages/shared/utils.js
+0
-43
app/assets/javascripts/packages_and_registries/infrastructure_registry/details/components/app.vue
...stries/infrastructure_registry/details/components/app.vue
+11
-8
app/assets/javascripts/packages_and_registries/infrastructure_registry/details/store/actions.js
...gistries/infrastructure_registry/details/store/actions.js
+1
-1
app/assets/javascripts/packages_and_registries/infrastructure_registry/list/components/packages_list.vue
...infrastructure_registry/list/components/packages_list.vue
+7
-10
app/assets/javascripts/packages_and_registries/infrastructure_registry/list/components/packages_list_app.vue
...astructure_registry/list/components/packages_list_app.vue
+5
-2
app/assets/javascripts/packages_and_registries/infrastructure_registry/list/stores/actions.js
...registries/infrastructure_registry/list/stores/actions.js
+1
-1
app/assets/javascripts/packages_and_registries/infrastructure_registry/list/stores/getters.js
...registries/infrastructure_registry/list/stores/getters.js
+1
-1
app/assets/javascripts/packages_and_registries/infrastructure_registry/shared/constants.js
...nd_registries/infrastructure_registry/shared/constants.js
+1
-0
app/assets/javascripts/packages_and_registries/infrastructure_registry/shared/package_list_row.vue
...tries/infrastructure_registry/shared/package_list_row.vue
+8
-11
app/assets/javascripts/packages_and_registries/package_registry/components/details/app.vue
...nd_registries/package_registry/components/details/app.vue
+1
-1
app/assets/javascripts/packages_and_registries/package_registry/components/details/package_title.vue
...ies/package_registry/components/details/package_title.vue
+1
-1
app/assets/javascripts/packages_and_registries/package_registry/components/details/version_row.vue
...tries/package_registry/components/details/version_row.vue
+2
-2
app/assets/javascripts/packages_and_registries/package_registry/components/list/app.vue
...s_and_registries/package_registry/components/list/app.vue
+1
-1
app/assets/javascripts/packages_and_registries/package_registry/components/list/package_list_row.vue
...ies/package_registry/components/list/package_list_row.vue
+5
-5
app/assets/javascripts/packages_and_registries/package_registry/components/list/packages_list.vue
...stries/package_registry/components/list/packages_list.vue
+1
-1
app/assets/javascripts/packages_and_registries/package_registry/constants.js
...pts/packages_and_registries/package_registry/constants.js
+10
-8
app/assets/javascripts/packages_and_registries/shared/components/package_icon_and_name.vue
...nd_registries/shared/components/package_icon_and_name.vue
+0
-0
app/assets/javascripts/packages_and_registries/shared/components/package_path.vue
...ackages_and_registries/shared/components/package_path.vue
+0
-0
app/assets/javascripts/packages_and_registries/shared/components/package_tags.vue
...ackages_and_registries/shared/components/package_tags.vue
+0
-0
app/assets/javascripts/packages_and_registries/shared/components/packages_list_loader.vue
...and_registries/shared/components/packages_list_loader.vue
+0
-0
app/assets/javascripts/packages_and_registries/shared/components/publish_method.vue
...kages_and_registries/shared/components/publish_method.vue
+0
-0
app/assets/javascripts/packages_and_registries/shared/constants.js
...s/javascripts/packages_and_registries/shared/constants.js
+36
-0
app/assets/javascripts/packages_and_registries/shared/utils.js
...ssets/javascripts/packages_and_registries/shared/utils.js
+10
-0
spec/frontend/packages/shared/utils_spec.js
spec/frontend/packages/shared/utils_spec.js
+0
-69
spec/frontend/packages_and_registries/infrastructure_registry/components/details/components/app_spec.js
...ucture_registry/components/details/components/app_spec.js
+21
-30
spec/frontend/packages_and_registries/infrastructure_registry/components/details/store/actions_spec.js
...ructure_registry/components/details/store/actions_spec.js
+1
-1
spec/frontend/packages_and_registries/infrastructure_registry/components/list/components/packages_list_app_spec.js
...stry/components/list/components/packages_list_app_spec.js
+5
-2
spec/frontend/packages_and_registries/infrastructure_registry/components/list/components/packages_list_spec.js
...registry/components/list/components/packages_list_spec.js
+5
-13
spec/frontend/packages_and_registries/infrastructure_registry/components/list/stores/actions_spec.js
...structure_registry/components/list/stores/actions_spec.js
+1
-1
spec/frontend/packages_and_registries/infrastructure_registry/components/shared/package_list_row_spec.js
...cture_registry/components/shared/package_list_row_spec.js
+3
-3
spec/frontend/packages_and_registries/package_registry/components/details/package_title_spec.js
...package_registry/components/details/package_title_spec.js
+1
-1
spec/frontend/packages_and_registries/package_registry/components/details/version_row_spec.js
...s/package_registry/components/details/version_row_spec.js
+2
-2
spec/frontend/packages_and_registries/package_registry/components/list/package_list_row_spec.js
...package_registry/components/list/package_list_row_spec.js
+3
-3
spec/frontend/packages_and_registries/package_registry/components/list/packages_list_spec.js
...es/package_registry/components/list/packages_list_spec.js
+1
-1
spec/frontend/packages_and_registries/shared/__snapshots__/publish_method_spec.js.snap
...gistries/shared/__snapshots__/publish_method_spec.js.snap
+0
-0
spec/frontend/packages_and_registries/shared/package_icon_and_name_spec.js
...kages_and_registries/shared/package_icon_and_name_spec.js
+1
-1
spec/frontend/packages_and_registries/shared/package_path_spec.js
...ntend/packages_and_registries/shared/package_path_spec.js
+1
-1
spec/frontend/packages_and_registries/shared/package_tags_spec.js
...ntend/packages_and_registries/shared/package_tags_spec.js
+1
-1
spec/frontend/packages_and_registries/shared/packages_list_loader_spec.js
...ckages_and_registries/shared/packages_list_loader_spec.js
+1
-1
spec/frontend/packages_and_registries/shared/publish_method_spec.js
...end/packages_and_registries/shared/publish_method_spec.js
+1
-1
spec/frontend/packages_and_registries/shared/utils_spec.js
spec/frontend/packages_and_registries/shared/utils_spec.js
+30
-0
No files found.
app/assets/javascripts/packages/shared/constants.js
deleted
100644 → 0
View file @
bead17ae
import
{
s__
}
from
'
~/locale
'
;
export
const
PackageType
=
{
CONAN
:
'
conan
'
,
MAVEN
:
'
maven
'
,
NPM
:
'
npm
'
,
NUGET
:
'
nuget
'
,
PYPI
:
'
pypi
'
,
COMPOSER
:
'
composer
'
,
RUBYGEMS
:
'
rubygems
'
,
GENERIC
:
'
generic
'
,
DEBIAN
:
'
debian
'
,
HELM
:
'
helm
'
,
};
// we want this separated from the main dictionary to avoid it being pulled in the search of package
export
const
TERRAFORM_PACKAGE_TYPE
=
'
terraform_module
'
;
export
const
TrackingActions
=
{
DELETE_PACKAGE
:
'
delete_package
'
,
REQUEST_DELETE_PACKAGE
:
'
request_delete_package
'
,
CANCEL_DELETE_PACKAGE
:
'
cancel_delete_package
'
,
PULL_PACKAGE
:
'
pull_package
'
,
DELETE_PACKAGE_FILE
:
'
delete_package_file
'
,
REQUEST_DELETE_PACKAGE_FILE
:
'
request_delete_package_file
'
,
CANCEL_DELETE_PACKAGE_FILE
:
'
cancel_delete_package_file
'
,
};
export
const
TrackingCategories
=
{
[
PackageType
.
MAVEN
]:
'
MavenPackages
'
,
[
PackageType
.
NPM
]:
'
NpmPackages
'
,
[
PackageType
.
CONAN
]:
'
ConanPackages
'
,
};
export
const
SHOW_DELETE_SUCCESS_ALERT
=
'
showSuccessDeleteAlert
'
;
export
const
DELETE_PACKAGE_ERROR_MESSAGE
=
s__
(
'
PackageRegistry|Something went wrong while deleting the package.
'
,
);
export
const
DELETE_PACKAGE_FILE_ERROR_MESSAGE
=
s__
(
'
PackageRegistry|Something went wrong while deleting the package file.
'
,
);
export
const
DELETE_PACKAGE_FILE_SUCCESS_MESSAGE
=
s__
(
'
PackageRegistry|Package file deleted successfully
'
,
);
export
const
PACKAGE_ERROR_STATUS
=
'
error
'
;
export
const
PACKAGE_DEFAULT_STATUS
=
'
default
'
;
export
const
PACKAGE_HIDDEN_STATUS
=
'
hidden
'
;
export
const
PACKAGE_PROCESSING_STATUS
=
'
processing
'
;
app/assets/javascripts/packages/shared/utils.js
deleted
100644 → 0
View file @
bead17ae
import
{
s__
}
from
'
~/locale
'
;
import
{
PackageType
,
TrackingCategories
}
from
'
./constants
'
;
export
const
packageTypeToTrackCategory
=
(
type
)
=>
// eslint-disable-next-line @gitlab/require-i18n-strings
`UI::
${
TrackingCategories
[
type
]}
`
;
export
const
beautifyPath
=
(
path
)
=>
(
path
?
path
.
split
(
'
/
'
).
join
(
'
/
'
)
:
''
);
export
const
getPackageTypeLabel
=
(
packageType
)
=>
{
switch
(
packageType
)
{
case
PackageType
.
CONAN
:
return
s__
(
'
PackageRegistry|Conan
'
);
case
PackageType
.
MAVEN
:
return
s__
(
'
PackageRegistry|Maven
'
);
case
PackageType
.
NPM
:
return
s__
(
'
PackageRegistry|npm
'
);
case
PackageType
.
NUGET
:
return
s__
(
'
PackageRegistry|NuGet
'
);
case
PackageType
.
PYPI
:
return
s__
(
'
PackageRegistry|PyPI
'
);
case
PackageType
.
RUBYGEMS
:
return
s__
(
'
PackageRegistry|RubyGems
'
);
case
PackageType
.
COMPOSER
:
return
s__
(
'
PackageRegistry|Composer
'
);
case
PackageType
.
GENERIC
:
return
s__
(
'
PackageRegistry|Generic
'
);
case
PackageType
.
DEBIAN
:
return
s__
(
'
PackageRegistry|Debian
'
);
case
PackageType
.
HELM
:
return
s__
(
'
PackageRegistry|Helm
'
);
default
:
return
null
;
}
};
export
const
getCommitLink
=
({
project_path
:
projectPath
,
pipeline
=
{}
},
isGroup
=
false
)
=>
{
if
(
isGroup
)
{
return
`/
${
projectPath
}
/commit/
${
pipeline
.
sha
}
`
;
}
return
`../commit/
${
pipeline
.
sha
}
`
;
};
app/assets/javascripts/packages_and_registries/infrastructure_registry/details/components/app.vue
View file @
56c03d33
...
@@ -17,9 +17,12 @@ import TerraformTitle from '~/packages_and_registries/infrastructure_registry/de
...
@@ -17,9 +17,12 @@ import TerraformTitle from '~/packages_and_registries/infrastructure_registry/de
import
TerraformInstallation
from
'
~/packages_and_registries/infrastructure_registry/details/components/terraform_installation.vue
'
;
import
TerraformInstallation
from
'
~/packages_and_registries/infrastructure_registry/details/components/terraform_installation.vue
'
;
import
Tracking
from
'
~/tracking
'
;
import
Tracking
from
'
~/tracking
'
;
import
PackageListRow
from
'
~/packages_and_registries/infrastructure_registry/shared/package_list_row.vue
'
;
import
PackageListRow
from
'
~/packages_and_registries/infrastructure_registry/shared/package_list_row.vue
'
;
import
PackagesListLoader
from
'
~/packages/shared/components/packages_list_loader.vue
'
;
import
PackagesListLoader
from
'
~/packages_and_registries/shared/components/packages_list_loader.vue
'
;
import
{
TrackingActions
,
SHOW_DELETE_SUCCESS_ALERT
}
from
'
~/packages/shared/constants
'
;
import
{
import
{
packageTypeToTrackCategory
}
from
'
~/packages/shared/utils
'
;
TRACKING_ACTIONS
,
SHOW_DELETE_SUCCESS_ALERT
,
}
from
'
~/packages_and_registries/shared/constants
'
;
import
{
TRACK_CATEGORY
}
from
'
~/packages_and_registries/infrastructure_registry/shared/constants
'
;
import
PackageFiles
from
'
./package_files.vue
'
;
import
PackageFiles
from
'
./package_files.vue
'
;
import
PackageHistory
from
'
./package_history.vue
'
;
import
PackageHistory
from
'
./package_history.vue
'
;
...
@@ -44,7 +47,7 @@ export default {
...
@@ -44,7 +47,7 @@ export default {
GlModal
:
GlModalDirective
,
GlModal
:
GlModalDirective
,
},
},
mixins
:
[
Tracking
.
mixin
()],
mixins
:
[
Tracking
.
mixin
()],
trackingActions
:
{
...
T
rackingActions
},
trackingActions
:
{
...
T
RACKING_ACTIONS
},
data
()
{
data
()
{
return
{
return
{
fileToDelete
:
null
,
fileToDelete
:
null
,
...
@@ -68,7 +71,7 @@ export default {
...
@@ -68,7 +71,7 @@ export default {
},
},
tracking
()
{
tracking
()
{
return
{
return
{
category
:
packageTypeToTrackCategory
(
this
.
packageEntity
.
package_type
)
,
category
:
TRACK_CATEGORY
,
};
};
},
},
hasVersions
()
{
hasVersions
()
{
...
@@ -86,7 +89,7 @@ export default {
...
@@ -86,7 +89,7 @@ export default {
}
}
},
},
async
confirmPackageDeletion
()
{
async
confirmPackageDeletion
()
{
this
.
track
(
T
rackingActions
.
DELETE_PACKAGE
);
this
.
track
(
T
RACKING_ACTIONS
.
DELETE_PACKAGE
);
await
this
.
deletePackage
();
await
this
.
deletePackage
();
const
returnTo
=
const
returnTo
=
!
this
.
groupListUrl
||
document
.
referrer
.
includes
(
this
.
projectName
)
!
this
.
groupListUrl
||
document
.
referrer
.
includes
(
this
.
projectName
)
...
@@ -96,12 +99,12 @@ export default {
...
@@ -96,12 +99,12 @@ export default {
window
.
location
.
replace
(
`
${
returnTo
}
?
${
modalQuery
}
`
);
window
.
location
.
replace
(
`
${
returnTo
}
?
${
modalQuery
}
`
);
},
},
handleFileDelete
(
file
)
{
handleFileDelete
(
file
)
{
this
.
track
(
T
rackingActions
.
REQUEST_DELETE_PACKAGE_FILE
);
this
.
track
(
T
RACKING_ACTIONS
.
REQUEST_DELETE_PACKAGE_FILE
);
this
.
fileToDelete
=
{
...
file
};
this
.
fileToDelete
=
{
...
file
};
this
.
$refs
.
deleteFileModal
.
show
();
this
.
$refs
.
deleteFileModal
.
show
();
},
},
confirmFileDelete
()
{
confirmFileDelete
()
{
this
.
track
(
T
rackingActions
.
DELETE_PACKAGE_FILE
);
this
.
track
(
T
RACKING_ACTIONS
.
DELETE_PACKAGE_FILE
);
this
.
deletePackageFile
(
this
.
fileToDelete
.
id
);
this
.
deletePackageFile
(
this
.
fileToDelete
.
id
);
this
.
fileToDelete
=
null
;
this
.
fileToDelete
=
null
;
},
},
...
...
app/assets/javascripts/packages_and_registries/infrastructure_registry/details/store/actions.js
View file @
56c03d33
...
@@ -4,7 +4,7 @@ import {
...
@@ -4,7 +4,7 @@ import {
DELETE_PACKAGE_ERROR_MESSAGE
,
DELETE_PACKAGE_ERROR_MESSAGE
,
DELETE_PACKAGE_FILE_ERROR_MESSAGE
,
DELETE_PACKAGE_FILE_ERROR_MESSAGE
,
DELETE_PACKAGE_FILE_SUCCESS_MESSAGE
,
DELETE_PACKAGE_FILE_SUCCESS_MESSAGE
,
}
from
'
~/packages/shared/constants
'
;
}
from
'
~/packages
_and_registries
/shared/constants
'
;
import
{
FETCH_PACKAGE_VERSIONS_ERROR
}
from
'
../constants
'
;
import
{
FETCH_PACKAGE_VERSIONS_ERROR
}
from
'
../constants
'
;
import
*
as
types
from
'
./mutation_types
'
;
import
*
as
types
from
'
./mutation_types
'
;
...
...
app/assets/javascripts/packages_and_registries/infrastructure_registry/list/components/packages_list.vue
View file @
56c03d33
...
@@ -4,9 +4,9 @@ import { mapState, mapGetters } from 'vuex';
...
@@ -4,9 +4,9 @@ import { mapState, mapGetters } from 'vuex';
import
{
s__
}
from
'
~/locale
'
;
import
{
s__
}
from
'
~/locale
'
;
import
Tracking
from
'
~/tracking
'
;
import
Tracking
from
'
~/tracking
'
;
import
PackagesListRow
from
'
~/packages_and_registries/infrastructure_registry/shared/package_list_row.vue
'
;
import
PackagesListRow
from
'
~/packages_and_registries/infrastructure_registry/shared/package_list_row.vue
'
;
import
PackagesListLoader
from
'
~/packages/shared/components/packages_list_loader.vue
'
;
import
PackagesListLoader
from
'
~/packages
_and_registries
/shared/components/packages_list_loader.vue
'
;
import
{
T
rackingActions
}
from
'
~/packag
es/shared/constants
'
;
import
{
T
RACKING_ACTIONS
}
from
'
~/packages_and_registri
es/shared/constants
'
;
import
{
packageTypeToTrackCategory
}
from
'
~/packages/shared/util
s
'
;
import
{
TRACK_CATEGORY
}
from
'
~/packages_and_registries/infrastructure_registry/shared/constant
s
'
;
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -49,27 +49,24 @@ export default {
...
@@ -49,27 +49,24 @@ export default {
return
this
.
itemToBeDeleted
?.
name
??
''
;
return
this
.
itemToBeDeleted
?.
name
??
''
;
},
},
tracking
()
{
tracking
()
{
const
category
=
this
.
itemToBeDeleted
?
packageTypeToTrackCategory
(
this
.
itemToBeDeleted
.
package_type
)
:
undefined
;
return
{
return
{
category
,
category
:
TRACK_CATEGORY
,
};
};
},
},
},
},
methods
:
{
methods
:
{
setItemToBeDeleted
(
item
)
{
setItemToBeDeleted
(
item
)
{
this
.
itemToBeDeleted
=
{
...
item
};
this
.
itemToBeDeleted
=
{
...
item
};
this
.
track
(
T
rackingActions
.
REQUEST_DELETE_PACKAGE
);
this
.
track
(
T
RACKING_ACTIONS
.
REQUEST_DELETE_PACKAGE
);
this
.
$refs
.
packageListDeleteModal
.
show
();
this
.
$refs
.
packageListDeleteModal
.
show
();
},
},
deleteItemConfirmation
()
{
deleteItemConfirmation
()
{
this
.
$emit
(
'
package:delete
'
,
this
.
itemToBeDeleted
);
this
.
$emit
(
'
package:delete
'
,
this
.
itemToBeDeleted
);
this
.
track
(
T
rackingActions
.
DELETE_PACKAGE
);
this
.
track
(
T
RACKING_ACTIONS
.
DELETE_PACKAGE
);
this
.
itemToBeDeleted
=
null
;
this
.
itemToBeDeleted
=
null
;
},
},
deleteItemCanceled
()
{
deleteItemCanceled
()
{
this
.
track
(
T
rackingActions
.
CANCEL_DELETE_PACKAGE
);
this
.
track
(
T
RACKING_ACTIONS
.
CANCEL_DELETE_PACKAGE
);
this
.
itemToBeDeleted
=
null
;
this
.
itemToBeDeleted
=
null
;
},
},
},
},
...
...
app/assets/javascripts/packages_and_registries/infrastructure_registry/list/components/packages_list_app.vue
View file @
56c03d33
...
@@ -4,8 +4,11 @@ import { mapActions, mapState } from 'vuex';
...
@@ -4,8 +4,11 @@ import { mapActions, mapState } from 'vuex';
import
createFlash
from
'
~/flash
'
;
import
createFlash
from
'
~/flash
'
;
import
{
historyReplaceState
}
from
'
~/lib/utils/common_utils
'
;
import
{
historyReplaceState
}
from
'
~/lib/utils/common_utils
'
;
import
{
s__
}
from
'
~/locale
'
;
import
{
s__
}
from
'
~/locale
'
;
import
{
SHOW_DELETE_SUCCESS_ALERT
}
from
'
~/packages/shared/constants
'
;
import
{
import
{
FILTERED_SEARCH_TERM
}
from
'
~/packages_and_registries/shared/constants
'
;
SHOW_DELETE_SUCCESS_ALERT
,
FILTERED_SEARCH_TERM
,
}
from
'
~/packages_and_registries/shared/constants
'
;
import
{
getQueryParams
,
extractFilterAndSorting
}
from
'
~/packages_and_registries/shared/utils
'
;
import
{
getQueryParams
,
extractFilterAndSorting
}
from
'
~/packages_and_registries/shared/utils
'
;
import
InfrastructureTitle
from
'
~/packages_and_registries/infrastructure_registry/list/components/infrastructure_title.vue
'
;
import
InfrastructureTitle
from
'
~/packages_and_registries/infrastructure_registry/list/components/infrastructure_title.vue
'
;
import
InfrastructureSearch
from
'
~/packages_and_registries/infrastructure_registry/list/components/infrastructure_search.vue
'
;
import
InfrastructureSearch
from
'
~/packages_and_registries/infrastructure_registry/list/components/infrastructure_search.vue
'
;
...
...
app/assets/javascripts/packages_and_registries/infrastructure_registry/list/stores/actions.js
View file @
56c03d33
import
Api
from
'
~/api
'
;
import
Api
from
'
~/api
'
;
import
createFlash
from
'
~/flash
'
;
import
createFlash
from
'
~/flash
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
{
DELETE_PACKAGE_ERROR_MESSAGE
}
from
'
~/packages/shared/constants
'
;
import
{
DELETE_PACKAGE_ERROR_MESSAGE
}
from
'
~/packages
_and_registries
/shared/constants
'
;
import
{
import
{
FETCH_PACKAGES_LIST_ERROR_MESSAGE
,
FETCH_PACKAGES_LIST_ERROR_MESSAGE
,
DELETE_PACKAGE_SUCCESS_MESSAGE
,
DELETE_PACKAGE_SUCCESS_MESSAGE
,
...
...
app/assets/javascripts/packages_and_registries/infrastructure_registry/list/stores/getters.js
View file @
56c03d33
import
{
beautifyPath
}
from
'
~/packages/shared/utils
'
;
import
{
beautifyPath
}
from
'
~/packages
_and_registries
/shared/utils
'
;
import
{
LIST_KEY_PROJECT
}
from
'
../constants
'
;
import
{
LIST_KEY_PROJECT
}
from
'
../constants
'
;
export
default
(
state
)
=>
export
default
(
state
)
=>
...
...
app/assets/javascripts/packages_and_registries/infrastructure_registry/shared/constants.js
0 → 100644
View file @
56c03d33
export
const
TRACK_CATEGORY
=
'
UI::TerraformPackages
'
;
app/assets/javascripts/packages_and_registries/infrastructure_registry/shared/package_list_row.vue
View file @
56c03d33
...
@@ -3,11 +3,13 @@ import { GlButton, GlLink, GlSprintf, GlTooltipDirective, GlTruncate } from '@gi
...
@@ -3,11 +3,13 @@ import { GlButton, GlLink, GlSprintf, GlTooltipDirective, GlTruncate } from '@gi
import
{
s__
}
from
'
~/locale
'
;
import
{
s__
}
from
'
~/locale
'
;
import
ListItem
from
'
~/vue_shared/components/registry/list_item.vue
'
;
import
ListItem
from
'
~/vue_shared/components/registry/list_item.vue
'
;
import
timeagoMixin
from
'
~/vue_shared/mixins/timeago
'
;
import
timeagoMixin
from
'
~/vue_shared/mixins/timeago
'
;
import
{
PACKAGE_ERROR_STATUS
,
PACKAGE_DEFAULT_STATUS
}
from
'
~/packages/shared/constants
'
;
import
{
import
{
getPackageTypeLabel
}
from
'
~/packages/shared/utils
'
;
PACKAGE_ERROR_STATUS
,
import
PackagePath
from
'
~/packages/shared/components/package_path.vue
'
;
PACKAGE_DEFAULT_STATUS
,
import
PackageTags
from
'
~/packages/shared/components/package_tags.vue
'
;
}
from
'
~/packages_and_registries/shared/constants
'
;
import
PublishMethod
from
'
~/packages/shared/components/publish_method.vue
'
;
import
PackagePath
from
'
~/packages_and_registries/shared/components/package_path.vue
'
;
import
PackageTags
from
'
~/packages_and_registries/shared/components/package_tags.vue
'
;
import
PublishMethod
from
'
~/packages_and_registries/shared/components/publish_method.vue
'
;
import
InfrastructureIconAndName
from
'
~/packages_and_registries/infrastructure_registry/shared/infrastructure_icon_and_name.vue
'
;
import
InfrastructureIconAndName
from
'
~/packages_and_registries/infrastructure_registry/shared/infrastructure_icon_and_name.vue
'
;
export
default
{
export
default
{
...
@@ -53,9 +55,6 @@ export default {
...
@@ -53,9 +55,6 @@ export default {
},
},
},
},
computed
:
{
computed
:
{
packageType
()
{
return
getPackageTypeLabel
(
this
.
packageEntity
.
package_type
);
},
hasPipeline
()
{
hasPipeline
()
{
return
Boolean
(
this
.
packageEntity
.
pipeline
);
return
Boolean
(
this
.
packageEntity
.
pipeline
);
},
},
...
@@ -120,9 +119,7 @@ export default {
...
@@ -120,9 +119,7 @@ export default {
</gl-sprintf>
</gl-sprintf>
</div>
</div>
<infrastructure-icon-and-name
v-if=
"showPackageType"
>
<infrastructure-icon-and-name
v-if=
"showPackageType"
/>
{{ packageType }}
</infrastructure-icon-and-name>
<package-path
<package-path
v-if=
"hasProjectLink"
v-if=
"hasProjectLink"
...
...
app/assets/javascripts/packages_and_registries/package_registry/components/details/app.vue
View file @
56c03d33
...
@@ -15,7 +15,7 @@ import { convertToGraphQLId } from '~/graphql_shared/utils';
...
@@ -15,7 +15,7 @@ import { convertToGraphQLId } from '~/graphql_shared/utils';
import
{
numberToHumanSize
}
from
'
~/lib/utils/number_utils
'
;
import
{
numberToHumanSize
}
from
'
~/lib/utils/number_utils
'
;
import
{
objectToQuery
}
from
'
~/lib/utils/url_utility
'
;
import
{
objectToQuery
}
from
'
~/lib/utils/url_utility
'
;
import
{
s__
,
__
}
from
'
~/locale
'
;
import
{
s__
,
__
}
from
'
~/locale
'
;
import
{
packageTypeToTrackCategory
}
from
'
~/packages
/shared
/utils
'
;
import
{
packageTypeToTrackCategory
}
from
'
~/packages
_and_registries/package_registry
/utils
'
;
import
AdditionalMetadata
from
'
~/packages_and_registries/package_registry/components/details/additional_metadata.vue
'
;
import
AdditionalMetadata
from
'
~/packages_and_registries/package_registry/components/details/additional_metadata.vue
'
;
import
DependencyRow
from
'
~/packages_and_registries/package_registry/components/details/dependency_row.vue
'
;
import
DependencyRow
from
'
~/packages_and_registries/package_registry/components/details/dependency_row.vue
'
;
import
InstallationCommands
from
'
~/packages_and_registries/package_registry/components/details/installation_commands.vue
'
;
import
InstallationCommands
from
'
~/packages_and_registries/package_registry/components/details/installation_commands.vue
'
;
...
...
app/assets/javascripts/packages_and_registries/package_registry/components/details/package_title.vue
View file @
56c03d33
...
@@ -3,7 +3,7 @@ import { GlIcon, GlSprintf, GlBadge, GlResizeObserverDirective } from '@gitlab/u
...
@@ -3,7 +3,7 @@ import { GlIcon, GlSprintf, GlBadge, GlResizeObserverDirective } from '@gitlab/u
import
{
GlBreakpointInstance
}
from
'
@gitlab/ui/dist/utils
'
;
import
{
GlBreakpointInstance
}
from
'
@gitlab/ui/dist/utils
'
;
import
{
numberToHumanSize
}
from
'
~/lib/utils/number_utils
'
;
import
{
numberToHumanSize
}
from
'
~/lib/utils/number_utils
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
__
}
from
'
~/locale
'
;
import
PackageTags
from
'
~/packages/shared/components/package_tags.vue
'
;
import
PackageTags
from
'
~/packages
_and_registries
/shared/components/package_tags.vue
'
;
import
{
PACKAGE_TYPE_NUGET
}
from
'
~/packages_and_registries/package_registry/constants
'
;
import
{
PACKAGE_TYPE_NUGET
}
from
'
~/packages_and_registries/package_registry/constants
'
;
import
{
getPackageTypeLabel
}
from
'
~/packages_and_registries/package_registry/utils
'
;
import
{
getPackageTypeLabel
}
from
'
~/packages_and_registries/package_registry/utils
'
;
import
MetadataItem
from
'
~/vue_shared/components/registry/metadata_item.vue
'
;
import
MetadataItem
from
'
~/vue_shared/components/registry/metadata_item.vue
'
;
...
...
app/assets/javascripts/packages_and_registries/package_registry/components/details/version_row.vue
View file @
56c03d33
<
script
>
<
script
>
import
{
GlLink
,
GlSprintf
,
GlTruncate
}
from
'
@gitlab/ui
'
;
import
{
GlLink
,
GlSprintf
,
GlTruncate
}
from
'
@gitlab/ui
'
;
import
{
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
{
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
PackageTags
from
'
~/packages/shared/components/package_tags.vue
'
;
import
PackageTags
from
'
~/packages
_and_registries
/shared/components/package_tags.vue
'
;
import
PublishMethod
from
'
~/packages/shared/components/publish_method.vue
'
;
import
PublishMethod
from
'
~/packages
_and_registries
/shared/components/publish_method.vue
'
;
import
ListItem
from
'
~/vue_shared/components/registry/list_item.vue
'
;
import
ListItem
from
'
~/vue_shared/components/registry/list_item.vue
'
;
import
TimeAgoTooltip
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
import
TimeAgoTooltip
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
import
{
PACKAGE_DEFAULT_STATUS
}
from
'
../../constants
'
;
import
{
PACKAGE_DEFAULT_STATUS
}
from
'
../../constants
'
;
...
...
app/assets/javascripts/packages_and_registries/package_registry/components/list/app.vue
View file @
56c03d33
...
@@ -3,7 +3,7 @@ import { GlEmptyState, GlLink, GlSprintf } from '@gitlab/ui';
...
@@ -3,7 +3,7 @@ import { GlEmptyState, GlLink, GlSprintf } from '@gitlab/ui';
import
createFlash
from
'
~/flash
'
;
import
createFlash
from
'
~/flash
'
;
import
{
historyReplaceState
}
from
'
~/lib/utils/common_utils
'
;
import
{
historyReplaceState
}
from
'
~/lib/utils/common_utils
'
;
import
{
s__
}
from
'
~/locale
'
;
import
{
s__
}
from
'
~/locale
'
;
import
{
SHOW_DELETE_SUCCESS_ALERT
}
from
'
~/packages/shared/constants
'
;
import
{
SHOW_DELETE_SUCCESS_ALERT
}
from
'
~/packages
_and_registries
/shared/constants
'
;
import
{
import
{
PROJECT_RESOURCE_TYPE
,
PROJECT_RESOURCE_TYPE
,
GROUP_RESOURCE_TYPE
,
GROUP_RESOURCE_TYPE
,
...
...
app/assets/javascripts/packages_and_registries/package_registry/components/list/package_list_row.vue
View file @
56c03d33
...
@@ -6,11 +6,11 @@ import {
...
@@ -6,11 +6,11 @@ import {
PACKAGE_ERROR_STATUS
,
PACKAGE_ERROR_STATUS
,
PACKAGE_DEFAULT_STATUS
,
PACKAGE_DEFAULT_STATUS
,
}
from
'
~/packages_and_registries/package_registry/constants
'
;
}
from
'
~/packages_and_registries/package_registry/constants
'
;
import
{
getPackageTypeLabel
}
from
'
~/packages
/shared
/utils
'
;
import
{
getPackageTypeLabel
}
from
'
~/packages
_and_registries/package_registry
/utils
'
;
import
PackagePath
from
'
~/packages/shared/components/package_path.vue
'
;
import
PackagePath
from
'
~/packages
_and_registries
/shared/components/package_path.vue
'
;
import
PackageTags
from
'
~/packages/shared/components/package_tags.vue
'
;
import
PackageTags
from
'
~/packages
_and_registries
/shared/components/package_tags.vue
'
;
import
PublishMethod
from
'
~/packages_and_registries/package_registry/components/list/publish_method.vue
'
;
import
PublishMethod
from
'
~/packages_and_registries/package_registry/components/list/publish_method.vue
'
;
import
PackageIconAndName
from
'
~/packages/shared/components/package_icon_and_name.vue
'
;
import
PackageIconAndName
from
'
~/packages
_and_registries
/shared/components/package_icon_and_name.vue
'
;
import
{
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
{
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
TimeagoTooltip
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
import
TimeagoTooltip
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
...
@@ -40,7 +40,7 @@ export default {
...
@@ -40,7 +40,7 @@ export default {
},
},
computed
:
{
computed
:
{
packageType
()
{
packageType
()
{
return
getPackageTypeLabel
(
this
.
packageEntity
.
packageType
.
toLowerCase
()
);
return
getPackageTypeLabel
(
this
.
packageEntity
.
packageType
);
},
},
packageLink
()
{
packageLink
()
{
const
{
project
,
id
}
=
this
.
packageEntity
;
const
{
project
,
id
}
=
this
.
packageEntity
;
...
...
app/assets/javascripts/packages_and_registries/package_registry/components/list/packages_list.vue
View file @
56c03d33
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
import
{
GlModal
,
GlSprintf
,
GlKeysetPagination
}
from
'
@gitlab/ui
'
;
import
{
GlModal
,
GlSprintf
,
GlKeysetPagination
}
from
'
@gitlab/ui
'
;
import
{
s__
}
from
'
~/locale
'
;
import
{
s__
}
from
'
~/locale
'
;
import
PackagesListRow
from
'
~/packages_and_registries/package_registry/components/list/package_list_row.vue
'
;
import
PackagesListRow
from
'
~/packages_and_registries/package_registry/components/list/package_list_row.vue
'
;
import
PackagesListLoader
from
'
~/packages/shared/components/packages_list_loader.vue
'
;
import
PackagesListLoader
from
'
~/packages
_and_registries
/shared/components/packages_list_loader.vue
'
;
import
{
import
{
DELETE_PACKAGE_TRACKING_ACTION
,
DELETE_PACKAGE_TRACKING_ACTION
,
REQUEST_DELETE_PACKAGE_TRACKING_ACTION
,
REQUEST_DELETE_PACKAGE_TRACKING_ACTION
,
...
...
app/assets/javascripts/packages_and_registries/package_registry/constants.js
View file @
56c03d33
import
{
s__
,
__
}
from
'
~/locale
'
;
import
{
s__
,
__
}
from
'
~/locale
'
;
export
{
DELETE_PACKAGE_TRACKING_ACTION
,
REQUEST_DELETE_PACKAGE_TRACKING_ACTION
,
CANCEL_DELETE_PACKAGE_TRACKING_ACTION
,
PULL_PACKAGE_TRACKING_ACTION
,
DELETE_PACKAGE_FILE_TRACKING_ACTION
,
REQUEST_DELETE_PACKAGE_FILE_TRACKING_ACTION
,
CANCEL_DELETE_PACKAGE_FILE_TRACKING_ACTION
,
}
from
'
~/packages_and_registries/shared/constants
'
;
export
const
PACKAGE_TYPE_CONAN
=
'
CONAN
'
;
export
const
PACKAGE_TYPE_CONAN
=
'
CONAN
'
;
export
const
PACKAGE_TYPE_MAVEN
=
'
MAVEN
'
;
export
const
PACKAGE_TYPE_MAVEN
=
'
MAVEN
'
;
export
const
PACKAGE_TYPE_NPM
=
'
NPM
'
;
export
const
PACKAGE_TYPE_NPM
=
'
NPM
'
;
...
@@ -11,14 +21,6 @@ export const PACKAGE_TYPE_GENERIC = 'GENERIC';
...
@@ -11,14 +21,6 @@ export const PACKAGE_TYPE_GENERIC = 'GENERIC';
export
const
PACKAGE_TYPE_DEBIAN
=
'
DEBIAN
'
;
export
const
PACKAGE_TYPE_DEBIAN
=
'
DEBIAN
'
;
export
const
PACKAGE_TYPE_HELM
=
'
HELM
'
;
export
const
PACKAGE_TYPE_HELM
=
'
HELM
'
;
export
const
DELETE_PACKAGE_TRACKING_ACTION
=
'
delete_package
'
;
export
const
REQUEST_DELETE_PACKAGE_TRACKING_ACTION
=
'
request_delete_package
'
;
export
const
CANCEL_DELETE_PACKAGE_TRACKING_ACTION
=
'
cancel_delete_package
'
;
export
const
PULL_PACKAGE_TRACKING_ACTION
=
'
pull_package
'
;
export
const
DELETE_PACKAGE_FILE_TRACKING_ACTION
=
'
delete_package_file
'
;
export
const
REQUEST_DELETE_PACKAGE_FILE_TRACKING_ACTION
=
'
request_delete_package_file
'
;
export
const
CANCEL_DELETE_PACKAGE_FILE_TRACKING_ACTION
=
'
cancel_delete_package_file
'
;
export
const
TRACKING_LABEL_CODE_INSTRUCTION
=
'
code_instruction
'
;
export
const
TRACKING_LABEL_CODE_INSTRUCTION
=
'
code_instruction
'
;
export
const
TRACKING_LABEL_CONAN_INSTALLATION
=
'
conan_installation
'
;
export
const
TRACKING_LABEL_CONAN_INSTALLATION
=
'
conan_installation
'
;
export
const
TRACKING_LABEL_MAVEN_INSTALLATION
=
'
maven_installation
'
;
export
const
TRACKING_LABEL_MAVEN_INSTALLATION
=
'
maven_installation
'
;
...
...
app/assets/javascripts/packages/shared/components/package_icon_and_name.vue
→
app/assets/javascripts/packages
_and_registries
/shared/components/package_icon_and_name.vue
View file @
56c03d33
File moved
app/assets/javascripts/packages/shared/components/package_path.vue
→
app/assets/javascripts/packages
_and_registries
/shared/components/package_path.vue
View file @
56c03d33
File moved
app/assets/javascripts/packages/shared/components/package_tags.vue
→
app/assets/javascripts/packages
_and_registries
/shared/components/package_tags.vue
View file @
56c03d33
File moved
app/assets/javascripts/packages/shared/components/packages_list_loader.vue
→
app/assets/javascripts/packages
_and_registries
/shared/components/packages_list_loader.vue
View file @
56c03d33
File moved
app/assets/javascripts/packages/shared/components/publish_method.vue
→
app/assets/javascripts/packages
_and_registries
/shared/components/publish_method.vue
View file @
56c03d33
File moved
app/assets/javascripts/packages_and_registries/shared/constants.js
View file @
56c03d33
import
{
s__
}
from
'
~/locale
'
;
export
const
FILTERED_SEARCH_TERM
=
'
filtered-search-term
'
;
export
const
FILTERED_SEARCH_TERM
=
'
filtered-search-term
'
;
export
const
FILTERED_SEARCH_TYPE
=
'
type
'
;
export
const
FILTERED_SEARCH_TYPE
=
'
type
'
;
export
const
HISTORY_PIPELINES_LIMIT
=
5
;
export
const
HISTORY_PIPELINES_LIMIT
=
5
;
export
const
DELETE_PACKAGE_TRACKING_ACTION
=
'
delete_package
'
;
export
const
REQUEST_DELETE_PACKAGE_TRACKING_ACTION
=
'
request_delete_package
'
;
export
const
CANCEL_DELETE_PACKAGE_TRACKING_ACTION
=
'
cancel_delete_package
'
;
export
const
PULL_PACKAGE_TRACKING_ACTION
=
'
pull_package
'
;
export
const
DELETE_PACKAGE_FILE_TRACKING_ACTION
=
'
delete_package_file
'
;
export
const
REQUEST_DELETE_PACKAGE_FILE_TRACKING_ACTION
=
'
request_delete_package_file
'
;
export
const
CANCEL_DELETE_PACKAGE_FILE_TRACKING_ACTION
=
'
cancel_delete_package_file
'
;
export
const
TRACKING_ACTIONS
=
{
DELETE_PACKAGE
:
DELETE_PACKAGE_TRACKING_ACTION
,
REQUEST_DELETE_PACKAGE
:
REQUEST_DELETE_PACKAGE_TRACKING_ACTION
,
CANCEL_DELETE_PACKAGE
:
CANCEL_DELETE_PACKAGE_TRACKING_ACTION
,
PULL_PACKAGE
:
PULL_PACKAGE_TRACKING_ACTION
,
DELETE_PACKAGE_FILE
:
DELETE_PACKAGE_FILE_TRACKING_ACTION
,
REQUEST_DELETE_PACKAGE_FILE
:
REQUEST_DELETE_PACKAGE_FILE_TRACKING_ACTION
,
CANCEL_DELETE_PACKAGE_FILE
:
CANCEL_DELETE_PACKAGE_FILE_TRACKING_ACTION
,
};
export
const
SHOW_DELETE_SUCCESS_ALERT
=
'
showSuccessDeleteAlert
'
;
export
const
DELETE_PACKAGE_ERROR_MESSAGE
=
s__
(
'
PackageRegistry|Something went wrong while deleting the package.
'
,
);
export
const
DELETE_PACKAGE_FILE_ERROR_MESSAGE
=
s__
(
'
PackageRegistry|Something went wrong while deleting the package file.
'
,
);
export
const
DELETE_PACKAGE_FILE_SUCCESS_MESSAGE
=
s__
(
'
PackageRegistry|Package file deleted successfully
'
,
);
export
const
PACKAGE_ERROR_STATUS
=
'
error
'
;
export
const
PACKAGE_DEFAULT_STATUS
=
'
default
'
;
export
const
PACKAGE_HIDDEN_STATUS
=
'
hidden
'
;
export
const
PACKAGE_PROCESSING_STATUS
=
'
processing
'
;
app/assets/javascripts/packages_and_registries/shared/utils.js
View file @
56c03d33
...
@@ -28,3 +28,13 @@ export const extractFilterAndSorting = (queryObject) => {
...
@@ -28,3 +28,13 @@ export const extractFilterAndSorting = (queryObject) => {
}
}
return
{
filters
,
sorting
};
return
{
filters
,
sorting
};
};
};
export
const
beautifyPath
=
(
path
)
=>
(
path
?
path
.
split
(
'
/
'
).
join
(
'
/
'
)
:
''
);
export
const
getCommitLink
=
({
project_path
:
projectPath
,
pipeline
=
{}
},
isGroup
=
false
)
=>
{
if
(
isGroup
)
{
return
`/
${
projectPath
}
/commit/
${
pipeline
.
sha
}
`
;
}
return
`../commit/
${
pipeline
.
sha
}
`
;
};
spec/frontend/packages/shared/utils_spec.js
deleted
100644 → 0
View file @
bead17ae
import
{
PackageType
,
TrackingCategories
}
from
'
~/packages/shared/constants
'
;
import
{
packageTypeToTrackCategory
,
beautifyPath
,
getPackageTypeLabel
,
getCommitLink
,
}
from
'
~/packages/shared/utils
'
;
import
{
packageList
}
from
'
jest/packages_and_registries/infrastructure_registry/components/mock_data
'
;
describe
(
'
Packages shared utils
'
,
()
=>
{
describe
(
'
packageTypeToTrackCategory
'
,
()
=>
{
it
(
'
prepend UI to package category
'
,
()
=>
{
expect
(
packageTypeToTrackCategory
()).
toMatchInlineSnapshot
(
`"UI::undefined"`
);
});
it
.
each
(
Object
.
keys
(
PackageType
))(
'
returns a correct category string for %s
'
,
(
packageKey
)
=>
{
const
packageName
=
PackageType
[
packageKey
];
expect
(
packageTypeToTrackCategory
(
packageName
)).
toBe
(
`UI::
${
TrackingCategories
[
packageName
]}
`
,
);
});
});
describe
(
'
beautifyPath
'
,
()
=>
{
it
(
'
returns a string with spaces around /
'
,
()
=>
{
expect
(
beautifyPath
(
'
foo/bar
'
)).
toBe
(
'
foo / bar
'
);
});
it
(
'
does not fail for empty string
'
,
()
=>
{
expect
(
beautifyPath
()).
toBe
(
''
);
});
});
describe
(
'
getPackageTypeLabel
'
,
()
=>
{
describe
.
each
`
packageType | expectedResult
${
'
conan
'
}
|
${
'
Conan
'
}
${
'
maven
'
}
|
${
'
Maven
'
}
${
'
npm
'
}
|
${
'
npm
'
}
${
'
nuget
'
}
|
${
'
NuGet
'
}
${
'
pypi
'
}
|
${
'
PyPI
'
}
${
'
rubygems
'
}
|
${
'
RubyGems
'
}
${
'
composer
'
}
|
${
'
Composer
'
}
${
'
debian
'
}
|
${
'
Debian
'
}
${
'
helm
'
}
|
${
'
Helm
'
}
${
'
foo
'
}
|
${
null
}
`
(
`package type`
,
({
packageType
,
expectedResult
})
=>
{
it
(
`
${
packageType
}
should show as
${
expectedResult
}
`
,
()
=>
{
expect
(
getPackageTypeLabel
(
packageType
)).
toBe
(
expectedResult
);
});
});
});
describe
(
'
getCommitLink
'
,
()
=>
{
it
(
'
returns a relative link when isGroup is false
'
,
()
=>
{
const
link
=
getCommitLink
(
packageList
[
0
],
false
);
expect
(
link
).
toContain
(
'
../commit
'
);
});
describe
(
'
when isGroup is true
'
,
()
=>
{
it
(
'
returns an absolute link matching project path
'
,
()
=>
{
const
mavenPackage
=
packageList
[
0
];
const
link
=
getCommitLink
(
mavenPackage
,
true
);
expect
(
link
).
toContain
(
`/
${
mavenPackage
.
project_path
}
/commit`
);
});
});
});
});
spec/frontend/packages_and_registries/infrastructure_registry/components/details/components/app_spec.js
View file @
56c03d33
...
@@ -10,9 +10,9 @@ import PackageFiles from '~/packages_and_registries/infrastructure_registry/deta
...
@@ -10,9 +10,9 @@ import PackageFiles from '~/packages_and_registries/infrastructure_registry/deta
import
PackageHistory
from
'
~/packages_and_registries/infrastructure_registry/details/components/package_history.vue
'
;
import
PackageHistory
from
'
~/packages_and_registries/infrastructure_registry/details/components/package_history.vue
'
;
import
*
as
getters
from
'
~/packages_and_registries/infrastructure_registry/details/store/getters
'
;
import
*
as
getters
from
'
~/packages_and_registries/infrastructure_registry/details/store/getters
'
;
import
PackageListRow
from
'
~/packages_and_registries/infrastructure_registry/shared/package_list_row.vue
'
;
import
PackageListRow
from
'
~/packages_and_registries/infrastructure_registry/shared/package_list_row.vue
'
;
import
PackagesListLoader
from
'
~/packages/shared/components/packages_list_loader.vue
'
;
import
PackagesListLoader
from
'
~/packages
_and_registries
/shared/components/packages_list_loader.vue
'
;
import
{
T
rackingActions
}
from
'
~/packag
es/shared/constants
'
;
import
{
T
RACKING_ACTIONS
}
from
'
~/packages_and_registri
es/shared/constants
'
;
import
*
as
SharedUtils
from
'
~/packages/shared/util
s
'
;
import
{
TRACK_CATEGORY
}
from
'
~/packages_and_registries/infrastructure_registry/shared/constant
s
'
;
import
TerraformTitle
from
'
~/packages_and_registries/infrastructure_registry/details/components/details_title.vue
'
;
import
TerraformTitle
from
'
~/packages_and_registries/infrastructure_registry/details/components/details_title.vue
'
;
import
TerraformInstallation
from
'
~/packages_and_registries/infrastructure_registry/details/components/terraform_installation.vue
'
;
import
TerraformInstallation
from
'
~/packages_and_registries/infrastructure_registry/details/components/terraform_installation.vue
'
;
import
Tracking
from
'
~/tracking
'
;
import
Tracking
from
'
~/tracking
'
;
...
@@ -232,87 +232,78 @@ describe('PackagesApp', () => {
...
@@ -232,87 +232,78 @@ describe('PackagesApp', () => {
describe
(
'
tracking
'
,
()
=>
{
describe
(
'
tracking
'
,
()
=>
{
let
eventSpy
;
let
eventSpy
;
let
utilSpy
;
const
category
=
'
foo
'
;
beforeEach
(()
=>
{
beforeEach
(()
=>
{
eventSpy
=
jest
.
spyOn
(
Tracking
,
'
event
'
);
eventSpy
=
jest
.
spyOn
(
Tracking
,
'
event
'
);
utilSpy
=
jest
.
spyOn
(
SharedUtils
,
'
packageTypeToTrackCategory
'
).
mockReturnValue
(
category
);
});
});
it
(
'
tracking category calls packageTypeToTrackCategory
'
,
()
=>
{
it
(
`delete button on delete modal call event with
${
TRACKING_ACTIONS
.
DELETE_PACKAGE
}
`
,
()
=>
{
createComponent
({
packageEntity
:
npmPackage
});
expect
(
wrapper
.
vm
.
tracking
.
category
).
toBe
(
category
);
expect
(
utilSpy
).
toHaveBeenCalledWith
(
'
npm
'
);
});
it
(
`delete button on delete modal call event with
${
TrackingActions
.
DELETE_PACKAGE
}
`
,
()
=>
{
createComponent
({
packageEntity
:
npmPackage
});
createComponent
({
packageEntity
:
npmPackage
});
findDeleteModal
().
vm
.
$emit
(
'
primary
'
);
findDeleteModal
().
vm
.
$emit
(
'
primary
'
);
expect
(
eventSpy
).
toHaveBeenCalledWith
(
expect
(
eventSpy
).
toHaveBeenCalledWith
(
category
,
TRACK_CATEGORY
,
T
rackingActions
.
DELETE_PACKAGE
,
T
RACKING_ACTIONS
.
DELETE_PACKAGE
,
expect
.
any
(
Object
),
expect
.
any
(
Object
),
);
);
});
});
it
(
`canceling a package deletion tracks
${
T
rackingActions
.
CANCEL_DELETE_PACKAGE
}
`
,
()
=>
{
it
(
`canceling a package deletion tracks
${
T
RACKING_ACTIONS
.
CANCEL_DELETE_PACKAGE
}
`
,
()
=>
{
createComponent
({
packageEntity
:
npmPackage
});
createComponent
({
packageEntity
:
npmPackage
});
findDeleteModal
().
vm
.
$emit
(
'
canceled
'
);
findDeleteModal
().
vm
.
$emit
(
'
canceled
'
);
expect
(
eventSpy
).
toHaveBeenCalledWith
(
expect
(
eventSpy
).
toHaveBeenCalledWith
(
category
,
TRACK_CATEGORY
,
T
rackingActions
.
CANCEL_DELETE_PACKAGE
,
T
RACKING_ACTIONS
.
CANCEL_DELETE_PACKAGE
,
expect
.
any
(
Object
),
expect
.
any
(
Object
),
);
);
});
});
it
(
`request a file deletion tracks
${
T
rackingActions
.
REQUEST_DELETE_PACKAGE_FILE
}
`
,
()
=>
{
it
(
`request a file deletion tracks
${
T
RACKING_ACTIONS
.
REQUEST_DELETE_PACKAGE_FILE
}
`
,
()
=>
{
createComponent
({
packageEntity
:
npmPackage
});
createComponent
({
packageEntity
:
npmPackage
});
findPackageFiles
().
vm
.
$emit
(
'
delete-file
'
,
mavenFiles
[
0
]);
findPackageFiles
().
vm
.
$emit
(
'
delete-file
'
,
mavenFiles
[
0
]);
expect
(
eventSpy
).
toHaveBeenCalledWith
(
expect
(
eventSpy
).
toHaveBeenCalledWith
(
category
,
TRACK_CATEGORY
,
T
rackingActions
.
REQUEST_DELETE_PACKAGE_FILE
,
T
RACKING_ACTIONS
.
REQUEST_DELETE_PACKAGE_FILE
,
expect
.
any
(
Object
),
expect
.
any
(
Object
),
);
);
});
});
it
(
`confirming a file deletion tracks
${
T
rackingActions
.
DELETE_PACKAGE_FILE
}
`
,
()
=>
{
it
(
`confirming a file deletion tracks
${
T
RACKING_ACTIONS
.
DELETE_PACKAGE_FILE
}
`
,
()
=>
{
createComponent
({
packageEntity
:
npmPackage
});
createComponent
({
packageEntity
:
npmPackage
});
findPackageFiles
().
vm
.
$emit
(
'
delete-file
'
,
npmPackage
);
findPackageFiles
().
vm
.
$emit
(
'
delete-file
'
,
npmPackage
);
findDeleteFileModal
().
vm
.
$emit
(
'
primary
'
);
findDeleteFileModal
().
vm
.
$emit
(
'
primary
'
);
expect
(
eventSpy
).
toHaveBeenCalledWith
(
expect
(
eventSpy
).
toHaveBeenCalledWith
(
category
,
TRACK_CATEGORY
,
T
rackingActions
.
REQUEST_DELETE_PACKAGE_FILE
,
T
RACKING_ACTIONS
.
REQUEST_DELETE_PACKAGE_FILE
,
expect
.
any
(
Object
),
expect
.
any
(
Object
),
);
);
});
});
it
(
`canceling a file deletion tracks
${
T
rackingActions
.
CANCEL_DELETE_PACKAGE_FILE
}
`
,
()
=>
{
it
(
`canceling a file deletion tracks
${
T
RACKING_ACTIONS
.
CANCEL_DELETE_PACKAGE_FILE
}
`
,
()
=>
{
createComponent
({
packageEntity
:
npmPackage
});
createComponent
({
packageEntity
:
npmPackage
});
findPackageFiles
().
vm
.
$emit
(
'
delete-file
'
,
npmPackage
);
findPackageFiles
().
vm
.
$emit
(
'
delete-file
'
,
npmPackage
);
findDeleteFileModal
().
vm
.
$emit
(
'
canceled
'
);
findDeleteFileModal
().
vm
.
$emit
(
'
canceled
'
);
expect
(
eventSpy
).
toHaveBeenCalledWith
(
expect
(
eventSpy
).
toHaveBeenCalledWith
(
category
,
TRACK_CATEGORY
,
T
rackingActions
.
CANCEL_DELETE_PACKAGE_FILE
,
T
RACKING_ACTIONS
.
CANCEL_DELETE_PACKAGE_FILE
,
expect
.
any
(
Object
),
expect
.
any
(
Object
),
);
);
});
});
it
(
`file download link call event with
${
T
rackingActions
.
PULL_PACKAGE
}
`
,
()
=>
{
it
(
`file download link call event with
${
T
RACKING_ACTIONS
.
PULL_PACKAGE
}
`
,
()
=>
{
createComponent
({
packageEntity
:
npmPackage
});
createComponent
({
packageEntity
:
npmPackage
});
findPackageFiles
().
vm
.
$emit
(
'
download-file
'
);
findPackageFiles
().
vm
.
$emit
(
'
download-file
'
);
expect
(
eventSpy
).
toHaveBeenCalledWith
(
expect
(
eventSpy
).
toHaveBeenCalledWith
(
category
,
TRACK_CATEGORY
,
T
rackingActions
.
PULL_PACKAGE
,
T
RACKING_ACTIONS
.
PULL_PACKAGE
,
expect
.
any
(
Object
),
expect
.
any
(
Object
),
);
);
});
});
...
...
spec/frontend/packages_and_registries/infrastructure_registry/components/details/store/actions_spec.js
View file @
56c03d33
...
@@ -12,7 +12,7 @@ import {
...
@@ -12,7 +12,7 @@ import {
DELETE_PACKAGE_ERROR_MESSAGE
,
DELETE_PACKAGE_ERROR_MESSAGE
,
DELETE_PACKAGE_FILE_ERROR_MESSAGE
,
DELETE_PACKAGE_FILE_ERROR_MESSAGE
,
DELETE_PACKAGE_FILE_SUCCESS_MESSAGE
,
DELETE_PACKAGE_FILE_SUCCESS_MESSAGE
,
}
from
'
~/packages/shared/constants
'
;
}
from
'
~/packages
_and_registries
/shared/constants
'
;
import
{
npmPackage
as
packageEntity
}
from
'
../../mock_data
'
;
import
{
npmPackage
as
packageEntity
}
from
'
../../mock_data
'
;
jest
.
mock
(
'
~/flash.js
'
);
jest
.
mock
(
'
~/flash.js
'
);
...
...
spec/frontend/packages_and_registries/infrastructure_registry/components/list/components/packages_list_app_spec.js
View file @
56c03d33
...
@@ -6,8 +6,11 @@ import createFlash from '~/flash';
...
@@ -6,8 +6,11 @@ import createFlash from '~/flash';
import
*
as
commonUtils
from
'
~/lib/utils/common_utils
'
;
import
*
as
commonUtils
from
'
~/lib/utils/common_utils
'
;
import
PackageListApp
from
'
~/packages_and_registries/infrastructure_registry/list/components/packages_list_app.vue
'
;
import
PackageListApp
from
'
~/packages_and_registries/infrastructure_registry/list/components/packages_list_app.vue
'
;
import
{
DELETE_PACKAGE_SUCCESS_MESSAGE
}
from
'
~/packages_and_registries/infrastructure_registry/list/constants
'
;
import
{
DELETE_PACKAGE_SUCCESS_MESSAGE
}
from
'
~/packages_and_registries/infrastructure_registry/list/constants
'
;
import
{
SHOW_DELETE_SUCCESS_ALERT
}
from
'
~/packages/shared/constants
'
;
import
{
import
{
FILTERED_SEARCH_TERM
}
from
'
~/packages_and_registries/shared/constants
'
;
SHOW_DELETE_SUCCESS_ALERT
,
FILTERED_SEARCH_TERM
,
}
from
'
~/packages_and_registries/shared/constants
'
;
import
*
as
packageUtils
from
'
~/packages_and_registries/shared/utils
'
;
import
*
as
packageUtils
from
'
~/packages_and_registries/shared/utils
'
;
import
InfrastructureSearch
from
'
~/packages_and_registries/infrastructure_registry/list/components/infrastructure_search.vue
'
;
import
InfrastructureSearch
from
'
~/packages_and_registries/infrastructure_registry/list/components/infrastructure_search.vue
'
;
...
...
spec/frontend/packages_and_registries/infrastructure_registry/components/list/components/packages_list_spec.js
View file @
56c03d33
...
@@ -5,9 +5,9 @@ import Vuex from 'vuex';
...
@@ -5,9 +5,9 @@ import Vuex from 'vuex';
import
stubChildren
from
'
helpers/stub_children
'
;
import
stubChildren
from
'
helpers/stub_children
'
;
import
PackagesList
from
'
~/packages_and_registries/infrastructure_registry/list/components/packages_list.vue
'
;
import
PackagesList
from
'
~/packages_and_registries/infrastructure_registry/list/components/packages_list.vue
'
;
import
PackagesListRow
from
'
~/packages_and_registries/infrastructure_registry/shared/package_list_row.vue
'
;
import
PackagesListRow
from
'
~/packages_and_registries/infrastructure_registry/shared/package_list_row.vue
'
;
import
PackagesListLoader
from
'
~/packages/shared/components/packages_list_loader.vue
'
;
import
PackagesListLoader
from
'
~/packages
_and_registries
/shared/components/packages_list_loader.vue
'
;
import
{
T
rackingActions
}
from
'
~/packag
es/shared/constants
'
;
import
{
T
RACKING_ACTIONS
}
from
'
~/packages_and_registri
es/shared/constants
'
;
import
*
as
SharedUtils
from
'
~/packages/shared/util
s
'
;
import
{
TRACK_CATEGORY
}
from
'
~/packages_and_registries/infrastructure_registry/shared/constant
s
'
;
import
Tracking
from
'
~/tracking
'
;
import
Tracking
from
'
~/tracking
'
;
import
{
packageList
}
from
'
../../mock_data
'
;
import
{
packageList
}
from
'
../../mock_data
'
;
...
@@ -190,26 +190,18 @@ describe('packages_list', () => {
...
@@ -190,26 +190,18 @@ describe('packages_list', () => {
describe
(
'
tracking
'
,
()
=>
{
describe
(
'
tracking
'
,
()
=>
{
let
eventSpy
;
let
eventSpy
;
let
utilSpy
;
const
category
=
'
foo
'
;
beforeEach
(()
=>
{
beforeEach
(()
=>
{
mountComponent
();
mountComponent
();
eventSpy
=
jest
.
spyOn
(
Tracking
,
'
event
'
);
eventSpy
=
jest
.
spyOn
(
Tracking
,
'
event
'
);
utilSpy
=
jest
.
spyOn
(
SharedUtils
,
'
packageTypeToTrackCategory
'
).
mockReturnValue
(
category
);
wrapper
.
setData
({
itemToBeDeleted
:
{
package_type
:
'
conan
'
}
});
wrapper
.
setData
({
itemToBeDeleted
:
{
package_type
:
'
conan
'
}
});
});
});
it
(
'
tracking category calls packageTypeToTrackCategory
'
,
()
=>
{
expect
(
wrapper
.
vm
.
tracking
.
category
).
toBe
(
category
);
expect
(
utilSpy
).
toHaveBeenCalledWith
(
'
conan
'
);
});
it
(
'
deleteItemConfirmation calls event
'
,
()
=>
{
it
(
'
deleteItemConfirmation calls event
'
,
()
=>
{
wrapper
.
vm
.
deleteItemConfirmation
();
wrapper
.
vm
.
deleteItemConfirmation
();
expect
(
eventSpy
).
toHaveBeenCalledWith
(
expect
(
eventSpy
).
toHaveBeenCalledWith
(
category
,
TRACK_CATEGORY
,
T
rackingActions
.
DELETE_PACKAGE
,
T
RACKING_ACTIONS
.
DELETE_PACKAGE
,
expect
.
any
(
Object
),
expect
.
any
(
Object
),
);
);
});
});
...
...
spec/frontend/packages_and_registries/infrastructure_registry/components/list/stores/actions_spec.js
View file @
56c03d33
...
@@ -6,7 +6,7 @@ import createFlash from '~/flash';
...
@@ -6,7 +6,7 @@ import createFlash from '~/flash';
import
{
MISSING_DELETE_PATH_ERROR
}
from
'
~/packages_and_registries/infrastructure_registry/list/constants
'
;
import
{
MISSING_DELETE_PATH_ERROR
}
from
'
~/packages_and_registries/infrastructure_registry/list/constants
'
;
import
*
as
actions
from
'
~/packages_and_registries/infrastructure_registry/list/stores/actions
'
;
import
*
as
actions
from
'
~/packages_and_registries/infrastructure_registry/list/stores/actions
'
;
import
*
as
types
from
'
~/packages_and_registries/infrastructure_registry/list/stores/mutation_types
'
;
import
*
as
types
from
'
~/packages_and_registries/infrastructure_registry/list/stores/mutation_types
'
;
import
{
DELETE_PACKAGE_ERROR_MESSAGE
}
from
'
~/packages/shared/constants
'
;
import
{
DELETE_PACKAGE_ERROR_MESSAGE
}
from
'
~/packages
_and_registries
/shared/constants
'
;
jest
.
mock
(
'
~/flash.js
'
);
jest
.
mock
(
'
~/flash.js
'
);
jest
.
mock
(
'
~/api.js
'
);
jest
.
mock
(
'
~/api.js
'
);
...
...
spec/frontend/packages_and_registries/infrastructure_registry/components/shared/package_list_row_spec.js
View file @
56c03d33
...
@@ -3,9 +3,9 @@ import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
...
@@ -3,9 +3,9 @@ import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import
{
createMockDirective
,
getBinding
}
from
'
helpers/vue_mock_directive
'
;
import
{
createMockDirective
,
getBinding
}
from
'
helpers/vue_mock_directive
'
;
import
PackagesListRow
from
'
~/packages_and_registries/infrastructure_registry/shared/package_list_row.vue
'
;
import
PackagesListRow
from
'
~/packages_and_registries/infrastructure_registry/shared/package_list_row.vue
'
;
import
PackagePath
from
'
~/packages/shared/components/package_path.vue
'
;
import
PackagePath
from
'
~/packages
_and_registries
/shared/components/package_path.vue
'
;
import
PackageTags
from
'
~/packages/shared/components/package_tags.vue
'
;
import
PackageTags
from
'
~/packages
_and_registries
/shared/components/package_tags.vue
'
;
import
{
PACKAGE_ERROR_STATUS
}
from
'
~/packages/shared/constants
'
;
import
{
PACKAGE_ERROR_STATUS
}
from
'
~/packages
_and_registries
/shared/constants
'
;
import
ListItem
from
'
~/vue_shared/components/registry/list_item.vue
'
;
import
ListItem
from
'
~/vue_shared/components/registry/list_item.vue
'
;
import
{
packageList
}
from
'
../mock_data
'
;
import
{
packageList
}
from
'
../mock_data
'
;
...
...
spec/frontend/packages_and_registries/package_registry/components/details/package_title_spec.js
View file @
56c03d33
...
@@ -2,7 +2,7 @@ import { GlIcon, GlSprintf } from '@gitlab/ui';
...
@@ -2,7 +2,7 @@ import { GlIcon, GlSprintf } from '@gitlab/ui';
import
{
GlBreakpointInstance
}
from
'
@gitlab/ui/dist/utils
'
;
import
{
GlBreakpointInstance
}
from
'
@gitlab/ui/dist/utils
'
;
import
{
createMockDirective
,
getBinding
}
from
'
helpers/vue_mock_directive
'
;
import
{
createMockDirective
,
getBinding
}
from
'
helpers/vue_mock_directive
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
PackageTags
from
'
~/packages/shared/components/package_tags.vue
'
;
import
PackageTags
from
'
~/packages
_and_registries
/shared/components/package_tags.vue
'
;
import
PackageTitle
from
'
~/packages_and_registries/package_registry/components/details/package_title.vue
'
;
import
PackageTitle
from
'
~/packages_and_registries/package_registry/components/details/package_title.vue
'
;
import
{
import
{
PACKAGE_TYPE_CONAN
,
PACKAGE_TYPE_CONAN
,
...
...
spec/frontend/packages_and_registries/package_registry/components/details/version_row_spec.js
View file @
56c03d33
import
{
GlLink
,
GlSprintf
,
GlTruncate
}
from
'
@gitlab/ui
'
;
import
{
GlLink
,
GlSprintf
,
GlTruncate
}
from
'
@gitlab/ui
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
{
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
PackageTags
from
'
~/packages/shared/components/package_tags.vue
'
;
import
PackageTags
from
'
~/packages
_and_registries
/shared/components/package_tags.vue
'
;
import
PublishMethod
from
'
~/packages/shared/components/publish_method.vue
'
;
import
PublishMethod
from
'
~/packages
_and_registries
/shared/components/publish_method.vue
'
;
import
VersionRow
from
'
~/packages_and_registries/package_registry/components/details/version_row.vue
'
;
import
VersionRow
from
'
~/packages_and_registries/package_registry/components/details/version_row.vue
'
;
import
ListItem
from
'
~/vue_shared/components/registry/list_item.vue
'
;
import
ListItem
from
'
~/vue_shared/components/registry/list_item.vue
'
;
import
TimeAgoTooltip
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
import
TimeAgoTooltip
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
...
...
spec/frontend/packages_and_registries/package_registry/components/list/package_list_row_spec.js
View file @
56c03d33
...
@@ -3,9 +3,9 @@ import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
...
@@ -3,9 +3,9 @@ import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import
{
createMockDirective
,
getBinding
}
from
'
helpers/vue_mock_directive
'
;
import
{
createMockDirective
,
getBinding
}
from
'
helpers/vue_mock_directive
'
;
import
PackagesListRow
from
'
~/packages_and_registries/package_registry/components/list/package_list_row.vue
'
;
import
PackagesListRow
from
'
~/packages_and_registries/package_registry/components/list/package_list_row.vue
'
;
import
PackagePath
from
'
~/packages/shared/components/package_path.vue
'
;
import
PackagePath
from
'
~/packages
_and_registries
/shared/components/package_path.vue
'
;
import
PackageTags
from
'
~/packages/shared/components/package_tags.vue
'
;
import
PackageTags
from
'
~/packages
_and_registries
/shared/components/package_tags.vue
'
;
import
PackageIconAndName
from
'
~/packages/shared/components/package_icon_and_name.vue
'
;
import
PackageIconAndName
from
'
~/packages
_and_registries
/shared/components/package_icon_and_name.vue
'
;
import
PublishMethod
from
'
~/packages_and_registries/package_registry/components/list/publish_method.vue
'
;
import
PublishMethod
from
'
~/packages_and_registries/package_registry/components/list/publish_method.vue
'
;
import
TimeagoTooltip
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
import
TimeagoTooltip
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
import
{
PACKAGE_ERROR_STATUS
}
from
'
~/packages_and_registries/package_registry/constants
'
;
import
{
PACKAGE_ERROR_STATUS
}
from
'
~/packages_and_registries/package_registry/constants
'
;
...
...
spec/frontend/packages_and_registries/package_registry/components/list/packages_list_spec.js
View file @
56c03d33
...
@@ -2,7 +2,7 @@ import { GlKeysetPagination, GlModal, GlSprintf } from '@gitlab/ui';
...
@@ -2,7 +2,7 @@ import { GlKeysetPagination, GlModal, GlSprintf } from '@gitlab/ui';
import
{
nextTick
}
from
'
vue
'
;
import
{
nextTick
}
from
'
vue
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
PackagesListRow
from
'
~/packages_and_registries/package_registry/components/list/package_list_row.vue
'
;
import
PackagesListRow
from
'
~/packages_and_registries/package_registry/components/list/package_list_row.vue
'
;
import
PackagesListLoader
from
'
~/packages/shared/components/packages_list_loader.vue
'
;
import
PackagesListLoader
from
'
~/packages
_and_registries
/shared/components/packages_list_loader.vue
'
;
import
{
import
{
DELETE_PACKAGE_TRACKING_ACTION
,
DELETE_PACKAGE_TRACKING_ACTION
,
REQUEST_DELETE_PACKAGE_TRACKING_ACTION
,
REQUEST_DELETE_PACKAGE_TRACKING_ACTION
,
...
...
spec/frontend/packages
/shared/components
/__snapshots__/publish_method_spec.js.snap
→
spec/frontend/packages
_and_registries/shared
/__snapshots__/publish_method_spec.js.snap
View file @
56c03d33
File moved
spec/frontend/packages
/shared/components
/package_icon_and_name_spec.js
→
spec/frontend/packages
_and_registries/shared
/package_icon_and_name_spec.js
View file @
56c03d33
import
{
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
PackageIconAndName
from
'
~/packages/shared/components/package_icon_and_name.vue
'
;
import
PackageIconAndName
from
'
~/packages
_and_registries
/shared/components/package_icon_and_name.vue
'
;
describe
(
'
PackageIconAndName
'
,
()
=>
{
describe
(
'
PackageIconAndName
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
...
spec/frontend/packages
/shared/components
/package_path_spec.js
→
spec/frontend/packages
_and_registries/shared
/package_path_spec.js
View file @
56c03d33
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
createMockDirective
,
getBinding
}
from
'
helpers/vue_mock_directive
'
;
import
{
createMockDirective
,
getBinding
}
from
'
helpers/vue_mock_directive
'
;
import
PackagePath
from
'
~/packages/shared/components/package_path.vue
'
;
import
PackagePath
from
'
~/packages
_and_registries
/shared/components/package_path.vue
'
;
describe
(
'
PackagePath
'
,
()
=>
{
describe
(
'
PackagePath
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
...
spec/frontend/packages
/shared/components
/package_tags_spec.js
→
spec/frontend/packages
_and_registries/shared
/package_tags_spec.js
View file @
56c03d33
import
{
mount
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
PackageTags
from
'
~/packages/shared/components/package_tags.vue
'
;
import
PackageTags
from
'
~/packages
_and_registries
/shared/components/package_tags.vue
'
;
import
{
mockTags
}
from
'
jest/packages_and_registries/infrastructure_registry/components/mock_data
'
;
import
{
mockTags
}
from
'
jest/packages_and_registries/infrastructure_registry/components/mock_data
'
;
describe
(
'
PackageTags
'
,
()
=>
{
describe
(
'
PackageTags
'
,
()
=>
{
...
...
spec/frontend/packages
/shared/components
/packages_list_loader_spec.js
→
spec/frontend/packages
_and_registries/shared
/packages_list_loader_spec.js
View file @
56c03d33
import
{
mount
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
PackagesListLoader
from
'
~/packages/shared/components/packages_list_loader.vue
'
;
import
PackagesListLoader
from
'
~/packages
_and_registries
/shared/components/packages_list_loader.vue
'
;
describe
(
'
PackagesListLoader
'
,
()
=>
{
describe
(
'
PackagesListLoader
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
...
spec/frontend/packages
/shared/components
/publish_method_spec.js
→
spec/frontend/packages
_and_registries/shared
/publish_method_spec.js
View file @
56c03d33
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
PublishMethod
from
'
~/packages/shared/components/publish_method.vue
'
;
import
PublishMethod
from
'
~/packages
_and_registries
/shared/components/publish_method.vue
'
;
import
{
packageList
}
from
'
jest/packages_and_registries/infrastructure_registry/components/mock_data
'
;
import
{
packageList
}
from
'
jest/packages_and_registries/infrastructure_registry/components/mock_data
'
;
describe
(
'
publish_method
'
,
()
=>
{
describe
(
'
publish_method
'
,
()
=>
{
...
...
spec/frontend/packages_and_registries/shared/utils_spec.js
View file @
56c03d33
...
@@ -4,8 +4,12 @@ import {
...
@@ -4,8 +4,12 @@ import {
keyValueToFilterToken
,
keyValueToFilterToken
,
searchArrayToFilterTokens
,
searchArrayToFilterTokens
,
extractFilterAndSorting
,
extractFilterAndSorting
,
beautifyPath
,
getCommitLink
,
}
from
'
~/packages_and_registries/shared/utils
'
;
}
from
'
~/packages_and_registries/shared/utils
'
;
import
{
packageList
}
from
'
jest/packages_and_registries/infrastructure_registry/components/mock_data
'
;
describe
(
'
Packages And Registries shared utils
'
,
()
=>
{
describe
(
'
Packages And Registries shared utils
'
,
()
=>
{
describe
(
'
getQueryParams
'
,
()
=>
{
describe
(
'
getQueryParams
'
,
()
=>
{
it
(
'
returns an object from a query string, with arrays
'
,
()
=>
{
it
(
'
returns an object from a query string, with arrays
'
,
()
=>
{
...
@@ -56,4 +60,30 @@ describe('Packages And Registries shared utils', () => {
...
@@ -56,4 +60,30 @@ describe('Packages And Registries shared utils', () => {
},
},
);
);
});
});
describe
(
'
beautifyPath
'
,
()
=>
{
it
(
'
returns a string with spaces around /
'
,
()
=>
{
expect
(
beautifyPath
(
'
foo/bar
'
)).
toBe
(
'
foo / bar
'
);
});
it
(
'
does not fail for empty string
'
,
()
=>
{
expect
(
beautifyPath
()).
toBe
(
''
);
});
});
describe
(
'
getCommitLink
'
,
()
=>
{
it
(
'
returns a relative link when isGroup is false
'
,
()
=>
{
const
link
=
getCommitLink
(
packageList
[
0
],
false
);
expect
(
link
).
toContain
(
'
../commit
'
);
});
describe
(
'
when isGroup is true
'
,
()
=>
{
it
(
'
returns an absolute link matching project path
'
,
()
=>
{
const
mavenPackage
=
packageList
[
0
];
const
link
=
getCommitLink
(
mavenPackage
,
true
);
expect
(
link
).
toContain
(
`/
${
mavenPackage
.
project_path
}
/commit`
);
});
});
});
});
});
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