From 216a482050b0f0ccdace9183375d0258c03c01e4 Mon Sep 17 00:00:00 2001 From: Helge Date: Mon, 17 Jun 2024 12:02:34 +0200 Subject: [PATCH] Add registered_by to marketplace / Complete test Change-Id: Ibbb857e9480805c6fa47eb224cac6cbbeeed233c --- lib/Kalamar/Plugin/Auth.pm | 4 ++-- .../Plugin/Auth/templates/auth/marketplace.html.ep | 6 +++++- t/plugin/auth-oauth.t | 8 +++++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/Kalamar/Plugin/Auth.pm b/lib/Kalamar/Plugin/Auth.pm index 2bcfedaa..7844157c 100644 --- a/lib/Kalamar/Plugin/Auth.pm +++ b/lib/Kalamar/Plugin/Auth.pm @@ -189,8 +189,8 @@ sub register { plugins => 'Plugins', instplugins => 'Installed Plugins', regby =>'Registered by', - regdate =>'Date of Registration', - instdate =>'Date of Installation', + regdate =>'Date of registration', + instdate =>'Installation date', install => 'Install', uninstall => 'Uninstall', installFail => 'Plugin could not be installed', diff --git a/lib/Kalamar/Plugin/Auth/templates/auth/marketplace.html.ep b/lib/Kalamar/Plugin/Auth/templates/auth/marketplace.html.ep index 60f2294c..f092587e 100644 --- a/lib/Kalamar/Plugin/Auth/templates/auth/marketplace.html.ep +++ b/lib/Kalamar/Plugin/Auth/templates/auth/marketplace.html.ep @@ -43,8 +43,12 @@

<%= $_->{client_url} %>

% } %if ($_->{registration_date}) { -

<%=loc('Auth_regdate')%>: <%= $_->{registration_date} %>

+

<%=loc('Auth_regdate')%>: <%= $_->{registration_date} %>

% }; + %if ($_->{registered_by}) { +

<%=loc('Auth_regby')%>: <%=$_->{registered_by} %>

+ % }; + %= form_for 'install-plugin', class => 'mkplace', method => "POST", begin %= hidden_field 'client-id' => $_->{client_id} diff --git a/t/plugin/auth-oauth.t b/t/plugin/auth-oauth.t index 667b8e1f..ad8d6ae7 100644 --- a/t/plugin/auth-oauth.t +++ b/t/plugin/auth-oauth.t @@ -940,7 +940,8 @@ $fake_backend_app->add_plugin({ "client_description" => 'Description Plugin 1', "client_url" => 'http://example.client.de', "registration_date" => '2022-05-31T14:30:09+02:00[Europe/Berlin]', -"registered_by" => 'system' +"registered_by" => 'testuser', +"refresh_token_expiry" => '7776000', }); @@ -994,9 +995,10 @@ $t->get_ok('/settings/marketplace') ->text_is('html head title' => 'Marketplace') ->element_exists('ul.plugin-list') ->element_exists('ul.plugin-list > li') - ->element_exists('p.registration_date') ->text_is('span.client-name','Plugin 1') ->text_is('p.plugin-desc','Description Plugin 1') + ->text_is('p.registration_date', 'Date of registration: 2022-05-31T14:30:09+02:00[Europe/Berlin]') + ->text_is('p.registered_by', 'Registered by: testuser') ; @@ -1037,7 +1039,7 @@ $t->post_ok('/settings/marketplace/install', form => {'client-id' => '52abc'}) ->element_exists('ul.plugin_in-list') ->element_exists('ul.plugin_in-list > li') ->text_is('ul.plugin_in-list > li > span.client-name','Plugin 1') - ->text_is('ul.plugin_in-list > li > p.inst_date','Date of Installation: 2022-12-13T16:33:27.621+01:00[Europe/Berlin]') + ->text_is('ul.plugin_in-list > li > p.inst_date','Installation date: 2022-12-13T16:33:27.621+01:00[Europe/Berlin]') ; $t->ua->max_redirects(0);