From bda53615ffa0dd86afc37bee229aa4af9e843b8f Mon Sep 17 00:00:00 2001 From: Liane Hampe Date: Tue, 21 Jan 2025 12:19:01 +0100 Subject: [PATCH 1/2] Adds current workflow state to dmsf_files show.api.rsb The get /dmsf/files/. response as provided by DmsfFiles#show and app/views/dmsf_files/show.api.rsb will be extended by the current state of the approval workflow. This makes it possible to forward a document to another plattform in case the workflow is approved. --- app/views/dmsf_files/show.api.rsb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/dmsf_files/show.api.rsb b/app/views/dmsf_files/show.api.rsb index 1acb460d3..80feeb9e7 100644 --- a/app/views/dmsf_files/show.api.rsb +++ b/app/views/dmsf_files/show.api.rsb @@ -34,6 +34,7 @@ api.dmsf_file do api.dmsf_workflow_assigned_at r.dmsf_workflow_assigned_at api.dmsf_workflow_started_by_user_id r.dmsf_workflow_started_by_user_id api.dmsf_workflow_started_at r.dmsf_workflow_started_at + api.dmsf_worklfow_state r.workflow_str(false) api.digest r.digest render_api_custom_values r.visible_custom_field_values, api end From 1d9f2440767cfdd782ed46cb20696f6063cd0a18 Mon Sep 17 00:00:00 2001 From: Liane Hampe Date: Tue, 21 Jan 2025 15:10:37 +0100 Subject: [PATCH 2/2] Updates api test to consider workflow state The get_document test in dmsf_file_api_test.rb will be extended by a further assertion for the workflow approval state to make sure the data is included in the response. --- test/integration/rest_api/dmsf_file_api_test.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/integration/rest_api/dmsf_file_api_test.rb b/test/integration/rest_api/dmsf_file_api_test.rb index 88b104185..ec45b90e7 100644 --- a/test/integration/rest_api/dmsf_file_api_test.rb +++ b/test/integration/rest_api/dmsf_file_api_test.rb @@ -65,6 +65,7 @@ def test_get_document # # # + # Waiting for Approval # # # @@ -87,6 +88,7 @@ def test_get_document # # 1 # + # Waiting for Approval # 81dc9bdb52d04dc20036dbd8313ed055 # # @@ -103,6 +105,8 @@ def test_get_document assert_select 'dmsf_file > content_url', text: "http://www.example.com/dmsf/files/#{@file1.id}/download" assert_select 'dmsf_file > dmsf_file_revisions > dmsf_file_revision', @file1.dmsf_file_revisions.all.size assert_select 'dmsf_file > dmsf_file_revisions > dmsf_file_revision > custom_fields > custom_field' + assert_select 'dmsf_file > dmsf_file_revisions > dmsf_file_revision > dmsf_worklfow_state', + text: 'Waiting for Approval' # curl -v -H "Content-Type: application/octet-stream" -X GET -u ${1}:${2} # http://localhost:3000/dmsf/files/41532/download > file.txt get "/dmsf/files/#{@file1.id}/download.xml?key=#{@token.value}"