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

Consistent design-id processing

parent 5e96ce00
......@@ -44,10 +44,12 @@ module Resolvers
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 = Array.wrap(gids).map { |id| DesignID.coerce_isolated_input(id) }
Array.wrap(gids).compact.map(&:model_id).presence
gids = gids.map { |id| DesignID.coerce_isolated_input(id) }
gids.map(&:model_id)
end
def issue
......
......@@ -32,16 +32,21 @@ module Resolvers
private
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,
ids: ids&.map(&:model_id),
ids: design_ids(ids),
filenames: filenames,
visible_at_version: version)
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
version.issue
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