Skip to content

Commit 99bfe13

Browse files
authored
Merge pull request #2985 from atmire/w2p-114596_CreatingTemplateItemResultsInPageWhichNeverFinishesLoading
Fixed the problem that creating template item results in page which never finishes loading
2 parents 3568acc + c5e3b18 commit 99bfe13

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

cypress/e2e/item-template.cy.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const ADD_TEMPLATE_ITEM_PAGE = '/collections/'.concat(Cypress.env('DSPACE_TEST_COLLECTION')).concat('/itemtemplate');
2+
3+
describe('Item Template', () => {
4+
beforeEach(() => {
5+
cy.visit(ADD_TEMPLATE_ITEM_PAGE);
6+
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
7+
});
8+
9+
it('should load properly', () => {
10+
cy.contains('.ds-header-row .lbl-cell', 'Field', { timeout: 10000 }).should('exist').should('be.visible');
11+
cy.contains('.ds-header-row b', 'Value', { timeout: 10000 }).should('exist').should('be.visible');
12+
cy.contains('.ds-header-row b', 'Lang', { timeout: 10000 }).should('exist').should('be.visible');
13+
cy.contains('.ds-header-row b', 'Edit', { timeout: 10000 }).should('exist').should('be.visible');
14+
});
15+
});

src/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ import {
2424
import {
2525
BehaviorSubject,
2626
combineLatest as observableCombineLatest,
27-
EMPTY,
2827
Observable,
28+
of,
2929
Subscription,
3030
} from 'rxjs';
3131
import {
@@ -188,7 +188,7 @@ export class DsoEditMetadataComponent implements OnInit, OnDestroy {
188188
const lazyProvider$: Observable<UpdateDataService<DSpaceObject>> = lazyDataService(this.dataServiceMap, this.dsoType, this.parentInjector);
189189
return lazyProvider$;
190190
} else {
191-
return EMPTY;
191+
return of(this.updateDataService);
192192
}
193193
}
194194

0 commit comments

Comments
 (0)