From 76a1f7398965c3f8396cb31b8e814c95612fa083 Mon Sep 17 00:00:00 2001 From: Mojca Lorber Date: Mon, 25 May 2020 12:15:24 +0200 Subject: [PATCH] Change order of snapshots versions --- app/assets/javascripts/my_modules/repositories.js | 2 +- app/controllers/my_module_repository_snapshots_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/my_modules/repositories.js b/app/assets/javascripts/my_modules/repositories.js index 94688d8ed..fe8ffe658 100644 --- a/app/assets/javascripts/my_modules/repositories.js +++ b/app/assets/javascripts/my_modules/repositories.js @@ -342,7 +342,7 @@ var MyModuleRepositories = (function() { dataType: 'json', success: function(data) { let snapshotItem = $(data.html); - FULL_VIEW_MODAL.find('.snapshots-container-scrollbody').append(snapshotItem); + FULL_VIEW_MODAL.find('.snapshots-container-scrollbody').prepend(snapshotItem); setTimeout(function() { checkSnapshotStatus(snapshotItem); }, STATUS_POLLING_INTERVAL); diff --git a/app/controllers/my_module_repository_snapshots_controller.rb b/app/controllers/my_module_repository_snapshots_controller.rb index 9daa54d30..fd81dd7c2 100644 --- a/app/controllers/my_module_repository_snapshots_controller.rb +++ b/app/controllers/my_module_repository_snapshots_controller.rb @@ -74,7 +74,7 @@ class MyModuleRepositorySnapshotsController < ApplicationController @repository_snapshots = @my_module.repository_snapshots .where(parent_id: params[:repository_id]) - .order(:updated_at) + .order(updated_at: :desc) render json: { html: render_to_string( partial: 'my_modules/repositories/full_view_sidebar',