forked from DSpace/dspace-angular
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request DSpace#1475 from 4Science/CST-4506_item_embargo
Add submission section for item embargo
- Loading branch information
Showing
35 changed files
with
1,379 additions
and
84 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
src/app/core/config/models/config-accesses-conditions-options.model.ts
This file contains 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,45 @@ | ||
/** | ||
* Model class for an Item Access Condition | ||
*/ | ||
export class AccessesConditionOption { | ||
|
||
/** | ||
* The name for this Access Condition | ||
*/ | ||
name: string; | ||
|
||
/** | ||
* The groupName for this Access Condition | ||
*/ | ||
groupName: string; | ||
|
||
/** | ||
* A boolean representing if this Access Condition has a start date | ||
*/ | ||
hasStartDate: boolean; | ||
|
||
/** | ||
* A boolean representing if this Access Condition has an end date | ||
*/ | ||
hasEndDate: boolean; | ||
|
||
/** | ||
* Maximum value of the start date | ||
*/ | ||
endDateLimit?: string; | ||
|
||
/** | ||
* Maximum value of the end date | ||
*/ | ||
startDateLimit?: string; | ||
|
||
/** | ||
* Maximum value of the start date | ||
*/ | ||
maxStartDate?: string; | ||
|
||
/** | ||
* Maximum value of the end date | ||
*/ | ||
maxEndDate?: string; | ||
} |
42 changes: 42 additions & 0 deletions
42
src/app/core/config/models/config-submission-access.model.ts
This file contains 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,42 @@ | ||
import { autoserialize, deserialize, inheritSerialization } from 'cerialize'; | ||
import { typedObject } from '../../cache/builders/build-decorators'; | ||
import { ConfigObject } from './config.model'; | ||
import { AccessesConditionOption } from './config-accesses-conditions-options.model'; | ||
import { SUBMISSION_ACCESSES_TYPE } from './config-type'; | ||
import { HALLink } from '../../shared/hal-link.model'; | ||
|
||
/** | ||
* Class for the configuration describing the item accesses condition | ||
*/ | ||
@typedObject | ||
@inheritSerialization(ConfigObject) | ||
export class SubmissionAccessModel extends ConfigObject { | ||
static type = SUBMISSION_ACCESSES_TYPE; | ||
|
||
/** | ||
* A list of available item access conditions | ||
*/ | ||
@autoserialize | ||
accessConditionOptions: AccessesConditionOption[]; | ||
|
||
/** | ||
* Boolean that indicates whether the current item must be findable via search or browse. | ||
*/ | ||
@autoserialize | ||
discoverable: boolean; | ||
|
||
/** | ||
* Boolean that indicates whether or not the user can change the discoverable flag. | ||
*/ | ||
@autoserialize | ||
canChangeDiscoverable: boolean; | ||
|
||
/** | ||
* The links to all related resources returned by the rest api. | ||
*/ | ||
@deserialize | ||
_links: { | ||
self: HALLink | ||
}; | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
src/app/core/config/models/config-submission-accesses.model.ts
This file contains 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,10 @@ | ||
import { inheritSerialization } from 'cerialize'; | ||
import { typedObject } from '../../cache/builders/build-decorators'; | ||
import { SUBMISSION_ACCESSES_TYPE } from './config-type'; | ||
import { SubmissionAccessModel } from './config-submission-access.model'; | ||
|
||
@typedObject | ||
@inheritSerialization(SubmissionAccessModel) | ||
export class SubmissionAccessesModel extends SubmissionAccessModel { | ||
static type = SUBMISSION_ACCESSES_TYPE; | ||
} |
This file contains 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 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,42 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { ConfigService } from './config.service'; | ||
import { RequestService } from '../data/request.service'; | ||
import { HALEndpointService } from '../shared/hal-endpoint.service'; | ||
import { ObjectCacheService } from '../cache/object-cache.service'; | ||
import { dataService } from '../cache/builders/build-decorators'; | ||
import { SUBMISSION_ACCESSES_TYPE } from './models/config-type'; | ||
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; | ||
import { Store } from '@ngrx/store'; | ||
import { CoreState } from '../core.reducers'; | ||
import { NotificationsService } from '../../shared/notifications/notifications.service'; | ||
import { HttpClient } from '@angular/common/http'; | ||
import { DefaultChangeAnalyzer } from '../data/default-change-analyzer.service'; | ||
import { ConfigObject } from './models/config.model'; | ||
import { SubmissionAccessesModel } from './models/config-submission-accesses.model'; | ||
import { RemoteData } from '../data/remote-data'; | ||
import { Observable } from 'rxjs'; | ||
import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model'; | ||
|
||
/** | ||
* Provides methods to retrieve, from REST server, bitstream access conditions configurations applicable during the submission process. | ||
*/ | ||
@Injectable() | ||
@dataService(SUBMISSION_ACCESSES_TYPE) | ||
export class SubmissionAccessesConfigService extends ConfigService { | ||
constructor( | ||
protected requestService: RequestService, | ||
protected rdbService: RemoteDataBuildService, | ||
protected store: Store<CoreState>, | ||
protected objectCache: ObjectCacheService, | ||
protected halService: HALEndpointService, | ||
protected notificationsService: NotificationsService, | ||
protected http: HttpClient, | ||
protected comparator: DefaultChangeAnalyzer<SubmissionAccessesModel> | ||
) { | ||
super(requestService, rdbService, null, objectCache, halService, notificationsService, http, comparator, 'submissionaccessoptions'); | ||
} | ||
|
||
findByHref(href: string, useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow): Observable<RemoteData<SubmissionAccessesModel>> { | ||
return super.findByHref(href, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow as FollowLinkConfig<ConfigObject>[]) as Observable<RemoteData<SubmissionAccessesModel>>; | ||
} | ||
} |
This file contains 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 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,25 @@ | ||
/** | ||
* An interface to represent an access condition. | ||
*/ | ||
export class AccessConditionObject { | ||
|
||
/** | ||
* The access condition id | ||
*/ | ||
id: string; | ||
|
||
/** | ||
* The access condition name | ||
*/ | ||
name: string; | ||
|
||
/** | ||
* Possible start date of the access condition | ||
*/ | ||
startDate: string; | ||
|
||
/** | ||
* Possible end date of the access condition | ||
*/ | ||
endDate: string; | ||
} |
9 changes: 9 additions & 0 deletions
9
src/app/core/submission/models/submission-accesses.resource-type.ts
This file contains 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,9 @@ | ||
import { ResourceType } from '../../shared/resource-type'; | ||
|
||
/** | ||
* The resource type for Accesses section | ||
* | ||
* Needs to be in a separate file to prevent circular | ||
* dependencies in webpack. | ||
*/ | ||
export const SUBMISSION_ACCESSES = new ResourceType('submissionaccesses'); |
8 changes: 8 additions & 0 deletions
8
src/app/core/submission/models/submission-item-access-condition.model.ts
This file contains 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,8 @@ | ||
import { AccessConditionObject } from './access-condition.model'; | ||
|
||
/** | ||
* An interface to represent item's access condition. | ||
*/ | ||
export class SubmissionItemAccessConditionObject extends AccessConditionObject { | ||
|
||
} |
23 changes: 3 additions & 20 deletions
23
src/app/core/submission/models/submission-upload-file-access-condition.model.ts
This file contains 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 |
---|---|---|
@@ -1,25 +1,8 @@ | ||
import { AccessConditionObject } from './access-condition.model'; | ||
|
||
/** | ||
* An interface to represent bitstream's access condition. | ||
*/ | ||
export class SubmissionUploadFileAccessConditionObject { | ||
|
||
/** | ||
* The access condition id | ||
*/ | ||
id: string; | ||
|
||
/** | ||
* The access condition name | ||
*/ | ||
name: string; | ||
|
||
/** | ||
* Possible start date of the access condition | ||
*/ | ||
startDate: string; | ||
export class SubmissionUploadFileAccessConditionObject extends AccessConditionObject { | ||
|
||
/** | ||
* Possible end date of the access condition | ||
*/ | ||
endDate: string; | ||
} |
21 changes: 21 additions & 0 deletions
21
src/app/core/submission/models/workspaceitem-section-accesses.model.ts
This file contains 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,21 @@ | ||
import { SubmissionItemAccessConditionObject } from './submission-item-access-condition.model'; | ||
|
||
/** | ||
* An interface to represent the submission's item accesses condition. | ||
*/ | ||
export interface WorkspaceitemSectionAccessesObject { | ||
/** | ||
* The access condition id | ||
*/ | ||
id: string; | ||
|
||
/** | ||
* Boolean that indicates whether the current item must be findable via search or browse. | ||
*/ | ||
discoverable: boolean; | ||
|
||
/** | ||
* A list of available item access conditions | ||
*/ | ||
accessConditions: SubmissionItemAccessConditionObject[]; | ||
} |
This file contains 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 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 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 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.