Merge branch 'devel-1.6.1' into context_menu

This commit is contained in:
Karel Picman 2018-02-14 13:34:39 +01:00
commit 496a362800
7 changed files with 21 additions and 18 deletions

View File

@ -122,6 +122,7 @@ class DmsfUploadController < ApplicationController
if upload
uploaded_file[:disk_filename] = upload.disk_filename
uploaded_file[:tempfile_path] = upload.tempfile_path
uploaded_file[:size] = upload.size
end
end
commit_files_internal uploaded_files

View File

@ -75,7 +75,7 @@
:data => {:confirm => l(:text_are_you_sure)},
:method => :delete,
:title => l(:title_delete),
:class => 'icon-only icon-delete') %>
:class => 'icon-only icon-del') %>
<% else %>
<%= link_to('', delete_dmsf_path(:id => project, :folder_id => subfolder, :commit => 'yes'),
:data => {:confirm => l(:text_are_you_sure)},

View File

@ -78,7 +78,7 @@
<span class="icon"></span>
<% end %>
</td>
<td class="hol"><%= position %> </td>
<td class="hol"></td>
<td class="hol">link.updated_at.to_i</td>
<td class="hol"></td>
<td class="none"><%= position %> </td>
<td class="none"></td>
<td class="none">link.updated_at.to_i</td>
<td class="none"></td>

View File

@ -64,10 +64,10 @@
<% if @file_delete_allowed %>
<%= link_to_if(@file_delete_allowed, '', dmsf_link_path(:id => link, :commit => 'yes'),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete,
:title => l(:title_delete), :class => "icon icon-delete" ) %>
:title => l(:title_delete), :class => "icon icon-del" ) %>
<% end %>
</td>
<td class="hol">1</td>
<td class="hol"></td>
<td class="hol">link.updated_at.to_i</td>
<td class="hol"></td>
<td class="none">1</td>
<td class="none"></td>
<td class="none">link.updated_at.to_i</td>
<td class="none"></td>

View File

@ -81,10 +81,10 @@
<% end %>
<% end %>
<th class ="dmsf_th"><%# controls %></th>
<th class="hol"><%# position %></th>
<th class="hol"><%# size %></th>
<th class="hol"><%# updated %></th>
<th class="hol"><%# version %></th>
<th class="none"><%# position %></th>
<th class="none"><%# size %></th>
<th class="none"><%# updated %></th>
<th class="none"><%# version %></th>
</tr>
</thead>
<tbody>

View File

@ -2,7 +2,6 @@
<attachments>
<folder_id>6118</folder_id>
<uploaded_file>
<disk_filename>cat.gif</disk_filename>
<name>cat.gif</name>
<title>cat.gif</title>
<description>REST API</description>

View File

@ -99,7 +99,6 @@ class DmsfFileApiTest < RedmineDmsf::Test::IntegrationTest
<attachments>
<folder_id/>
<uploaded_file>
<disk_filename>test.txt</disk_filename>
<name>test.txt</name>
<title>test.txt</title>
<description>REST API</description>
@ -109,16 +108,20 @@ class DmsfFileApiTest < RedmineDmsf::Test::IntegrationTest
</uploaded_file>
</attachments>
}
post "/projects/#{@project1.id}/dmsf/commit.xml?&key=#{token.value}", payload, {"CONTENT_TYPE" => 'application/xml'}
assert_difference 'DmsfFileRevision.count', +1 do
post "/projects/#{@project1.id}/dmsf/commit.xml?&key=#{token.value}", payload, {"CONTENT_TYPE" => 'application/xml'}
end
#<?xml version="1.0" encoding="UTF-8"?>
#<dmsf_files total_count="1" type="array">
# <file>
# <id>17229</id>
# <name>test.txt</name>
# </file>
# </dmsf_files>
# </dmsf_files> #
assert_select 'dmsf_files > file > name', :text => 'test.txt'
assert_response :success
revision = DmsfFileRevision.order(:id).last
assert revision && revision.size > 0
begin
FileUtils.rm_rf Setting.plugin_redmine_dmsf['dmsf_storage_directory']
rescue Exception => e