Skip to content

Commit bcbed93

Browse files
Merge remote-tracking branch 'origin/maven/fixes/9.0' into maven/release/9.0
2 parents b8d02c6 + 0c3665d commit bcbed93

File tree

3 files changed

+60
-42
lines changed

3 files changed

+60
-42
lines changed

Backend/services/core/src/main/java/org/edu_sharing/service/search/SearchServiceElastic.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,12 @@ public BoolQuery.Builder getPermissionsQuery(BoolQuery.Builder builder, String f
201201
}
202202

203203
public BoolQuery.Builder getPermissionsQuery(BoolQuery.Builder audienceQueryBuilder, String field, Set<String> authorities) {
204-
audienceQueryBuilder.minimumShouldMatch("1");
204+
BoolQuery.Builder bool = QueryBuilders.bool();
205+
bool.minimumShouldMatch("1");
205206
for (String a : authorities) {
206-
audienceQueryBuilder.should(should -> should.match(match -> match.field(field).query(a)));
207+
bool.should(should -> should.match(match -> match.field(field).query(a)));
207208
}
209+
audienceQueryBuilder.must(bool.build()._toQuery());
208210
return audienceQueryBuilder;
209211
}
210212

@@ -685,7 +687,6 @@ BoolQuery.Builder getGlobalConditions(List<String> authorityScope, List<String>
685687
BoolQuery.Builder permissionsFilter = QueryBuilders.bool().must(must -> must.bool(queryGlobalConditionsFactory::apply));
686688
String user = serviceRegistry.getAuthenticationService().getCurrentUserName();
687689
permissionsFilter.should(should -> should.match(match -> match.field("owner").query(user)));
688-
permissionsFilter.minimumShouldMatch("1");
689690
for (String permission : permissions) {
690691
permissionsFilter.should(s -> s.bool(bool -> getPermissionsQuery(bool, "permissions." + permission)));
691692
}

Backend/services/core/src/test/java/org/edu_sharing/service/search/SearchServiceElasticTest.java

+47-38
Original file line numberDiff line numberDiff line change
@@ -72,25 +72,28 @@ void getGlobalConditions() {
7272
SearchServiceElasticTestUtils.assertQuery(
7373
"{\n" +
7474
" \"bool\": {\n" +
75-
" \"minimum_should_match\": \"1\",\n" +
7675
" \"must\": [\n" +
7776
" {\n" +
7877
" \"bool\": {\n" +
79-
" \"minimum_should_match\": \"1\",\n" +
8078
" \"must\": [\n" +
8179
" {\n" +
82-
" \"match\": {\n" +
83-
" \"nodeRef.storeRef.protocol\": {\n" +
84-
" \"query\": \"workspace\"\n" +
85-
" }\n" +
80+
" \"bool\": {\n" +
81+
" \"minimum_should_match\": \"1\",\n" +
82+
" \"should\": [\n" +
83+
" {\n" +
84+
" \"match\": {\n" +
85+
" \"permissions.read\": {\n" +
86+
" \"query\": \"scope\"\n" +
87+
" }\n" +
88+
" }\n" +
89+
" }\n" +
90+
" ]\n" +
8691
" }\n" +
87-
" }\n" +
88-
" ],\n" +
89-
" \"should\": [\n" +
92+
" },\n" +
9093
" {\n" +
9194
" \"match\": {\n" +
92-
" \"permissions.read\": {\n" +
93-
" \"query\": \"scope\"\n" +
95+
" \"nodeRef.storeRef.protocol\": {\n" +
96+
" \"query\": \"workspace\"\n" +
9497
" }\n" +
9598
" }\n" +
9699
" }\n" +
@@ -115,34 +118,40 @@ void getGlobalConditions() {
115118
" },\n" +
116119
" {\n" +
117120
" \"bool\": {\n" +
118-
" \"minimum_should_match\": \"1\",\n" +
119-
" \"should\": [\n" +
120-
" {\n" +
121-
" \"match\": {\n" +
122-
" \"permissions.read\": {\n" +
123-
" \"query\": \"test_group1\"\n" +
124-
" }\n" +
125-
" }\n" +
126-
" },\n" +
127-
" {\n" +
128-
" \"match\": {\n" +
129-
" \"permissions.read\": {\n" +
130-
" \"query\": \"GROUP_EVERYONE\"\n" +
131-
" }\n" +
132-
" }\n" +
133-
" },\n" +
134-
" {\n" +
135-
" \"match\": {\n" +
136-
" \"permissions.read\": {\n" +
137-
" \"query\": \"tester\"\n" +
138-
" }\n" +
139-
" }\n" +
140-
" },\n" +
121+
" \"must\": [\n" +
141122
" {\n" +
142-
" \"match\": {\n" +
143-
" \"permissions.read\": {\n" +
144-
" \"query\": \"test_group2\"\n" +
145-
" }\n" +
123+
" \"bool\": {\n" +
124+
" \"minimum_should_match\": \"1\",\n" +
125+
" \"should\": [\n" +
126+
" {\n" +
127+
" \"match\": {\n" +
128+
" \"permissions.read\": {\n" +
129+
" \"query\": \"test_group1\"\n" +
130+
" }\n" +
131+
" }\n" +
132+
" },\n" +
133+
" {\n" +
134+
" \"match\": {\n" +
135+
" \"permissions.read\": {\n" +
136+
" \"query\": \"GROUP_EVERYONE\"\n" +
137+
" }\n" +
138+
" }\n" +
139+
" },\n" +
140+
" {\n" +
141+
" \"match\": {\n" +
142+
" \"permissions.read\": {\n" +
143+
" \"query\": \"tester\"\n" +
144+
" }\n" +
145+
" }\n" +
146+
" },\n" +
147+
" {\n" +
148+
" \"match\": {\n" +
149+
" \"permissions.read\": {\n" +
150+
" \"query\": \"test_group2\"\n" +
151+
" }\n" +
152+
" }\n" +
153+
" }\n" +
154+
" ]\n" +
146155
" }\n" +
147156
" }\n" +
148157
" ]\n" +

Frontend/src/app/features/mds/mds-editor/widgets/mds-editor-widget-chips/mds-editor-widget-chips.component.scss

+9-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,16 @@
33
mat-form-field {
44
width: 100%;
55
}
6+
/**
7+
prevent to long text from overflow the widget
8+
*/
9+
mat-chip {
10+
max-width: 225px;
11+
}
612
.mat-chip-label {
7-
@include limitLineLength(200px);
13+
@include limitLineLength(180px);
14+
display: inline-flex;
15+
flex-grow: 1;
816
}
917

1018
.input-wrapper {

0 commit comments

Comments
 (0)