mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Merge branch 'DURACOM-234' into DURACOM-240-mathjax
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import {
|
||||
AsyncPipe,
|
||||
NgClass,
|
||||
NgFor,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import {
|
||||
@@ -83,6 +84,7 @@ import { ValidateEmailNotTaken } from './validators/email-taken.validator';
|
||||
imports: [
|
||||
FormComponent,
|
||||
NgIf,
|
||||
NgFor,
|
||||
AsyncPipe,
|
||||
TranslateModule,
|
||||
NgClass,
|
||||
|
@@ -1,6 +1,7 @@
|
||||
import {
|
||||
AsyncPipe,
|
||||
NgClass,
|
||||
NgFor,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import {
|
||||
@@ -54,6 +55,7 @@ import { LdnService } from '../ldn-services-model/ldn-services.model';
|
||||
changeDetection: ChangeDetectionStrategy.Default,
|
||||
imports: [
|
||||
NgIf,
|
||||
NgFor,
|
||||
TranslateModule,
|
||||
AsyncPipe,
|
||||
PaginationComponent,
|
||||
|
@@ -1,7 +1,5 @@
|
||||
import { SearchResult } from '../../../shared/search/models/search-result.model';
|
||||
import { searchResultFor } from '../../../shared/search/search-result-element-decorator';
|
||||
import { AdminNotifyMessage } from './admin-notify-message.model';
|
||||
|
||||
@searchResultFor(AdminNotifyMessage)
|
||||
export class AdminNotifySearchResult extends SearchResult<AdminNotifyMessage> {
|
||||
}
|
||||
|
@@ -1,6 +1,7 @@
|
||||
import {
|
||||
AsyncPipe,
|
||||
NgForOf,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
@@ -59,6 +60,7 @@ import { QueryPredicate } from './query-predicate.model';
|
||||
NgbAccordionModule,
|
||||
TranslateModule,
|
||||
AsyncPipe,
|
||||
NgIf,
|
||||
NgForOf,
|
||||
FiltersComponent,
|
||||
],
|
||||
|
@@ -8,7 +8,10 @@ import {
|
||||
OnInit,
|
||||
} from '@angular/core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import {
|
||||
BehaviorSubject,
|
||||
Observable,
|
||||
} from 'rxjs';
|
||||
|
||||
import {
|
||||
APP_CONFIG,
|
||||
@@ -20,7 +23,7 @@ import { RemoteData } from '../../../../../core/data/remote-data';
|
||||
import { Context } from '../../../../../core/shared/context.model';
|
||||
import { Item } from '../../../../../core/shared/item.model';
|
||||
import {
|
||||
getAllSucceededRemoteData,
|
||||
getFirstCompletedRemoteData,
|
||||
getRemoteDataPayload,
|
||||
} from '../../../../../core/shared/operators';
|
||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||
@@ -49,7 +52,7 @@ export class WorkflowItemSearchResultAdminWorkflowListElementComponent extends S
|
||||
/**
|
||||
* The item linked to the workflow item
|
||||
*/
|
||||
public item$: Observable<Item>;
|
||||
public item$: BehaviorSubject<Item> = new BehaviorSubject<Item>(undefined);
|
||||
|
||||
constructor(private linkService: LinkService,
|
||||
protected truncatableService: TruncatableService,
|
||||
@@ -65,6 +68,11 @@ export class WorkflowItemSearchResultAdminWorkflowListElementComponent extends S
|
||||
ngOnInit(): void {
|
||||
super.ngOnInit();
|
||||
this.dso = this.linkService.resolveLink(this.dso, followLink('item'));
|
||||
this.item$ = (this.dso.item as Observable<RemoteData<Item>>).pipe(getAllSucceededRemoteData(), getRemoteDataPayload());
|
||||
(this.dso.item as Observable<RemoteData<Item>>).pipe(
|
||||
getFirstCompletedRemoteData(),
|
||||
getRemoteDataPayload())
|
||||
.subscribe((item: Item) => {
|
||||
this.item$.next(item);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -31,7 +31,6 @@ import { Context } from '../../../../../core/shared/context.model';
|
||||
import { DSpaceObject } from '../../../../../core/shared/dspace-object.model';
|
||||
import { Item } from '../../../../../core/shared/item.model';
|
||||
import {
|
||||
getAllSucceededRemoteData,
|
||||
getFirstCompletedRemoteData,
|
||||
getRemoteDataPayload,
|
||||
} from '../../../../../core/shared/operators';
|
||||
@@ -63,7 +62,7 @@ export class WorkspaceItemSearchResultAdminWorkflowListElementComponent extends
|
||||
/**
|
||||
* The item linked to the workflow item
|
||||
*/
|
||||
public item$: Observable<Item>;
|
||||
public item$: BehaviorSubject<Item> = new BehaviorSubject<Item>(undefined);
|
||||
|
||||
/**
|
||||
* The id of the item linked to the workflow item
|
||||
@@ -90,11 +89,14 @@ export class WorkspaceItemSearchResultAdminWorkflowListElementComponent extends
|
||||
ngOnInit(): void {
|
||||
super.ngOnInit();
|
||||
this.dso = this.linkService.resolveLink(this.dso, followLink('item'));
|
||||
this.item$ = (this.dso.item as Observable<RemoteData<Item>>).pipe(getAllSucceededRemoteData(), getRemoteDataPayload());
|
||||
const item$ = (this.dso.item as Observable<RemoteData<Item>>).pipe(getFirstCompletedRemoteData(), getRemoteDataPayload());
|
||||
|
||||
this.item$.pipe(
|
||||
item$.pipe(
|
||||
take(1),
|
||||
tap((item: Item) => this.itemId = item.id),
|
||||
tap((item: Item) => {
|
||||
this.item$.next(item);
|
||||
this.itemId = item.id;
|
||||
}),
|
||||
mergeMap((item: Item) => this.retrieveSupervisorOrders(item.id)),
|
||||
).subscribe((supervisionOrderList: SupervisionOrder[]) => {
|
||||
this.supervisionOrder$.next(supervisionOrderList);
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import {
|
||||
ExtraOptions,
|
||||
NoPreloading,
|
||||
InMemoryScrollingOptions,
|
||||
Route,
|
||||
RouterConfigOptions,
|
||||
} from '@angular/router';
|
||||
|
||||
import { NOTIFICATIONS_MODULE_PATH } from './admin/admin-routing-paths';
|
||||
@@ -26,6 +26,7 @@ import { COMMUNITY_MODULE_PATH } from './community-page/community-page-routing-p
|
||||
import { AuthBlockingGuard } from './core/auth/auth-blocking.guard';
|
||||
import { AuthenticatedGuard } from './core/auth/authenticated.guard';
|
||||
import { GroupAdministratorGuard } from './core/data/feature-authorization/feature-authorization-guard/group-administrator.guard';
|
||||
import { SiteAdministratorGuard } from './core/data/feature-authorization/feature-authorization-guard/site-administrator.guard';
|
||||
import { SiteRegisterGuard } from './core/data/feature-authorization/feature-authorization-guard/site-register.guard';
|
||||
import { EndUserAgreementCurrentUserGuard } from './core/end-user-agreement/end-user-agreement-current-user.guard';
|
||||
import { ReloadGuard } from './core/reload/reload.guard';
|
||||
@@ -155,7 +156,7 @@ export const APP_ROUTES: Route[] = [
|
||||
path: ADMIN_MODULE_PATH,
|
||||
loadChildren: () => import('./admin/admin-routes')
|
||||
.then((m) => m.ROUTES),
|
||||
canActivate: [EndUserAgreementCurrentUserGuard],
|
||||
canActivate: [SiteAdministratorGuard, EndUserAgreementCurrentUserGuard],
|
||||
},
|
||||
{
|
||||
path: NOTIFICATIONS_MODULE_PATH,
|
||||
@@ -260,12 +261,10 @@ export const APP_ROUTES: Route[] = [
|
||||
],
|
||||
},
|
||||
];
|
||||
export const APP_ROUTING_CONF: ExtraOptions = {
|
||||
// enableTracing: true,
|
||||
useHash: false,
|
||||
scrollPositionRestoration: 'enabled',
|
||||
anchorScrolling: 'enabled',
|
||||
initialNavigation: 'enabledBlocking',
|
||||
preloadingStrategy: NoPreloading,
|
||||
export const APP_ROUTING_CONF: RouterConfigOptions = {
|
||||
onSameUrlNavigation: 'reload',
|
||||
};
|
||||
export const APP_ROUTING_SCROLL_CONF: InMemoryScrollingOptions = {
|
||||
scrollPositionRestoration: 'top',
|
||||
anchorScrolling: 'enabled',
|
||||
};
|
||||
|
@@ -12,7 +12,11 @@ import {
|
||||
NgModule,
|
||||
} from '@angular/core';
|
||||
import {
|
||||
NoPreloading,
|
||||
provideRouter,
|
||||
withEnabledBlockingInitialNavigation,
|
||||
withInMemoryScrolling,
|
||||
withPreloading,
|
||||
withRouterConfig,
|
||||
} from '@angular/router';
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
@@ -52,6 +56,7 @@ import {
|
||||
import {
|
||||
APP_ROUTES,
|
||||
APP_ROUTING_CONF,
|
||||
APP_ROUTING_SCROLL_CONF,
|
||||
} from './app-routes';
|
||||
import { BROWSE_BY_DECORATOR_MAP } from './browse-by/browse-by-switcher/browse-by-decorator';
|
||||
import { AuthInterceptor } from './core/auth/auth.interceptor';
|
||||
@@ -105,7 +110,13 @@ const IMPORTS = [
|
||||
];
|
||||
|
||||
const PROVIDERS = [
|
||||
provideRouter(APP_ROUTES, withRouterConfig(APP_ROUTING_CONF)),
|
||||
provideRouter(
|
||||
APP_ROUTES,
|
||||
withRouterConfig(APP_ROUTING_CONF),
|
||||
withInMemoryScrolling(APP_ROUTING_SCROLL_CONF),
|
||||
withEnabledBlockingInitialNavigation(),
|
||||
withPreloading(NoPreloading),
|
||||
),
|
||||
{
|
||||
provide: APP_BASE_HREF,
|
||||
useFactory: getBaseHref,
|
||||
|
@@ -24,6 +24,7 @@ import { AuthenticateAction } from '../../core/auth/auth.actions';
|
||||
import { CoreState } from '../../core/core-state.model';
|
||||
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
||||
import { Registration } from '../../core/shared/registration.model';
|
||||
import { ProfilePageSecurityFormComponent } from '../../profile-page/profile-page-security-form/profile-page-security-form.component';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
import {
|
||||
createFailedRemoteDataObject$,
|
||||
@@ -84,6 +85,8 @@ describe('ForgotPasswordFormComponent', () => {
|
||||
{ provide: NotificationsService, useValue: notificationsService },
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
}).overrideComponent(ForgotPasswordFormComponent, {
|
||||
remove: { imports: [ ProfilePageSecurityFormComponent ] },
|
||||
}).compileComponents();
|
||||
}));
|
||||
beforeEach(() => {
|
||||
|
@@ -166,7 +166,7 @@ describe('EditRelationshipComponent', () => {
|
||||
comp.url = url;
|
||||
comp.fieldUpdate = fieldUpdate1;
|
||||
comp.editItem = item;
|
||||
comp.relatedItem$ = observableOf(relatedItem);
|
||||
comp.relatedItem$.next(relatedItem);
|
||||
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
@@ -13,9 +13,9 @@ import {
|
||||
} from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import {
|
||||
BehaviorSubject,
|
||||
combineLatest as observableCombineLatest,
|
||||
Observable,
|
||||
of,
|
||||
} from 'rxjs';
|
||||
import {
|
||||
filter,
|
||||
@@ -45,7 +45,6 @@ import { ListableObjectComponentLoaderComponent } from '../../../../shared/objec
|
||||
import { VirtualMetadataComponent } from '../../virtual-metadata/virtual-metadata.component';
|
||||
|
||||
@Component({
|
||||
// eslint-disable-next-line @angular-eslint/component-selector
|
||||
selector: 'ds-edit-relationship',
|
||||
styleUrls: ['./edit-relationship.component.scss'],
|
||||
templateUrl: './edit-relationship.component.html',
|
||||
@@ -95,7 +94,7 @@ export class EditRelationshipComponent implements OnChanges {
|
||||
/**
|
||||
* The related item of this relationship
|
||||
*/
|
||||
relatedItem$: Observable<Item>;
|
||||
relatedItem$: BehaviorSubject<Item> = new BehaviorSubject<Item>(null);
|
||||
|
||||
/**
|
||||
* The view-mode we're currently on
|
||||
@@ -128,16 +127,19 @@ export class EditRelationshipComponent implements OnChanges {
|
||||
getRemoteDataPayload(),
|
||||
filter((item: Item) => hasValue(item) && isNotEmpty(item.uuid)),
|
||||
);
|
||||
this.relatedItem$ = observableCombineLatest(
|
||||
observableCombineLatest([
|
||||
this.leftItem$,
|
||||
this.rightItem$,
|
||||
).pipe(
|
||||
]).pipe(
|
||||
map((items: Item[]) =>
|
||||
items.find((item) => item.uuid !== this.editItem.uuid),
|
||||
),
|
||||
);
|
||||
take(1),
|
||||
).subscribe((relatedItem) => {
|
||||
this.relatedItem$.next(relatedItem);
|
||||
});
|
||||
} else {
|
||||
this.relatedItem$ = of(this.update.relatedItem);
|
||||
this.relatedItem$.next(this.update.relatedItem);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,10 +148,10 @@ export class EditRelationshipComponent implements OnChanges {
|
||||
*/
|
||||
remove(): void {
|
||||
this.closeVirtualMetadataModal();
|
||||
observableCombineLatest(
|
||||
observableCombineLatest([
|
||||
this.leftItem$,
|
||||
this.rightItem$,
|
||||
).pipe(
|
||||
]).pipe(
|
||||
map((items: Item[]) =>
|
||||
items.map((item) => this.objectUpdatesService
|
||||
.isSelectedVirtualMetadata(this.url, this.relationship.id, item.uuid)),
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import {
|
||||
AsyncPipe,
|
||||
NgFor,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import {
|
||||
@@ -21,6 +22,7 @@ import {
|
||||
standalone: true,
|
||||
imports: [
|
||||
NgIf,
|
||||
NgFor,
|
||||
AsyncPipe,
|
||||
],
|
||||
styleUrls: ['./ePerson-data.component.scss'],
|
||||
|
@@ -1,4 +1,7 @@
|
||||
import { NgIf } from '@angular/common';
|
||||
import {
|
||||
NgFor,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
Input,
|
||||
@@ -20,6 +23,7 @@ import { ObjectKeysPipe } from '../../../shared/utils/object-keys-pipe';
|
||||
imports: [
|
||||
TranslateModule,
|
||||
NgIf,
|
||||
NgFor,
|
||||
ObjectKeysPipe,
|
||||
],
|
||||
standalone: true,
|
||||
|
@@ -1,3 +1,4 @@
|
||||
import { NgIf } from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
EventEmitter,
|
||||
@@ -26,6 +27,7 @@ import { SuggestionEvidencesComponent } from './suggestion-evidences/suggestion-
|
||||
templateUrl: './suggestion-list-element.component.html',
|
||||
animations: [fadeIn],
|
||||
imports: [
|
||||
NgIf,
|
||||
TranslateModule,
|
||||
ItemSearchResultListElementComponent,
|
||||
SuggestionActionsComponent,
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import {
|
||||
AsyncPipe,
|
||||
NgFor,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import {
|
||||
@@ -44,6 +45,7 @@ import { SuggestionTargetsStateService } from '../suggestion-targets.state.servi
|
||||
TranslateModule,
|
||||
PaginationComponent,
|
||||
NgIf,
|
||||
NgFor,
|
||||
RouterLink,
|
||||
],
|
||||
standalone: true,
|
||||
|
@@ -13,7 +13,9 @@ import { of as observableOf } from 'rxjs';
|
||||
|
||||
import { RestResponse } from '../../core/cache/response.models';
|
||||
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
||||
import { AlertComponent } from '../../shared/alert/alert.component';
|
||||
import { FormBuilderService } from '../../shared/form/builder/form-builder.service';
|
||||
import { FormComponent } from '../../shared/form/form.component';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
import { VarDirective } from '../../shared/utils/var.directive';
|
||||
import { ProfilePageSecurityFormComponent } from './profile-page-security-form.component';
|
||||
@@ -52,6 +54,8 @@ describe('ProfilePageSecurityFormComponent', () => {
|
||||
FormBuilderService,
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
}).overrideComponent(ProfilePageSecurityFormComponent, {
|
||||
remove: { imports: [ FormComponent, AlertComponent ] },
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
|
@@ -1,3 +1,4 @@
|
||||
import { NgIf } from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
EventEmitter,
|
||||
@@ -32,6 +33,7 @@ import { NotificationsService } from '../../shared/notifications/notifications.s
|
||||
selector: 'ds-profile-page-security-form',
|
||||
templateUrl: './profile-page-security-form.component.html',
|
||||
imports: [
|
||||
NgIf,
|
||||
FormComponent,
|
||||
AlertComponent,
|
||||
TranslateModule,
|
||||
|
@@ -12,7 +12,6 @@ import {
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import {
|
||||
EventType,
|
||||
NavigationEnd,
|
||||
Router,
|
||||
RouterLink,
|
||||
RouterLinkActive,
|
||||
@@ -26,7 +25,10 @@ import {
|
||||
Subscription,
|
||||
} from 'rxjs';
|
||||
import {
|
||||
distinctUntilChanged,
|
||||
filter,
|
||||
map,
|
||||
startWith,
|
||||
take,
|
||||
} from 'rxjs/operators';
|
||||
|
||||
@@ -37,6 +39,7 @@ import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||
import { RemoteData } from '../../../core/data/remote-data';
|
||||
import { BrowseDefinition } from '../../../core/shared/browse-definition.model';
|
||||
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
|
||||
import { isNotEmpty } from '../../empty.util';
|
||||
|
||||
export interface ComColPageNavOption {
|
||||
id: string;
|
||||
@@ -123,13 +126,16 @@ export class ComcolPageBrowseByComponent implements OnDestroy, OnInit {
|
||||
|
||||
this.subs.push(combineLatest([
|
||||
this.allOptions$,
|
||||
this.router.events,
|
||||
]).subscribe(([navOptions, scrollEvent]: [ComColPageNavOption[], Scroll]) => {
|
||||
if (scrollEvent.type === EventType.Scroll) {
|
||||
for (const option of navOptions) {
|
||||
if (option.routerLink === (scrollEvent.routerEvent as NavigationEnd).urlAfterRedirects.split('?')[0]) {
|
||||
this.currentOption$.next(option);
|
||||
}
|
||||
this.router.events.pipe(
|
||||
startWith(this.router),
|
||||
filter((next: Router|Scroll) => (isNotEmpty((next as Router)?.url) || (next as Scroll)?.type === EventType.Scroll)),
|
||||
map((next: Router|Scroll) => (next as Router)?.url || (next as Scroll).routerEvent.urlAfterRedirects),
|
||||
distinctUntilChanged(),
|
||||
),
|
||||
]).subscribe(([navOptions, url]: [ComColPageNavOption[], string]) => {
|
||||
for (const option of navOptions) {
|
||||
if (option.routerLink === url?.split('?')[0]) {
|
||||
this.currentOption$.next(option);
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
@@ -1,4 +1,7 @@
|
||||
import { AsyncPipe } from '@angular/common';
|
||||
import {
|
||||
AsyncPipe,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
EventEmitter,
|
||||
@@ -18,6 +21,7 @@ import { LoadingComponent } from '../loading/loading.component';
|
||||
templateUrl: './item-withdrawn-reinstate-modal.component.html',
|
||||
styleUrls: ['./item-withdrawn-reinstate-modal.component.scss'],
|
||||
imports: [
|
||||
NgIf,
|
||||
TranslateModule,
|
||||
LoadingComponent,
|
||||
FormsModule,
|
@@ -3,15 +3,15 @@ import { Router } from '@angular/router';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { take } from 'rxjs/operators';
|
||||
import { Item } from 'src/app/core/shared/item.model';
|
||||
|
||||
import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service';
|
||||
import { ItemDataService } from '../../../core/data/item-data.service';
|
||||
import { RemoteData } from '../../../core/data/remote-data';
|
||||
import { QualityAssuranceEventDataService } from '../../../core/notifications/qa/events/quality-assurance-event-data.service';
|
||||
import { QualityAssuranceEventObject } from '../../../core/notifications/qa/models/quality-assurance-event.model';
|
||||
import { Item } from '../../../core/shared/item.model';
|
||||
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
|
||||
import { ItemWithdrawnReinstateModalComponent } from '../../correction-suggestion/withdrawn-reinstate-modal.component';
|
||||
import { ItemWithdrawnReinstateModalComponent } from '../../correction-suggestion/item-withdrawn-reinstate-modal.component';
|
||||
import { NotificationsService } from '../../notifications/notifications.service';
|
||||
|
||||
export const REQUEST_WITHDRAWN = 'REQUEST/WITHDRAWN';
|
||||
|
@@ -4,6 +4,7 @@ import {
|
||||
Inject,
|
||||
OnInit,
|
||||
} from '@angular/core';
|
||||
import { RouterLinkActive } from '@angular/router';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
import { isNotEmpty } from '../../empty.util';
|
||||
@@ -17,7 +18,7 @@ import { ExternalLinkMenuItemModel } from './models/external-link.model';
|
||||
styleUrls: ['./menu-item.component.scss'],
|
||||
templateUrl: './external-link-menu-item.component.html',
|
||||
standalone: true,
|
||||
imports: [NgClass, TranslateModule],
|
||||
imports: [NgClass, TranslateModule, RouterLinkActive],
|
||||
})
|
||||
export class ExternalLinkMenuItemComponent implements OnInit {
|
||||
item: ExternalLinkMenuItemModel;
|
||||
|
@@ -3,6 +3,7 @@ import {
|
||||
Component,
|
||||
Inject,
|
||||
} from '@angular/core';
|
||||
import { RouterLinkActive } from '@angular/router';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
import { OnClickMenuItemModel } from './models/onclick.model';
|
||||
@@ -15,7 +16,7 @@ import { OnClickMenuItemModel } from './models/onclick.model';
|
||||
styleUrls: ['./menu-item.component.scss', './onclick-menu-item.component.scss'],
|
||||
templateUrl: './onclick-menu-item.component.html',
|
||||
standalone: true,
|
||||
imports: [NgIf, TranslateModule],
|
||||
imports: [NgIf, TranslateModule, RouterLinkActive],
|
||||
})
|
||||
export class OnClickMenuItemComponent {
|
||||
item: OnClickMenuItemModel;
|
||||
|
@@ -10,6 +10,7 @@ import { Item } from '../../../../core/shared/item.model';
|
||||
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
|
||||
import { ClaimedTask } from '../../../../core/tasks/models/claimed-task-object.model';
|
||||
import { AbstractComponentLoaderComponent } from '../../../abstract-component-loader/abstract-component-loader.component';
|
||||
import { DynamicComponentLoaderDirective } from '../../../abstract-component-loader/dynamic-component-loader.directive';
|
||||
import { MyDSpaceActionsResult } from '../../mydspace-actions';
|
||||
import { ClaimedTaskActionsAbstractComponent } from '../abstract/claimed-task-actions-abstract.component';
|
||||
import { getComponentByWorkflowTaskOption } from './claimed-task-actions-decorator';
|
||||
@@ -18,6 +19,7 @@ import { getComponentByWorkflowTaskOption } from './claimed-task-actions-decorat
|
||||
selector: 'ds-claimed-task-actions-loader',
|
||||
templateUrl: '../../../abstract-component-loader/abstract-component-loader.component.html',
|
||||
standalone: true,
|
||||
imports: [ DynamicComponentLoaderDirective ],
|
||||
})
|
||||
/**
|
||||
* Component for loading a ClaimedTaskAction component depending on the "option" input
|
||||
|
@@ -1,10 +1,8 @@
|
||||
import { ClaimedTask } from '../../../core/tasks/models/claimed-task-object.model';
|
||||
import { SearchResult } from '../../search/models/search-result.model';
|
||||
import { searchResultFor } from '../../search/search-result-element-decorator';
|
||||
|
||||
/**
|
||||
* Represents a search result object of a ClaimedTask object
|
||||
*/
|
||||
@searchResultFor(ClaimedTask)
|
||||
export class ClaimedTaskSearchResult extends SearchResult<ClaimedTask> {
|
||||
}
|
||||
|
@@ -1,7 +1,5 @@
|
||||
import { Collection } from '../../../core/shared/collection.model';
|
||||
import { SearchResult } from '../../search/models/search-result.model';
|
||||
import { searchResultFor } from '../../search/search-result-element-decorator';
|
||||
|
||||
@searchResultFor(Collection)
|
||||
export class CollectionSearchResult extends SearchResult<Collection> {
|
||||
}
|
||||
|
@@ -1,7 +1,5 @@
|
||||
import { Community } from '../../../core/shared/community.model';
|
||||
import { SearchResult } from '../../search/models/search-result.model';
|
||||
import { searchResultFor } from '../../search/search-result-element-decorator';
|
||||
|
||||
@searchResultFor(Community)
|
||||
export class CommunitySearchResult extends SearchResult<Community> {
|
||||
}
|
||||
|
@@ -2,10 +2,8 @@ import { GenericConstructor } from '../../../core/shared/generic-constructor';
|
||||
import { Item } from '../../../core/shared/item.model';
|
||||
import { inheritEquatable } from '../../../core/utilities/equals.decorators';
|
||||
import { SearchResult } from '../../search/models/search-result.model';
|
||||
import { searchResultFor } from '../../search/search-result-element-decorator';
|
||||
import { ListableObject } from './listable-object.model';
|
||||
|
||||
@searchResultFor(Item)
|
||||
@inheritEquatable(SearchResult)
|
||||
export class ItemSearchResult extends SearchResult<Item> {
|
||||
|
||||
|
@@ -15,6 +15,7 @@ import { ListableObject } from '../listable-object.model';
|
||||
@Component({
|
||||
selector: 'ds-objects-collection-tabulatable',
|
||||
template: ``,
|
||||
standalone: true,
|
||||
})
|
||||
|
||||
/**
|
||||
|
@@ -1,10 +1,8 @@
|
||||
import { PoolTask } from '../../../core/tasks/models/pool-task-object.model';
|
||||
import { SearchResult } from '../../search/models/search-result.model';
|
||||
import { searchResultFor } from '../../search/search-result-element-decorator';
|
||||
|
||||
/**
|
||||
* Represents a search result object of a PoolTask object
|
||||
*/
|
||||
@searchResultFor(PoolTask)
|
||||
export class PoolTaskSearchResult extends SearchResult<PoolTask> {
|
||||
}
|
||||
|
@@ -1,10 +1,8 @@
|
||||
import { WorkflowItem } from '../../../core/submission/models/workflowitem.model';
|
||||
import { SearchResult } from '../../search/models/search-result.model';
|
||||
import { searchResultFor } from '../../search/search-result-element-decorator';
|
||||
|
||||
/**
|
||||
* Represents a search result object of a WorkflowItem object
|
||||
*/
|
||||
@searchResultFor(WorkflowItem)
|
||||
export class WorkflowItemSearchResult extends SearchResult<WorkflowItem> {
|
||||
}
|
||||
|
@@ -1,10 +1,8 @@
|
||||
import { WorkspaceItem } from '../../../core/submission/models/workspaceitem.model';
|
||||
import { SearchResult } from '../../search/models/search-result.model';
|
||||
import { searchResultFor } from '../../search/search-result-element-decorator';
|
||||
|
||||
/**
|
||||
* Represents a search result object of a WorkspaceItem object
|
||||
*/
|
||||
@searchResultFor(WorkspaceItem)
|
||||
export class WorkspaceItemSearchResult extends SearchResult<WorkspaceItem> {
|
||||
}
|
||||
|
@@ -1,24 +1,36 @@
|
||||
import { AdminNotifyMessage } from '../../admin/admin-notify-dashboard/models/admin-notify-message.model';
|
||||
import { AdminNotifySearchResult } from '../../admin/admin-notify-dashboard/models/admin-notify-message-search-result.model';
|
||||
import { Collection } from '../../core/shared/collection.model';
|
||||
import { Community } from '../../core/shared/community.model';
|
||||
import { GenericConstructor } from '../../core/shared/generic-constructor';
|
||||
import { Item } from '../../core/shared/item.model';
|
||||
import { WorkflowItem } from '../../core/submission/models/workflowitem.model';
|
||||
import { WorkspaceItem } from '../../core/submission/models/workspaceitem.model';
|
||||
import { ClaimedTask } from '../../core/tasks/models/claimed-task-object.model';
|
||||
import { PoolTask } from '../../core/tasks/models/pool-task-object.model';
|
||||
import { ClaimedTaskSearchResult } from '../object-collection/shared/claimed-task-search-result.model';
|
||||
import { CollectionSearchResult } from '../object-collection/shared/collection-search-result.model';
|
||||
import { CommunitySearchResult } from '../object-collection/shared/community-search-result.model';
|
||||
import { ItemSearchResult } from '../object-collection/shared/item-search-result.model';
|
||||
import { ListableObject } from '../object-collection/shared/listable-object.model';
|
||||
import { PoolTaskSearchResult } from '../object-collection/shared/pool-task-search-result.model';
|
||||
import { WorkflowItemSearchResult } from '../object-collection/shared/workflow-item-search-result.model';
|
||||
import { WorkspaceItemSearchResult } from '../object-collection/shared/workspace-item-search-result.model';
|
||||
|
||||
/**
|
||||
* Contains the mapping between a search result component and a DSpaceObject
|
||||
*/
|
||||
const searchResultMap = new Map();
|
||||
export const SEARCH_RESULT_MAP = new Map<string| GenericConstructor<ListableObject>, GenericConstructor<ListableObject>>([
|
||||
[AdminNotifyMessage, AdminNotifySearchResult],
|
||||
[ClaimedTask, ClaimedTaskSearchResult],
|
||||
[PoolTask, PoolTaskSearchResult],
|
||||
[Collection, CollectionSearchResult],
|
||||
[Community, CommunitySearchResult],
|
||||
[Item, ItemSearchResult],
|
||||
[WorkflowItem, WorkflowItemSearchResult],
|
||||
[WorkspaceItem, WorkspaceItemSearchResult],
|
||||
]);
|
||||
|
||||
/**
|
||||
* Used to map Search Result components to their matching DSpaceObject
|
||||
* @param {GenericConstructor<ListableObject>} domainConstructor The constructor of the DSpaceObject
|
||||
* @returns Decorator function that performs the actual mapping on initialization of the component
|
||||
*/
|
||||
export function searchResultFor(domainConstructor: GenericConstructor<ListableObject>) {
|
||||
return function decorator(searchResult: any) {
|
||||
if (!searchResult) {
|
||||
return;
|
||||
}
|
||||
searchResultMap.set(domainConstructor, searchResult);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Requests the matching component based on a given DSpaceObject's constructor
|
||||
@@ -26,5 +38,5 @@ export function searchResultFor(domainConstructor: GenericConstructor<ListableOb
|
||||
* @returns The component's constructor that matches the given DSpaceObject
|
||||
*/
|
||||
export function getSearchResultFor(domainConstructor: GenericConstructor<ListableObject>) {
|
||||
return searchResultMap.get(domainConstructor);
|
||||
return SEARCH_RESULT_MAP.get(domainConstructor);
|
||||
}
|
||||
|
@@ -14,10 +14,10 @@
|
||||
</div>
|
||||
<div class="well ds-base-drop-zone mt-1 mb-3 text-muted p-2">
|
||||
<p class="text-center m-0 p-0 d-flex justify-content-center align-items-center"
|
||||
*ngIf="fileObject!==null"> {{ fileObject.name }} </p>
|
||||
*ngIf="fileObject"> {{ fileObject?.name }} </p>
|
||||
<p class="text-center m-0 p-0 d-flex justify-content-center align-items-center">
|
||||
<span><i class="fas fa-cloud-upload"
|
||||
aria-hidden="true"></i> {{ (fileObject === null ? dropMessageLabel : dropMessageLabelReplacement) | translate}} {{'uploader.or' | translate}}</span>
|
||||
aria-hidden="true"></i> {{ ((fileObject === null || fileObject === undefined) ? dropMessageLabel : dropMessageLabelReplacement) | translate}} {{'uploader.or' | translate}}</span>
|
||||
<label class="btn btn-link m-0 p-0 ml-1">
|
||||
<input class="form-control-file d-none" requireFile #file="ngModel" type="file" name="file-upload"
|
||||
id="file-upload"
|
||||
|
@@ -11,6 +11,7 @@ import {
|
||||
providers: [
|
||||
{ provide: NG_VALIDATORS, useExisting: IpV4Validator, multi: true },
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
/**
|
||||
* Validator to validate if an Ip is in the right format
|
||||
|
@@ -1,3 +1,4 @@
|
||||
import { NgFor } from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
Input,
|
||||
@@ -29,6 +30,7 @@ import { SubmissionImportExternalCollectionComponent } from '../import-external-
|
||||
styleUrls: ['./submission-import-external-preview.component.scss'],
|
||||
templateUrl: './submission-import-external-preview.component.html',
|
||||
imports: [
|
||||
NgFor,
|
||||
TranslateModule,
|
||||
],
|
||||
standalone: true,
|
||||
|
@@ -46,7 +46,13 @@
|
||||
"angularCompilerOptions": {
|
||||
"fullTemplateTypeCheck": true,
|
||||
"strictInjectionParameters": true,
|
||||
"strictInputAccessModifiers": true
|
||||
"strictInputAccessModifiers": true,
|
||||
"extendedDiagnostics": {
|
||||
// The categories to use for specific diagnostics.
|
||||
"checks": {
|
||||
"missingControlFlowDirective": "error"
|
||||
},
|
||||
}
|
||||
},
|
||||
"exclude": [
|
||||
"cypress.config.ts"
|
||||
|
Reference in New Issue
Block a user