Commit a9be7231 authored by Mathieu Pionnier's avatar Mathieu Pionnier
Browse files

[WIP] #15333 service accounts limit

parent ae2ff6f7
Pipeline #10180 failed with stages
in 51 seconds
......@@ -117,6 +117,18 @@ class serviceAccount
return $serviceAccounts;
}
/** Get a service account object
*
* @param id $serviceAccountName The user unique identifier
*
* @return auth/account The service account object
*/
public function searchServiceAccountsByName($serviceAccountName)
{
$maxResults = 200;
return $this->sdoFactory->find("auth/account", "accountType = 'service'", $maxResults);
}
/**
* Prepare an empty service object
*
......
......@@ -63,8 +63,8 @@ class serviceAccount
{
$this->view->addContentFile("auth/serviceAccount/index.html");
$this->view->setSource("serviceAccounts", $serviceAccounts);
$this->view->setSource("accountsLimit", 200);
$hasSecurityLevel = isset(\laabs::configuration('auth')['useSecurityLevel']) ? (bool) \laabs::configuration('auth')['useSecurityLevel'] : false;
$accountId = \laabs::getToken("AUTH")->accountId;
$account = \laabs::callService("auth/userAccount/read_userAccountId_", $accountId);
......
......@@ -497,6 +497,9 @@ msgstr "Ajouter un utilisateur"
msgid "User modification"
msgstr "Modification"
msgid "Service account search"
msgstr "Rechercher un compte de service"
msgid "User name"
msgstr "Identifiant"
......@@ -887,3 +890,4 @@ msgctxt "userStory"
msgid "importDescriptionField"
msgstr "Champs de description"
msgctxt "userStory"
......@@ -2336,6 +2336,23 @@ output {
-o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}
.searchBar {
width: 90%;
height: 34px;
padding: 6px 12px;
font-size: 14px;
line-height: 1.42857143;
color: #555555;
background-color: #ffffff;
background-image: none;
border: 1px solid #cccccc;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
-o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}
.form-control:focus {
border-color: #23aae5;
outline: 0;
......
......@@ -5,6 +5,12 @@
<i class="fa fa-laptop"></i>
Manage service account
</h1>
<!-- <div class="input-group"> -->
<input type="text" class="searchBar" id="serviceAccount_search" name="serviceAccount" placeholder="Service account search"/>
<button type="button" class="btn btn-primary" id="searchServiceAccount" title="Search"><i class="fa fa-search">&nbsp;</i>Search</button>
<!-- </div> -->
<?merge accountsLimit.ifgt(199) ?>
<p>toto</p>
</div>
</div>
<div class="container-fluid" data-translate-catalog="auth/messages">
......@@ -71,6 +77,27 @@
$("#addServiceAccount").on("click", function(){
load("/serviceAccount");
});
//search
$('#searchServiceAccount').on('click', function () {
$('#searchServiceAccount').prop('disabled', true);
$.ajax({
type : 'GET',
url : '/serviceAccount/searchServiceAccountsByName',
data : $('#serviceAccount_search').val(),
dataType : 'html',
// success : function (response) {
// $('#archive_searchResult').empty().html(response);
// $('#archive_search').prop('disabled', false);
// },
// error : function(response) {
// response = JSON.parse(response.responseText);
// gritter.show(response.message);
// $('#archive_search').prop('disabled', false);
// }
});
});
//edit
$("#list-serviceAccount").on('click', '.edit', function() {
......
......@@ -99,4 +99,14 @@ interface adminServiceaccountInterface
*/
public function updateServiceaccount_serviceAccountId_Disable();
/**
* Search for service account by name
*
* @param string $accountName
*
* @action auth/serviceAccount/searchServiceAccountsByName
* @return auth/serviceAccount/index
*/
public function searchServiceAccountsByName($accountName);
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment