Skip to content

Commit 2f1e656

Browse files
Merge branch 'dspace-cris-2024_02_x' into task/dspace-cris-2024_02_x/DSC-2193
# Conflicts: # bitbucket-pipelines.yml
2 parents 675296e + 4303b63 commit 2f1e656

12 files changed

Lines changed: 31 additions & 16 deletions

File tree

src/app/app-routes.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,15 +187,14 @@ export const APP_ROUTES: Route[] = [
187187
data: {
188188
isBackDoor: true,
189189
},
190-
canMatch: [() => environment.auth.disableStandardLogin],
190+
canMatch: [() => !environment.auth.disableStandardLogin],
191191
},
192192
{
193193
path: 'login',
194194
loadChildren: () => import('./login-page/login-page-routes').then((m) => m.ROUTES),
195195
data: {
196196
isBackDoor: false,
197197
},
198-
canMatch: [() => !environment.auth.disableStandardLogin],
199198
},
200199
{
201200
path: 'logout',

src/app/app.component.spec.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ const initialState = {
7171
};
7272

7373
const itemPageUrl = '/entities/publication/3b6ef8e8-15a1-4607-abf8-2a6fbd572346';
74+
const itemPageCustomUrl = '/entities/publication/aCustomUrl';
7475

7576
export function getMockLocaleService(): LocaleService {
7677
return jasmine.createSpyObj('LocaleService', {
@@ -206,6 +207,14 @@ describe('App component', () => {
206207
expect(comp.isRouteLoading$.value).toBeTrue();
207208
}));
208209

210+
it('should show loading for item page administrative edit if custom url is used', fakeAsync(() => {
211+
routeServiceMock.getCurrentUrl.and.returnValue(of(itemPageCustomUrl));
212+
routerEventsObs.next(new NavigationStart(2, itemPageCustomUrl + '/edit'));
213+
fixture.detectChanges();
214+
tick();
215+
expect(comp.isRouteLoading$.value).toBeTrue();
216+
}));
217+
209218
it('should not show loading navigating between item pages in administrative edit', fakeAsync(() => {
210219
routeServiceMock.getCurrentUrl.and.returnValue(of(itemPageUrl + '/edit'));
211220
routerEventsObs.next(new NavigationStart(2, itemPageUrl + '/edit/status'));

src/app/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ export class AppComponent implements OnInit, AfterViewInit {
224224
}
225225

226226
private isAdministrativeEditItemPageRoute(nextUrl: string, currentUrl: string): boolean {
227-
const editPageRegEx = /\/(entities\/[^\/]+|items)\/[0-9a-f-]{36}\/edit(?:\/.*)?$/;
227+
const editPageRegEx = /\/(entities\/[^/]+|items)\/[^/]+\/edit(?:\/.*)?$/;
228228
return editPageRegEx.test(nextUrl) && !editPageRegEx.test(currentUrl);
229229
}
230230

src/app/cris-layout/cris-layout-matrix/cris-layout-box-container/boxes/metadata/rendering-types/metadataGroup/table/table.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</tr>
99
<tr *ngFor="let index of componentsToBeRenderedMap.keys();">
1010
<td *ngFor="let mdg of componentsToBeRenderedMap.get(index)">
11-
<ds-metadata-render class="w-100"
11+
<ds-metadata-render class="w-100 auto-phrase"
1212
[item]="item"
1313
[field]="mdg.field"
1414
[metadataValue]="mdg.value"></ds-metadata-render>

src/app/cris-layout/cris-layout-matrix/cris-layout-box-container/boxes/metadata/rendering-types/metadataGroup/table/table.component.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22
margin-left: -0.75rem !important;
33
margin-right: -0.75rem !important;
44
}
5+
6+
td {
7+
word-break: auto-phrase;
8+
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
:host {
22
word-break: break-word;
3+
&.auto-phrase {
4+
word-break: auto-phrase;
5+
}
36
}

src/app/item-page/item-page.resolver.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ export const itemPageResolver: ResolveFn<RemoteData<Item>> = (
7575
map((rd: RemoteData<Item>) => {
7676
store.dispatch(new ResolvedAction(state.url, rd.payload));
7777
if (rd.hasSucceeded && hasValue(rd.payload)) {
78-
const itemRoute = router.parseUrl(getItemPageRoute(rd.payload)).toString();
78+
const isItemEditPage = state.url.includes('/edit');
79+
const itemRoute = isItemEditPage ? state.url : router.parseUrl(getItemPageRoute(rd.payload)).toString();
7980
// Check if custom url not empty and if the current id parameter is different from the custom url redirect to custom url
8081
if (hasValue(rd.payload.metadata) && isNotEmpty(rd.payload.metadata['cris.customurl'])) {
8182
if (route.params.id !== rd.payload.metadata['cris.customurl'][0].value) {

src/app/shared/log-in/log-in.component.spec.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ describe('LogInComponent', () => {
138138

139139
it('should render a log-in container component for each auth method available', () => {
140140
const loginContainers = fixture.debugElement.queryAll(By.css('ds-log-in-container'));
141-
expect(loginContainers.length).toBe(2);
141+
expect(loginContainers.length).toBe(1);
142142

143143
});
144144

@@ -154,14 +154,15 @@ describe('LogInComponent', () => {
154154
expect(result).toEqual([{ authMethodType: AuthMethodType.Password, position: 1 }]);
155155
});
156156

157-
it('excludes password method when standard login is disabled', () => {
157+
it('does not exclude password method when standard login is disabled', () => {
158158
const authMethods = [
159159
{ authMethodType: AuthMethodType.Password, position: 1 },
160160
{ authMethodType: AuthMethodType.Shibboleth, position: 2 },
161161
];
162162
component.excludedAuthMethod = undefined;
163163
const result = component.filterAndSortAuthMethods(authMethods, false, true);
164164
expect(result).toEqual([
165+
{ authMethodType: AuthMethodType.Password, position: 1 },
165166
{ authMethodType: AuthMethodType.Shibboleth, position: 2 },
166167
]);
167168
});
@@ -176,7 +177,6 @@ describe('LogInComponent', () => {
176177
component.excludedAuthMethod = AuthMethodType.Ip;
177178
const result = component.filterAndSortAuthMethods(authMethods, isBackdoor);
178179
expect(result).toEqual([
179-
{ authMethodType: AuthMethodType.Password, position: 1 },
180180
{ authMethodType: AuthMethodType.Shibboleth, position: 3 },
181181
]);
182182
});
@@ -191,7 +191,6 @@ describe('LogInComponent', () => {
191191
const result = component.filterAndSortAuthMethods(authMethods, isBackdoor);
192192
expect(result).toEqual([
193193
{ authMethodType: AuthMethodType.Shibboleth, position: 1 },
194-
{ authMethodType: AuthMethodType.Password, position: 2 },
195194
]);
196195
});
197196
});

src/app/shared/log-in/log-in.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ export class LogInComponent implements OnInit, OnDestroy {
167167
if (isBackdoor) {
168168
return authM.authMethodType === AuthMethodType.Password;
169169
}
170-
if (isStandardLoginDisabled) {
170+
if (!isStandardLoginDisabled) {
171171
return authM.authMethodType !== AuthMethodType.Password;
172172
}
173173
return true;

src/assets/i18n/en.json5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1893,7 +1893,7 @@
18931893

18941894
"context-menu.actions.audit-item.btn": "Audit",
18951895

1896-
"context-menu.actions.bulk-import.btn": "Import items into collection",
1896+
"context-menu.actions.bulk-import.btn": "Import into collection",
18971897

18981898
"context-menu.actions.claim.btn": "Claim this profile",
18991899

0 commit comments

Comments
 (0)