Skip to content

Commit

Permalink
Add registered_by to marketplace / Complete test
Browse files Browse the repository at this point in the history
Change-Id: Ibbb857e9480805c6fa47eb224cac6cbbeeed233c
  • Loading branch information
hebasta committed Jun 17, 2024
1 parent f0f1a01 commit 216a482
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/Kalamar/Plugin/Auth.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
6 changes: 5 additions & 1 deletion lib/Kalamar/Plugin/Auth/templates/auth/marketplace.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,12 @@
<p class="plugin-url"><a href="<%= $_->{client_url} %>"><%= $_->{client_url} %></a></p>
% }
%if ($_->{registration_date}) {
<p class="registration_date"> <%=loc('Auth_regdate')%>: <%= $_->{registration_date} %></p>
<p class="registration_date"><%=loc('Auth_regdate')%>: <%= $_->{registration_date} %></p>
% };
%if ($_->{registered_by}) {
<p class="registered_by"><%=loc('Auth_regby')%>: <%=$_->{registered_by} %></p>
% };

%= form_for 'install-plugin', class => 'mkplace', method => "POST", begin
%= hidden_field 'client-id' => $_->{client_id}
<input type="submit" class="form-submit" value="<%= loc('Auth_install')%>"/>
Expand Down
8 changes: 5 additions & 3 deletions t/plugin/auth-oauth.t
Original file line number Diff line number Diff line change
Expand Up @@ -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',
});


Expand Down Expand Up @@ -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')
;


Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 216a482

Please sign in to comment.