Merge branch 'main-gh' into DSC-389

This commit is contained in:
Davide Negretti
2022-03-11 10:53:35 +01:00
38 changed files with 16209 additions and 15927 deletions

2
.gitattributes vendored Normal file
View File

@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto

View File

@@ -101,7 +101,7 @@ Installing
### Configuring
Default configuration file is located in `config/` folder.
Default runtime configuration file is located in `config/` folder. These configurations can be changed without rebuilding the distribution.
To override the default configuration values, create local files that override the parameters you need to change. You can use `config.example.yml` as a starting point.
@@ -167,6 +167,22 @@ These configuration sources are collected **at run time**, and written to `dist/
The configuration file can be externalized by using environment variable `DSPACE_APP_CONFIG_PATH`.
#### Buildtime Configuring
Buildtime configuration must defined before build in order to include in transpiled JavaScript. This is primarily for the server. These settings can be found under `src/environment/` folder.
To override the default configuration values for development, create local file that override the build time parameters you need to change.
- Create a new `environment.(dev or development).ts` file in `src/environment/` for a `development` environment;
If needing to update default configurations values for production, update local file that override the build time parameters you need to change.
- Update `environment.production.ts` file in `src/environment/` for a `production` environment;
The environment object is provided for use as import in code and is extended with he runtime configuration on bootstrap of the application.
> Take caution moving runtime configs into the buildtime configuration. They will be overwritten by what is defined in the runtime config on bootstrap.
#### Using environment variables in code
To use environment variables in a UI component, use:
@@ -183,7 +199,6 @@ or
import { environment } from '../environment.ts';
```
Running the app
---------------

View File

@@ -116,7 +116,7 @@
"rxjs": "^6.6.3",
"sortablejs": "1.13.0",
"tslib": "^2.0.0",
"url-parse": "^1.5.3",
"url-parse": "^1.5.6",
"uuid": "^8.3.2",
"webfontloader": "1.6.28",
"zone.js": "^0.10.3"
@@ -158,7 +158,7 @@
"jasmine-core": "~3.6.0",
"jasmine-marbles": "0.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "^5.2.3",
"karma": "^6.3.14",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",

View File

@@ -18,6 +18,7 @@ import { PaginationService } from '../../core/pagination/pagination.service';
import { map } from 'rxjs/operators';
import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model';
import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model';
import { isValidDate } from '../../shared/date.util';
@Component({
selector: 'ds-browse-by-date-page',
@@ -85,10 +86,10 @@ export class BrowseByDatePageComponent extends BrowseByMetadataPageComponent {
let lowerLimit = environment.browseBy.defaultLowerLimit;
if (hasValue(firstItemRD.payload)) {
const date = firstItemRD.payload.firstMetadataValue(metadataKeys);
if (hasValue(date)) {
if (isNotEmpty(date) && isValidDate(date)) {
const dateObj = new Date(date);
// TODO: it appears that getFullYear (based on local time) is sometimes unreliable. Switching to UTC.
lowerLimit = dateObj.getUTCFullYear();
lowerLimit = isNaN(dateObj.getUTCFullYear()) ? lowerLimit : dateObj.getUTCFullYear();
}
}
const options = [];

View File

@@ -219,6 +219,9 @@ describe('AuthEffects', () => {
const expected = cold('--b-', { b: new RetrieveTokenAction() });
expect(authEffects.checkTokenCookie$).toBeObservable(expected);
authEffects.checkTokenCookie$.subscribe(() => {
expect((authEffects as any).authorizationsService.invalidateAuthorizationsRequestCache).toHaveBeenCalled();
});
});
it('should return a RETRIEVE_AUTH_METHODS action in response to a CHECK_AUTHENTICATION_TOKEN_COOKIE action when authenticated is false', () => {

View File

@@ -162,6 +162,7 @@ export class AuthEffects {
return this.authService.checkAuthenticationCookie().pipe(
map((response: AuthStatus) => {
if (response.authenticated) {
this.authorizationsService.invalidateAuthorizationsRequestCache();
return new RetrieveTokenAction();
} else {
return new RetrieveAuthMethodsAction(response);

View File

@@ -3,7 +3,7 @@ import { compare } from 'fast-json-patch';
import { Operation } from 'fast-json-patch';
import { getClassForType } from '../cache/builders/build-decorators';
import { TypedObject } from '../cache/object-cache.reducer';
import { DSpaceSerializer } from '../dspace-rest/dspace.serializer';
import { DSpaceNotNullSerializer } from '../dspace-rest/dspace-not-null.serializer';
import { ChangeAnalyzer } from './change-analyzer';
/**
@@ -22,8 +22,8 @@ export class DefaultChangeAnalyzer<T extends TypedObject> implements ChangeAnaly
* The second object to compare
*/
diff(object1: T, object2: T): Operation[] {
const serializer1 = new DSpaceSerializer(getClassForType(object1.type));
const serializer2 = new DSpaceSerializer(getClassForType(object2.type));
const serializer1 = new DSpaceNotNullSerializer(getClassForType(object1.type));
const serializer2 = new DSpaceNotNullSerializer(getClassForType(object2.type));
return compare(serializer1.serialize(object1), serializer2.serialize(object2));
}
}

View File

@@ -90,11 +90,13 @@ describe('EpersonRegistrationService', () => {
const expected = service.searchByToken('test-token');
expect(expected).toBeObservable(cold('(a|)', {
a: Object.assign(new Registration(), {
a: jasmine.objectContaining({
payload: Object.assign(new Registration(), {
email: registrationWithUser.email,
token: 'test-token',
user: registrationWithUser.user
})
})
}));
});

View File

@@ -79,7 +79,7 @@ export class EpersonRegistrationService {
* Search a registration based on the provided token
* @param token
*/
searchByToken(token: string): Observable<Registration> {
searchByToken(token: string): Observable<RemoteData<Registration>> {
const requestId = this.requestService.generateRequestId();
const href$ = this.getTokenSearchEndpoint(token).pipe(
@@ -97,15 +97,14 @@ export class EpersonRegistrationService {
});
return this.rdbService.buildSingle<Registration>(href$).pipe(
skipWhile((rd: RemoteData<Registration>) => rd.isStale),
getFirstSucceededRemoteData(),
map((restResponse: RemoteData<Registration>) => {
return Object.assign(new Registration(), {
email: restResponse.payload.email, token: token, user: restResponse.payload.user
});
}),
map((rd) => {
if (rd.hasSucceeded && hasValue(rd.payload)) {
return Object.assign(rd, { payload: Object.assign(rd.payload, { token }) });
} else {
return rd;
}
})
);
}
}

View File

@@ -0,0 +1,76 @@
import { Deserialize, Serialize } from 'cerialize';
import { Serializer } from '../serializer';
import { GenericConstructor } from '../shared/generic-constructor';
/**
* This Serializer turns responses from DSpace's REST API
* to models and vice versa, but with all fields with null value removed for the Serialized objects
*/
export class DSpaceNotNullSerializer<T> implements Serializer<T> {
/**
* Create a new DSpaceNotNullSerializer instance
*
* @param modelType a class or interface to indicate
* the kind of model this serializer should work with
*/
constructor(private modelType: GenericConstructor<T>) {
}
/**
* Convert a model in to the format expected by the backend, but with all fields with null value removed
*
* @param model The model to serialize
* @returns An object to send to the backend
*/
serialize(model: T): any {
return getSerializedObjectWithoutNullFields(Serialize(model, this.modelType));
}
/**
* Convert an array of models in to the format expected by the backend, but with all fields with null value removed
*
* @param models The array of models to serialize
* @returns An object to send to the backend
*/
serializeArray(models: T[]): any {
return getSerializedObjectWithoutNullFields(Serialize(models, this.modelType));
}
/**
* Convert a response from the backend in to a model.
*
* @param response An object returned by the backend
* @returns a model of type T
*/
deserialize(response: any): T {
if (Array.isArray(response)) {
throw new Error('Expected a single model, use deserializeArray() instead');
}
return Deserialize(response, this.modelType) as T;
}
/**
* Convert a response from the backend in to an array of models
*
* @param response An object returned by the backend
* @returns an array of models of type T
*/
deserializeArray(response: any): T[] {
if (!Array.isArray(response)) {
throw new Error('Expected an Array, use deserialize() instead');
}
return Deserialize(response, this.modelType) as T[];
}
}
function getSerializedObjectWithoutNullFields(serializedObjectBefore): any {
const copySerializedObject = {};
for (const [key, value] of Object.entries(serializedObjectBefore)) {
if (value !== null) {
copySerializedObject[key] = value;
}
}
return copySerializedObject;
}

View File

@@ -1,4 +1,4 @@
<div class="container">
<div class="container" *ngIf="(registration$ |async)">
<h3 class="mb-4">{{'forgot-password.form.head' | translate}}</h3>
<div class="card mb-4">
<div class="card-header">{{'forgot-password.form.identification.header' | translate}}</div>

View File

@@ -16,7 +16,11 @@ import { Registration } from '../../core/shared/registration.model';
import { ForgotPasswordFormComponent } from './forgot-password-form.component';
import { By } from '@angular/platform-browser';
import { AuthenticateAction } from '../../core/auth/auth.actions';
import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
import {
createFailedRemoteDataObject$,
createSuccessfulRemoteDataObject,
createSuccessfulRemoteDataObject$
} from '../../shared/remote-data.utils';
describe('ForgotPasswordFormComponent', () => {
let comp: ForgotPasswordFormComponent;
@@ -36,7 +40,7 @@ describe('ForgotPasswordFormComponent', () => {
beforeEach(waitForAsync(() => {
route = {data: observableOf({registration: registration})};
route = {data: observableOf({registration: createSuccessfulRemoteDataObject(registration)})};
router = new RouterStub();
notificationsService = new NotificationsServiceStub();

View File

@@ -11,7 +11,10 @@ import { Store } from '@ngrx/store';
import { CoreState } from '../../core/core.reducers';
import { RemoteData } from '../../core/data/remote-data';
import { EPerson } from '../../core/eperson/models/eperson.model';
import { getFirstCompletedRemoteData } from '../../core/shared/operators';
import {
getFirstCompletedRemoteData,
getFirstSucceededRemoteDataPayload,
} from '../../core/shared/operators';
@Component({
selector: 'ds-forgot-password-form',
@@ -48,7 +51,8 @@ export class ForgotPasswordFormComponent {
ngOnInit(): void {
this.registration$ = this.route.data.pipe(
map((data) => data.registration as Registration),
map((data) => data.registration as RemoteData<Registration>),
getFirstSucceededRemoteDataPayload(),
);
this.registration$.subscribe((registration: Registration) => {
this.email = registration.email;

View File

@@ -1,9 +1,9 @@
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { ItemPageResolver } from '../item-page/item-page.resolver';
import { RegistrationResolver } from '../register-email-form/registration.resolver';
import { ThemedForgotPasswordFormComponent } from './forgot-password-form/themed-forgot-password-form.component';
import { ThemedForgotEmailComponent } from './forgot-password-email/themed-forgot-email.component';
import { RegistrationGuard } from '../register-page/registration.guard';
@NgModule({
imports: [
@@ -16,12 +16,11 @@ import { ThemedForgotEmailComponent } from './forgot-password-email/themed-forgo
{
path: ':token',
component: ThemedForgotPasswordFormComponent,
resolve: {registration: RegistrationResolver}
canActivate: [ RegistrationGuard ],
}
])
],
providers: [
RegistrationResolver,
ItemPageResolver,
]
})

View File

@@ -1,8 +1,8 @@
import { RegistrationResolver } from './registration.resolver';
import { EpersonRegistrationService } from '../core/data/eperson-registration.service';
import { of as observableOf } from 'rxjs';
import { Registration } from '../core/shared/registration.model';
import { first } from 'rxjs/operators';
import { createSuccessfulRemoteDataObject$ } from '../shared/remote-data.utils';
describe('RegistrationResolver', () => {
let resolver: RegistrationResolver;
@@ -13,7 +13,7 @@ describe('RegistrationResolver', () => {
beforeEach(() => {
epersonRegistrationService = jasmine.createSpyObj('epersonRegistrationService', {
searchByToken: observableOf(registration)
searchByToken: createSuccessfulRemoteDataObject$(registration)
});
resolver = new RegistrationResolver(epersonRegistrationService);
});
@@ -23,9 +23,9 @@ describe('RegistrationResolver', () => {
.pipe(first())
.subscribe(
(resolved) => {
expect(resolved.token).toEqual(token);
expect(resolved.email).toEqual('test@email.org');
expect(resolved.user).toEqual('user-uuid');
expect(resolved.payload.token).toEqual(token);
expect(resolved.payload.email).toEqual('test@email.org');
expect(resolved.payload.user).toEqual('user-uuid');
done();
}
);

View File

@@ -3,18 +3,22 @@ import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/r
import { EpersonRegistrationService } from '../core/data/eperson-registration.service';
import { Registration } from '../core/shared/registration.model';
import { Observable } from 'rxjs';
import { RemoteData } from '../core/data/remote-data';
import { getFirstCompletedRemoteData } from '../core/shared/operators';
@Injectable()
/**
* Resolver to resolve a Registration object based on the provided token
*/
export class RegistrationResolver implements Resolve<Registration> {
export class RegistrationResolver implements Resolve<RemoteData<Registration>> {
constructor(private epersonRegistrationService: EpersonRegistrationService) {
}
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<Registration> {
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<RemoteData<Registration>> {
const token = route.params.token;
return this.epersonRegistrationService.searchByToken(token);
return this.epersonRegistrationService.searchByToken(token).pipe(
getFirstCompletedRemoteData(),
);
}
}

View File

@@ -1,4 +1,4 @@
<div class="container">
<div class="container" *ngIf="(registration$ |async)">
<h3 class="mb-4">{{'register-page.create-profile.header' | translate}}</h3>
<div class="card mb-4">
<div class="card-header">{{'register-page.create-profile.identification.header' | translate}}</div>

View File

@@ -21,7 +21,11 @@ import {
END_USER_AGREEMENT_METADATA_FIELD,
EndUserAgreementService
} from '../../core/end-user-agreement/end-user-agreement.service';
import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
import {
createFailedRemoteDataObject$,
createSuccessfulRemoteDataObject,
createSuccessfulRemoteDataObject$
} from '../../shared/remote-data.utils';
describe('CreateProfileComponent', () => {
let comp: CreateProfileComponent;
@@ -106,7 +110,7 @@ describe('CreateProfileComponent', () => {
};
epersonWithAgreement = Object.assign(new EPerson(), valuesWithAgreement);
route = {data: observableOf({registration: registration})};
route = {data: observableOf({registration: createSuccessfulRemoteDataObject(registration)})};
router = new RouterStub();
notificationsService = new NotificationsServiceStub();

View File

@@ -19,7 +19,7 @@ import {
END_USER_AGREEMENT_METADATA_FIELD,
EndUserAgreementService
} from '../../core/end-user-agreement/end-user-agreement.service';
import { getFirstCompletedRemoteData } from '../../core/shared/operators';
import { getFirstCompletedRemoteData, getFirstSucceededRemoteDataPayload } from '../../core/shared/operators';
/**
* Component that renders the create profile page to be used by a user registering through a token
@@ -56,7 +56,8 @@ export class CreateProfileComponent implements OnInit {
ngOnInit(): void {
this.registration$ = this.route.data.pipe(
map((data) => data.registration as Registration),
map((data) => data.registration as RemoteData<Registration>),
getFirstSucceededRemoteDataPayload(),
);
this.registration$.subscribe((registration: Registration) => {
this.email = registration.email;

View File

@@ -2,9 +2,9 @@ import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { RegisterEmailComponent } from './register-email/register-email.component';
import { ItemPageResolver } from '../item-page/item-page.resolver';
import { RegistrationResolver } from '../register-email-form/registration.resolver';
import { EndUserAgreementCookieGuard } from '../core/end-user-agreement/end-user-agreement-cookie.guard';
import { ThemedCreateProfileComponent } from './create-profile/themed-create-profile.component';
import { RegistrationGuard } from './registration.guard';
@NgModule({
imports: [
@@ -17,13 +17,14 @@ import { ThemedCreateProfileComponent } from './create-profile/themed-create-pro
{
path: ':token',
component: ThemedCreateProfileComponent,
resolve: {registration: RegistrationResolver},
canActivate: [EndUserAgreementCookieGuard]
canActivate: [
RegistrationGuard,
EndUserAgreementCookieGuard,
],
}
])
],
providers: [
RegistrationResolver,
ItemPageResolver
]
})

View File

@@ -0,0 +1,106 @@
import { RegistrationGuard } from './registration.guard';
import { EpersonRegistrationService } from '../core/data/eperson-registration.service';
import { ActivatedRouteSnapshot, Router, RouterStateSnapshot } from '@angular/router';
import { AuthService } from '../core/auth/auth.service';
import { Location } from '@angular/common';
import {
createFailedRemoteDataObject$,
createSuccessfulRemoteDataObject,
} from '../shared/remote-data.utils';
import { Registration } from '../core/shared/registration.model';
import { of as observableOf } from 'rxjs/internal/observable/of';
import { RemoteData } from '../core/data/remote-data';
describe('RegistrationGuard', () => {
let guard: RegistrationGuard;
let epersonRegistrationService: EpersonRegistrationService;
let router: Router;
let authService: AuthService;
let registration: Registration;
let registrationRD: RemoteData<Registration>;
let currentUrl: string;
let startingRouteData: any;
let route: ActivatedRouteSnapshot;
let state: RouterStateSnapshot;
beforeEach(() => {
registration = Object.assign(new Registration(), {
email: 'test@email.com',
token: 'testToken',
user: 'testUser',
});
registrationRD = createSuccessfulRemoteDataObject(registration);
currentUrl = 'test-current-url';
startingRouteData = {
existingData: 'some-existing-data',
};
route = Object.assign(new ActivatedRouteSnapshot(), {
data: Object.assign({}, startingRouteData),
params: {
token: 'testToken',
},
});
state = Object.assign({
url: currentUrl,
});
epersonRegistrationService = jasmine.createSpyObj('epersonRegistrationService', {
searchByToken: observableOf(registrationRD),
});
router = jasmine.createSpyObj('router', {
navigateByUrl: Promise.resolve(),
}, {
url: currentUrl,
});
authService = jasmine.createSpyObj('authService', {
isAuthenticated: observableOf(false),
setRedirectUrl: {},
});
guard = new RegistrationGuard(epersonRegistrationService, router, authService);
});
describe('canActivate', () => {
describe('when searchByToken returns a successful response', () => {
beforeEach(() => {
(epersonRegistrationService.searchByToken as jasmine.Spy).and.returnValue(observableOf(registrationRD));
});
it('should return true', (done) => {
guard.canActivate(route, state).subscribe((result) => {
expect(result).toEqual(true);
done();
});
});
it('should add the response to the route\'s data', (done) => {
guard.canActivate(route, state).subscribe(() => {
expect(route.data).toEqual({ ...startingRouteData, registration: registrationRD });
done();
});
});
it('should not redirect', (done) => {
guard.canActivate(route, state).subscribe(() => {
expect(router.navigateByUrl).not.toHaveBeenCalled();
done();
});
});
});
describe('when searchByToken returns a 404 response', () => {
beforeEach(() => {
(epersonRegistrationService.searchByToken as jasmine.Spy).and.returnValue(createFailedRemoteDataObject$('Not Found', 404));
});
it('should redirect', () => {
guard.canActivate(route, state).subscribe();
expect(router.navigateByUrl).toHaveBeenCalled();
});
});
});
});

View File

@@ -0,0 +1,43 @@
import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/internal/Observable';
import { EpersonRegistrationService } from '../core/data/eperson-registration.service';
import { AuthService } from '../core/auth/auth.service';
import { map } from 'rxjs/operators';
import { getFirstCompletedRemoteData, redirectOn4xx } from '../core/shared/operators';
import { Location } from '@angular/common';
@Injectable({
providedIn: 'root'
})
/**
* A guard responsible for redirecting to 4xx pages upon retrieving a Registration object
* The guard also adds the resulting RemoteData<Registration> object to the route's data for further usage in components
* The reason this is a guard and not a resolver, is because it has to run before the EndUserAgreementCookieGuard
*/
export class RegistrationGuard implements CanActivate {
constructor(private epersonRegistrationService: EpersonRegistrationService,
private router: Router,
private authService: AuthService) {
}
/**
* Can the user activate the route? Returns true if the provided token resolves to an existing Registration, false if
* not. Redirects to 4xx page on 4xx error. Adds the resulting RemoteData<Registration> object to the route's
* data.registration property
* @param route
* @param state
*/
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> {
const token = route.params.token;
return this.epersonRegistrationService.searchByToken(token).pipe(
getFirstCompletedRemoteData(),
redirectOn4xx(this.router, this.authService),
map((rd) => {
route.data = { ...route.data, registration: rd };
return rd.hasSucceeded;
}),
);
}
}

View File

@@ -5,10 +5,6 @@
params: {collapsedSidebarWidth: (collapsedSidebarWidth | async), totalSidebarWidth: (totalSidebarWidth | async)}
}">
<ds-themed-header-navbar-wrapper></ds-themed-header-navbar-wrapper>
<ds-notifications-board
[options]="notificationOptions">
</ds-notifications-board>
<main class="main-content">
<ds-themed-breadcrumbs></ds-themed-breadcrumbs>
@@ -23,6 +19,9 @@
<ds-themed-footer></ds-themed-footer>
</div>
</div>
<ds-notifications-board [options]="notificationOptions">
</ds-notifications-board>
<ng-template #fullScreenLoader>
<div class="ds-full-screen-loader">
<ds-loading [showMessage]="false"></ds-loading>

View File

@@ -113,3 +113,11 @@ export function dateToString(date: Date | NgbDateStruct): string {
const dateStr = `${year}-${month}-${day}`;
return moment.utc(dateStr, 'YYYYMMDD').format('YYYY-MM-DD');
}
/**
* Checks if the given string represents a valid date
* @param date the string to be checked
*/
export function isValidDate(date: string) {
return moment(date).isValid();
}

View File

@@ -23,9 +23,7 @@ import { SubmissionFormsConfigService } from '../../../core/config/submission-fo
import { SectionDataObject } from '../models/section-data.model';
import { SectionsType } from '../sections-type';
import {
mockSubmissionCollectionId,
mockSubmissionId,
mockUploadResponse1ParsedErrors
mockSubmissionCollectionId, mockSubmissionId, mockUploadResponse1ParsedErrors,
} from '../../../shared/mocks/submission.mock';
import { BrowserModule } from '@angular/platform-browser';
import { CommonModule } from '@angular/common';
@@ -45,6 +43,7 @@ import { ObjectCacheService } from '../../../core/cache/object-cache.service';
import { RequestService } from '../../../core/data/request.service';
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
import { cold } from 'jasmine-marbles';
import { WorkflowItem } from '../../../core/submission/models/workflowitem.model';
function getMockSubmissionFormsConfigService(): SubmissionFormsConfigService {
return jasmine.createSpyObj('FormOperationsService', {
@@ -296,8 +295,10 @@ describe('SubmissionSectionFormComponent test suite', () => {
};
compAsAny.formData = {};
compAsAny.sectionMetadata = ['dc.title'];
spyOn(compAsAny, 'inCurrentSubmissionScope').and.callThrough();
expect(comp.hasMetadataEnrichment(newSectionData)).toBeTruthy();
expect(compAsAny.inCurrentSubmissionScope).toHaveBeenCalledWith('dc.title');
});
it('should return false when has not Metadata Enrichment', () => {
@@ -306,7 +307,10 @@ describe('SubmissionSectionFormComponent test suite', () => {
};
compAsAny.formData = newSectionData;
compAsAny.sectionMetadata = ['dc.title'];
spyOn(compAsAny, 'inCurrentSubmissionScope').and.callThrough();
expect(comp.hasMetadataEnrichment(newSectionData)).toBeFalsy();
expect(compAsAny.inCurrentSubmissionScope).toHaveBeenCalledWith('dc.title');
});
it('should return false when metadata has Metadata Enrichment but not belonging to sectionMetadata', () => {
@@ -318,6 +322,77 @@ describe('SubmissionSectionFormComponent test suite', () => {
expect(comp.hasMetadataEnrichment(newSectionData)).toBeFalsy();
});
describe('inCurrentSubmissionScope', () => {
beforeEach(() => {
// @ts-ignore
comp.formConfig = {
rows: [
{
fields: [
{
selectableMetadata: [{ metadata: 'scoped.workflow' }],
scope: 'WORKFLOW',
} as FormFieldModel
]
},
{
fields: [
{
selectableMetadata: [{ metadata: 'scoped.workspace' }],
scope: 'WORKSPACE',
} as FormFieldModel
]
},
{
fields: [
{
selectableMetadata: [{ metadata: 'dc.title' }],
} as FormFieldModel
]
}
]
};
});
describe('in workspace scope', () => {
beforeEach(() => {
// @ts-ignore
comp.submissionObject = { type: WorkspaceItem.type };
});
it('should return true for unscoped fields', () => {
expect((comp as any).inCurrentSubmissionScope('dc.title')).toBe(true);
});
it('should return true for fields scoped to workspace', () => {
expect((comp as any).inCurrentSubmissionScope('scoped.workspace')).toBe(true);
});
it('should return false for fields scoped to workflow', () => {
expect((comp as any).inCurrentSubmissionScope('scoped.workflow')).toBe(false);
});
});
describe('in workflow scope', () => {
beforeEach(() => {
// @ts-ignore
comp.submissionObject = { type: WorkflowItem.type };
});
it('should return true when field is unscoped', () => {
expect((comp as any).inCurrentSubmissionScope('dc.title')).toBe(true);
});
it('should return true for fields scoped to workflow', () => {
expect((comp as any).inCurrentSubmissionScope('scoped.workflow')).toBe(true);
});
it('should return false for fields scoped to workspace', () => {
expect((comp as any).inCurrentSubmissionScope('scoped.workspace')).toBe(false);
});
});
});
it('should update form properly', () => {
spyOn(comp, 'initForm');
spyOn(comp, 'checksForErrors');

View File

@@ -34,6 +34,9 @@ import { followLink } from '../../../shared/utils/follow-link-config.model';
import { environment } from '../../../../environments/environment';
import { ConfigObject } from '../../../core/config/models/config.model';
import { RemoteData } from '../../../core/data/remote-data';
import { SubmissionScopeType } from '../../../core/submission/submission-scope-type';
import { WorkflowItem } from '../../../core/submission/models/workflowitem.model';
import { SubmissionObject } from '../../../core/submission/models/submission-object.model';
/**
* This component represents a section that contains a Form.
@@ -112,7 +115,7 @@ export class SubmissionSectionFormComponent extends SectionModelComponent {
*/
protected subs: Subscription[] = [];
protected workspaceItem: WorkspaceItem;
protected submissionObject: SubmissionObject;
/**
* The FormComponent reference
*/
@@ -173,10 +176,10 @@ export class SubmissionSectionFormComponent extends SectionModelComponent {
getRemoteDataPayload())
])),
take(1))
.subscribe(([sectionData, workspaceItem]: [WorkspaceitemSectionFormObject, WorkspaceItem]) => {
.subscribe(([sectionData, submissionObject]: [WorkspaceitemSectionFormObject, SubmissionObject]) => {
if (isUndefined(this.formModel)) {
// this.sectionData.errorsToShow = [];
this.workspaceItem = workspaceItem;
this.submissionObject = submissionObject;
// Is the first loading so init form
this.initForm(sectionData);
this.sectionData.data = sectionData;
@@ -223,7 +226,7 @@ export class SubmissionSectionFormComponent extends SectionModelComponent {
const sectionDataToCheck = {};
Object.keys(sectionData).forEach((key) => {
if (this.sectionMetadata && this.sectionMetadata.includes(key)) {
if (this.sectionMetadata && this.sectionMetadata.includes(key) && this.inCurrentSubmissionScope(key)) {
sectionDataToCheck[key] = sectionData[key];
}
});
@@ -246,6 +249,28 @@ export class SubmissionSectionFormComponent extends SectionModelComponent {
return isNotEmpty(diffResult);
}
/**
* Whether a specific field is editable in the current scope. Unscoped fields always return true.
* @private
*/
private inCurrentSubmissionScope(field: string): boolean {
const scope = this.formConfig?.rows.find(row => {
return row.fields?.[0]?.selectableMetadata?.[0]?.metadata === field;
}).fields?.[0]?.scope;
switch (scope) {
case SubmissionScopeType.WorkspaceItem: {
return this.submissionObject.type === WorkspaceItem.type;
}
case SubmissionScopeType.WorkflowItem: {
return this.submissionObject.type === WorkflowItem.type;
}
default: {
return true;
}
}
}
/**
* Initialize form model
*

File diff suppressed because it is too large Load Diff

View File

@@ -1622,6 +1622,19 @@
// "dso-selector.placeholder": "Search for a {{ type }}",
"dso-selector.placeholder": "Rechercher un(e) {{ type }}",
// "dso-selector.select.collection.head": "Select a collection",
"dso-selector.select.collection.head": "Sélectionner une collection",
// "dso-selector.set-scope.community.head": "Select a search scope",
"dso-selector.set-scope.community.head": "Sélectionnez un champ de recherche",
// "dso-selector.set-scope.community.button": "Search all of DSpace",
"dso-selector.set-scope.community.button": "Chercher dans toutes les collections",
// "dso-selector.set-scope.community.input-header": "Search for a community or collection",
"dso-selector.set-scope.community.input-header": "Chercher une communauté ou une collection",
// "confirmation-modal.export-metadata.header": "Export metadata for {{ dsoName }}",
"confirmation-modal.export-metadata.header": "Exporter métadonnées de {{ dsoName }}",
@@ -4282,9 +4295,29 @@
// "sorting.dc.title.DESC": "Title Descending",
"sorting.dc.title.DESC": "Titre décroissant",
// "sorting.score.DESC": "Relevance",
"sorting.score.DESC": "Pertinence",
// "sorting.score.ASC": "Least Relevant",
"sorting.score.ASC": "Le moins pertinent",
// "sorting.score.DESC": "Most Relevant",
"sorting.score.DESC": "Le plus pertinent",
// "sorting.dc.date.issued.ASC": "Date Issued Ascending",
"sorting.dc.date.issued.ASC": "Date de publication (croissante)",
// "sorting.dc.date.issued.DESC": "Date Issued Descending",
"sorting.dc.date.issued.DESC": "Date de publication (decroissante)",
// "sorting.dc.date.accessioned.ASC": "Accessioned Date Ascending",
"sorting.dc.date.accessioned.ASC": "Date de dépôt (croissante)",
// "sorting.dc.date.accessioned.DESC": "Accessioned Date Descending",
"sorting.dc.date.accessioned.DESC": "Date de dépôt (decroissante)",
// "sorting.lastModified.ASC": "Last modified Ascending",
"sorting.lastModified.ASC": "Dernière modification (croissante)",
// "sorting.lastModified.DESC": "Last modified Descending",
"sorting.lastModified.ASC": "Dernière modification (descroissante)",
// "statistics.title": "Statistics",

View File

@@ -3,7 +3,6 @@ import { makeStateKey } from '@angular/platform-browser';
import { Config } from './config.interface';
import { ServerConfig } from './server-config.interface';
import { CacheConfig } from './cache-config.interface';
import { UniversalConfig } from './universal-config.interface';
import { INotificationBoardOptions } from './notifications-config.interfaces';
import { SubmissionConfig } from './submission-config.interface';
import { FormConfig } from './form-config.interfaces';
@@ -25,7 +24,6 @@ interface AppConfig extends Config {
form: FormConfig;
notifications: INotificationBoardOptions;
submission: SubmissionConfig;
universal: UniversalConfig;
debug: boolean;
defaultLanguage: string;
languages: LangConfig[];

View File

@@ -0,0 +1,6 @@
import { AppConfig } from './app-config.interface';
import { UniversalConfig } from './universal-config.interface';
export interface BuildConfig extends AppConfig {
universal: UniversalConfig;
}

View File

@@ -14,18 +14,10 @@ import { ServerConfig } from './server-config.interface';
import { SubmissionConfig } from './submission-config.interface';
import { ThemeConfig } from './theme.model';
import { UIServerConfig } from './ui-server-config.interface';
import { UniversalConfig } from './universal-config.interface';
export class DefaultAppConfig implements AppConfig {
production = false;
// Angular Universal settings
universal: UniversalConfig = {
preboot: true,
async: true,
time: false
};
// NOTE: will log all redux actions and transfers in console
debug = false;

5
src/environments/.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
environment.*.ts
!environment.production.ts
!environment.test.ts
!environment.ts

View File

@@ -1,6 +1,6 @@
import { AppConfig } from '../config/app-config.interface';
import { BuildConfig } from '../config/build-config.interface';
export const environment: Partial<AppConfig> = {
export const environment: Partial<BuildConfig> = {
production: true,
// Angular Universal settings

View File

@@ -1,9 +1,9 @@
// This configuration is only used for unit tests, end-to-end tests use environment.production.ts
import { BuildConfig } from 'src/config/build-config.interface';
import { RestRequestMethod } from '../app/core/data/rest-request-method';
import { NotificationAnimationsType } from '../app/shared/notifications/models/notification-animations-type';
import { AppConfig } from '../config/app-config.interface';
export const environment: AppConfig = {
export const environment: BuildConfig = {
production: false,
// Angular Universal settings

View File

@@ -3,9 +3,9 @@
// `ng test --configuration test` replaces `environment.ts` with `environment.test.ts`.
// The list of file replacements can be found in `angular.json`.
import { AppConfig } from '../config/app-config.interface';
import { BuildConfig } from '../config/build-config.interface';
export const environment: Partial<AppConfig> = {
export const environment: Partial<BuildConfig> = {
production: false,
// Angular Universal settings

View File

@@ -30,7 +30,9 @@ const main = () => {
if (environment.production) {
enableProdMode();
}
if (hasValue(environment.universal) && environment.universal.preboot) {
return bootstrap();
} else {
@@ -47,7 +49,7 @@ const main = () => {
};
// support async tag or hmr
if (hasValue(environment.universal) && environment.universal.preboot === false) {
if (hasValue(environment.universal) && !environment.universal.preboot) {
main();
} else {
document.addEventListener('DOMContentLoaded', main);

260
yarn.lock
View File

@@ -1940,6 +1940,11 @@
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea"
integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==
"@socket.io/base64-arraybuffer@~1.0.2":
version "1.0.2"
resolved "https://registry.yarnpkg.com/@socket.io/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz#568d9beae00b0d835f4f8c53fd55714986492e61"
integrity sha512-dOlCBKnDw4iShaIsH/bxujKTM18+2TOAsYz+KSc11Am38H4q5Xw8Bbz97ZYdrVNM+um3p7w86Bvvmcn9q+5+eQ==
"@szmarczak/http-timer@^1.1.2":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421"
@@ -1970,6 +1975,11 @@
resolved "https://registry.yarnpkg.com/@types/circular-json/-/circular-json-0.4.0.tgz#7401f7e218cfe87ad4c43690da5658b9acaf51be"
integrity sha512-7+kYB7x5a7nFWW1YPBh3KxhwKfiaI4PbZ1RvzBU91LZy7lWJO822CI+pqzSre/DZ7KsCuMKdHnLHHFu8AyXbQg==
"@types/component-emitter@^1.2.10":
version "1.2.11"
resolved "https://registry.yarnpkg.com/@types/component-emitter/-/component-emitter-1.2.11.tgz#50d47d42b347253817a39709fef03ce66a108506"
integrity sha512-SRXjM+tfsSlA9VuG8hGO2nft2p8zjXCK1VcC6N4NXbBbYbSia9kzCChYQajIjzIqOOOuh5Ock6MmV2oux4jDZQ==
"@types/connect@*":
version "3.4.35"
resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.35.tgz#5fcf6ae445e4021d1fc2219a4873cc73a3bb2ad1"
@@ -1977,6 +1987,16 @@
dependencies:
"@types/node" "*"
"@types/cookie@^0.4.1":
version "0.4.1"
resolved "https://registry.yarnpkg.com/@types/cookie/-/cookie-0.4.1.tgz#bfd02c1f2224567676c1545199f87c3a861d878d"
integrity sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==
"@types/cors@^2.8.12":
version "2.8.12"
resolved "https://registry.yarnpkg.com/@types/cors/-/cors-2.8.12.tgz#6b2c510a7ad7039e98e7b8d3d6598f4359e5c080"
integrity sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==
"@types/deep-freeze@0.1.2":
version "0.1.2"
resolved "https://registry.yarnpkg.com/@types/deep-freeze/-/deep-freeze-0.1.2.tgz#68e5379291910e82c2f0d1629732163c2aa662cc"
@@ -2081,6 +2101,11 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.12.tgz#ac7fb693ac587ee182c3780c26eb65546a1a3c10"
integrity sha512-+2Iggwg7PxoO5Kyhvsq9VarmPbIelXP070HMImEpbtGCoyWNINQj4wzjbQCXzdHTRXnqufutJb5KAURZANNBAw==
"@types/node@>=10.0.0":
version "17.0.17"
resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.17.tgz#a8ddf6e0c2341718d74ee3dc413a13a042c45a0c"
integrity sha512-e8PUNQy1HgJGV3iU/Bp2+D/DXh3PYeyli8LgIwsQcs1Ar1LoaWHSIT6Rw+H2rNJmiq6SNWiDytfx8+gYj7wDHw==
"@types/node@^14.14.31", "@types/node@^14.14.9":
version "14.18.0"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.0.tgz#98df2397f6936bfbff4f089e40e06fa5dd88d32a"
@@ -3043,7 +3068,7 @@ base64-js@^1.0.2, base64-js@^1.3.1:
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a"
integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==
base64id@2.0.0:
base64id@2.0.0, base64id@~2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/base64id/-/base64id-2.0.0.tgz#2770ac6bc47d312af97a8bf9a634342e0cd25cb6"
integrity sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==
@@ -4036,7 +4061,7 @@ colorette@^2.0.10, colorette@^2.0.14, colorette@^2.0.16:
resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.16.tgz#713b9af84fdb000139f04546bd4a93f62a5085da"
integrity sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g==
colors@1.4.0, colors@^1.1.2, colors@^1.4.0:
colors@1.4.0, colors@^1.1.2:
version "1.4.0"
resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78"
integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==
@@ -4378,6 +4403,14 @@ core-util-is@~1.0.0:
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85"
integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==
cors@~2.8.5:
version "2.8.5"
resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29"
integrity sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==
dependencies:
object-assign "^4"
vary "^1"
cosmiconfig@^5.0.0:
version "5.2.1"
resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.1.tgz#040f726809c591e77a17c0a3626ca45b4f168b1a"
@@ -4995,15 +5028,10 @@ data-urls@^2.0.0:
whatwg-mimetype "^2.3.0"
whatwg-url "^8.0.0"
date-format@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/date-format/-/date-format-2.1.0.tgz#31d5b5ea211cf5fd764cd38baf9d033df7e125cf"
integrity sha512-bYQuGLeFxhkxNOF3rcMtiZxvCBAquGzZm6oWA1oZ0g2THUzivaRhv8uOhdr19LmoobSOLoIAxeUK2RdbM8IFTA==
date-format@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/date-format/-/date-format-3.0.0.tgz#eb8780365c7d2b1511078fb491e6479780f3ad95"
integrity sha512-eyTcpKOcamdhWJXj56DpQMo1ylSQpcGtGKXcU0Tb97+K56/CF5amAqqqNj0+KvA0iw2ynxtHWFsPDSClCxe48w==
date-format@^4.0.3:
version "4.0.3"
resolved "https://registry.yarnpkg.com/date-format/-/date-format-4.0.3.tgz#f63de5dc08dc02efd8ef32bf2a6918e486f35873"
integrity sha512-7P3FyqDcfeznLZp2b+OMitV9Sz2lUnsT87WaTat9nVwqsBkTzPG3lPLNwW3en6F4pHUiWzr6vb8CLhjdK9bcxQ==
dayjs@^1.10.4:
version "1.10.7"
@@ -5024,7 +5052,7 @@ debug@2.6.9, debug@^2.2.0, debug@^2.3.3:
dependencies:
ms "2.0.0"
debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.2.0, debug@^4.3.2:
debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.2.0, debug@^4.3.2, debug@^4.3.3, debug@~4.3.1, debug@~4.3.2:
version "4.3.3"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664"
integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==
@@ -5603,6 +5631,13 @@ engine.io-parser@~2.2.0:
blob "0.0.5"
has-binary2 "~1.0.2"
engine.io-parser@~5.0.0:
version "5.0.3"
resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-5.0.3.tgz#ca1f0d7b11e290b4bfda251803baea765ed89c09"
integrity sha512-BtQxwF27XUNnSafQLvDi0dQ8s3i6VgzSoQMJacpIcGNrlUdfHSKbgm3jmjCVvQluGzqwujQMPAoMai3oYSTurg==
dependencies:
"@socket.io/base64-arraybuffer" "~1.0.2"
engine.io@~3.5.0:
version "3.5.0"
resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-3.5.0.tgz#9d6b985c8a39b1fe87cd91eb014de0552259821b"
@@ -5615,6 +5650,22 @@ engine.io@~3.5.0:
engine.io-parser "~2.2.0"
ws "~7.4.2"
engine.io@~6.1.0:
version "6.1.2"
resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-6.1.2.tgz#e7b9d546d90c62246ffcba4d88594be980d3855a"
integrity sha512-v/7eGHxPvO2AWsksyx2PUsQvBafuvqs0jJJQ0FdmJG1b9qIvgSbqDRGwNhfk2XHaTTbTXiC4quRE8Q9nRjsrQQ==
dependencies:
"@types/cookie" "^0.4.1"
"@types/cors" "^2.8.12"
"@types/node" ">=10.0.0"
accepts "~1.3.4"
base64id "2.0.0"
cookie "~0.4.1"
cors "~2.8.5"
debug "~4.3.1"
engine.io-parser "~5.0.0"
ws "~8.2.3"
enhanced-resolve@4.3.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.3.0.tgz#3b806f3bfafc1ec7de69551ef93cca46c1704126"
@@ -6261,10 +6312,10 @@ find-up@^4.0.0, find-up@^4.1.0:
locate-path "^5.0.0"
path-exists "^4.0.0"
flatted@^2.0.1:
version "2.0.2"
resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138"
integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==
flatted@^3.2.4:
version "3.2.5"
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.5.tgz#76c8584f4fc843db64702a6bd04ab7a8bd666da3"
integrity sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==
flatten@^1.0.2:
version "1.0.3"
@@ -6280,9 +6331,9 @@ flush-write-stream@^1.0.0:
readable-stream "^2.3.6"
follow-redirects@^1.0.0, follow-redirects@^1.14.0:
version "1.14.5"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.5.tgz#f09a5848981d3c772b5392309778523f8d85c381"
integrity sha512-wtphSXy7d4/OR+MvIFbCVBDzZ5520qV8XfPklSN5QtxuMUJZ+b0Wnst1e1lCDocfzuCkHqj8k0FpZqO+UIaKNA==
version "1.14.9"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.9.tgz#dd4ea157de7bfaf9ea9b3fbd85aa16951f78d8d7"
integrity sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==
font-awesome@4.7.0:
version "4.7.0"
@@ -6393,14 +6444,14 @@ fs-extra@^0.22.1:
jsonfile "^2.1.0"
rimraf "^2.2.8"
fs-extra@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0"
integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==
fs-extra@^10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.0.0.tgz#9ff61b655dde53fb34a82df84bb214ce802e17c1"
integrity sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==
dependencies:
graceful-fs "^4.2.0"
jsonfile "^4.0.0"
universalify "^0.1.0"
jsonfile "^6.0.1"
universalify "^2.0.0"
fs-extra@^9.0.0, fs-extra@^9.1.0:
version "9.1.0"
@@ -6590,7 +6641,7 @@ glob@7.1.6:
once "^1.3.0"
path-is-absolute "^1.0.0"
glob@^7.0.3, glob@^7.0.6, glob@^7.1.1, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@~7.2.0:
glob@^7.0.3, glob@^7.0.6, glob@^7.1.1, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@^7.1.7, glob@~7.2.0:
version "7.2.0"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023"
integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==
@@ -7854,7 +7905,7 @@ isarray@2.0.1:
resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.1.tgz#a37d94ed9cda2d59865c9f76fe596ee1f338741e"
integrity sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=
isbinaryfile@^4.0.6:
isbinaryfile@^4.0.8:
version "4.0.8"
resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-4.0.8.tgz#5d34b94865bd4946633ecc78a026fc76c5b11fcf"
integrity sha512-53h6XFniq77YdW+spoRrebh0mnmTxRPTlcuIArO57lmMdq4uBKFKaeTjnb92oYWrSn/LVL+LT+Hap2tFQj8V+w==
@@ -8341,34 +8392,34 @@ karma-source-map-support@1.4.0:
dependencies:
source-map-support "^0.5.5"
karma@^5.2.3:
version "5.2.3"
resolved "https://registry.yarnpkg.com/karma/-/karma-5.2.3.tgz#3264024219bad2728e92542e0058a2492d7a46e4"
integrity sha512-tHdyFADhVVPBorIKCX8A37iLHxc6RBRphkSoQ+MLKdAtFn1k97tD8WUGi1KlEtDZKL3hui0qhsY9HXUfSNDYPQ==
karma@^6.3.14:
version "6.3.14"
resolved "https://registry.yarnpkg.com/karma/-/karma-6.3.14.tgz#1ed57a489249b9260bc604325ae333766d4cddc9"
integrity sha512-SDFoU5F4LdosEiUVWUDRPCV/C1zQRNtIakx7rWkigf7R4sxGADlSEeOma4S1f/js7YAzvqLW92ByoiQptg+8oQ==
dependencies:
body-parser "^1.19.0"
braces "^3.0.2"
chokidar "^3.4.2"
colors "^1.4.0"
chokidar "^3.5.1"
colors "1.4.0"
connect "^3.7.0"
di "^0.0.1"
dom-serialize "^2.2.1"
glob "^7.1.6"
graceful-fs "^4.2.4"
glob "^7.1.7"
graceful-fs "^4.2.6"
http-proxy "^1.18.1"
isbinaryfile "^4.0.6"
lodash "^4.17.19"
log4js "^6.2.1"
mime "^2.4.5"
isbinaryfile "^4.0.8"
lodash "^4.17.21"
log4js "^6.4.1"
mime "^2.5.2"
minimatch "^3.0.4"
qjobs "^1.2.0"
range-parser "^1.2.1"
rimraf "^3.0.2"
socket.io "^2.3.0"
socket.io "^4.2.0"
source-map "^0.6.1"
tmp "0.2.1"
ua-parser-js "0.7.22"
yargs "^15.3.1"
tmp "^0.2.1"
ua-parser-js "^0.7.30"
yargs "^16.1.1"
keyv@^3.0.0:
version "3.1.0"
@@ -8721,16 +8772,16 @@ log-update@^4.0.0:
slice-ansi "^4.0.0"
wrap-ansi "^6.2.0"
log4js@^6.2.1:
version "6.3.0"
resolved "https://registry.yarnpkg.com/log4js/-/log4js-6.3.0.tgz#10dfafbb434351a3e30277a00b9879446f715bcb"
integrity sha512-Mc8jNuSFImQUIateBFwdOQcmC6Q5maU0VVvdC2R6XMb66/VnT+7WS4D/0EeNMZu1YODmJe5NIn2XftCzEocUgw==
log4js@^6.4.1:
version "6.4.1"
resolved "https://registry.yarnpkg.com/log4js/-/log4js-6.4.1.tgz#9d3a8bf2c31c1e213fe3fc398a6053f7a2bc53e8"
integrity sha512-iUiYnXqAmNKiIZ1XSAitQ4TmNs8CdZYTAWINARF3LjnsLN8tY5m0vRwd6uuWj/yNY0YHxeZodnbmxKFUOM2rMg==
dependencies:
date-format "^3.0.0"
debug "^4.1.1"
flatted "^2.0.1"
rfdc "^1.1.4"
streamroller "^2.2.4"
date-format "^4.0.3"
debug "^4.3.3"
flatted "^3.2.4"
rfdc "^1.3.0"
streamroller "^3.0.2"
loglevel@^1.6.8:
version "1.8.0"
@@ -8995,7 +9046,7 @@ mime@1.6.0, mime@^1.4.1:
resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1"
integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==
mime@^2.4.4, mime@^2.4.5:
mime@^2.4.4, mime@^2.5.2:
version "2.6.0"
resolved "https://registry.yarnpkg.com/mime/-/mime-2.6.0.tgz#a2a682a95cd4d0cb1d6257e28f83da7e35800367"
integrity sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==
@@ -9290,9 +9341,9 @@ nan@^2.12.1:
integrity sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==
nanoid@^3.1.23, nanoid@^3.1.30:
version "3.1.30"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.30.tgz#63f93cc548d2a113dc5dfbc63bfa09e2b9b64362"
integrity sha512-zJpuPDwOv8D2zq2WRoMe1HsfZthVewpel9CAvTfc/2mBD1uUT/agc5f7GHGWXlYkFvi1mVxe4IjvP2HNrop7nQ==
version "3.3.1"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.1.tgz#6347a18cac88af88f58af0b3594b723d5e99bb35"
integrity sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==
nanomatch@^1.2.9:
version "1.2.13"
@@ -9398,9 +9449,9 @@ no-case@^3.0.4:
tslib "^2.0.3"
node-fetch@^2.6.1:
version "2.6.6"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.6.tgz#1751a7c01834e8e1697758732e9efb6eeadfaf89"
integrity sha512-Z8/6vRlTUChSdIgMa51jxQ4lrw/Jy5SOW10ObaA47/RElsAN2c5Pn8bTgFGWn/ibwzXTE8qwr1Yzx28vsecXEA==
version "2.6.7"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad"
integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==
dependencies:
whatwg-url "^5.0.0"
@@ -9674,7 +9725,7 @@ oauth-sign@~0.9.0:
resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455"
integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==
object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1:
object-assign@^4, object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=
@@ -12266,7 +12317,7 @@ rework@1.0.1:
convert-source-map "^0.3.3"
css "^2.0.0"
rfdc@^1.1.4, rfdc@^1.3.0:
rfdc@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.0.tgz#d0b7c441ab2720d05dc4cf26e01c89631d9da08b"
integrity sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==
@@ -12910,6 +12961,11 @@ socket.io-adapter@~1.1.0:
resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-1.1.2.tgz#ab3f0d6f66b8fc7fca3959ab5991f82221789be9"
integrity sha512-WzZRUj1kUjrTIrUKpZLEzFZ1OLj5FwLlAFQs9kuZJzJi5DKdU7FsWc36SNmA8iDOtwBQyT8FkrriRM8vXLYz8g==
socket.io-adapter@~2.3.3:
version "2.3.3"
resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-2.3.3.tgz#4d6111e4d42e9f7646e365b4f578269821f13486"
integrity sha512-Qd/iwn3VskrpNO60BeRyCyr8ZWw9CPZyitW4AQwmRZ8zCiyDiL+znRnWX6tDHXnWn1sJrM1+b6Mn6wEDJJ4aYQ==
socket.io-client@2.4.0, socket.io-client@^2.4.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-2.4.0.tgz#aafb5d594a3c55a34355562fc8aea22ed9119a35"
@@ -12945,6 +13001,15 @@ socket.io-parser@~3.4.0:
debug "~4.1.0"
isarray "2.0.1"
socket.io-parser@~4.0.4:
version "4.0.4"
resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-4.0.4.tgz#9ea21b0d61508d18196ef04a2c6b9ab630f4c2b0"
integrity sha512-t+b0SS+IxG7Rxzda2EVvyBZbvFPBCjJoyHuE0P//7OAsN23GItzDRdWa6ALxZI/8R5ygK7jAR6t028/z+7295g==
dependencies:
"@types/component-emitter" "^1.2.10"
component-emitter "~1.3.0"
debug "~4.3.1"
socket.io@2.4.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-2.4.0.tgz#01030a2727bd8eb2e85ea96d69f03692ee53d47e"
@@ -12957,17 +13022,17 @@ socket.io@2.4.0:
socket.io-client "2.4.0"
socket.io-parser "~3.4.0"
socket.io@^2.3.0:
version "2.4.1"
resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-2.4.1.tgz#95ad861c9a52369d7f1a68acf0d4a1b16da451d2"
integrity sha512-Si18v0mMXGAqLqCVpTxBa8MGqriHGQh8ccEOhmsmNS3thNCGBwO8WGrwMibANsWtQQ5NStdZwHqZR3naJVFc3w==
socket.io@^4.2.0:
version "4.4.1"
resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-4.4.1.tgz#cd6de29e277a161d176832bb24f64ee045c56ab8"
integrity sha512-s04vrBswdQBUmuWJuuNTmXUVJhP0cVky8bBDhdkf8y0Ptsu7fKU2LuLbts9g+pdmAdyMMn8F/9Mf1/wbtUN0fg==
dependencies:
debug "~4.1.0"
engine.io "~3.5.0"
has-binary2 "~1.0.2"
socket.io-adapter "~1.1.0"
socket.io-client "2.4.0"
socket.io-parser "~3.4.0"
accepts "~1.3.4"
base64id "~2.0.0"
debug "~4.3.2"
engine.io "~6.1.0"
socket.io-adapter "~2.3.3"
socket.io-parser "~4.0.4"
sockjs-client@1.4.0:
version "1.4.0"
@@ -13317,14 +13382,14 @@ stream-throttle@^0.1.3:
commander "^2.2.0"
limiter "^1.0.5"
streamroller@^2.2.4:
version "2.2.4"
resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-2.2.4.tgz#c198ced42db94086a6193608187ce80a5f2b0e53"
integrity sha512-OG79qm3AujAM9ImoqgWEY1xG4HX+Lw+yY6qZj9R1K2mhF5bEmQ849wvrb+4vt4jLMLzwXttJlQbOdPOQVRv7DQ==
streamroller@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-3.0.2.tgz#30418d0eee3d6c93ec897f892ed098e3a81e68b7"
integrity sha512-ur6y5S5dopOaRXBuRIZ1u6GC5bcEXHRZKgfBjfCglMhmIf+roVCECjvkEYzNQOXIN2/JPnkMPW/8B3CZoKaEPA==
dependencies:
date-format "^2.1.0"
date-format "^4.0.3"
debug "^4.1.1"
fs-extra "^8.1.0"
fs-extra "^10.0.0"
strict-uri-encode@^1.0.0:
version "1.1.0"
@@ -13786,13 +13851,6 @@ tmp@0.0.30:
dependencies:
os-tmpdir "~1.0.1"
tmp@0.2.1, tmp@~0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.1.tgz#8457fc3037dcf4719c251367a1af6500ee1ccf14"
integrity sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==
dependencies:
rimraf "^3.0.0"
tmp@^0.0.33:
version "0.0.33"
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"
@@ -13800,6 +13858,13 @@ tmp@^0.0.33:
dependencies:
os-tmpdir "~1.0.2"
tmp@^0.2.1, tmp@~0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.1.tgz#8457fc3037dcf4719c251367a1af6500ee1ccf14"
integrity sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==
dependencies:
rimraf "^3.0.0"
to-array@0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/to-array/-/to-array-0.1.4.tgz#17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890"
@@ -14106,16 +14171,16 @@ typescript@~4.0.5:
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.8.tgz#5739105541db80a971fdbd0d56511d1a6f17d37f"
integrity sha512-oz1765PN+imfz1MlZzSZPtC/tqcwsCyIYA8L47EkRnRW97ztRk83SzMiWLrnChC0vqoYxSU1fcFUDA5gV/ZiPg==
ua-parser-js@0.7.22:
version "0.7.22"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.22.tgz#960df60a5f911ea8f1c818f3747b99c6e177eae3"
integrity sha512-YUxzMjJ5T71w6a8WWVcMGM6YWOTX27rCoIQgLXiWaxqXSx9D7DNjiGWn1aJIRSQ5qr0xuhra77bSIh6voR/46Q==
ua-parser-js@1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-1.0.2.tgz#e2976c34dbfb30b15d2c300b2a53eac87c57a775"
integrity sha512-00y/AXhx0/SsnI51fTc0rLRmafiGOM4/O+ny10Ps7f+j/b8p/ZY11ytMgznXkOVo4GQ+KwQG5UQLkLGirsACRg==
ua-parser-js@^0.7.30:
version "0.7.31"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.31.tgz#649a656b191dffab4f21d5e053e27ca17cbff5c6"
integrity sha512-qLK/Xe9E2uzmYI3qLeOmI0tEOt+TBBQyUIAh4aAgU05FVYzeZrKUdkAZfBNVGRaHVgV0TDkdEngJSw/SyQchkQ==
unbox-primitive@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471"
@@ -14286,10 +14351,10 @@ url-parse-lax@^3.0.0:
dependencies:
prepend-http "^2.0.0"
url-parse@^1.4.3, url-parse@^1.5.3:
version "1.5.3"
resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.3.tgz#71c1303d38fb6639ade183c2992c8cc0686df862"
integrity sha512-IIORyIQD9rvj0A4CLWsHkBBJuNqWpFQe224b6j9t/ABmquIS0qDU2pY6kl6AuOrL5OkCXHMCFNe1jBcuAggjvQ==
url-parse@^1.4.3, url-parse@^1.5.3, url-parse@^1.5.6:
version "1.5.6"
resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.6.tgz#b2a41d5a233645f3c31204cc8be60e76a15230a2"
integrity sha512-xj3QdUJ1DttD1LeSfvJlU1eiF1RvBSBfUu8GplFGdUzSO28y5yUtEl7wb//PI4Af6qh0o/K8545vUmucRrfWsw==
dependencies:
querystringify "^2.1.1"
requires-port "^1.0.0"
@@ -14381,7 +14446,7 @@ validate-npm-package-name@^3.0.0:
dependencies:
builtins "^1.0.3"
vary@~1.1.2:
vary@^1, vary@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=
@@ -15016,6 +15081,11 @@ ws@~7.4.2:
resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c"
integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==
ws@~8.2.3:
version "8.2.3"
resolved "https://registry.yarnpkg.com/ws/-/ws-8.2.3.tgz#63a56456db1b04367d0b721a0b80cae6d8becbba"
integrity sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==
xdg-basedir@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13"
@@ -15151,7 +15221,7 @@ yargs@^15.3.1, yargs@^15.4.1:
y18n "^4.0.0"
yargs-parser "^18.1.2"
yargs@^16.0.0, yargs@^16.2.0:
yargs@^16.0.0, yargs@^16.1.1, yargs@^16.2.0:
version "16.2.0"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66"
integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==