Class: Types::GroupType
Instance Method Summary
collapse
#cross_project_pipeline_available?, #root_storage_statistics
Methods inherited from BaseObject
accepts, assignable?, authorization, authorize, authorized?, #current_user, #id
#present, #unpresented
Instance Method Details
#avatar_url ⇒ Object
225
226
227
|
# File 'app/graphql/types/group_type.rb', line 225
def avatar_url
object.avatar_url(only_path: false)
end
|
#container_repositories_count ⇒ Object
233
234
235
|
# File 'app/graphql/types/group_type.rb', line 233
def container_repositories_count
group.container_repositories.size
end
|
#dependency_proxy_blob_count ⇒ Object
245
246
247
|
# File 'app/graphql/types/group_type.rb', line 245
def dependency_proxy_blob_count
group.dependency_proxy_blobs.size
end
|
#dependency_proxy_image_count ⇒ Object
241
242
243
|
# File 'app/graphql/types/group_type.rb', line 241
def dependency_proxy_image_count
group.dependency_proxy_manifests.size
end
|
#dependency_proxy_manifests ⇒ Object
237
238
239
|
# File 'app/graphql/types/group_type.rb', line 237
def dependency_proxy_manifests
group.dependency_proxy_manifests.order_id_desc
end
|
#dependency_proxy_setting ⇒ Object
255
256
257
|
# File 'app/graphql/types/group_type.rb', line 255
def dependency_proxy_setting
group.dependency_proxy_setting || group.create_dependency_proxy_setting
end
|
#dependency_proxy_total_size ⇒ Object
249
250
251
252
253
|
# File 'app/graphql/types/group_type.rb', line 249
def dependency_proxy_total_size
ActiveSupport::NumberHelper.number_to_human_size(
group.dependency_proxy_manifests.sum(:size) + group.dependency_proxy_blobs.sum(:size)
)
end
|
#label(title:) ⇒ Object
216
217
218
219
220
221
222
223
|
# File 'app/graphql/types/group_type.rb', line 216
def label(title:)
BatchLoader::GraphQL.for(title).batch(key: group) do |titles, loader, args|
LabelsFinder
.new(current_user, group: args[:key], title: titles)
.execute
.each { |label| loader.call(label.title, label) }
end
end
|