Build list optimization

This commit is contained in:
Wedge 2020-01-22 14:33:03 +03:00
parent 70bdc39d33
commit 6830f121ed
3 changed files with 30 additions and 26 deletions

View File

@ -13,7 +13,7 @@ rd-widget ng-show='build_list.packages'
tbody tbody
tr ng-repeat-start='package in build_list.packages' tr ng-repeat-start='package in build_list.packages'
td td
a.expand ng-show='package.dependent_projects' a.expand ng-show='::package.dependent_projects.length'
span.fa.fa-chevron-up[ span.fa.fa-chevron-up[
ng-show = 'package.show_dependent_projects' ng-show = 'package.show_dependent_projects'
ng-click = 'package.show_dependent_projects = false' ] ng-click = 'package.show_dependent_projects = false' ]
@ -21,30 +21,31 @@ rd-widget ng-show='build_list.packages'
ng-hide = 'package.show_dependent_projects' ng-hide = 'package.show_dependent_projects'
ng-click = 'package.show_dependent_projects = true' ] ng-click = 'package.show_dependent_projects = true' ]
td td
div ng-if='!package.url' div ng-if='::!package.url'
| {{package.fullname}} | {{::package.fullname}}
a ng-if='package.url' ng-href="{{package.url}}" a ng-if='::package.url' ng-href="{{::package.url}}"
| {{package.fullname}} | {{::package.fullname}}
td td
| {{package.name}} | {{::package.name}}
td td
| {{package.epoch}} | {{::package.epoch}}
td td
| {{package.version}} | {{::package.version}}
td td
| {{package.release}} | {{::package.release}}
tr[ tr[
ng-repeat-end = '' ng-repeat-end = ''
ng-if = '::package.dependent_projects.length'
ng-show = 'package.show_dependent_projects' ng-show = 'package.show_dependent_projects'
ng-repeat = 'project in package.dependent_projects' ] ng-repeat = 'project in ::package.dependent_projects' ]
td td
td td
a ng-href="{{project.url}}" a ng-href="{{::project.url}}"
| {{project.name}} | {{::project.name}}
td td
p ng-repeat='package in project.dependent_packages' p ng-repeat='package in ::project.dependent_packages'
| {{package}} | {{::package}}
td colspan=3 td colspan=3
a ng-href='{{project.new_url}}' a ng-href='{{::project.new_url}}'
= t('layout.build_lists.create_build_list') = t('layout.build_lists.create_build_list')

View File

@ -50,6 +50,7 @@ json.build_list do
json.(package, :id, :name, :fullname, :release, :version, :sha1, :epoch) json.(package, :id, :name, :fullname, :release, :version, :sha1, :epoch)
json.url "#{APP_CONFIG['file_store_url']}/api/v1/file_stores/#{package.sha1}" if package.sha1 json.url "#{APP_CONFIG['file_store_url']}/api/v1/file_stores/#{package.sha1}" if package.sha1
if @build_list.save_to_platform.main?
json.dependent_projects dependent_projects(package) do |project, packages| json.dependent_projects dependent_projects(package) do |project, packages|
json.url project_path(project.name_with_owner) json.url project_path(project.name_with_owner)
json.name project.name_with_owner json.name project.name_with_owner
@ -57,8 +58,10 @@ json.build_list do
json.new_url new_project_build_list_path(project) json.new_url new_project_build_list_path(project)
dependent_projects_exists = true dependent_projects_exists = true
end if @build_list.save_to_platform.main? end
else
json.dependent_projects []
end
end if @build_list.packages.present? end if @build_list.packages.present?
json.dependent_projects_exists dependent_projects_exists json.dependent_projects_exists dependent_projects_exists

View File

@ -9,7 +9,7 @@ rd-widget ng-show='subject.results'
tbody tbody
tr ng-repeat='item in subject.results' tr ng-repeat='item in subject.results'
td td
a ng-href='{{item.url}}' a ng-href='{{::item.url}}'
| {{item.file_name}} | {{::item.file_name}}
td td
| {{item.size}} | {{::item.size}}