Skip to content

Commit 8669ec9

Browse files
committed
Merge branch '2.1.x' into bugfix/AB#67930_DB-duplicated-layers-on-map-change-in-the-map-settings # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
2 parents f2a9f95 + c1f739c commit 8669ec9

26 files changed

+238
-70
lines changed

apps/back-office/project.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,32 @@
287287
"includePaths": ["libs/safe/src/lib/style/themes/oort"]
288288
}
289289
},
290+
"oort-alimentaide": {
291+
"fileReplacements": [
292+
{
293+
"replace": "apps/back-office/src/environments/environment.ts",
294+
"with": "apps/back-office/src/environments/environment.oort.alimentaide.ts"
295+
}
296+
],
297+
"budgets": [
298+
{
299+
"type": "initial",
300+
"maximumWarning": "12mb",
301+
"maximumError": "15mb"
302+
},
303+
{
304+
"type": "anyComponentStyle",
305+
"maximumWarning": "6kb",
306+
"maximumError": "10kb"
307+
}
308+
],
309+
"baseHref": "/admin/",
310+
"deployUrl": "/admin/",
311+
"outputHashing": "all",
312+
"stylePreprocessorOptions": {
313+
"includePaths": ["libs/safe/src/lib/style/themes/oort"]
314+
}
315+
},
290316
"oort-demo": {
291317
"fileReplacements": [
292318
{
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import { AuthConfig } from 'angular-oauth2-oidc';
2+
import { theme } from '../themes/oort/oort.prod';
3+
import { sharedEnvironment } from './environment.shared';
4+
5+
/**
6+
* Authentication configuration
7+
*/
8+
const authConfig: AuthConfig = {
9+
issuer: 'https://id.oortcloud.tech/auth/realms/oort',
10+
redirectUri: 'https://alimentaide-973-guyane.oortcloud.tech/admin/',
11+
postLogoutRedirectUri:
12+
'https://alimentaide-973-guyane.oortcloud.tech/admin/auth/',
13+
clientId: 'oort-client',
14+
scope: 'openid profile email offline_access',
15+
responseType: 'code',
16+
showDebugInformation: false,
17+
};
18+
19+
/**
20+
* Environment file for local development.
21+
*/
22+
export const environment = {
23+
...sharedEnvironment,
24+
production: true,
25+
apiUrl: 'https://alimentaide-973-guyane.oortcloud.tech/api',
26+
subscriptionApiUrl: 'wss://alimentaide-973-guyane.oortcloud.tech/api',
27+
frontOfficeUri: 'https://alimentaide-973-guyane.oortcloud.tech',
28+
backOfficeUri: 'https://alimentaide-973-guyane.oortcloud.tech/admin/',
29+
module: 'backoffice',
30+
availableLanguages: ['fr', 'en'],
31+
authConfig,
32+
esriApiKey:
33+
'AAPKf2bae9b3f32943e2a8d58b0b96ffea3fj8Vt8JYDt1omhzN_lONXPRHN8B89umU-pA9t7ze1rfCIiiEVXizYEiFRFiVrl6wg',
34+
theme,
35+
availableWidgets: [
36+
'donut-chart',
37+
'line-chart',
38+
'bar-chart',
39+
'column-chart',
40+
'pie-chart',
41+
'grid',
42+
'text',
43+
'map',
44+
'summaryCard',
45+
],
46+
};

apps/front-office/project.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,30 @@
268268
"includePaths": ["libs/safe/src/lib/style/themes/oort"]
269269
}
270270
},
271+
"oort-alimentaide": {
272+
"fileReplacements": [
273+
{
274+
"replace": "apps/front-office/src/environments/environment.ts",
275+
"with": "apps/front-office/src/environments/environment.oort.alimentaide.ts"
276+
}
277+
],
278+
"budgets": [
279+
{
280+
"type": "initial",
281+
"maximumWarning": "12mb",
282+
"maximumError": "15mb"
283+
},
284+
{
285+
"type": "anyComponentStyle",
286+
"maximumWarning": "6kb",
287+
"maximumError": "10kb"
288+
}
289+
],
290+
"outputHashing": "all",
291+
"stylePreprocessorOptions": {
292+
"includePaths": ["libs/safe/src/lib/style/themes/oort"]
293+
}
294+
},
271295
"oort-demo": {
272296
"fileReplacements": [
273297
{

apps/front-office/src/app/graphql.module.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import { setContext } from '@apollo/client/link/context';
1111
import { WebSocketLink } from '@apollo/client/link/ws';
1212
import { getMainDefinition } from '@apollo/client/utilities';
1313
import { environment } from '../environments/environment';
14+
import extractFiles from 'extract-files/extractFiles.mjs';
15+
import isExtractableFile from 'extract-files/isExtractableFile.mjs';
1416

1517
/**
1618
* Configuration of the Apollo client.
@@ -28,6 +30,7 @@ export const createApollo = (httpLink: HttpLink): ApolloClientOptions<any> => {
2830

2931
const http = httpLink.create({
3032
uri: `${environment.apiUrl}/graphql`,
33+
extractFiles: (body) => extractFiles(body, isExtractableFile),
3134
});
3235

3336
const ws = new WebSocketLink({
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { AuthConfig } from 'angular-oauth2-oidc';
2+
import { theme } from '../themes/oort/oort.prod';
3+
import { sharedEnvironment } from './environment.shared';
4+
5+
/** Authentication configuration of the module. */
6+
const authConfig: AuthConfig = {
7+
issuer: 'https://id.oortcloud.tech/auth/realms/oort',
8+
redirectUri: 'https://alimentaide-973-guyane.oortcloud.tech/',
9+
postLogoutRedirectUri: 'https://alimentaide-973-guyane.oortcloud.tech/auth/',
10+
clientId: 'oort-client',
11+
scope: 'openid profile email offline_access',
12+
responseType: 'code',
13+
showDebugInformation: false,
14+
};
15+
16+
/** Environment configuration */
17+
export const environment = {
18+
...sharedEnvironment,
19+
production: true,
20+
apiUrl: 'https://alimentaide-973-guyane.oortcloud.tech/api',
21+
subscriptionApiUrl: 'wss://alimentaide-973-guyane.oortcloud.tech/api',
22+
frontOfficeUri: 'https://alimentaide-973-guyane.oortcloud.tech',
23+
backOfficeUri: 'https://alimentaide-973-guyane.oortcloud.tech/admin/',
24+
availableLanguages: ['fr', 'en'],
25+
authConfig,
26+
esriApiKey:
27+
'AAPKf2bae9b3f32943e2a8d58b0b96ffea3fj8Vt8JYDt1omhzN_lONXPRHN8B89umU-pA9t7ze1rfCIiiEVXizYEiFRFiVrl6wg',
28+
theme,
29+
};

libs/safe/src/lib/components/search-resource-grid-modal/search-resource-grid-modal.component.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ <h2 *ngIf="!selectable">{{ 'common.record.few' | translate }}</h2>
2626
<ui-button
2727
category="secondary"
2828
variant="primary"
29-
uiDialogClose
3029
cdkFocusInitial
3130
(click)="closeModal()"
3231
*ngIf="selectable"

libs/safe/src/lib/components/ui/aggregation-builder/aggregation-builder.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<safe-tagbox
66
class="flex flex-1"
77
[choices$]="fields$"
8-
[formControl]="$any(aggregationForm.get('sourceFields'))"
8+
[control]="$any(aggregationForm.get('sourceFields'))"
99
[label]="'components.aggregationBuilder.sourceFields' | translate"
1010
></safe-tagbox>
1111
</div>

libs/safe/src/lib/components/ui/tagbox/tagbox.component.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
(optionSelected)="add($event)"
3737
[uiChipListFor]="chipList"
3838
[chipInputSeparatorKeyCodes]="separatorKeysCodes"
39-
[disabled]="choicesEmpty"
4039
class="bg-transparent block overflow-hidden border-0 rounded-md w-full p-0 text-gray-900 placeholder:text-gray-400 sm:text-sm sm:leading-6 focus:ring-0 focus:ring-inset"
4140
(chipTokenEnd)="add($event)"
4241
/>

libs/safe/src/lib/components/ui/tagbox/tagbox.component.ts

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,15 @@ export class SafeTagboxComponent
3030
public separatorKeysCodes: number[] = [ENTER, COMMA];
3131
@ViewChild('textInput') private textInput?: ElementRef<HTMLInputElement>;
3232

33-
public inputControl: FormControl = new UntypedFormControl('');
34-
public showInput = false;
3533
public choicesEmpty = false;
34+
public inputControl: FormControl = new UntypedFormControl({
35+
value: '',
36+
disabled: this.choicesEmpty,
37+
});
38+
public showInput = false;
3639

3740
// === OUTPUT CONTROL ===
38-
@Input() formControl!: FormControl;
41+
@Input() control!: FormControl;
3942

4043
/**
4144
* Tagbox constructor
@@ -47,9 +50,14 @@ export class SafeTagboxComponent
4750
ngOnInit(): void {
4851
this.choices$.pipe(takeUntil(this.destroy$)).subscribe((choices: any[]) => {
4952
this.choicesEmpty = choices.length === 0;
53+
if (this.choicesEmpty) {
54+
this.inputControl.disable();
55+
} else {
56+
this.inputControl.enable();
57+
}
5058
this.selectedChoices = this.choicesEmpty
5159
? []
52-
: this.formControl.value
60+
: this.control.value
5361
.map((value: string) =>
5462
choices.find((choice) => value === choice[this.valueKey])
5563
)
@@ -105,20 +113,20 @@ export class SafeTagboxComponent
105113
* @param event Chip event with the text input.
106114
*/
107115
add(event: string | any): void {
108-
const value = (event[this.displayKey] ?? event).trim();
109-
116+
const value = event[this.displayKey] ?? event;
110117
if (
111118
value &&
112119
this.availableChoices.some((x) => x[this.displayKey] === value)
113120
) {
114121
this.selectedChoices.push(
115122
this.availableChoices.find((x) => x[this.displayKey] === value)
116123
);
117-
this.formControl.setValue(
118-
this.selectedChoices.map((x) => x[this.valueKey])
119-
);
124+
this.control.setValue(this.selectedChoices.map((x) => x[this.valueKey]));
120125
this.filteredChoices = this.availableChoices.filter(
121-
(x) => x[this.displayKey] !== value
126+
(choice) =>
127+
!this.selectedChoices.find(
128+
(x) => x[this.valueKey] === choice[this.valueKey]
129+
)
122130
);
123131
}
124132
this.inputControl.setValue('', { emitEvent: false });
@@ -133,21 +141,17 @@ export class SafeTagboxComponent
133141
* @param choice Choice to remove.
134142
*/
135143
remove(choice: any): void {
136-
const index = this.selectedChoices.findIndex(
137-
(x) => x[this.valueKey] === choice[this.valueKey]
138-
);
139-
140-
if (index >= 0) {
141-
this.selectedChoices.splice(index, 1);
144+
if (choice) {
145+
this.selectedChoices = this.selectedChoices.filter(
146+
(x) => x[this.valueKey] !== choice[this.valueKey]
147+
);
142148
this.filteredChoices = this.availableChoices.filter(
143149
(choice) =>
144150
!this.selectedChoices.find(
145151
(x) => x[this.valueKey] === choice[this.valueKey]
146152
)
147153
);
148-
this.formControl.setValue(
149-
this.selectedChoices.map((x) => x[this.valueKey])
150-
);
154+
this.control.setValue(this.selectedChoices.map((x) => x[this.valueKey]));
151155
}
152156
}
153157
}

libs/safe/src/lib/components/users/users.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ export class SafeUsersComponent
102102
(this.searchText.trim().length === 0 ||
103103
(this.searchText.trim().length > 0 &&
104104
!!data.name &&
105-
data.name.toLowerCase().includes(this.searchText.trim()))) &&
105+
data.name.toLowerCase().includes(this.searchText.trim())) ||
106+
(!!data.username &&
107+
data.username.toLowerCase().includes(this.searchText.trim()))) &&
106108
(this.roleFilter.trim().toLowerCase().length === 0 ||
107109
(this.roleFilter.trim().toLowerCase().length > 0 &&
108110
!!data.roles &&

0 commit comments

Comments
 (0)