-
Notifications
You must be signed in to change notification settings - Fork 532
[DSpace-CRIS] Administrative Edit of archived items via submission form and security configuration for metadata visibility (Frontend) #5145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 25 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
1e9fbee
[DURACOM-453] add edit item menu and data service
FrancescoMolinaro a3c14c5
[DURACOM-453] finalize improvement for submission and edit mode
FrancescoMolinaro e0bb5f9
Merge branch 'task/main/DURACOM-444' into task/main/DURACOM-453
FrancescoMolinaro 664e44f
Merge branch 'task/main/DURACOM-426' into task/main/DURACOM-453
FrancescoMolinaro 2edc805
Merge remote-tracking branch 'gitHub/main' into task/main/DURACOM-453
FrancescoMolinaro 850a973
[DURACOM-453] add metadata security and finilize edit mode
FrancescoMolinaro 87cfa6e
[DURACOM-453] fix observable issue, add full projection
FrancescoMolinaro ab0885e
[DURACOM-453] add shared submission config and labels
FrancescoMolinaro c352534
[DURACOM-453] port metadata security update, init and administrate
FrancescoMolinaro 31cafeb
[DURACOM-453] port error parsing in edit mode
FrancescoMolinaro 8c656fe
Merge remote-tracking branch 'gitHub/main' into task/main/DURACOM-453
FrancescoMolinaro 6369166
[DURACOM-453] remove collection form required from fields, fix metada…
FrancescoMolinaro b383541
[DURACOM-453] fix collection form metadata name
FrancescoMolinaro cb4bc13
[DURACOM-453] fix security level patch update, fix style in admin tab…
FrancescoMolinaro db7bd44
[DURACOM-453] handle errors on missing security settings endpoint
FrancescoMolinaro 12047a5
Merge remote-tracking branch 'gitHub/main' into task/main/DURACOM-453
FrancescoMolinaro 1faf25a
[DURACOM-453] fix missing security config in tests
FrancescoMolinaro 7746789
Merge remote-tracking branch 'gitHub/main' into task/main/DURACOM-453
FrancescoMolinaro 386078e
[DURACOM-453] refactor, hide *-edit forms, fix cache issue, add type …
FrancescoMolinaro 8982db7
[DURACOM-453] add back button to footer, add breadcrumb in edit page,…
FrancescoMolinaro a84e2d3
[DURACOM-453] fix issue with missing collection step in edit mode, re…
FrancescoMolinaro 2a8b2c5
Merge remote-tracking branch 'gitHub/main' into task/main/DURACOM-453
FrancescoMolinaro 7ebc02f
Merge remote-tracking branch 'gitHub/main' into task/main/DURACOM-453
FrancescoMolinaro c46c5a6
[DURACOM-453] fix lint
FrancescoMolinaro bca2d61
[DURACOM-453] remove opened property, fix cache issue for bitstreams,…
FrancescoMolinaro c2c8abe
[DURACOM-453] correct other workspace config to use came case
FrancescoMolinaro e9705f0
[DURACOM-453] prevent possible issue with spy order on submission test
FrancescoMolinaro ac2d4de
[DURACOM-453] fix error handling in menu provider, update labels
FrancescoMolinaro 1b5114c
Merge remote-tracking branch '4science_gitHub/task/main/DURACOM-453' …
FrancescoMolinaro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/app/core/breadcrumbs/edit-item-breadcrumb.resolver.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| import { | ||
| EnvironmentInjector, | ||
| runInInjectionContext, | ||
| } from '@angular/core'; | ||
| import { TestBed } from '@angular/core/testing'; | ||
| import { editItemBreadcrumbResolver } from '@dspace/core/breadcrumbs/edit-item-breadcrumb.resolver'; | ||
| import { Item } from '@dspace/core/shared/item.model'; | ||
| import { getTestScheduler } from 'jasmine-marbles'; | ||
| import { of } from 'rxjs'; | ||
|
|
||
| import { ItemDataService } from '../data/item-data.service'; | ||
| import { createSuccessfulRemoteDataObject$ } from '../utilities/remote-data.utils'; | ||
| import { DSOBreadcrumbsService } from './dso-breadcrumbs.service'; | ||
|
|
||
| describe('editItemBreadcrumbResolver', () => { | ||
| describe('resolve', () => { | ||
| let resolver: any; | ||
| let dsoBreadcrumbService: any; | ||
| let itemDataService: any; | ||
| let testItem: Item; | ||
| let uuid: string; | ||
| let breadcrumbUrl: string; | ||
| let currentUrl: string; | ||
|
|
||
| beforeEach(() => { | ||
| uuid = '1234-65487-12354-1235'; | ||
| breadcrumbUrl = `/items/${uuid}`; | ||
| currentUrl = `${breadcrumbUrl}/edit`; | ||
| testItem = Object.assign(new Item(), { | ||
| uuid: uuid, | ||
| type: 'item', | ||
| }); | ||
|
|
||
| itemDataService = { | ||
| findById: () => createSuccessfulRemoteDataObject$(testItem), | ||
| }; | ||
|
|
||
| dsoBreadcrumbService = { | ||
| getRepresentativeName: () => testItem.uuid, | ||
| getBreadcrumbs: () => of({ provider: dsoBreadcrumbService, key: testItem, url: breadcrumbUrl }), | ||
| }; | ||
|
|
||
| TestBed.configureTestingModule({ | ||
| providers: [ | ||
| { provide: DSOBreadcrumbsService, useValue: dsoBreadcrumbService }, | ||
| { provide: ItemDataService, useValue: itemDataService }, | ||
| ], | ||
| }); | ||
|
|
||
| resolver = editItemBreadcrumbResolver; | ||
| }); | ||
|
|
||
| it('should resolve a breadcrumb config for the correct uuid', () => { | ||
| const injector = TestBed.inject(EnvironmentInjector); | ||
| const resolvedConfig = runInInjectionContext(injector, () => | ||
| resolver({ params: { id: testItem.uuid + ':FULL' } } as any, { url: currentUrl } as any), | ||
| ); | ||
| const expectedConfig = { provider: dsoBreadcrumbService, key: testItem, url: breadcrumbUrl }; | ||
| getTestScheduler().expectObservable(resolvedConfig).toBe('(a|)', { a: expectedConfig }); | ||
| }); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import { | ||
| ActivatedRouteSnapshot, | ||
| ResolveFn, | ||
| RouterStateSnapshot, | ||
| } from '@angular/router'; | ||
| import { itemBreadcrumbResolver } from '@dspace/core/breadcrumbs/item-breadcrumb.resolver'; | ||
| import { Observable } from 'rxjs'; | ||
|
|
||
| import { Item } from '../shared/item.model'; | ||
| import { BreadcrumbConfig } from './models/breadcrumb-config.model'; | ||
|
|
||
| /** | ||
| * The resolve function that resolves the BreadcrumbConfig object for an Item in edit mode | ||
| */ | ||
| export const editItemBreadcrumbResolver: ResolveFn<BreadcrumbConfig<Item>> = ( | ||
| route: ActivatedRouteSnapshot, | ||
| state: RouterStateSnapshot, | ||
| ): Observable<BreadcrumbConfig<Item>> => { | ||
| const routeWithCorrectId = Object.assign(route, { | ||
| params: { | ||
| ...route.params, | ||
| id: route.params.id.split(':')[0], | ||
| }, | ||
| }); | ||
|
|
||
| return itemBreadcrumbResolver(routeWithCorrectId, state) as Observable<BreadcrumbConfig<Item>>; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.