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
6e659c7a
Commit
6e659c7a
authored
Sep 06, 2021
by
Nicolò Maria Mezzopera
Committed by
Nicolò Maria Mezzopera
Sep 13, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove package_details_apollo feature flag
Changelog: changed
parent
e0bf215c
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
31 additions
and
61 deletions
+31
-61
app/assets/javascripts/pages/projects/packages/packages/show/index.js
...avascripts/pages/projects/packages/packages/show/index.js
+3
-11
app/helpers/packages_helper.rb
app/helpers/packages_helper.rb
+1
-2
app/views/projects/packages/packages/show.html.haml
app/views/projects/packages/packages/show.html.haml
+1
-4
config/feature_flags/development/package_details_apollo.yml
config/feature_flags/development/package_details_apollo.yml
+0
-8
spec/features/groups/packages_spec.rb
spec/features/groups/packages_spec.rb
+0
-8
spec/features/projects/package_files_spec.rb
spec/features/projects/package_files_spec.rb
+0
-14
spec/features/projects/packages_spec.rb
spec/features/projects/packages_spec.rb
+0
-8
spec/helpers/packages_helper_spec.rb
spec/helpers/packages_helper_spec.rb
+26
-6
No files found.
app/assets/javascripts/pages/projects/packages/packages/show/index.js
View file @
6e659c7a
(
async
function
initPackage
()
{
let
app
;
if
(
document
.
getElementById
(
'
js-vue-packages-detail-new
'
))
{
app
=
await
import
(
/* webpackChunkName: 'new_package_app' */
`~/packages_and_registries/package_registry/pages/details.js`
);
}
else
{
app
=
await
import
(
'
~/packages/details/
'
);
}
app
.
default
();
})();
import
initPackageDetails
from
'
~/packages_and_registries/package_registry/pages/details
'
;
initPackageDetails
();
app/helpers/packages_helper.rb
View file @
6e659c7a
...
...
@@ -64,9 +64,8 @@ module PackagesHelper
project
.
container_repositories
.
exists?
end
def
package_details_data
(
project
,
package
,
use_presenter
=
false
)
def
package_details_data
(
project
,
package
)
{
package:
use_presenter
?
package_from_presenter
(
package
)
:
nil
,
package_id:
package
.
id
,
can_delete:
can?
(
current_user
,
:destroy_package
,
project
).
to_s
,
svg_path:
image_path
(
'illustrations/no-packages.svg'
),
...
...
app/views/projects/packages/packages/show.html.haml
View file @
6e659c7a
...
...
@@ -6,7 +6,4 @@
.row
.col-12
-
if
Feature
.
enabled?
(
:package_details_apollo
,
default_enabled: :yaml
)
#js-vue-packages-detail-new
{
data:
package_details_data
(
@project
,
@package
)
}
-
else
#js-vue-packages-detail
{
data:
package_details_data
(
@project
,
@package
,
true
)
}
config/feature_flags/development/package_details_apollo.yml
deleted
100644 → 0
View file @
e0bf215c
---
name
:
package_details_apollo
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/64939
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/334786
milestone
:
'
14.1'
type
:
development
group
:
group::package
default_enabled
:
true
spec/features/groups/packages_spec.rb
View file @
6e659c7a
...
...
@@ -44,14 +44,6 @@ RSpec.describe 'Group Packages' do
it_behaves_like
'packages list'
,
check_project_name:
true
context
'when package_details_apollo feature flag is off'
do
before
do
stub_feature_flags
(
package_details_apollo:
false
)
end
it_behaves_like
'package details link'
end
it_behaves_like
'package details link'
it
'allows you to navigate to the project page'
do
...
...
spec/features/projects/package_files_spec.rb
View file @
6e659c7a
...
...
@@ -23,20 +23,6 @@ RSpec.describe 'PackageFiles' do
expect
(
status_code
).
to
eq
(
200
)
end
context
'when package_details_apollo feature flag is off'
do
before
do
stub_feature_flags
(
package_details_apollo:
false
)
end
it
'renders the download link with the correct url'
,
:js
do
visit
project_package_path
(
project
,
package
)
download_url
=
download_project_package_file_path
(
project
,
package_file
)
expect
(
page
).
to
have_link
(
package_file
.
file_name
,
href:
download_url
)
end
end
it
'does not allow download of package belonging to different project'
do
another_package
=
create
(
:maven_package
)
another_file
=
another_package
.
package_files
.
first
...
...
spec/features/projects/packages_spec.rb
View file @
6e659c7a
...
...
@@ -37,14 +37,6 @@ RSpec.describe 'Packages' do
it_behaves_like
'packages list'
context
'when package_details_apollo feature flag is off'
do
before
do
stub_feature_flags
(
package_details_apollo:
false
)
end
it_behaves_like
'package details link'
end
it_behaves_like
'package details link'
context
'deleting a package'
do
...
...
spec/helpers/packages_helper_spec.rb
View file @
6e659c7a
...
...
@@ -223,21 +223,41 @@ RSpec.describe PackagesHelper do
describe
'#package_details_data'
do
let_it_be
(
:package
)
{
create
(
:package
)
}
let
(
:expected_result
)
do
{
package_id:
package
.
id
,
can_delete:
'true'
,
project_name:
project
.
name
,
group_list_url:
''
}
end
before
do
allow
(
helper
).
to
receive
(
:current_user
)
{
project
.
owner
}
allow
(
helper
).
to
receive
(
:can?
)
{
true
}
end
it
'when use_presenter is true populate the package key'
do
result
=
helper
.
package_details_data
(
project
,
package
,
true
)
context
'in a project without a group'
do
it
'populates presenter data'
do
result
=
helper
.
package_details_data
(
project
,
package
)
expect
(
result
[
:package
]).
not_to
be_nil
expect
(
result
).
to
match
(
hash_including
(
expected_result
))
end
end
it
'when use_presenter is false the package key is nil'
do
result
=
helper
.
package_details_data
(
project
,
package
,
false
)
context
'in a project with a group'
do
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:project_with_group
)
{
create
(
:project
,
group:
group
)
}
expect
(
result
[
:package
]).
to
be_nil
it
'populates presenter data'
do
result
=
helper
.
package_details_data
(
project_with_group
,
package
)
expected
=
expected_result
.
merge
({
group_list_url:
group_packages_path
(
project_with_group
.
group
),
project_name:
project_with_group
.
name
})
expect
(
result
).
to
match
(
hash_including
(
expected
))
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