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
tr ng-repeat-start='package in build_list.packages'
td
a.expand ng-show='package.dependent_projects'
a.expand ng-show='::package.dependent_projects.length'
span.fa.fa-chevron-up[
ng-show = 'package.show_dependent_projects'
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-click = 'package.show_dependent_projects = true' ]
td
div ng-if='!package.url'
| {{package.fullname}}
a ng-if='package.url' ng-href="{{package.url}}"
| {{package.fullname}}
div ng-if='::!package.url'
| {{::package.fullname}}
a ng-if='::package.url' ng-href="{{::package.url}}"
| {{::package.fullname}}
td
| {{package.name}}
| {{::package.name}}
td
| {{package.epoch}}
| {{::package.epoch}}
td
| {{package.version}}
| {{::package.version}}
td
| {{package.release}}
| {{::package.release}}
tr[
ng-repeat-end = ''
ng-if = '::package.dependent_projects.length'
ng-show = 'package.show_dependent_projects'
ng-repeat = 'project in package.dependent_projects' ]
ng-repeat = 'project in ::package.dependent_projects' ]
td
td
a ng-href="{{project.url}}"
| {{project.name}}
a ng-href="{{::project.url}}"
| {{::project.name}}
td
p ng-repeat='package in project.dependent_packages'
| {{package}}
p ng-repeat='package in ::project.dependent_packages'
| {{::package}}
td colspan=3
a ng-href='{{project.new_url}}'
a ng-href='{{::project.new_url}}'
= t('layout.build_lists.create_build_list')

View File

@ -50,15 +50,18 @@ json.build_list do
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.dependent_projects dependent_projects(package) do |project, packages|
json.url project_path(project.name_with_owner)
json.name project.name_with_owner
json.dependent_packages packages
json.new_url new_project_build_list_path(project)
dependent_projects_exists = true
end if @build_list.save_to_platform.main?
if @build_list.save_to_platform.main?
json.dependent_projects dependent_projects(package) do |project, packages|
json.url project_path(project.name_with_owner)
json.name project.name_with_owner
json.dependent_packages packages
json.new_url new_project_build_list_path(project)
dependent_projects_exists = true
end
else
json.dependent_projects []
end
end if @build_list.packages.present?
json.dependent_projects_exists dependent_projects_exists

View File

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