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
e830bf42
Commit
e830bf42
authored
May 15, 2020
by
Sashi
Committed by
Mayra Cabrera
May 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Relocate Nuget presenter helpers to presenters module
parent
0b00a5e1
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
71 additions
and
71 deletions
+71
-71
changelogs/unreleased/sk-217056-relocate-nuget-presenter.yml
changelogs/unreleased/sk-217056-relocate-nuget-presenter.yml
+5
-0
ee/app/presenters/packages/nuget/package_metadata_presenter.rb
...p/presenters/packages/nuget/package_metadata_presenter.rb
+1
-1
ee/app/presenters/packages/nuget/packages_metadata_presenter.rb
.../presenters/packages/nuget/packages_metadata_presenter.rb
+1
-1
ee/app/presenters/packages/nuget/presenter_helpers.rb
ee/app/presenters/packages/nuget/presenter_helpers.rb
+63
-0
ee/app/presenters/packages/nuget/search_results_presenter.rb
ee/app/presenters/packages/nuget/search_results_presenter.rb
+1
-1
ee/lib/api/helpers/packages/nuget/metadata_presenter_helpers.rb
.../api/helpers/packages/nuget/metadata_presenter_helpers.rb
+0
-68
No files found.
changelogs/unreleased/sk-217056-relocate-nuget-presenter.yml
0 → 100644
View file @
e830bf42
---
title
:
Relocate Nuget presenter helpers to presenters module
merge_request
:
31985
author
:
Sashi Kumar
type
:
other
ee/app/presenters/packages/nuget/package_metadata_presenter.rb
View file @
e830bf42
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
module
Packages
module
Packages
module
Nuget
module
Nuget
class
PackageMetadataPresenter
class
PackageMetadataPresenter
include
API
::
Helpers
::
Packages
::
Nuget
::
Metadata
PresenterHelpers
include
Packages
::
Nuget
::
PresenterHelpers
def
initialize
(
package
)
def
initialize
(
package
)
@package
=
package
@package
=
package
...
...
ee/app/presenters/packages/nuget/packages_metadata_presenter.rb
View file @
e830bf42
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
module
Packages
module
Packages
module
Nuget
module
Nuget
class
PackagesMetadataPresenter
class
PackagesMetadataPresenter
include
API
::
Helpers
::
Packages
::
Nuget
::
Metadata
PresenterHelpers
include
Packages
::
Nuget
::
PresenterHelpers
include
Gitlab
::
Utils
::
StrongMemoize
include
Gitlab
::
Utils
::
StrongMemoize
COUNT
=
1
.
freeze
COUNT
=
1
.
freeze
...
...
ee/app/presenters/packages/nuget/presenter_helpers.rb
0 → 100644
View file @
e830bf42
# frozen_string_literal: true
module
Packages
module
Nuget
module
PresenterHelpers
include
::
API
::
Helpers
::
RelatedResourcesHelpers
BLANK_STRING
=
''
EMPTY_ARRAY
=
[].
freeze
private
def
json_url_for
(
package
)
path
=
api_v4_projects_packages_nuget_metadata_package_name_package_version_path
(
{
id:
package
.
project_id
,
package_name:
package
.
name
,
package_version:
package
.
version
,
format:
'.json'
},
true
)
expose_url
(
path
)
end
def
archive_url_for
(
package
)
path
=
api_v4_projects_packages_nuget_download_package_name_package_version_package_filename_path
(
{
id:
package
.
project_id
,
package_name:
package
.
name
,
package_version:
package
.
version
,
package_filename:
package
.
package_files
.
last
&
.
file_name
},
true
)
expose_url
(
path
)
end
def
catalog_entry_for
(
package
)
{
json_url:
json_url_for
(
package
),
authors:
BLANK_STRING
,
dependencies:
EMPTY_ARRAY
,
package_name:
package
.
name
,
package_version:
package
.
version
,
archive_url:
archive_url_for
(
package
),
summary:
BLANK_STRING
,
tags:
tags_for
(
package
)
}
end
def
base_path_for
(
package
)
api_v4_projects_packages_nuget_path
(
id:
package
.
project_id
)
end
def
tags_for
(
package
)
package
.
tag_names
.
join
(
::
Packages
::
Tag
::
NUGET_TAGS_SEPARATOR
)
end
end
end
end
ee/app/presenters/packages/nuget/search_results_presenter.rb
View file @
e830bf42
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
module
Packages
module
Packages
module
Nuget
module
Nuget
class
SearchResultsPresenter
class
SearchResultsPresenter
include
API
::
Helpers
::
Packages
::
Nuget
::
Metadata
PresenterHelpers
include
Packages
::
Nuget
::
PresenterHelpers
include
Gitlab
::
Utils
::
StrongMemoize
include
Gitlab
::
Utils
::
StrongMemoize
delegate
:total_count
,
to: :@search
delegate
:total_count
,
to: :@search
...
...
ee/lib/api/helpers/packages/nuget/metadata_presenter_helpers.rb
deleted
100644 → 0
View file @
0b00a5e1
# frozen_string_literal: true
module
API
module
Helpers
module
Packages
module
Nuget
module
MetadataPresenterHelpers
include
::
API
::
Helpers
::
RelatedResourcesHelpers
include
::
API
::
Helpers
::
PackagesHelpers
BLANK_STRING
=
''
EMPTY_ARRAY
=
[].
freeze
private
def
json_url_for
(
package
)
path
=
api_v4_projects_packages_nuget_metadata_package_name_package_version_path
(
{
id:
package
.
project
.
id
,
package_name:
package
.
name
,
package_version:
package
.
version
,
format:
'.json'
},
true
)
expose_url
(
path
)
end
def
archive_url_for
(
package
)
path
=
api_v4_projects_packages_nuget_download_package_name_package_version_package_filename_path
(
{
id:
package
.
project
.
id
,
package_name:
package
.
name
,
package_version:
package
.
version
,
package_filename:
package
.
package_files
.
last
&
.
file_name
},
true
)
expose_url
(
path
)
end
def
catalog_entry_for
(
package
)
{
json_url:
json_url_for
(
package
),
authors:
BLANK_STRING
,
dependencies:
EMPTY_ARRAY
,
package_name:
package
.
name
,
package_version:
package
.
version
,
archive_url:
archive_url_for
(
package
),
summary:
BLANK_STRING
,
tags:
tags_for
(
package
)
}
end
def
base_path_for
(
package
)
api_v4_projects_packages_nuget_path
(
id:
package
.
project
.
id
)
end
def
tags_for
(
package
)
package
.
tag_names
.
join
(
::
Packages
::
Tag
::
NUGET_TAGS_SEPARATOR
)
end
end
end
end
end
end
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