Skip to content

Commit 817fcb2

Browse files
Merge pull request #2414 from ReliefApplications/next
Next
2 parents 7e6f99b + 6b6c026 commit 817fcb2

File tree

69 files changed

+1753
-487
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1753
-487
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
# [2.9.0](https://github.com/ReliefApplications/ems-frontend/compare/v2.8.3...v2.9.0) (2024-02-23)
2+
3+
4+
### Bug Fixes
5+
6+
* button action would redirect to incorrect page on web element ([8faadb2](https://github.com/ReliefApplications/ems-frontend/commit/8faadb2aeae26aef64895a79480b15c3b9d6dfbb))
7+
* dashboard context value select could sometimes display empty value ([#2405](https://github.com/ReliefApplications/ems-frontend/issues/2405)) ([2bb449f](https://github.com/ReliefApplications/ems-frontend/commit/2bb449fc4438784ac0ee69f36aa5cb479e753271))
8+
* min and max dates not taken into account in forms ([#2396](https://github.com/ReliefApplications/ems-frontend/issues/2396)) ([bb03549](https://github.com/ReliefApplications/ems-frontend/commit/bb03549698e216d1b0cc2dd4e330f3e4cdfc1aee))
9+
* ref data focus on form builder init ([#2397](https://github.com/ReliefApplications/ems-frontend/issues/2397)) ([6672ba3](https://github.com/ReliefApplications/ems-frontend/commit/6672ba3fa0e414f6d848c0759c8b83a6c878b3f3))
10+
* tagbox would not correctly indicate values, when value passed from another element ([d4a603b](https://github.com/ReliefApplications/ems-frontend/commit/d4a603b6ff550645694f0e93701c82ec4a764c6c))
11+
12+
13+
### Features
14+
15+
* allow questions using reference data to be depending between themselves ([#2384](https://github.com/ReliefApplications/ems-frontend/issues/2384)) ([89ce3f7](https://github.com/ReliefApplications/ems-frontend/commit/89ce3f78994b6b74745fa8ca3011064051009e6d))
16+
* implementation of choicesByGraphQL questions ([#2407](https://github.com/ReliefApplications/ems-frontend/issues/2407)) ([56c75f6](https://github.com/ReliefApplications/ems-frontend/commit/56c75f6c8cb11c1a678a0938473bdba273169735))
17+
118
## [2.8.3](https://github.com/ReliefApplications/ems-frontend/compare/v2.8.2...v2.8.3) (2024-02-15)
219

320

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,12 @@ Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protrac
162162
163163
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). -->
164164

165+
If you need to upload files to the blob storage where we store shared assets, you can use the az commands.
166+
First, build the front-office in production mode ( any environment, but same version ).
167+
Then, run:
168+
169+
az storage blob upload-batch --destination {container} --account-name {accountname} --destination-path {path-to-folder-in-container} --source {path-to-folder-locally}
170+
165171
# Common issues
166172

167173
## Javascript heap out of memory

apps/back-office/src/app/app.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
ResourceDropdownComponent,
1010
ResourceSelectTextComponent,
1111
TestServiceDropdownComponent,
12+
CodeEditorComponent,
1213
} from '@oort-front/shared';
1314
import { TranslateService } from '@ngx-translate/core';
1415
import { environment } from '../environments/environment';
@@ -32,6 +33,7 @@ export class AppComponent implements OnInit {
3233
ResourceDropdownComponent,
3334
ResourceSelectTextComponent,
3435
TestServiceDropdownComponent,
36+
CodeEditorComponent,
3537
];
3638
/** Application title */
3739
title = 'back-office';

apps/web-widgets/project.json

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,46 @@
8383
"maximumError": "2mb"
8484
}
8585
],
86+
"fileReplacements": [
87+
{
88+
"replace": "apps/web-widgets/src/environments/environment.ts",
89+
"with": "apps/web-widgets/src/environments/environment.azure.uat.ts"
90+
}
91+
],
92+
"outputHashing": "none",
8693
"stylePreprocessorOptions": {
8794
"includePaths": [
8895
"libs/styles/src/lib/themes/default",
8996
"apps/web-widgets/src/app/styles"
9097
]
91-
},
98+
}
99+
},
100+
"azure-local": {
92101
"fileReplacements": [
93102
{
94103
"replace": "apps/web-widgets/src/environments/environment.ts",
95-
"with": "apps/web-widgets/src/environments/environment.azure.uat.ts"
104+
"with": "apps/web-widgets/src/environments/environment.azure.local.ts"
96105
}
97106
],
98-
"outputHashing": "none"
107+
"budgets": [
108+
{
109+
"type": "initial",
110+
"maximumWarning": "12mb",
111+
"maximumError": "15mb"
112+
},
113+
{
114+
"type": "anyComponentStyle",
115+
"maximumWarning": "1mb",
116+
"maximumError": "2mb"
117+
}
118+
],
119+
"outputHashing": "none",
120+
"stylePreprocessorOptions": {
121+
"includePaths": [
122+
"libs/styles/src/lib/themes/default",
123+
"apps/web-widgets/src/app/styles"
124+
]
125+
}
99126
},
100127
"oort-dev": {
101128
"budgets": [

apps/web-widgets/src/app/widgets/app-widget/app-widget.component.ts

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
EventEmitter,
55
Injector,
66
Input,
7+
OnDestroy,
78
OnInit,
89
Output,
910
ViewEncapsulation,
@@ -18,7 +19,7 @@ import {
1819
WorkflowService,
1920
MapLayersService,
2021
} from '@oort-front/shared';
21-
import { debounceTime } from 'rxjs';
22+
import { Subject, debounceTime, takeUntil } from 'rxjs';
2223
import { isEmpty } from 'lodash';
2324
import { ShadowDomService } from '@oort-front/ui';
2425
import { Router } from '@angular/router';
@@ -41,7 +42,7 @@ import { Router } from '@angular/router';
4142
})
4243
export class AppWidgetComponent
4344
extends ShadowRootExtendedHostComponent
44-
implements OnInit
45+
implements OnInit, OnDestroy
4546
{
4647
/** Application Id */
4748
@Input()
@@ -87,6 +88,8 @@ export class AppWidgetComponent
8788
/** Available pages */
8889
@Output()
8990
pages = new EventEmitter<any[]>();
91+
/** Trigger subscription teardown on component destruction */
92+
private destroy$: Subject<void> = new Subject<void>();
9093

9194
/**
9295
* Application as Web Widget.
@@ -106,7 +109,7 @@ export class AppWidgetComponent
106109
private router: Router,
107110
private shadowDomService: ShadowDomService
108111
) {
109-
console.log('DEBUG: build from 02/14/2023');
112+
console.log('DEBUG: build from 02/22/2023');
110113
super(el, injector);
111114
this.shadowDomService.shadowRoot = el.nativeElement.shadowRoot;
112115
this.contextService.filter$
@@ -115,8 +118,9 @@ export class AppWidgetComponent
115118
this.filterActive$.emit(!isEmpty(current));
116119
this.filter$.emit(current);
117120
});
118-
this.applicationService.application$.subscribe(
119-
(application: Application | null) => {
121+
this.applicationService.application$
122+
.pipe(takeUntil(this.destroy$))
123+
.subscribe((application: Application | null) => {
120124
if (application) {
121125
const pages = application.pages
122126
?.filter((x) => x.content)
@@ -134,8 +138,7 @@ export class AppWidgetComponent
134138
} else {
135139
this.pages.emit([]);
136140
}
137-
}
138-
);
141+
});
139142
}
140143

141144
/**
@@ -196,4 +199,9 @@ export class AppWidgetComponent
196199
return 'dashboard';
197200
}
198201
}
202+
203+
ngOnDestroy(): void {
204+
this.destroy$.next();
205+
this.destroy$.complete();
206+
}
199207
}

apps/web-widgets/src/app/widgets/app-widget/application/pages/dashboard/dashboard.component.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
*ngIf="!loading && showFilter && !isFullScreen"
33
[isFullScreen]="isFullScreen"
44
variant="modern"
5-
[opened]="true"
5+
[opened]="$any(dashboard?.filter?.show)"
6+
[closable]="$any(dashboard?.filter?.closable)"
67
[dashboard]="dashboard"
78
[structure]="dashboard?.filter?.structure"
89
></shared-dashboard-filter>
@@ -17,7 +18,8 @@
1718
*ngIf="!loading && showFilter && isFullScreen"
1819
[editable]="true"
1920
[isFullScreen]="isFullScreen"
20-
[opened]="true"
21+
[opened]="$any(dashboard?.filter?.show)"
22+
[closable]="$any(dashboard?.filter?.closable)"
2123
[dashboard]="dashboard"
2224
[structure]="dashboard?.filter?.structure"
2325
></shared-dashboard-filter>

apps/web-widgets/src/environments/environment.azure.dev.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ export const environment = {
3030
availableLanguages: ['en', 'test'],
3131
authConfig,
3232
theme,
33-
tinymceBaseUrl: 'https://ems-safe-dev.who.int/tinymce',
34-
i18nUrl: 'https://ems-safe-dev.who.int/assets/i18n/',
33+
tinymceBaseUrl: 'https://ems2-dev.who.int/app-builder/tinymce',
34+
i18nUrl: 'https://ems2-dev.who.int/app-builder/i18n/',
3535
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { environment as devEnvironment } from './environment.azure.dev';
2+
3+
/**
4+
* Environment file for local development.
5+
* Similar to dev, but with different urls, so no CORS issues.
6+
*/
7+
export const environment = {
8+
...devEnvironment,
9+
tinymceBaseUrl:
10+
'https://whoemssafedsta03.blob.core.windows.net/shared/dev/tinymce/',
11+
i18nUrl: 'https://whoemssafedsta03.blob.core.windows.net/shared/dev/i18n/',
12+
};

apps/web-widgets/src/environments/environment.azure.uat.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,6 @@ export const environment = {
2929
availableLanguages: ['en', 'test'],
3030
authConfig,
3131
theme,
32+
tinymceBaseUrl: 'https://ems2-test.who.int/app-builder/tinymce',
33+
i18nUrl: 'https://ems2-test.who.int/app-builder/i18n/',
3234
};

libs/shared/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ export * from './lib/survey/components/resource-custom-filters/resource-custom-f
111111
export * from './lib/survey/components/resource-dropdown/resource-dropdown.component';
112112
export * from './lib/survey/components/resource-select-text/resource-select-text.component';
113113
export * from './lib/survey/components/test-service-dropdown/test-service-dropdown.component';
114+
export * from './lib/survey/components/code-editor/code-editor.component';
114115

115116
/** Grid Layouts */
116117
export * from './lib/components/grid-layout/edit-layout-modal/public-api';

0 commit comments

Comments
 (0)