Skip to content

Commit cad3e79

Browse files
feat: add organization name variable (#854)
* Updated mock backend paths & added orgName as env variable * fix docker compose * Updated getting started frontend documentation * Removed duplicate mock data, edited yml & docu * Fixed #795 by adding a white background * Revert "Fixed #795 by adding a white background" This reverts commit d4ec2e2. --------- Co-authored-by: DanielHabenicht <daniel-habenicht@outlook.de>
1 parent 9881db9 commit cad3e79

File tree

20 files changed

+34
-80543
lines changed

20 files changed

+34
-80543
lines changed

Phonebook.Frontend/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ ARG EMPLOYEE_PICTURES_ENDPOINT
3030
ARG ASSETS_ENDPOINT
3131
ARG CONTACT_EMAIL
3232
ARG CONTACT_URL
33+
ARG ORGANIZATION_NAME
3334

3435
RUN rm -r ./*
3536
COPY ./nginx/ ./

Phonebook.Frontend/docker-compose.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,9 @@ services:
2929
EMPLOYEE_PICTURES_ENDPOINT: 'https://pictures.example.com/'
3030
ASSETS_ENDPOINT: 'https://localhost:8081/api/assets'
3131
ROOMPLANNINGTOOL_URL: 'http://example.com'
32+
ORGANIZATION_NAME: 'Your very fancy Company'
3233
ports:
3334
- 80:80
34-
volumes:
35-
- ./nginx.conf /etc/nginx/nginx.conf
36-
- ./conf.d /etc/nginx/conf.d
3735
restart: always
3836
# stdin_open: true
3937
# tty: true

Phonebook.Frontend/src/app/shared/components/user/user-detail/user-detail.component.html

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,7 @@ <h4 mat-line i18n="@@ColumnTitleMobile">Mobile</h4>
165165
</mat-list-item>
166166
<mat-list-item *ngIf="person.Contacts.Fax !== ''">
167167
<mat-icon mat-list-icon>print</mat-icon>
168-
<h4 mat-line i18n="Datapoint|Label for Person.Fax data@@DataPersonFax">
169-
Fax
170-
</h4>
168+
<h4 mat-line i18n="Datapoint|Label for Person.Fax data@@DataPersonFax"> Fax </h4>
171169
<p mat-line>
172170
<app-interactive-attribute-field
173171
[value]="person.Contacts.Fax"
@@ -252,9 +250,7 @@ <h3 mat-subheader i18n="@@UserDetailComponentSubTitleFurtherInformation">
252250
<mat-list-item>
253251
<mat-icon mat-list-icon>business</mat-icon>
254252
<h4 mat-line>
255-
<ng-container i18n="@@ColumnTitleOrgUnit">
256-
Organization Unit
257-
</ng-container>
253+
<ng-container i18n="@@ColumnTitleOrgUnit"> Organization Unit </ng-container>
258254
<a mat-button [routerLink]="organigramLink">
259255
<span
260256
class="mat-small"

Phonebook.Frontend/src/app/shared/components/user/user-detail/user-detail.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export class UserDetailComponent implements OnInit, OnChanges, OnDestroy {
8080
{ value: this.person.Contacts.Phone, param: { type: 'work' } },
8181
],
8282
organization: {
83-
value: 'T-Systems Multimedia Solutions',
83+
value: runtimeEnvironment.organizationName,
8484
param: { type: ['work'] },
8585
},
8686
categories: [...this.person.Business.OrgUnit, ...this.person.Business.ShortOrgUnit],

Phonebook.Frontend/src/environments/EnvironmentInterfaces.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ export interface RuntimeEnvironmentInterface {
5454
* The Base Url of the RocketChat Messenger
5555
*/
5656
readonly rocketChatUrl?: string;
57+
/**
58+
* The name of your company/organization. Empty string if not set.
59+
*/
60+
readonly organizationName: string;
5761
}
5862

5963
export enum Environment {

Phonebook.Frontend/src/environments/runtime-environment.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ export const runtimeEnvironment: RuntimeEnvironmentInterface = {
1818
ENV.roomPlanningToolUrl !== '${ROOMPLANNINGTOOL_URL}' ? ENV.roomPlanningToolUrl : undefined,
1919
contactUrl: ENV.contactUrl !== '${CONTACT_URL}' ? ENV.contactUrl : undefined,
2020
rocketChatUrl: ENV.rocketChatUrl !== '${ROCKETCHAT_URL}' ? ENV.rocketChatUrl : undefined,
21+
organizationName: ENV.organizationName !== '${ORGANIZATION_NAME}' ? ENV.organizationName : '',
2122
};

Phonebook.Frontend/src/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
roomPlanningToolUrl: '${ROOMPLANNINGTOOL_URL}',
1818
contactUrl: '${CONTACT_URL}',
1919
rocketChatUrl: '${ROCKETCHAT_URL}',
20+
organizationName: '${ORGANIZATION_NAME}',
2021
};
2122
</script>
2223
<base href="/" />

Phonebook.Frontend/substitute_variables.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
# State all required variables here
4-
requiredVariables=( BASE_URL SERVER_NAME ENVIRONMENT ENVIRONMENT_TAG ASSETS_ENDPOINT CONTACT_EMAIL CONTACT_URL)
4+
requiredVariables=( BASE_URL SERVER_NAME ENVIRONMENT ENVIRONMENT_TAG ASSETS_ENDPOINT CONTACT_EMAIL CONTACT_URL ORGANIZATION_NAME)
55

66
# State all optional variables here
77
optionalVariables=( RAVEN_URL EMPLOYEE_PICTURES_ENDPOINT ROOMPLANNINGTOOL_URL ROCKETCHAT_URL)

Phonebook/phonebook/templates/frontend-deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ spec:
6464
value: "{{ .Values.assetsEndpoint }}"
6565
- name: ROCKETCHAT_URL
6666
value: "{{ .Values.rocketChatUrl }}"
67+
- name: ORGANIZATION_NAME
68+
value: "{{ .Values.organizationName }}"
6769
resources:
6870
{{- toYaml .Values.resources | nindent 12 }}
6971
{{- with .Values.nodeSelector }}

demo/source/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,11 @@ function generateBranch() {
160160
}
161161

162162
fs.writeFileSync(
163-
'./mocks/synthetic/persons.json',
163+
'./mocks/synthetic/api/people.json',
164164
JSON.stringify(generateArray(1500, generatePerson))
165165
);
166-
fs.writeFileSync('./mocks/synthetic/rooms.json', JSON.stringify(rooms));
166+
fs.writeFileSync('./mocks/synthetic/api/rooms.json', JSON.stringify(rooms));
167167
fs.writeFileSync(
168-
'./mocks/synthetic/branches.json',
168+
'./mocks/synthetic/api/OrgUnit.json',
169169
JSON.stringify(generateArray(cityCount * 2, generateBranch))
170170
);

0 commit comments

Comments
 (0)