Skip to content

Commit e0a97af

Browse files
committed
merge 2.0.x
2 parents 37289f0 + bd171c7 commit e0a97af

File tree

289 files changed

+28585
-4803
lines changed

Some content is hidden

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

289 files changed

+28585
-4803
lines changed

.devops/sit-CD.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Node.js with Angular
2+
# Build a Node.js project that uses Angular.
3+
# Add steps that analyze code, save build artifacts, deploy, and more:
4+
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
5+
6+
trigger:
7+
- stage
8+
9+
pool:
10+
vmImage: ubuntu-latest
11+
12+
steps:
13+
- task: NodeTool@0
14+
inputs:
15+
versionSpec: '18.x'
16+
displayName: 'Install Node.js'
17+
18+
- script: |
19+
npm install
20+
npx nx run front-office:build:azure-sit
21+
npx nx run back-office:build:azure-sit
22+
displayName: 'npm install and build the apps'
23+
24+
- task: ArchiveFiles@2
25+
inputs:
26+
rootFolderOrFile: '$(System.DefaultWorkingDirectory)/dist/apps/front-office'
27+
includeRootFolder: false
28+
archiveType: 'zip'
29+
archiveFile: '$(Build.ArtifactStagingDirectory)/sit/front-office/$(Build.BuildId).zip'
30+
replaceExistingArchive: true
31+
32+
- task: ArchiveFiles@2
33+
inputs:
34+
rootFolderOrFile: '$(System.DefaultWorkingDirectory)/dist/apps/back-office'
35+
includeRootFolder: false
36+
archiveType: 'zip'
37+
archiveFile: '$(Build.ArtifactStagingDirectory)/sit/back-office/$(Build.BuildId).zip'
38+
replaceExistingArchive: true
39+
40+
- task: PublishBuildArtifacts@1
41+
inputs:
42+
PathtoPublish: '$(Build.ArtifactStagingDirectory)/sit/front-office/$(Build.BuildId).zip'
43+
ArtifactName: 'sit-front-office'
44+
publishLocation: 'Container'
45+
46+
- task: PublishBuildArtifacts@1
47+
inputs:
48+
PathtoPublish: '$(Build.ArtifactStagingDirectory)/sit/back-office/$(Build.BuildId).zip'
49+
ArtifactName: 'sit-back-office'
50+
publishLocation: 'Container'

.github/workflows/github-pages.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
name: Github Pages
22

33
on:
4-
push:
5-
branches:
6-
- tailwind
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: write
78

89
concurrency:
910
group: ${{ github.workflow }}-${{ github.ref }}
@@ -56,6 +57,9 @@ jobs:
5657
steps:
5758
- name: Checkout
5859
uses: actions/checkout@v3
60+
- name: Get branch name
61+
id: branch-name
62+
uses: tj-actions/branch-names@v6
5963
- name: Download storybook
6064
uses: actions/download-artifact@v1
6165
with:
@@ -68,5 +72,5 @@ jobs:
6872
repository-name: ReliefApplications/ReliefApplications.github.io
6973
branch: master
7074
folder: dist/ui
71-
target-folder: oort/ui
75+
target-folder: oort/frontend/storybook/${{ steps.branch-name.outputs.current_branch }}
7276
clean: true

.github/workflows/storybook.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,5 @@ jobs:
7272
repository-name: ReliefApplications/ReliefApplications.github.io
7373
branch: master
7474
folder: storybook
75-
target-folder: oort/frontend/${{ steps.branch-name.outputs.current_branch }}/storybook
75+
target-folder: oort/frontend/storybook/${{ steps.branch-name.outputs.current_branch }}
7676
clean: true

.scripts/build-widgets.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
const fs = require('fs-extra');
22
const concat = require('concat');
33

4-
build = async () => {
5-
const files = [
6-
'./dist/web-widgets/runtime.js',
7-
'./dist/web-widgets/polyfills.js',
8-
// './dist/web-widgets/es2015-polyfills.js',
9-
// './dist/web-widgets/scripts.js',
10-
'./dist/web-widgets/main.js',
11-
];
4+
const filesToFind = ['runtime', 'polyfill', 'main'];
5+
6+
const directory = './dist/apps/web-widgets';
127

8+
build = async () => {
9+
const files = fs
10+
.readdirSync(directory)
11+
.filter((name) => filesToFind.some((x) => name.startsWith(x)));
1312
await fs.ensureDir('widgets');
14-
await concat(files, 'widgets/app-builder.js');
13+
await concat(
14+
files.map((name) => `${directory}/${name}`),
15+
'widgets/app-builder.js'
16+
);
1517
};
1618
build();

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
## [2.0.9](https://github.com/ReliefApplications/oort-frontend/compare/v2.0.8...v2.0.9) (2023-08-29)
2+
3+
4+
### Bug Fixes
5+
6+
* Change detection on POST choices by url ([#1764](https://github.com/ReliefApplications/oort-frontend/issues/1764)) ([a6c740e](https://github.com/ReliefApplications/oort-frontend/commit/a6c740ef65ca8c736d1277f6ef256a42930928b1))
7+
* storybook not building ([7f17a8c](https://github.com/ReliefApplications/oort-frontend/commit/7f17a8c22cb148c8bb87901861ebc2a56d6bb09d))
8+
9+
## [2.0.8](https://github.com/ReliefApplications/oort-frontend/compare/v2.0.7...v2.0.8) (2023-08-25)
10+
11+
12+
### Bug Fixes
13+
14+
* aplly search to add new form page/step graphql-select ([#1739](https://github.com/ReliefApplications/oort-frontend/issues/1739)) ([3653dcc](https://github.com/ReliefApplications/oort-frontend/commit/3653dcc3080e712cf4529e5d39bbb23794e15d2b))
15+
116
## [2.0.7](https://github.com/ReliefApplications/oort-frontend/compare/v2.0.6...v2.0.7) (2023-08-17)
217

318

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,14 @@ npx nx run ui:build-storybook
150150

151151
Pushing the code on the repo should automatically deploy storybook on a public environment.
152152

153+
## Web components
154+
155+
To test web components, you can:
156+
- go to this repo: https://github.com/ReliefApplications/app-builder-widgets-poc
157+
- Switch to the branch: https://github.com/ReliefApplications/app-builder-widgets-poc/tree/fix/68747_add_forms_and_missing_styles_file
158+
- execute: `npm i && npm run start`
159+
You should find under the form widget dropdown some form types in order to test the form web component.
160+
153161
<!-- ## Build the web components
154162
155163
We first need to generate the elements, using this command:

apps/back-office/jest.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ export default {
1111
},
1212
},
1313
coverageDirectory: '../../coverage/apps/back-office',
14+
testPathIgnorePatterns: [
15+
"/node_modules/",
16+
"<rootDir>/src/app/__mocks__/"
17+
],
1418
transform: {
1519
'^.+\\.(ts|mjs|js|html)$': 'jest-preset-angular',
1620
},

apps/back-office/project.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,32 @@
154154
"includePaths": ["libs/safe/src/lib/style/themes/default"]
155155
}
156156
},
157+
"azure-sit": {
158+
"fileReplacements": [
159+
{
160+
"replace": "apps/back-office/src/environments/environment.ts",
161+
"with": "apps/back-office/src/environments/environment.azure.sit.ts"
162+
}
163+
],
164+
"budgets": [
165+
{
166+
"type": "initial",
167+
"maximumWarning": "12mb",
168+
"maximumError": "15mb"
169+
},
170+
{
171+
"type": "anyComponentStyle",
172+
"maximumWarning": "6kb",
173+
"maximumError": "10kb"
174+
}
175+
],
176+
"baseHref": "/backoffice/",
177+
"deployUrl": "/backoffice/",
178+
"outputHashing": "all",
179+
"stylePreprocessorOptions": {
180+
"includePaths": ["libs/safe/src/lib/style/themes/default"]
181+
}
182+
},
157183
"azure-dev": {
158184
"fileReplacements": [
159185
{

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

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
import { ComponentFixture, TestBed } from '@angular/core/testing';
2-
2+
import { ActivatedRoute } from '@angular/router';
33
import { AppPreviewComponent } from './app-preview.component';
4+
import { of } from 'rxjs';
5+
import { ApolloTestingModule } from 'apollo-angular/testing';
6+
import {
7+
TranslateFakeLoader,
8+
TranslateLoader,
9+
TranslateModule,
10+
TranslateService,
11+
} from '@ngx-translate/core';
12+
import {
13+
OAuthService,
14+
UrlHelperService,
15+
OAuthLogger,
16+
DateTimeProvider,
17+
} from 'angular-oauth2-oidc';
18+
import { HttpClientTestingModule } from '@angular/common/http/testing';
19+
import { AppAbility } from '@oort-front/safe';
20+
import { SafeLayoutModule } from '@oort-front/safe';
21+
import { DialogModule } from '@angular/cdk/dialog';
22+
import { AppPreviewModule } from './app-preview.module';
423

524
describe('AppPreviewComponent', () => {
625
let component: AppPreviewComponent;
@@ -9,6 +28,40 @@ describe('AppPreviewComponent', () => {
928
beforeEach(async () => {
1029
await TestBed.configureTestingModule({
1130
declarations: [AppPreviewComponent],
31+
providers: [
32+
TranslateService,
33+
OAuthService,
34+
UrlHelperService,
35+
OAuthLogger,
36+
DateTimeProvider,
37+
AppAbility,
38+
{
39+
provide: ActivatedRoute,
40+
useValue: {
41+
params: of({}),
42+
},
43+
},
44+
{
45+
provide: 'environment',
46+
useValue: {
47+
availableLanguages: [],
48+
theme: {},
49+
},
50+
},
51+
],
52+
imports: [
53+
ApolloTestingModule,
54+
HttpClientTestingModule,
55+
SafeLayoutModule,
56+
DialogModule,
57+
AppPreviewModule,
58+
TranslateModule.forRoot({
59+
loader: {
60+
provide: TranslateLoader,
61+
useClass: TranslateFakeLoader,
62+
},
63+
}),
64+
]
1265
}).compileComponents();
1366
});
1467

0 commit comments

Comments
 (0)