Commit 16b56a72 authored by Alex Kalderimis's avatar Alex Kalderimis

Consistent design-id processing

parent 5e96ce00
...@@ -44,10 +44,12 @@ module Resolvers ...@@ -44,10 +44,12 @@ module Resolvers
end end
def design_ids(gids) def design_ids(gids)
return if gids.nil?
# TODO: remove this line when the compatibility layer is removed # TODO: remove this line when the compatibility layer is removed
# See: https://gitlab.com/gitlab-org/gitlab/-/issues/257883 # See: https://gitlab.com/gitlab-org/gitlab/-/issues/257883
gids = Array.wrap(gids).map { |id| DesignID.coerce_isolated_input(id) } gids = gids.map { |id| DesignID.coerce_isolated_input(id) }
Array.wrap(gids).compact.map(&:model_id).presence gids.map(&:model_id)
end end
def issue def issue
......
...@@ -32,16 +32,21 @@ module Resolvers ...@@ -32,16 +32,21 @@ module Resolvers
private private
def find(ids, filenames) def find(ids, filenames)
# TODO: remove this line when the compatibility layer is removed
# See: https://gitlab.com/gitlab-org/gitlab/-/issues/257883
ids = ids&.map { |id| DesignID.coerce_isolated_input(id) }
::DesignManagement::DesignsFinder.new(issue, current_user, ::DesignManagement::DesignsFinder.new(issue, current_user,
ids: ids&.map(&:model_id), ids: design_ids(ids),
filenames: filenames, filenames: filenames,
visible_at_version: version) visible_at_version: version)
end end
def design_ids(gids)
return if gids.nil?
# TODO: remove this line when the compatibility layer is removed
# See: https://gitlab.com/gitlab-org/gitlab/-/issues/257883
gids = gids.map { |id| DesignID.coerce_isolated_input(id) }
gids.map(&:model_id)
end
def issue def issue
version.issue version.issue
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment