Skip to content

Commit

Permalink
feat: add organization name variable (#854)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
mr-woodapple and DanielHabenicht authored Jun 4, 2024
1 parent 9881db9 commit cad3e79
Show file tree
Hide file tree
Showing 20 changed files with 34 additions and 80,543 deletions.
1 change: 1 addition & 0 deletions Phonebook.Frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ ARG EMPLOYEE_PICTURES_ENDPOINT
ARG ASSETS_ENDPOINT
ARG CONTACT_EMAIL
ARG CONTACT_URL
ARG ORGANIZATION_NAME

RUN rm -r ./*
COPY ./nginx/ ./
Expand Down
4 changes: 1 addition & 3 deletions Phonebook.Frontend/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ services:
EMPLOYEE_PICTURES_ENDPOINT: 'https://pictures.example.com/'
ASSETS_ENDPOINT: 'https://localhost:8081/api/assets'
ROOMPLANNINGTOOL_URL: 'http://example.com'
ORGANIZATION_NAME: 'Your very fancy Company'
ports:
- 80:80
volumes:
- ./nginx.conf /etc/nginx/nginx.conf
- ./conf.d /etc/nginx/conf.d
restart: always
# stdin_open: true
# tty: true
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,7 @@ <h4 mat-line i18n="@@ColumnTitleMobile">Mobile</h4>
</mat-list-item>
<mat-list-item *ngIf="person.Contacts.Fax !== ''">
<mat-icon mat-list-icon>print</mat-icon>
<h4 mat-line i18n="Datapoint|Label for Person.Fax data@@DataPersonFax">
Fax
</h4>
<h4 mat-line i18n="Datapoint|Label for Person.Fax data@@DataPersonFax"> Fax </h4>
<p mat-line>
<app-interactive-attribute-field
[value]="person.Contacts.Fax"
Expand Down Expand Up @@ -252,9 +250,7 @@ <h3 mat-subheader i18n="@@UserDetailComponentSubTitleFurtherInformation">
<mat-list-item>
<mat-icon mat-list-icon>business</mat-icon>
<h4 mat-line>
<ng-container i18n="@@ColumnTitleOrgUnit">
Organization Unit
</ng-container>
<ng-container i18n="@@ColumnTitleOrgUnit"> Organization Unit </ng-container>
<a mat-button [routerLink]="organigramLink">
<span
class="mat-small"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class UserDetailComponent implements OnInit, OnChanges, OnDestroy {
{ value: this.person.Contacts.Phone, param: { type: 'work' } },
],
organization: {
value: 'T-Systems Multimedia Solutions',
value: runtimeEnvironment.organizationName,
param: { type: ['work'] },
},
categories: [...this.person.Business.OrgUnit, ...this.person.Business.ShortOrgUnit],
Expand Down
4 changes: 4 additions & 0 deletions Phonebook.Frontend/src/environments/EnvironmentInterfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ export interface RuntimeEnvironmentInterface {
* The Base Url of the RocketChat Messenger
*/
readonly rocketChatUrl?: string;
/**
* The name of your company/organization. Empty string if not set.
*/
readonly organizationName: string;
}

export enum Environment {
Expand Down
1 change: 1 addition & 0 deletions Phonebook.Frontend/src/environments/runtime-environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ export const runtimeEnvironment: RuntimeEnvironmentInterface = {
ENV.roomPlanningToolUrl !== '${ROOMPLANNINGTOOL_URL}' ? ENV.roomPlanningToolUrl : undefined,
contactUrl: ENV.contactUrl !== '${CONTACT_URL}' ? ENV.contactUrl : undefined,
rocketChatUrl: ENV.rocketChatUrl !== '${ROCKETCHAT_URL}' ? ENV.rocketChatUrl : undefined,
organizationName: ENV.organizationName !== '${ORGANIZATION_NAME}' ? ENV.organizationName : '',
};
1 change: 1 addition & 0 deletions Phonebook.Frontend/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
roomPlanningToolUrl: '${ROOMPLANNINGTOOL_URL}',
contactUrl: '${CONTACT_URL}',
rocketChatUrl: '${ROCKETCHAT_URL}',
organizationName: '${ORGANIZATION_NAME}',
};
</script>
<base href="/" />
Expand Down
2 changes: 1 addition & 1 deletion Phonebook.Frontend/substitute_variables.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# State all required variables here
requiredVariables=( BASE_URL SERVER_NAME ENVIRONMENT ENVIRONMENT_TAG ASSETS_ENDPOINT CONTACT_EMAIL CONTACT_URL)
requiredVariables=( BASE_URL SERVER_NAME ENVIRONMENT ENVIRONMENT_TAG ASSETS_ENDPOINT CONTACT_EMAIL CONTACT_URL ORGANIZATION_NAME)

# State all optional variables here
optionalVariables=( RAVEN_URL EMPLOYEE_PICTURES_ENDPOINT ROOMPLANNINGTOOL_URL ROCKETCHAT_URL)
Expand Down
2 changes: 2 additions & 0 deletions Phonebook/phonebook/templates/frontend-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ spec:
value: "{{ .Values.assetsEndpoint }}"
- name: ROCKETCHAT_URL
value: "{{ .Values.rocketChatUrl }}"
- name: ORGANIZATION_NAME
value: "{{ .Values.organizationName }}"
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
Expand Down
6 changes: 3 additions & 3 deletions demo/source/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@ function generateBranch() {
}

fs.writeFileSync(
'./mocks/synthetic/persons.json',
'./mocks/synthetic/api/people.json',
JSON.stringify(generateArray(1500, generatePerson))
);
fs.writeFileSync('./mocks/synthetic/rooms.json', JSON.stringify(rooms));
fs.writeFileSync('./mocks/synthetic/api/rooms.json', JSON.stringify(rooms));
fs.writeFileSync(
'./mocks/synthetic/branches.json',
'./mocks/synthetic/api/OrgUnit.json',
JSON.stringify(generateArray(cityCount * 2, generateBranch))
);
1 change: 1 addition & 0 deletions demo/source/mocks/synthetic/api/OrgUnit.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions demo/source/mocks/synthetic/api/branches.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions demo/source/mocks/synthetic/api/people.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions demo/source/mocks/synthetic/api/rooms.json

Large diffs are not rendered by default.

Loading

0 comments on commit cad3e79

Please sign in to comment.