Skip to content

Commit

Permalink
Hide column on dashboard when tracking disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
darcato committed Apr 10, 2024
1 parent eca24a5 commit 47745ed
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public class IamViewInfoInterceptor implements HandlerInterceptor {
public static final String RCAUTH_ENABLED_KEY = "iamRcauthEnabled";
public static final String RESOURCES_PATH_KEY = "resourcesPrefix";
public static final String CLIENT_DEFAULTS_PROPERTIES_KEY = "clientDefaultsProperties";
public static final String CLIENT_TRACK_LAST_USED_KEY = "clientTrackLastUsed";

@Value("${iam.version}")
String iamVersion;
Expand Down Expand Up @@ -83,6 +84,8 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons
request.setAttribute(RCAUTH_ENABLED_KEY, rcAuthProperties.isEnabled());

request.setAttribute(CLIENT_DEFAULTS_PROPERTIES_KEY, clientRegistrationProperties.getClientDefaults());

request.setAttribute(CLIENT_TRACK_LAST_USED_KEY, iamProperties.getClient().isTrackLastUsed());

if (iamProperties.getVersionedStaticResources().isEnableVersioning()) {
request.setAttribute(RESOURCES_PATH_KEY, String.format("/resources/%s", gitCommitId));
Expand Down
4 changes: 4 additions & 0 deletions iam-login-service/src/main/webapp/WEB-INF/tags/iamHeader.tag
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,8 @@ function getAccessTokenValiditySeconds() {
function getRefreshTokenValiditySeconds() {
return ${clientDefaultsProperties.defaultRefreshTokenValiditySeconds};
}
function getClientTrackLastUsed() {
return ${clientTrackLastUsed};
}
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<th>Client name & id</th>
<th>Created</th>
<th>Dyn. registered</th>
<th>Last Used</th>
<th ng-if="$ctrl.clientTrackLastUsed">Last Used</th>
<th>Information</th>
<th><span class="pull-right">Actions</span></th>
</tr>
Expand Down Expand Up @@ -106,13 +106,13 @@
<!-- Dynamically registered -->
{{ c.dynamically_registered }}
</td>
<td class="col-xs-1">
<td class="col-xs-1" ng-if="$ctrl.clientTrackLastUsed">
<!-- Last Used -->
<div ng-if="c.last_used">
{{c.last_used | date }}
</div>
<div ng-if="!c.last_used" class="text-muted">
Never
N/A
</div>
</td>
<td class="col-xs-4">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
self.resetFilter = resetFilter;
self.onChangePage = onChangePage;
self.deleteClient = deleteClient;
self.clientTrackLastUsed = getClientTrackLastUsed();

self.$onInit = function () {
console.debug('ClientsListController.self', self);
Expand Down

0 comments on commit 47745ed

Please sign in to comment.