@@ -5,7 +5,7 @@ import { RemoteData } from '../../../../../core/data/remote-data';
55import { ActivatedRoute , Router } from '@angular/router' ;
66import { map , take } from 'rxjs/operators' ;
77import { getFirstCompletedRemoteData , getFirstSucceededRemoteData } from '../../../../../core/shared/operators' ;
8- import { hasValue , isEmpty } from '../../../../empty.util' ;
8+ import { isEmpty } from '../../../../empty.util' ;
99import { ResourceType } from '../../../../../core/shared/resource-type' ;
1010import { ComColDataService } from '../../../../../core/data/comcol-data.service' ;
1111import { NotificationsService } from '../../../../notifications/notifications.service' ;
@@ -50,29 +50,20 @@ export class ComcolMetadataComponent<TDomain extends Community | Collection> imp
5050 * @param event The event returned by the community/collection form. Contains the new dso and logo uploader
5151 */
5252 onSubmit ( event ) {
53-
54- const uploader = event . uploader ;
55- const deleteLogo = event . deleteLogo ;
56-
57- const newLogo = hasValue ( uploader ) && uploader . queue . length > 0 ;
58- if ( newLogo ) {
59- this . dsoDataService . getLogoEndpoint ( event . dso . uuid ) . pipe ( take ( 1 ) ) . subscribe ( ( href : string ) => {
60- uploader . options . url = href ;
61- uploader . uploadAll ( ) ;
62- } ) ;
63- }
64-
6553 if ( ! isEmpty ( event . operations ) ) {
6654 this . dsoDataService . patch ( event . dso , event . operations ) . pipe ( getFirstCompletedRemoteData ( ) )
6755 . subscribe ( async ( response : RemoteData < DSpaceObject > ) => {
6856 if ( response . hasSucceeded ) {
57+ await this . router . navigate ( [ this . frontendURL + event . dso . uuid ] ) ;
6958 this . notificationsService . success ( null , this . translate . get ( `${ this . type . value } .edit.notifications.success` ) ) ;
7059 } else if ( response . statusCode === 403 ) {
7160 this . notificationsService . error ( null , this . translate . get ( `${ this . type . value } .edit.notifications.unauthorized` ) ) ;
7261 } else {
7362 this . notificationsService . error ( null , this . translate . get ( `${ this . type . value } .edit.notifications.error` ) ) ;
7463 }
7564 } ) ;
65+ } else {
66+ this . router . navigate ( [ this . frontendURL + event . dso . uuid ] ) ;
7667 }
7768 }
7869
0 commit comments