Skip to content

Commit

Permalink
UI: Make display of clock widget configurable #3176, UI: Allow settin…
Browse files Browse the repository at this point in the history
…g of ui2 web app page title #3316
  • Loading branch information
shral committed Mar 14, 2023
1 parent 7a83c7b commit 855af9d
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 4 deletions.
Expand Up @@ -461,6 +461,18 @@ attributetype ( 1.2.40.0.13.1.15.111.3.80 NAME 'dcmuiPersonNameFormat'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
SINGLE-VALUE )

attributetype ( 1.2.40.0.13.1.15.111.3.82 NAME 'dcmuiHideClock'
DESC 'Hide Clock'
EQUALITY booleanMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.7
SINGLE-VALUE )

attributetype ( 1.2.40.0.13.1.15.111.3.83 NAME 'dcmuiPageTitle'
DESC 'Page Title'
EQUALITY caseExactMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
SINGLE-VALUE )

objectclass ( 1.2.40.0.13.1.15.111.4.1 NAME 'dcmuiConfig'
DESC 'Archive UI Configuration'
SUP top STRUCTURAL
Expand All @@ -474,6 +486,8 @@ objectclass ( 1.2.40.0.13.1.15.111.4.1 NAME 'dcmuiConfig'
dcmuiLogoURL $
dcmuiAboutInfo $
dcmuiDateTimeFormat $
dcmuiHideClock $
dcmuiPageTitle $
dcmuiPersonNameFormat $
dcmDefaultLanguage $
dcmLanguages $
Expand Down
Expand Up @@ -390,6 +390,16 @@ olcAttributeTypes: ( 1.2.40.0.13.1.15.111.3.80 NAME 'dcmuiPersonNameFormat'
EQUALITY caseExactMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
SINGLE-VALUE )
olcAttributeTypes: ( 1.2.40.0.13.1.15.111.3.82 NAME 'dcmuiHideClock'
DESC 'Hide Clock'
EQUALITY booleanMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.7
SINGLE-VALUE )
olcAttributeTypes: ( 1.2.40.0.13.1.15.111.3.83 NAME 'dcmuiPageTitle'
DESC 'Page Title'
EQUALITY caseExactMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
SINGLE-VALUE )
-
replace: olcObjectClasses
olcObjectClasses: ( 1.2.40.0.13.1.15.111.4.1 NAME 'dcmuiConfig'
Expand All @@ -405,6 +415,8 @@ olcObjectClasses: ( 1.2.40.0.13.1.15.111.4.1 NAME 'dcmuiConfig'
dcmuiLogoURL $
dcmuiAboutInfo $
dcmuiDateTimeFormat $
dcmuiHideClock $
dcmuiPageTitle $
dcmuiPersonNameFormat $
dcmDefaultLanguage $
dcmLanguages $
Expand Down
Expand Up @@ -389,6 +389,16 @@ olcAttributeTypes: ( 1.2.40.0.13.1.15.111.3.80 NAME 'dcmuiPersonNameFormat'
EQUALITY caseExactMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
SINGLE-VALUE )
olcAttributeTypes: ( 1.2.40.0.13.1.15.111.3.82 NAME 'dcmuiHideClock'
DESC 'Hide Clock'
EQUALITY booleanMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.7
SINGLE-VALUE )
olcAttributeTypes: ( 1.2.40.0.13.1.15.111.3.83 NAME 'dcmuiPageTitle'
DESC 'Page Title'
EQUALITY caseExactMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
SINGLE-VALUE )
olcObjectClasses: ( 1.2.40.0.13.1.15.111.4.1 NAME 'dcmuiConfig'
DESC 'Archive UI Configuration'
SUP top STRUCTURAL
Expand All @@ -402,6 +412,8 @@ olcObjectClasses: ( 1.2.40.0.13.1.15.111.4.1 NAME 'dcmuiConfig'
dcmuiLogoURL $
dcmuiAboutInfo $
dcmuiDateTimeFormat $
dcmuiHideClock $
dcmuiPageTitle $
dcmuiPersonNameFormat $
dcmDefaultLanguage $
dcmLanguages $
Expand Down
Expand Up @@ -55,6 +55,8 @@ public class UIConfig {
private String xdsUrl;
private String backgroundUrl;
private String dateTimeFormat;
private boolean hideClock;
private String pageTitle;
private String personNameFormat;
private String logoUrl;
private String[] defaultWidgetAets = {};
Expand Down Expand Up @@ -125,6 +127,21 @@ public void setDateTimeFormat(String dateTimeFormat) {
this.dateTimeFormat = dateTimeFormat;
}

public boolean isHideClock() {
return hideClock;
}

public void setHideClock(boolean hideClock) {
this.hideClock = hideClock;
}

public String getPageTitle() {
return pageTitle;
}

public void setPageTitle(String pageTitle) {
this.pageTitle = pageTitle;
}
public String getPersonNameFormat() {
return personNameFormat;
}
Expand Down
Expand Up @@ -90,6 +90,8 @@ private void writeTo(UIConfig uiConfig, JsonWriter writer) {
writer.writeNotNullOrDef("dcmuiXDSInterfaceURL", uiConfig.getXdsUrl(),null);
writer.writeNotNullOrDef("dcmuiBackgroundURL", uiConfig.getBackgroundUrl(),null);
writer.writeNotNullOrDef("dcmuiDateTimeFormat", uiConfig.getDateTimeFormat(),null);
writer.writeNotDef("dcmuiHideClock", uiConfig.isHideClock(),false);
writer.writeNotNullOrDef("dcmuiPageTitle", uiConfig.getPageTitle(),null);
writer.writeNotNullOrDef("dcmuiPersonNameFormat", uiConfig.getPersonNameFormat(),null);
writer.writeNotNullOrDef("dcmuiLogoURL", uiConfig.getLogoUrl(),null);
writer.writeNotEmpty("dcmuiDefaultWidgetAets", uiConfig.getDefaultWidgetAets());
Expand Down Expand Up @@ -391,6 +393,12 @@ private void loadFrom(UIConfig uiConfig, JsonReader reader) {
case "dcmuiDateTimeFormat":
uiConfig.setDateTimeFormat(reader.stringValue());
break;
case "dcmuiHideClock":
uiConfig.setHideClock(reader.booleanValue());
break;
case "dcmuiPageTitle":
uiConfig.setPageTitle(reader.stringValue());
break;
case "dcmuiPersonNameFormat":
uiConfig.setPersonNameFormat(reader.stringValue());
break;
Expand Down
Expand Up @@ -116,6 +116,8 @@ private Attributes storeTo(ConfigurationChanges.ModifiedObject ldapObj, UIConfig
LdapUtils.storeNotNullOrDef(ldapObj,attrs, "dcmuiXDSInterfaceURL", uiConfig.getXdsUrl(),null);
LdapUtils.storeNotNullOrDef(ldapObj,attrs, "dcmuiBackgroundURL", uiConfig.getBackgroundUrl(),null);
LdapUtils.storeNotNullOrDef(ldapObj,attrs, "dcmuiDateTimeFormat", uiConfig.getDateTimeFormat(),null);
LdapUtils.storeNotDef(ldapObj,attrs, "dcmuiHideClock", uiConfig.isHideClock(),false);
LdapUtils.storeNotNullOrDef(ldapObj,attrs, "dcmuiPageTitle", uiConfig.getPageTitle(),null);
LdapUtils.storeNotNullOrDef(ldapObj,attrs, "dcmuiPersonNameFormat", uiConfig.getPersonNameFormat(),null);
LdapUtils.storeNotNullOrDef(ldapObj,attrs, "dcmuiLogoURL", uiConfig.getLogoUrl(),null);
LdapUtils.storeNotEmpty(ldapObj,attrs, "dcmuiDefaultWidgetAets", uiConfig.getDefaultWidgetAets());
Expand Down Expand Up @@ -488,6 +490,8 @@ private UIConfig loadUIConfig(SearchResult sr, String deviceDN) throws NamingExc
uiConfig.setXdsUrl(LdapUtils.stringValue(attrs.get("dcmuiXDSInterfaceURL"),null));
uiConfig.setBackgroundUrl(LdapUtils.stringValue(attrs.get("dcmuiBackgroundURL"),null));
uiConfig.setDateTimeFormat(LdapUtils.stringValue(attrs.get("dcmuiDateTimeFormat"),null));
uiConfig.setHideClock(LdapUtils.booleanValue(attrs.get("dcmuiHideClock"),false));
uiConfig.setPageTitle(LdapUtils.stringValue(attrs.get("dcmuiPageTitle"),null));
uiConfig.setPersonNameFormat(LdapUtils.stringValue(attrs.get("dcmuiPersonNameFormat"),null));
uiConfig.setLogoUrl(LdapUtils.stringValue(attrs.get("dcmuiLogoURL"),null));
uiConfig.setDefaultWidgetAets(LdapUtils.stringArray(attrs.get("dcmuiDefaultWidgetAets")));
Expand Down Expand Up @@ -855,6 +859,8 @@ private List<ModificationItem> storeDiff(ConfigurationChanges.ModifiedObject lda
LdapUtils.storeDiffObject(ldapObj,mods,"dcmuiXDSInterfaceURL",prevUIConfig.getXdsUrl(),uiConfig.getXdsUrl(),null);
LdapUtils.storeDiffObject(ldapObj,mods,"dcmuiBackgroundURL",prevUIConfig.getBackgroundUrl(),uiConfig.getBackgroundUrl(),null);
LdapUtils.storeDiffObject(ldapObj,mods,"dcmuiDateTimeFormat",prevUIConfig.getDateTimeFormat(),uiConfig.getDateTimeFormat(),null);
LdapUtils.storeDiff(ldapObj,mods,"dcmuiHideClock",prevUIConfig.isHideClock(),uiConfig.isHideClock(),false);
LdapUtils.storeDiffObject(ldapObj,mods,"dcmuiPageTitle",prevUIConfig.getPageTitle(),uiConfig.getPageTitle(),null);
LdapUtils.storeDiffObject(ldapObj,mods,"dcmuiPersonNameFormat",prevUIConfig.getPersonNameFormat(),uiConfig.getPersonNameFormat(),null);
LdapUtils.storeDiffObject(ldapObj,mods,"dcmuiLogoURL",prevUIConfig.getLogoUrl(),uiConfig.getLogoUrl(),null);
LdapUtils.storeDiff(ldapObj,mods,"dcmuiDefaultWidgetAets",prevUIConfig.getDefaultWidgetAets(),uiConfig.getDefaultWidgetAets());
Expand Down
7 changes: 5 additions & 2 deletions dcm4chee-arc-ui2/src/app/app.component.html
Expand Up @@ -41,7 +41,7 @@
</div>
</div>
<div class="overlay" *ngIf="dcm4cheeArch && dcm4cheeArch.open" (click)="mainservice.dcm4cheeArcConfig.open = false"></div>
<div class="clock" [ngClass]="{'extend':!clockUnExtended}" *ngIf="currentServerTime || j4care.is(mainservice, 'dcm4cheeArcConfig.hasMoreThanOneBaseUrl')" (mouseenter)="clockUnExtended = true" (mouseleave)="hideExtendedClock()">
<div class="clock" [ngClass]="{'extend':!clockUnExtended && !dcmuiHideClock}" *ngIf="currentServerTime || j4care.is(mainservice, 'dcm4cheeArcConfig.hasMoreThanOneBaseUrl')" (mouseenter)="clockUnExtended = true" (mouseleave)="hideExtendedClock()">
<div class="base_url_switcher" *ngIf="j4care.is(mainservice, 'dcm4cheeArcConfig.hasMoreThanOneBaseUrl')">
<i class="config glyphicon glyphicon-cog" (click)="mainservice.dcm4cheeArcConfig.open = !mainservice.dcm4cheeArcConfig.open"></i>
<ul *ngIf="j4care.is(mainservice,'dcm4cheeArcConfig.open')" class="base_url_dropdown">
Expand All @@ -55,10 +55,13 @@
<span>{{dcm4cheeArch['deviceNameUrlMap'][mainservice.baseUrl]}}</span>
</div>-->

<ng-container *ngIf="currentServerTime">
<ng-container *ngIf="currentServerTime && !dcmuiHideClock">
<div class="time" i18n-title="@@title.app.server_time_param" title="Server time: {{j4care.fullDateToString(currentServerTime)}}">{{currentServerTime.getHours() < 10 ? '0'+currentServerTime.getHours():currentServerTime.getHours()}}:{{currentServerTime.getMinutes() < 10 ? '0'+currentServerTime.getMinutes():currentServerTime.getMinutes()}}:{{currentServerTime.getSeconds() < 10 ? '0'+currentServerTime.getSeconds():currentServerTime.getSeconds()}}</div>
<div class="text">{{mainservice.archiveDeviceName || myDeviceName}}</div>
</ng-container>
<ng-container *ngIf="dcmuiHideClock">
<div class="text">{{mainservice.archiveDeviceName || myDeviceName}}</div>
</ng-container>
</div>
<div class="background"></div>
<!--<app-widgets></app-widgets>-->
Expand Down
21 changes: 20 additions & 1 deletion dcm4chee-arc-ui2/src/app/app.component.ts
Expand Up @@ -23,6 +23,7 @@ import {LanguageSwitcher} from "./models/language-switcher";
import {HttpErrorHandler} from "./helpers/http-error-handler";
import {ConfiguredDateTameFormatObject, LanguageObject, LocalLanguageObject} from "./interfaces";
import {AppRequestsService} from "./app-requests.service";
import { Title } from '@angular/platform-browser';
declare var DCM4CHE: any;
declare var Keycloak: any;
const worker = new Worker('./server-time.worker', { type: 'module', name: 'server-time'});
Expand Down Expand Up @@ -66,6 +67,8 @@ export class AppComponent implements OnInit {
label:$localize `:@@available_devices:Available devices`,
title:$localize `:@@here_you_can_change_the_archive_device_to_which_the_calls_are_made:Here you can change the archive device to which the calls are made`
}
dcmuiHideClock:boolean = false;
dcmuiPageTitle:string;
constructor(
public viewContainerRef: ViewContainerRef,
public dialog: MatDialog,
Expand All @@ -75,7 +78,8 @@ export class AppComponent implements OnInit {
private permissionService:PermissionService,
private keycloakHttpClient:KeycloakHttpClient,
private _keycloakService: KeycloakService,
public httpErrorHandler:HttpErrorHandler
public httpErrorHandler:HttpErrorHandler,
private title:Title
){
console.log("in app.component construct", window);
}
Expand Down Expand Up @@ -153,6 +157,21 @@ export class AppComponent implements OnInit {
console.log("Global Patient Name Format:", this.personNameFormat);
this.mainservice.setGlobal(global);
}
if(_.hasIn(global, "uiConfig.dcmuiHideClock") && !this.dcmuiHideClock){
this.dcmuiHideClock = _.get(global, "uiConfig.dcmuiHideClock");
global["dcmuiHideClock"] = this.dcmuiHideClock;
console.log("hideClock", this.dcmuiHideClock);
this.mainservice.setGlobal(global);
}
if(_.hasIn(global, "uiConfig.dcmuiPageTitle") && !this.dcmuiPageTitle){
this.dcmuiPageTitle = _.get(global, "uiConfig.dcmuiPageTitle");
global["dcmuiPageTitle"] = this.dcmuiPageTitle;
console.log("hideClock", this.dcmuiPageTitle);
if(this.dcmuiPageTitle && this.dcmuiPageTitle != ""){
this.title.setTitle(this.dcmuiPageTitle);
}
this.mainservice.setGlobal(global);
}
}
});
}
Expand Down
3 changes: 2 additions & 1 deletion dcm4chee-arc-ui2/src/app/app.module.ts
@@ -1,4 +1,4 @@
import { BrowserModule } from '@angular/platform-browser';
import { BrowserModule, Title } from '@angular/platform-browser';
import {LOCALE_ID, NgModule} from '@angular/core';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import { RouterModule } from '@angular/router';
Expand Down Expand Up @@ -289,6 +289,7 @@ import {UploadFilesService} from "./widgets/dialogs/upload-files/upload-files.se
UploadFilesService,
CustomDatePipe,
DynamicPipePipe,
Title,
{provide: LOCALE_ID, useValue: 'en-US' },
{
provide: DateAdapter,
Expand Down

0 comments on commit 855af9d

Please sign in to comment.