Merge branch 'dmp-refactoring' of https://code-repo.d4science.org/MaDgiK-CITE/argos into dmp-refactoring

# Conflicts:
#	dmp-frontend/src/app/ui/plan/overview/plan-overview.component.html
This commit is contained in:
Sofia Papacharalampous 2024-07-08 15:20:38 +03:00
commit 986d83df49
136 changed files with 1111 additions and 806 deletions

View File

@ -165,8 +165,8 @@ public class DescriptionController {
@OperationWithTenantHeader(summary = "Query all descriptions", description = SwaggerHelpers.Description.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.Description.endpoint_query_request_body, content = @Content(
examples = {
@ExampleObject(
name = "Pagination and projection",
description = "Simple paginated request using a property projection list and pagination info",
name = SwaggerHelpers.Commons.pagination_example,
description = SwaggerHelpers.Commons.pagination_example_description,
value = SwaggerHelpers.Description.endpoint_query_request_body_example
)
}
@ -177,8 +177,8 @@ public class DescriptionController {
)
),
examples = @ExampleObject(
name = "First page",
description = "Example with the first page of paginated results",
name = SwaggerHelpers.Commons.pagination_response_example,
description = SwaggerHelpers.Commons.pagination_response_example_description,
value = SwaggerHelpers.Description.endpoint_query_response_example
))))
public QueryResult<Description> query(@RequestBody DescriptionLookup lookup) throws MyApplicationException, MyForbiddenException {

View File

@ -101,8 +101,8 @@ public class DescriptionTemplateController {
@OperationWithTenantHeader(summary = "Query all description templates", description = SwaggerHelpers.DescriptionTemplate.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.DescriptionTemplate.endpoint_query_request_body, content = @Content(
examples = {
@ExampleObject(
name = "Pagination and projection",
description = "Simple paginated request using a property projection list and pagination info",
name = SwaggerHelpers.Commons.pagination_example,
description = SwaggerHelpers.Commons.pagination_example_description,
value = SwaggerHelpers.DescriptionTemplate.endpoint_query_request_body_example
)
}
@ -113,8 +113,8 @@ public class DescriptionTemplateController {
)
),
examples = @ExampleObject(
name = "First page",
description = "Example with the first page of paginated results",
name = SwaggerHelpers.Commons.pagination_response_example,
description = SwaggerHelpers.Commons.pagination_response_example_description,
value = SwaggerHelpers.DescriptionTemplate.endpoint_query_response_example
))))
public QueryResult<DescriptionTemplate> query(@RequestBody DescriptionTemplateLookup lookup) throws MyApplicationException, MyForbiddenException {

View File

@ -82,8 +82,8 @@ public class DescriptionTemplateTypeController {
@OperationWithTenantHeader(summary = "Query all description template types", description = SwaggerHelpers.DescriptionTemplateType.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.DescriptionTemplateType.endpoint_query_request_body, content = @Content(
examples = {
@ExampleObject(
name = "Pagination and projection",
description = "Simple paginated request using a property projection list and pagination info",
name = SwaggerHelpers.Commons.pagination_example,
description = SwaggerHelpers.Commons.pagination_example_description,
value = SwaggerHelpers.DescriptionTemplateType.endpoint_query_request_body_example
)
}
@ -94,8 +94,8 @@ public class DescriptionTemplateTypeController {
)
),
examples = @ExampleObject(
name = "First page",
description = "Example with the first page of paginated results",
name = SwaggerHelpers.Commons.pagination_response_example,
description = SwaggerHelpers.Commons.pagination_response_example_description,
value = SwaggerHelpers.DescriptionTemplateType.endpoint_query_response_example
))))
public QueryResult<DescriptionTemplateType> Query(@RequestBody DescriptionTemplateTypeLookup lookup) throws MyApplicationException, MyForbiddenException {

View File

@ -82,8 +82,8 @@ public class EntityDoiController {
@OperationWithTenantHeader(summary = "Query all entity dois", description = SwaggerHelpers.EntityDoi.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.EntityDoi.endpoint_query_request_body, content = @Content(
examples = {
@ExampleObject(
name = "Pagination and projection",
description = "Simple paginated request using a property projection list and pagination info",
name = SwaggerHelpers.Commons.pagination_example,
description = SwaggerHelpers.Commons.pagination_example_description,
value = SwaggerHelpers.EntityDoi.endpoint_query_request_body_example
)
}
@ -94,8 +94,8 @@ public class EntityDoiController {
)
),
examples = @ExampleObject(
name = "First page",
description = "Example with the first page of paginated results",
name = SwaggerHelpers.Commons.pagination_response_example,
description = SwaggerHelpers.Commons.pagination_response_example_description,
value = SwaggerHelpers.EntityDoi.endpoint_query_response_example
))))
public QueryResult<EntityDoi> query(@RequestBody EntityDoiLookup lookup) throws MyApplicationException, MyForbiddenException {

View File

@ -105,8 +105,8 @@ public class LockController {
@OperationWithTenantHeader(summary = "Query all locked entities", description = SwaggerHelpers.Lock.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.Lock.endpoint_query_request_body, content = @Content(
examples = {
@ExampleObject(
name = "Pagination and projection",
description = "Simple paginated request using a property projection list and pagination info",
name = SwaggerHelpers.Commons.pagination_example,
description = SwaggerHelpers.Commons.pagination_example_description,
value = SwaggerHelpers.Lock.endpoint_query_request_body_example
)
}
@ -117,8 +117,8 @@ public class LockController {
)
),
examples = @ExampleObject(
name = "First page",
description = "Example with the first page of paginated results",
name = SwaggerHelpers.Commons.pagination_response_example,
description = SwaggerHelpers.Commons.pagination_response_example_description,
value = SwaggerHelpers.Lock.endpoint_query_response_example
))))
public QueryResult<Lock> query(@RequestBody LockLookup lookup) throws MyApplicationException, MyForbiddenException, InvalidAlgorithmParameterException, NoSuchPaddingException, IllegalBlockSizeException, NoSuchAlgorithmException, BadPaddingException, InvalidKeyException {

View File

@ -94,8 +94,8 @@ public class PlanBlueprintController {
@OperationWithTenantHeader(summary = "Query all plan blueprints", description = SwaggerHelpers.PlanBlueprint.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.PlanBlueprint.endpoint_query_request_body, content = @Content(
examples = {
@ExampleObject(
name = "Pagination and projection",
description = "Simple paginated request using a property projection list and pagination info",
name = SwaggerHelpers.Commons.pagination_example,
description = SwaggerHelpers.Commons.pagination_example_description,
value = SwaggerHelpers.PlanBlueprint.endpoint_query_request_body_example
)
}
@ -106,8 +106,8 @@ public class PlanBlueprintController {
)
),
examples = @ExampleObject(
name = "First page",
description = "Example with the first page of paginated results",
name = SwaggerHelpers.Commons.pagination_response_example,
description = SwaggerHelpers.Commons.pagination_response_example_description,
value = SwaggerHelpers.PlanBlueprint.endpoint_query_response_example
))))
public QueryResult<PlanBlueprint> query(@RequestBody PlanBlueprintLookup lookup) throws MyApplicationException, MyForbiddenException {

View File

@ -147,8 +147,8 @@ public class PlanController {
@PostMapping("query")
@OperationWithTenantHeader(summary = "Query all plans", description = SwaggerHelpers.Plan.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.Plan.endpoint_query_request_body, content = @Content(examples = @ExampleObject(
name = "Pagination and projection",
description = "Simple paginated request using a property projection list and pagination info",
name = SwaggerHelpers.Commons.pagination_example,
description = SwaggerHelpers.Commons.pagination_example_description,
value = SwaggerHelpers.Plan.endpoint_query_request_body_example
))), responses = @ApiResponse(description = "OK", responseCode = "200", content = @Content(
array = @ArraySchema(
@ -157,8 +157,8 @@ public class PlanController {
)
),
examples = @ExampleObject(
name = "First page",
description = "Example with the first page of paginated results",
name = SwaggerHelpers.Commons.pagination_response_example,
description = SwaggerHelpers.Commons.pagination_response_example_description,
value = SwaggerHelpers.Plan.endpoint_query_response_example
))))
public QueryResult<Plan> Query(@RequestBody PlanLookup lookup) throws MyApplicationException, MyForbiddenException {

View File

@ -14,7 +14,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import org.opencdmp.audit.AuditableAction;
import org.opencdmp.controllers.swagger.SwaggerHelpers;
import org.opencdmp.controllers.swagger.annotation.OperationWithTenantHeader;
import org.opencdmp.model.Lock;
import org.opencdmp.controllers.swagger.annotation.SwaggerCommonErrorResponses;
import org.opencdmp.model.Tenant;
import org.opencdmp.models.Account;
import org.opencdmp.models.AccountBuilder;
@ -32,12 +32,17 @@ import java.util.List;
@RestController
@RequestMapping("/api/principal/")
@Tag(name = "Principal", description = "Get user account information")
@SwaggerCommonErrorResponses
public class PrincipalController {
private static final LoggerService logger = new LoggerService(LoggerFactory.getLogger(PrincipalController.class));
private final AuditService auditService;
private final CurrentPrincipalResolver currentPrincipalResolver;
private final AccountBuilder accountBuilder;
private final TenantService tenantService;
@Autowired
@ -51,7 +56,7 @@ public class PrincipalController {
this.tenantService = tenantService;
}
@RequestMapping(path = "me", method = RequestMethod.GET )
@RequestMapping(path = "me", method = RequestMethod.GET)
@OperationWithTenantHeader(summary = "Fetch auth information of the logged in user", description = "",
responses = @ApiResponse(description = "OK", responseCode = "200", content = @Content(
schema = @Schema(

View File

@ -12,7 +12,6 @@ import gr.cite.tools.fieldset.FieldSet;
import gr.cite.tools.logging.LoggerService;
import gr.cite.tools.logging.MapLogEntry;
import gr.cite.tools.validation.ValidationFilterAnnotation;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
@ -33,7 +32,6 @@ import org.opencdmp.data.ReferenceEntity;
import org.opencdmp.model.builder.reference.ReferenceBuilder;
import org.opencdmp.model.censorship.reference.ReferenceCensor;
import org.opencdmp.model.persist.ReferencePersist;
import org.opencdmp.model.planblueprint.PlanBlueprint;
import org.opencdmp.model.reference.Reference;
import org.opencdmp.model.result.QueryResult;
import org.opencdmp.query.ReferenceQuery;
@ -74,7 +72,6 @@ public class ReferenceController {
private final MessageSource messageSource;
@Autowired
public ReferenceController(
BuilderFactory builderFactory,
@ -95,8 +92,8 @@ public class ReferenceController {
@OperationWithTenantHeader(summary = "Query all references", description = SwaggerHelpers.Reference.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.Reference.endpoint_query_request_body, content = @Content(
examples = {
@ExampleObject(
name = "Pagination and projection",
description = "Simple paginated request using a property projection list and pagination info",
name = SwaggerHelpers.Commons.pagination_example,
description = SwaggerHelpers.Commons.pagination_example_description,
value = SwaggerHelpers.Reference.endpoint_query_request_body_example
)
}
@ -107,8 +104,8 @@ public class ReferenceController {
)
),
examples = @ExampleObject(
name = "First page",
description = "Example with the first page of paginated results",
name = SwaggerHelpers.Commons.pagination_response_example,
description = SwaggerHelpers.Commons.pagination_response_example_description,
value = SwaggerHelpers.Reference.endpoint_query_response_example
))))
public QueryResult<Reference> query(@RequestBody ReferenceLookup lookup) throws MyApplicationException, MyForbiddenException {
@ -126,10 +123,27 @@ public class ReferenceController {
return new QueryResult<>(models, count);
}
@PostMapping("search")
@Hidden
//TODO thgiannos add swagger docs
@OperationWithTenantHeader(summary = "Query all references including results from external APIs", description = SwaggerHelpers.Reference.endpoint_search, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.Reference.endpoint_search_request_body, content = @Content(
examples = {
@ExampleObject(
name = SwaggerHelpers.Commons.pagination_example,
description = SwaggerHelpers.Commons.pagination_example_description,
value = SwaggerHelpers.Reference.endpoint_search_request_body_example
)
}
)), responses = @ApiResponse(description = "OK", responseCode = "200", content = @Content(
array = @ArraySchema(
schema = @Schema(
implementation = Reference.class
)
),
examples = @ExampleObject(
name = SwaggerHelpers.Commons.pagination_response_example,
description = SwaggerHelpers.Commons.pagination_response_example_description,
value = SwaggerHelpers.Reference.endpoint_search_response_example
))))
@Swagger404
public List<Reference> searchReferenceWithDefinition(@RequestBody ReferenceSearchLookup lookup) throws MyNotFoundException, InvalidApplicationException {
logger.debug("search with db definition {}", Reference.class.getSimpleName());

View File

@ -94,8 +94,8 @@ public class ReferenceTypeController{
@OperationWithTenantHeader(summary = "Query all reference types", description = SwaggerHelpers.ReferenceType.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.ReferenceType.endpoint_query_request_body, content = @Content(
examples = {
@ExampleObject(
name = "Pagination and projection",
description = "Simple paginated request using a property projection list and pagination info",
name = SwaggerHelpers.Commons.pagination_example,
description = SwaggerHelpers.Commons.pagination_example_description,
value = SwaggerHelpers.ReferenceType.endpoint_query_request_body_example
)
}
@ -106,8 +106,8 @@ public class ReferenceTypeController{
)
),
examples = @ExampleObject(
name = "First page",
description = "Example with the first page of paginated results",
name = SwaggerHelpers.Commons.pagination_response_example,
description = SwaggerHelpers.Commons.pagination_response_example_description,
value = SwaggerHelpers.ReferenceType.endpoint_query_response_example
))))
public QueryResult<ReferenceType> query(@RequestBody ReferenceTypeLookup lookup) throws MyApplicationException, MyForbiddenException {

View File

@ -81,8 +81,8 @@ public class TagController {
@OperationWithTenantHeader(summary = "Query all tags", description = SwaggerHelpers.Tag.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.Tag.endpoint_query_request_body, content = @Content(
examples = {
@ExampleObject(
name = "Pagination and projection",
description = "Simple paginated request using a property projection list and pagination info",
name = SwaggerHelpers.Commons.pagination_example,
description = SwaggerHelpers.Commons.pagination_example_description,
value = SwaggerHelpers.Tag.endpoint_query_request_body_example
)
}
@ -93,8 +93,8 @@ public class TagController {
)
),
examples = @ExampleObject(
name = "First page",
description = "Example with the first page of paginated results",
name = SwaggerHelpers.Commons.pagination_response_example,
description = SwaggerHelpers.Commons.pagination_response_example_description,
value = SwaggerHelpers.Tag.endpoint_query_response_example
))))
public QueryResult<Tag> Query(@RequestBody TagLookup lookup) throws MyApplicationException, MyForbiddenException {

View File

@ -12,7 +12,6 @@ import gr.cite.tools.fieldset.FieldSet;
import gr.cite.tools.logging.LoggerService;
import gr.cite.tools.logging.MapLogEntry;
import gr.cite.tools.validation.ValidationFilterAnnotation;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
@ -37,9 +36,11 @@ import org.opencdmp.model.builder.PlanAssociatedUserBuilder;
import org.opencdmp.model.builder.UserBuilder;
import org.opencdmp.model.censorship.PlanAssociatedUserCensor;
import org.opencdmp.model.censorship.UserCensor;
import org.opencdmp.model.persist.*;
import org.opencdmp.model.persist.UserMergeRequestPersist;
import org.opencdmp.model.persist.UserPersist;
import org.opencdmp.model.persist.UserRolePatchPersist;
import org.opencdmp.model.persist.UserTenantUsersInviteRequest;
import org.opencdmp.model.persist.actionconfirmation.RemoveCredentialRequestPersist;
import org.opencdmp.model.plan.Plan;
import org.opencdmp.model.result.QueryResult;
import org.opencdmp.model.user.User;
import org.opencdmp.query.UserQuery;
@ -110,8 +111,8 @@ public class UserController {
@OperationWithTenantHeader(summary = "Query all users", description = SwaggerHelpers.User.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.User.endpoint_query_request_body, content = @Content(
examples = {
@ExampleObject(
name = "Pagination and projection",
description = "Simple paginated request using a property projection list and pagination info",
name = SwaggerHelpers.Commons.pagination_example,
description = SwaggerHelpers.Commons.pagination_example_description,
value = SwaggerHelpers.User.endpoint_query_request_body_example
)
}
@ -122,8 +123,8 @@ public class UserController {
)
),
examples = @ExampleObject(
name = "First page",
description = "Example with the first page of paginated results",
name = SwaggerHelpers.Commons.pagination_response_example,
description = SwaggerHelpers.Commons.pagination_response_example_description,
value = SwaggerHelpers.User.endpoint_query_response_example
))))
public QueryResult<User> query(@RequestBody UserLookup lookup) throws MyApplicationException, MyForbiddenException {
@ -143,7 +144,25 @@ public class UserController {
}
@PostMapping("plan-associated/query")
@Hidden
@OperationWithTenantHeader(summary = "Query all plan associated users", description = SwaggerHelpers.User.endpoint_query_plan_associated, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.User.endpoint_query_request_body, content = @Content(
examples = {
@ExampleObject(
name = SwaggerHelpers.Commons.pagination_example,
description = SwaggerHelpers.Commons.pagination_example_description,
value = SwaggerHelpers.User.endpoint_query_plan_associated_request_body_example
)
}
)), responses = @ApiResponse(description = "OK", responseCode = "200", content = @Content(
array = @ArraySchema(
schema = @Schema(
implementation = PlanAssociatedUser.class
)
),
examples = @ExampleObject(
name = SwaggerHelpers.Commons.pagination_response_example,
description = SwaggerHelpers.Commons.pagination_response_example_description,
value = SwaggerHelpers.User.endpoint_query_plan_associated_response_example
))))
public QueryResult<PlanAssociatedUser> queryPlanAssociated(@RequestBody UserLookup lookup) throws MyApplicationException, MyForbiddenException {
logger.debug("querying {}", User.class.getSimpleName());
@ -219,8 +238,11 @@ public class UserController {
}
@GetMapping("/export/csv/{hasTenantAdminMode}")
@Hidden
public ResponseEntity<byte[]> exportCsv(@PathVariable("hasTenantAdminMode") Boolean hasTenantAdminMode) throws MyApplicationException, MyForbiddenException, MyNotFoundException, IOException, InvalidApplicationException {
@OperationWithTenantHeader(summary = "Export users in a .csv file", description = "",
responses = @ApiResponse(description = "OK", responseCode = "200"))
public ResponseEntity<byte[]> exportCsv(
@Parameter(name = "hasTenantAdminMode", description = "Controls whether to fetch users as a tenant admin or not", example = "false", required = true) @PathVariable("hasTenantAdminMode") Boolean hasTenantAdminMode
) throws MyApplicationException, MyForbiddenException, MyNotFoundException, IOException, InvalidApplicationException {
logger.debug(new MapLogEntry("export" + User.class.getSimpleName()).And("hasTenantAdminMode", hasTenantAdminMode));
// this.censorFactory.censor(UserCensor.class).censor(fieldSet, null);

View File

@ -8,6 +8,26 @@ public final class SwaggerHelpers {
"""
This is an object containing a list of the properties you wish to include in the response, similar to the 'project' attribute on queries.
""";
public static final String pagination_example =
"""
Pagination and projection
""";
public static final String pagination_example_description =
"""
Simple paginated request using a property projection list and pagination info
""";
public static final String pagination_response_example =
"""
Pagination and projection
""";
public static final String pagination_response_example_description =
"""
Simple paginated request using a property projection list and pagination info
""";
}
public static final class Errors {
@ -3346,6 +3366,190 @@ public final class SwaggerHelpers {
}
""";
public static final String endpoint_search =
"""
This endpoint is used to fetch all the available references.<br/>
It also allows to restrict the results using a query object passed in the request body.<br/>
""";
public static final String endpoint_search_request_body =
"""
Let's explore the options this object gives us.
### <u>General query parameters:</u>
<ul>
<li><b>page:</b>
This is an object controlling the pagination of the results. It contains two properties.
</li>
<ul>
<li><b>offset:</b>
How many records to omit.
</li>
<li><b>size:</b>
How many records to include in each page.
</li>
</ul>
</ul>
For example, if we want the third page, and our pages to contain 15 elements, we would pass the following object:
```JSON
{
"offset": 30,
"size": 15
}
```
<ul>
<li><b>order:</b>
This is an object controlling the ordering of the results.
It contains a list of strings called <i>items</i> with the names of the properties to use.
<br/>If the name of the property is prefixed with a <b>'-'</b>, the ordering direction is <b>DESC</b>. Otherwise, it is <b>ASC</b>.
</li>
</ul>
For example, if we wanted to order based on the field 'createdAt' in descending order, we would pass the following object:
```JSON
{
"items": [
"-createdAt"
],
}
```
<ul>
<li><b>metadata:</b>
This is an object containing metadata for the request. There is only one available option.
<ul>
<li><b>countAll:</b>
If this is set to true, the count property included in the response will account for all the records regardless the pagination,
with all the rest of filtering options applied of course.
Otherwise, if it is set to false or not present, only the returned results will be counted.
<br/>The first option is useful for the UI clients to calculate how many result pages are available.
</li>
</ul>
</li>
<li><b>project:</b>
This is an object controlling the data projection of the results.
It contains a list of strings called <i>fields</i> with the names of the properties to project.
<br/>You can also include properties that are deeper in the object tree by prefixing them with dots.
</li>
</ul>
### <u>Reference specific query parameters:</u>
<ul>
<li><b>like:</b>
If there is a like parameter present in the query, only the reference entities that include the contents of the parameter either in their labels, descriptions or the references will be in the response.
</li>
<li><b>typeId:</b>
This is the type id of the references we want in the response. <br/>If empty, every record is included.
</li>
<li><b>key:</b>
This is the id of the external source (API) we want results from.
<br/>If not present, no external reference is included.
</li>
<li><b>dependencyReferences:</b>
This is a list and determines which records we want to include in the response, based on the references they depend on.
<br/>If not present, every record is included.
</li>
</ul>
""";
public static final String endpoint_search_request_body_example =
"""
{
"project":{
"fields":[
"id",
"hash",
"label",
"type",
"type.id",
"description",
"definition.fields.code",
"definition.fields.dataType",
"definition.fields.value",
"reference",
"abbreviation",
"source",
"sourceType"
]
},
"page":{
"size":100,
"offset":0
},
"typeId":"5b9c284f-f041-4995-96cc-fad7ad13289c",
"dependencyReferences":[
\s
],
"order":{
"items":[
"label"
]
}
}
""";
public static final String endpoint_search_response_example =
"""
[
{
"label": "A Randomized, Double-Blind, Placebo-Controlled, Multi-Center Study to Evaluate the Efficacy of ManNAc in Subjects with GNE Myopathy (nih_________::5U01AR070498-04)",
"type": {
"id": "5b9c284f-f041-4995-96cc-fad7ad13289c"
},
"description": "A Randomized, Double-Blind, Placebo-Controlled, Multi-Center Study to Evaluate the Efficacy of ManNAc in Subjects with GNE Myopathy",
"definition": {
"fields": [
{
"code": "referenceType",
"dataType": 0,
"value": "Grants"
},
{
"code": "key",
"dataType": 0,
"value": "openaire"
}
]
},
"reference": "nih_________::5U01AR070498-04",
"source": "openaire",
"sourceType": 1,
"hash": ""
},
{
"label": "A genome scale census of virulence factors in the major mould pathogen of human lungs, Aspergillus fumigatus (ukri________::1640253)",
"type": {
"id": "5b9c284f-f041-4995-96cc-fad7ad13289c"
},
"description": "A genome scale census of virulence factors in the major mould pathogen of human lungs, Aspergillus fumigatus",
"definition": {
"fields": [
{
"code": "referenceType",
"dataType": 0,
"value": "Grants"
},
{
"code": "key",
"dataType": 0,
"value": "openaire"
}
]
},
"reference": "ukri________::1640253",
"source": "openaire",
"sourceType": 1,
"hash": ""
}
]
""";
}
public static final class ReferenceType {
@ -3779,6 +3983,12 @@ public final class SwaggerHelpers {
It also allows to restrict the results using a query object passed in the request body.<br/>
""";
public static final String endpoint_query_plan_associated =
"""
This endpoint is used to fetch all the available users.<br/>
It also allows to restrict the results using a query object passed in the request body.<br/>
""";
public static final String endpoint_query_request_body =
"""
Let's explore the options this object gives us.
@ -3908,6 +4118,32 @@ public final class SwaggerHelpers {
}
""";
public static final String endpoint_query_plan_associated_request_body_example =
"""
{
"project":{
"fields":[
"id",
"name",
"email"
]
},
"page":{
"size":100,
"offset":0
},
"isActive":[
1
],
"order":{
"items":[
"name"
]
},
"like":"user%"
}
""";
public static final String endpoint_query_response_example =
"""
{
@ -4241,6 +4477,25 @@ public final class SwaggerHelpers {
}
""";
public static final String endpoint_query_plan_associated_response_example =
"""
{
"items":[
{
"id":"d26916c6-8763-450e-9048-b06e1114d0b4",
"name":"user3 user3",
"email":"user3@dmp.gr"
},
{
"id":"02832fb6-0b12-469f-a886-7685406959d4",
"name":"user4",
"email":"user4@dmp.gr"
}
],
"count":2
}
""";
}
public static final class Principal {

View File

@ -45,7 +45,7 @@ const appRoutes: Routes = [
},
{
path: 'plans',
loadChildren: () => import('./ui/plan/plan.module').then(m => m.DmpModule),
loadChildren: () => import('./ui/plan/plan.module').then(m => m.PlanModule),
data: {
authContext: {
permissions: [AppPermission.ViewMyPlanPage]
@ -59,7 +59,7 @@ const appRoutes: Routes = [
},
{
path: 'explore-plans',
loadChildren: () => import('./ui/plan/plan.module').then(m => m.PublicDmpModule),
loadChildren: () => import('./ui/plan/plan.module').then(m => m.PublicPlanModule),
data: {
breadcrumb: true,
...BreadcrumbService.generateRouteDataConfiguration({

View File

@ -252,7 +252,7 @@ export class AppComponent implements OnInit, AfterViewInit {
return this.authentication.currentAccountIsAuthenticated();
}
goToDMPs() { //not used
goToPlans() { //not used
this.router.navigate(['/plans'], { queryParams: { /*refresh : Math.random() ,returnUrl: this.state.url*/ } });
}

View File

@ -1,4 +1,4 @@
export enum AnnotationEntityType {
Description = "description",
Dmp = "dmp"
Plan = "plan"
}

View File

@ -1,4 +1,4 @@
export enum FileTransformerEntityType {
Dmp = 0,
Plan = 0,
Description = 1
}

View File

@ -13,11 +13,11 @@ export enum ResponseErrorCode {
DescriptionTemplateNewVersionConflict = 113,
DescriptionTemplateIsNotFinalized = 114,
MultipleDescriptionTemplateVersionsNotSupported = 115,
DmpNewVersionConflict = 116,
DmpIsNotFinalized = 117,
MultipleDmpVersionsNotSupported = 118,
DmpIsFinalized = 119,
DmpCanNotChange = 120,
PlanNewVersionConflict = 116,
PlanIsNotFinalized = 117,
MultiplePlanVersionsNotSupported = 118,
PlanIsFinalized = 119,
PlanCanNotChange = 120,
PlanDescriptionTemplateCanNotChange = 121,
InvalidDescriptionTemplate = 122,
DescriptionIsFinalized = 123,
@ -28,11 +28,11 @@ export enum ResponseErrorCode {
TenantConfigurationTypeCanNotChange = 128,
MultipleTenantConfigurationTypeNotAllowed = 129,
TenantCodeExists = 130,
DmpNewVersionAlreadyCreatedDraft = 131,
PlanNewVersionAlreadyCreatedDraft = 131,
DescriptionTemplateInactiveUser = 132,
DescriptionTemplateMissingUserContactInfo = 133,
DmpInactiveUser = 134,
DmpMissingUserContactInfo = 135,
PlanInactiveUser = 134,
PlanMissingUserContactInfo = 135,
ImportDescriptionWithoutPlanDescriptionTemplate = 136,
DuplicatePlanUser = 137,
DescriptionTemplateNewVersionAlreadyCreatedDraft = 138,
@ -79,15 +79,15 @@ export class ResponseErrorCodeHelper {
return language.instant("GENERAL.BACKEND-ERRORS.DESCRIPTION-TEMPLATE-IS-NOT-FINALIZED");
case ResponseErrorCode.MultipleDescriptionTemplateVersionsNotSupported:
return language.instant("GENERAL.BACKEND-ERRORS.MULTIPLE-DESCRIPTION-TEMPLATE-VERSIONS-NOT-SUPPORTED");
case ResponseErrorCode.DmpNewVersionConflict:
case ResponseErrorCode.PlanNewVersionConflict:
return language.instant("GENERAL.BACKEND-ERRORS.PLAN-NEW-VERSION-CONFLICT");
case ResponseErrorCode.DmpIsNotFinalized:
case ResponseErrorCode.PlanIsNotFinalized:
return language.instant("GENERAL.BACKEND-ERRORS.PLAN-IS-NOT-FINALIZED");
case ResponseErrorCode.MultipleDmpVersionsNotSupported:
case ResponseErrorCode.MultiplePlanVersionsNotSupported:
return language.instant("GENERAL.BACKEND-ERRORS.MULTIPLE-PLAN-VERSIONS-NOT-SUPPORTED");
case ResponseErrorCode.DmpIsFinalized:
case ResponseErrorCode.PlanIsFinalized:
return language.instant("GENERAL.BACKEND-ERRORS.PLAN-IS-FINALIZED");
case ResponseErrorCode.DmpCanNotChange:
case ResponseErrorCode.PlanCanNotChange:
return language.instant("GENERAL.BACKEND-ERRORS.PLAN-CAN-NOT-CHANGE");
case ResponseErrorCode.PlanDescriptionTemplateCanNotChange:
return language.instant("GENERAL.BACKEND-ERRORS.PLAN-DESCRIPTION-TEMPLATE-CAN-NOT-CHANGE");
@ -109,15 +109,15 @@ export class ResponseErrorCodeHelper {
return language.instant("GENERAL.BACKEND-ERRORS.MULTIPLE-TENANT-CONFIGURATION-TYPE-NOT-ALLOWED");
case ResponseErrorCode.TenantCodeExists:
return language.instant("GENERAL.BACKEND-ERRORS.TENANT-CODE-EXISTS");
case ResponseErrorCode.DmpNewVersionAlreadyCreatedDraft:
case ResponseErrorCode.PlanNewVersionAlreadyCreatedDraft:
return language.instant("GENERAL.BACKEND-ERRORS.PLAN-NEW-VERSION-ALREADY-CREATED-DRAFT");
case ResponseErrorCode.DescriptionTemplateInactiveUser:
return language.instant("GENERAL.BACKEND-ERRORS.DESCRIPTION-TEMPLATE-INACTIVE-USER");
case ResponseErrorCode.DescriptionTemplateMissingUserContactInfo:
return language.instant("GENERAL.BACKEND-ERRORS.DESCRIPTION-TEMPLATE-MISSING-USER-CONTACT-INFO");
case ResponseErrorCode.DmpInactiveUser:
case ResponseErrorCode.PlanInactiveUser:
return language.instant("GENERAL.BACKEND-ERRORS.PLAN-INACTIVE-USER");
case ResponseErrorCode.DmpMissingUserContactInfo:
case ResponseErrorCode.PlanMissingUserContactInfo:
return language.instant("GENERAL.BACKEND-ERRORS.PLAN-MISSING-USER-CONTACT-INFO");
case ResponseErrorCode.ImportDescriptionWithoutPlanDescriptionTemplate:
return language.instant("GENERAL.BACKEND-ERRORS.IMPORT-DESCRIPTION-WITHOUT-PLAN-DESCRIPTION-TEMPLATE");

View File

@ -72,7 +72,7 @@ export interface UserCredentialData {
email: String;
}
export interface DmpAssociatedUser {
export interface PlanAssociatedUser {
id: Guid;
name: string;
email: string;

View File

@ -30,7 +30,7 @@ export class FileTransformerService extends BaseService {
private _loading: boolean = false;
private xmlExportRepo: RepositoryFileFormat = {
entityTypes: [FileTransformerEntityType.Description, FileTransformerEntityType.Dmp],
entityTypes: [FileTransformerEntityType.Description, FileTransformerEntityType.Plan],
format: "xml",
hasLogo: true,
icon: "fa-file-code-o",

View File

@ -34,7 +34,7 @@ export class AnalyticsService {
public static PlanFilterDialog: string = 'DMP Criteria';
public static PlanListingItem: string = 'DMP Listing Item';
public static StartNewPlanDialog: string = 'Start New DMP Dialog';
public static DmpUploadDialog: string = 'DMP Upload Dialog';
public static PlanUploadDialog: string = 'DMP Upload Dialog';
public static PlanOverview: string = 'DMP Overview';
public static FAQ: string = 'FAQ';
public static Glossary: string = 'Glossary';

View File

@ -1,7 +1,7 @@
import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { IsActive } from '@app/core/common/enum/is-active.enum';
import { DmpAssociatedUser, RemoveCredentialRequestPersist, User, UserMergeRequestPersist, UserPersist, UserRolePatchPersist, UserTenantUsersInviteRequest } from '@app/core/model/user/user';
import { PlanAssociatedUser, RemoveCredentialRequestPersist, User, UserMergeRequestPersist, UserPersist, UserRolePatchPersist, UserTenantUsersInviteRequest } from '@app/core/model/user/user';
import { UserLookup } from '@app/core/query/user.lookup';
import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration';
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
@ -31,9 +31,9 @@ export class UserService {
return this.http.post<QueryResult<User>>(url, q).pipe(catchError((error: any) => throwError(error)));
}
queryDmpAssociated(q: UserLookup): Observable<QueryResult<DmpAssociatedUser>> {
queryPlanAssociated(q: UserLookup): Observable<QueryResult<PlanAssociatedUser>> {
const url = `${this.apiBase}/plan-associated/query`;
return this.http.post<QueryResult<DmpAssociatedUser>>(url, q).pipe(catchError((error: any) => throwError(error)));
return this.http.post<QueryResult<PlanAssociatedUser>>(url, q).pipe(catchError((error: any) => throwError(error)));
}
getSingle(id: Guid, reqFields: string[] = []): Observable<User> {
@ -178,14 +178,14 @@ export class UserService {
valueAssign: (item: User) => item.id,
};
singleAutoCompleteDmpAssociatedUserConfiguration: SingleAutoCompleteConfiguration = {
initialItems: (data?: any) => this.queryDmpAssociated(this.buildAutocompleteLookup()).pipe(map(x => x.items)),
filterFn: (searchQuery: string, data?: any) => this.queryDmpAssociated(this.buildAutocompleteLookup(searchQuery)).pipe(map(x => x.items)),
getSelectedItem: (selectedItem: any) => this.queryDmpAssociated(this.buildAutocompleteLookup(null, null, [selectedItem])).pipe(map(x => x.items[0])),
displayFn: (item: DmpAssociatedUser) => item.name,
subtitleFn: (item: DmpAssociatedUser) => item.email,
titleFn: (item: DmpAssociatedUser) => item.name,
valueAssign: (item: DmpAssociatedUser) => item.id,
singleAutoCompletePlanAssociatedUserConfiguration: SingleAutoCompleteConfiguration = {
initialItems: (data?: any) => this.queryPlanAssociated(this.buildAutocompleteLookup()).pipe(map(x => x.items)),
filterFn: (searchQuery: string, data?: any) => this.queryPlanAssociated(this.buildAutocompleteLookup(searchQuery)).pipe(map(x => x.items)),
getSelectedItem: (selectedItem: any) => this.queryPlanAssociated(this.buildAutocompleteLookup(null, null, [selectedItem])).pipe(map(x => x.items[0])),
displayFn: (item: PlanAssociatedUser) => item.name,
subtitleFn: (item: PlanAssociatedUser) => item.email,
titleFn: (item: PlanAssociatedUser) => item.name,
valueAssign: (item: PlanAssociatedUser) => item.id,
};
public buildAutocompleteLookup(like?: string, excludedIds?: Guid[], ids?: Guid[]): UserLookup {

View File

@ -225,11 +225,11 @@
</button>
<mat-action-list class="ml-4">
<button mat-list-item (click)="addNewInput(descriptionTemplateFieldTypeEnum.INTERNAL_ENTRIES_PLANS)">
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="Internal Dmp icon">
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="Internal Plan icon">
{{enumUtils.toDescriptionTemplateFieldTypeString(descriptionTemplateFieldTypeEnum.INTERNAL_ENTRIES_PLANS)}}
</button>
<button mat-list-item (click)="addNewInput(descriptionTemplateFieldTypeEnum.INTERNAL_ENTRIES_DESCRIPTIONS)">
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="Internal Dmp icon">
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="Internal Plan icon">
{{enumUtils.toDescriptionTemplateFieldTypeString(descriptionTemplateFieldTypeEnum.INTERNAL_ENTRIES_DESCRIPTIONS)}}
</button>
<button mat-list-item (click)="addNewInput(descriptionTemplateFieldTypeEnum.TAGS)">

View File

@ -93,11 +93,11 @@
<mat-divider></mat-divider>
<mat-optgroup label="{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.FIELD.FIELDS.INTERNAL-ENTITIES' | translate}}">
<mat-option [value]="descriptionTemplateFieldTypeEnum.INTERNAL_ENTRIES_PLANS">
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="InternalDmpEntities icon">
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="InternalPlanEntities icon">
{{enumUtils.toDescriptionTemplateFieldTypeString(descriptionTemplateFieldTypeEnum.INTERNAL_ENTRIES_PLANS)}}
</mat-option>
<mat-option [value]="descriptionTemplateFieldTypeEnum.INTERNAL_ENTRIES_DESCRIPTIONS">
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="InternalDmpEntities icon">
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="InternalPlanEntities icon">
{{enumUtils.toDescriptionTemplateFieldTypeString(descriptionTemplateFieldTypeEnum.INTERNAL_ENTRIES_DESCRIPTIONS)}}
</mat-option>
<mat-option [value]="descriptionTemplateFieldTypeEnum.TAGS">

View File

@ -8,7 +8,7 @@ export enum ViewStyleType{
FreeText = "freetext",
RadioBox = "radiobox",
DatePicker = "datePicker",
InternalDmpEntities = "internalDmpEntities",
InternalPlanEntities = "InternalPlanEntities",
ExternalDatasets = "externalDatasets",
DataRepositories = "dataRepositories",
PubRepositories = "pubRepositories",

View File

@ -167,12 +167,12 @@ export class MaintenanceTasksComponent extends BaseComponent implements OnInit {
.afterClosed()
.subscribe(confirm => {
if (confirm) {
this.doSendDmpTouchEvents(ev);
this.doSendPlanTouchEvents(ev);
}
});
}
private doSendDmpTouchEvents(ev: Event) {
private doSendPlanTouchEvents(ev: Event) {
(ev.target as HTMLButtonElement).disabled = true;
this.maintenanceService.sendPlanTouchEvents().pipe(takeUntil(this._destroyed)).subscribe(
_ => {

View File

@ -1,5 +1,5 @@
<div class="container-fluid">
<div class="row dmp-blueprint-editor">
<div class="row plan-blueprint-editor">
<div class="col-md-10 offset-md-1">
<div class="row align-items-center mt-4 mb-4" *ngIf="formGroup">
<div class="col-md col-12">
@ -41,7 +41,7 @@
</mat-form-field>
</div>
<h4 class="col-12">{{'PLAN-BLUEPRINT-EDITOR.FIELDS.SECTIONS' | translate}}
<mat-error *ngIf="formGroup.get('definition').get('sections').hasError('dmpBlueprintSystemFieldRequired')"> {{'PLAN-BLUEPRINT-EDITOR.SYSTEM-FIELDS-REQUIRED' | translate}} </mat-error>
<mat-error *ngIf="formGroup.get('definition').get('sections').hasError('planBlueprintSystemFieldRequired')"> {{'PLAN-BLUEPRINT-EDITOR.SYSTEM-FIELDS-REQUIRED' | translate}} </mat-error>
</h4>
<div class="col-12" cdkDropList (cdkDropListDropped)="dropSections($event)">
<div *ngFor="let section of formGroup.get('definition').get('sections').controls; let sectionIndex=index;" class="row mb-3" cdkDrag [cdkDragDisabled]="formGroup.disabled">
@ -109,13 +109,13 @@
<mat-form-field class="mt-3 w-100">
<mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.CATEGORY' | translate}}</mat-label>
<mat-select [formControl]="field.get('category')" [disabled]="field.disabled" (selectionChange)="fieldCategoryChanged(sectionIndex, fieldIndex)">
<mat-option *ngFor="let fieldCategory of dmpBlueprintFieldCategoryEnum" [value]="fieldCategory">{{enumUtils.toPlanBlueprintFieldCategoryString(fieldCategory)}}</mat-option>
<mat-option *ngFor="let fieldCategory of planBlueprintFieldCategoryEnum" [value]="fieldCategory">{{enumUtils.toPlanBlueprintFieldCategoryString(fieldCategory)}}</mat-option>
</mat-select>
<mat-error *ngIf="field.get('category').hasError('backendError')">{{field.get('category').getError('backendError').message}}</mat-error>
<mat-error *ngIf="field.get('category').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field>
</div>
<div class="col-12 col-xl-4" *ngIf="field.get('category').value === dmpBlueprintSectionFieldCategory.System">
<div class="col-12 col-xl-4" *ngIf="field.get('category').value === planBlueprintSectionFieldCategory.System">
<mat-form-field class="mt-3 w-100">
<mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.SYSTEM-FIELD-TYPE' | translate}}</mat-label>
<mat-select [formControl]="field.get('systemFieldType')" [disabled]="field.disabled">
@ -125,7 +125,7 @@
<mat-error *ngIf="field.get('systemFieldType').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field>
</div>
<div class="col-12 col-xl-4" *ngIf="field.get('category').value === dmpBlueprintSectionFieldCategory.Extra">
<div class="col-12 col-xl-4" *ngIf="field.get('category').value === planBlueprintSectionFieldCategory.Extra">
<mat-form-field class="mt-3 w-100">
<mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.DATA-TYPE' | translate}}</mat-label>
<mat-select [formControl]="field.get('dataType')">
@ -137,7 +137,7 @@
<mat-error *ngIf="field.get('dataType').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field>
</div>
<div class="col-12 col-xl-4" *ngIf="field.get('category').value === dmpBlueprintSectionFieldCategory.ReferenceType">
<div class="col-12 col-xl-4" *ngIf="field.get('category').value === planBlueprintSectionFieldCategory.ReferenceType">
<mat-form-field class="mt-3 w-100">
<mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.REFERENCE-TYPE' | translate}}</mat-label>
<app-single-auto-complete placeholder="{{'PLAN-BLUEPRINT-EDITOR.FIELDS.REFERENCE-TYPE' | translate}}" [required]="true" [formControl]="field.get('referenceTypeId')" [configuration]="referenceTypeService.singleAutocompleteConfiguration"></app-single-auto-complete>
@ -184,7 +184,7 @@
<mat-error *ngIf="field.get('required').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</div>
<div class="col-auto col-xl-2">
<div *ngIf="field.get('category').value === dmpBlueprintSectionFieldCategory.ReferenceType">
<div *ngIf="field.get('category').value === planBlueprintSectionFieldCategory.ReferenceType">
<mat-checkbox [disabled]="formGroup.disabled" [checked]="field.get('multipleSelect').value" (change)="field.get('multipleSelect').setValue($event.checked)"><span>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.FIELD-MULTIPLE-SELECT' | translate}}</span></mat-checkbox>
<mat-error *ngIf="field.get('multipleSelect')?.hasError('backendError')">{{field.get('multipleSelect')?.getError('backendError').message}}</mat-error>
<mat-error *ngIf="field.get('multipleSelect')?.hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>

View File

@ -4,7 +4,7 @@
margin-bottom: 0 !important;
}
.dmp-blueprint-editor {
.plan-blueprint-editor {
// margin-top: 1.3rem;
// margin-left: 1em;
// margin-right: 3em;

View File

@ -65,12 +65,12 @@ export class PlanBlueprintEditorComponent extends BaseEditor<PlanBlueprintEditor
hoveredSectionIndex: number = -1;
hoveredDescriptionTemplateIndex: number = -1;
dmpBlueprintSectionFieldCategory = PlanBlueprintFieldCategory;
dmpBlueprintSystemFieldType = PlanBlueprintSystemFieldType;
planBlueprintSectionFieldCategory = PlanBlueprintFieldCategory;
planBlueprintSystemFieldType = PlanBlueprintSystemFieldType;
public planBlueprintSystemFieldTypeEnum = this.enumUtils.getEnumValues<PlanBlueprintSystemFieldType>(PlanBlueprintSystemFieldType);
dmpBlueprintExtraFieldDataType = PlanBlueprintExtraFieldDataType;
planBlueprintExtraFieldDataType = PlanBlueprintExtraFieldDataType;
public planBlueprintExtraFieldDataTypeEnum = this.enumUtils.getEnumValues<PlanBlueprintExtraFieldDataType>(PlanBlueprintExtraFieldDataType);
public dmpBlueprintFieldCategoryEnum = this.enumUtils.getEnumValues<PlanBlueprintFieldCategory>(PlanBlueprintFieldCategory);
public planBlueprintFieldCategoryEnum = this.enumUtils.getEnumValues<PlanBlueprintFieldCategory>(PlanBlueprintFieldCategory);
descriptionTempalteGroupSingleAutocompleteConfiguration: SingleAutoCompleteConfiguration = {
initialItems: (data?: any) => this.descriptionTemplateService.query(this.descriptionTemplateService.buildDescriptionTempalteGroupAutocompleteLookup([IsActive.Active], null, null, null, this.getUsedDescriptionTemplateGroupIds())).pipe(map(x => x.items)),
filterFn: (searchQuery: string, data?: any) => this.descriptionTemplateService.query(this.descriptionTemplateService.buildDescriptionTempalteGroupAutocompleteLookup([IsActive.Active], searchQuery, null, null, this.getUsedDescriptionTemplateGroupIds() ? this.getUsedDescriptionTemplateGroupIds() : null)).pipe(map(x => x.items)),
@ -126,7 +126,7 @@ export class PlanBlueprintEditorComponent extends BaseEditor<PlanBlueprintEditor
public enumUtils: EnumUtils,
private planBlueprintService: PlanBlueprintService,
private logger: LoggingService,
private dmpBlueprintEditorService: PlanBlueprintEditorService,
private planBlueprintEditorService: PlanBlueprintEditorService,
private fileUtils: FileUtils,
public descriptionTemplateService: DescriptionTemplateService,
public referenceTypeService: ReferenceTypeService,
@ -190,14 +190,14 @@ export class PlanBlueprintEditorComponent extends BaseEditor<PlanBlueprintEditor
if (data && data.id) this.checkLock(data.id, LockTargetType.PlanBlueprint, 'PLAN-BLUEPRINT-EDITOR.LOCKED-DIALOG.TITLE', 'PLAN-BLUEPRINT-EDITOR.LOCKED-DIALOG.MESSAGE');
} catch (error) {
this.logger.error('Could not parse dmpBlueprint item: ' + data + error);
this.logger.error('Could not parse planBlueprint item: ' + data + error);
this.uiNotificationService.snackBarNotification(this.language.instant('COMMONS.ERRORS.DEFAULT'), SnackBarNotificationLevel.Error);
}
}
buildForm() {
this.formGroup = this.editorModel.buildForm(null, this.isDeleted || !this.authService.hasPermission(AppPermission.EditPlanBlueprint));
this.dmpBlueprintEditorService.setValidationErrorModel(this.editorModel.validationErrorModel);
this.planBlueprintEditorService.setValidationErrorModel(this.editorModel.validationErrorModel);
if (this.isFinalized || this.isDeleted) {
this.formGroup.disable();
}
@ -517,28 +517,28 @@ export class PlanBlueprintEditorComponent extends BaseEditor<PlanBlueprintEditor
}
hasTitle(): boolean {
const dmpBlueprint: PlanBlueprintPersist = this.formGroup.value;
return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.Title));
const planBlueprint: PlanBlueprintPersist = this.formGroup.value;
return planBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.Title));
}
hasDescription(): boolean {
const dmpBlueprint: PlanBlueprintPersist = this.formGroup.value;
return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.Description));
const planBlueprint: PlanBlueprintPersist = this.formGroup.value;
return planBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.Description));
}
hasLanguage(): boolean {
const dmpBlueprint: PlanBlueprintPersist = this.formGroup.value;
return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.Language));
const planBlueprint: PlanBlueprintPersist = this.formGroup.value;
return planBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.Language));
}
hasAccess(): boolean {
const dmpBlueprint: PlanBlueprintPersist = this.formGroup.value;
return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.AccessRights));
const planBlueprint: PlanBlueprintPersist = this.formGroup.value;
return planBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.AccessRights));
}
hasDescriptionTemplates(): boolean {
const dmpBlueprint: PlanBlueprintPersist = this.formGroup.value;
return dmpBlueprint.definition.sections.some(section => section.hasTemplates == true);
const planBlueprint: PlanBlueprintPersist = this.formGroup.value;
return planBlueprint.definition.sections.some(section => section.hasTemplates == true);
}
private showValidationErrorsDialog(projectOnly?: boolean, errmess?: string[]) {

View File

@ -1,4 +1,4 @@
.dmp-blueprint-listing-filters {
.plan-blueprint-listing-filters {
}

View File

@ -1,5 +1,5 @@
<div class="container-fluid">
<div class="row dmp-blueprint-listing">
<div class="row plan-blueprint-listing">
<div class="col-md-10 offset-md-1">
<div class="row mb-4 mt-4">
<div class="col">

View File

@ -3,7 +3,7 @@
border-radius: 4px;
}
.dmp-blueprint-listing {
.plan-blueprint-listing {
// margin-top: 1.3rem;
// margin-left: 1rem;
// margin-right: 2rem;

View File

@ -53,7 +53,7 @@ export class AnnotationDialogComponent extends BaseComponent {
private formBuilder: FormBuilder = new FormBuilder();
public annotationStatusFormGroup: UntypedFormGroup;
public listingStatuses: Status[] = [];
public dmpUsersMentionNames: string[] = [];
public planUsersMentionNames: string[] = [];
@ViewChild('annotationStatus') annotationStatus: MatSelectionList;
@ -76,7 +76,7 @@ export class AnnotationDialogComponent extends BaseComponent {
this.entityId = data.entityId;
this.anchor = data.anchor;
this.entityType = data.entityType;
this.dmpUsersMentionNames = data.planUsers.map(x => x.user.name);
this.planUsersMentionNames = data.planUsers.map(x => x.user.name);
dialogRef.backdropClick().pipe(takeUntil(this._destroyed)).subscribe(() => dialogRef.close(this.changesMade));
}

View File

@ -25,26 +25,26 @@
</div>
</div>
<div class="card col-auto mt-0" [style.display]="isIntroCardVisible ? 'block' : 'none'">
<a *ngIf="this.hasDmps()" class="col-auto d-flex" (click)="dismissIntroCard()"><span class="ml-auto mt-3 material-icons clear-icon">clear</span></a>
<a *ngIf="this.hasPlans()" class="col-auto d-flex" (click)="dismissIntroCard()"><span class="ml-auto mt-3 material-icons clear-icon">clear</span></a>
<p *ngIf="!this.hasDmps()" class="card-title mb-0 pt-4">{{'DASHBOARD.PLAN-QUESTION' | translate}}</p>
<p *ngIf="!this.hasDmps()" class="card-content mb-0">{{'DASHBOARD.INFO-PLAN-TEXT' | translate}}</p>
<p *ngIf="!this.hasPlans()" class="card-title mb-0 pt-4">{{'DASHBOARD.PLAN-QUESTION' | translate}}</p>
<p *ngIf="!this.hasPlans()" class="card-content mb-0">{{'DASHBOARD.INFO-PLAN-TEXT' | translate}}</p>
<p *ngIf="!this.hasDmps()" class="card-content pt-3 mb-0">
<p *ngIf="!this.hasPlans()" class="card-content pt-3 mb-0">
{{'DASHBOARD.NEW-QUESTION' | translate}} <a href="https://www.openaire.eu/how-to-create-a-data-management-plan" target="_blank"><u>{{'DASHBOARD.OPEN-AIR-GUIDE' | translate}}</u></a> {{'DASHBOARD.LEARN-MORE' | translate}}
</p>
<p *ngIf="this.hasDmps()" class="card-content mb-0 pt-0">{{'DASHBOARD.PLAN-ABOUT-BEG' | translate}}
<p *ngIf="this.hasPlans()" class="card-content mb-0 pt-0">{{'DASHBOARD.PLAN-ABOUT-BEG' | translate}}
<b>{{'DASHBOARD.DESCRIPTIONS-DASHBOARD-TEXT' | translate}}</b>
{{'DASHBOARD.PLAN-ABOUT-END' | translate}}
</p>
<div class="row d-flex align-items-center">
<div *ngIf="!this.hasDmps()" class="col-auto p-0 add-description-btn d-flex">
<div *ngIf="!this.hasPlans()" class="col-auto p-0 add-description-btn d-flex">
<div class="pr-2">
<button type="button" class="align-self-center normal-btn" (click)="openNewPlanDialog()">{{'DASHBOARD.START-YOUR-FIRST-PLAN' | translate}}</button>
</div>
</div>
<div *ngIf="this.hasDmps()" class="col-auto p-0 new-description-tour add-description-btn col-auto d-flex">
<div *ngIf="this.hasPlans()" class="col-auto p-0 new-description-tour add-description-btn col-auto d-flex">
<div class="pr-2">
<button mat-raised-button type="button" class="align-self-center yellow-btn" (click)="addNewDescription()">{{'DASHBOARD.ACTIONS.ADD-DESCRIPTION' | translate}}</button>
</div>
@ -55,26 +55,26 @@
</div>
</div>
</div>
<div *ngIf="this.hasDmps()" class="col">
<div *ngIf="this.hasPlans()" class="col">
<div class="latest-activity-title">{{'DASHBOARD.LATEST-ACTIVITY' | translate}}</div>
<mat-tab-group color="#00000" mat-stretch-tabs="false" mat-align-tabs="start" class="my-mat-tab remove-border-bottom" [selectedIndex]="indexFromCurrentType" (selectedTabChange)="currentType = $event.tab.ariaLabel">
<mat-tab aria-label="recent" label="{{'DASHBOARD.ALL' | translate}}">
<app-recent-edited-activity [isActive]="currentType == 'recent'" [includeDmps]="true" [includeDescriptions]="true"></app-recent-edited-activity>
<app-recent-edited-activity [isActive]="currentType == 'recent'" [includePlans]="true" [includeDescriptions]="true"></app-recent-edited-activity>
</mat-tab>
<mat-tab aria-label="drafts" label="{{'DASHBOARD.DRAFTS' | translate}}">
<app-recent-edited-activity [isActive]="currentType == 'drafts'" [includeDmps]="true" [includeDescriptions]="true" [onlyDrafts]="true" type="drafts" [selectedType]="currentType"></app-recent-edited-activity>
<app-recent-edited-activity [isActive]="currentType == 'drafts'" [includePlans]="true" [includeDescriptions]="true" [onlyDrafts]="true" type="drafts" [selectedType]="currentType"></app-recent-edited-activity>
</mat-tab>>
<mat-tab aria-label="dmps" label="{{'DASHBOARD.PLANS' | translate}}">
<app-recent-edited-activity [isActive]="currentType == 'dmps'" [includeDmps]="true" type="dmps" [selectedType]="currentType"></app-recent-edited-activity>
<mat-tab aria-label="plans" label="{{'DASHBOARD.PLANS' | translate}}">
<app-recent-edited-activity [isActive]="currentType == 'plans'" [includePlans]="true" type="plans" [selectedType]="currentType"></app-recent-edited-activity>
</mat-tab>
<mat-tab aria-label="descriptions" label="{{'DASHBOARD.DESCRIPTIONS' | translate}}">
<app-recent-edited-activity [isActive]="currentType == 'descriptions'" [includeDescriptions]="true" type="descriptions" [selectedType]="currentType" [hasDmps]="this.hasDmps()" (addNewDescription)="addNewDescription($event)"></app-recent-edited-activity>
<app-recent-edited-activity [isActive]="currentType == 'descriptions'" [includeDescriptions]="true" type="descriptions" [selectedType]="currentType" [hasPlans]="this.hasPlans()" (addNewDescription)="addNewDescription($event)"></app-recent-edited-activity>
</mat-tab>
</mat-tab-group>
</div>
</div>
<!-- Right Sidebar -->
<div *ngIf="!this.hasDmps()" class="col-12 col-xl-2 mb-4 stats">
<div *ngIf="!this.hasPlans()" class="col-12 col-xl-2 mb-4 stats">
<div class="row">
<div class="col-12">
<div class="personal-usage" style="width: fit-content;">
@ -101,7 +101,7 @@
</div>
</div>
</div>
<div *ngIf="this.hasDmps()" class="col-12 col-xl-2 mb-4 stats">
<div *ngIf="this.hasPlans()" class="col-12 col-xl-2 mb-4 stats">
<div class="row">
<div class="col-12">
<div class="personal-usage" style="width: fit-content;"><span>{{'DASHBOARD.PERSONAL-USAGE' | translate}}</span></div>
@ -162,7 +162,7 @@
</div>
</div>
<div class="col-12 col-xl-auto mb-4 stats">
<div *ngIf="!hasDmps()" class="row flex-xl-column">
<div *ngIf="!hasPlans()" class="row flex-xl-column">
<div class="col-12">
<div class="personal-usage"><span>{{'DASHBOARD.PUBLIC-USAGE' | translate}}</span></div>
</div>
@ -184,7 +184,7 @@
</div>
</div>
<div *ngIf="hasDmps()" class="row flex-xl-column">
<div *ngIf="hasPlans()" class="row flex-xl-column">
<div class="col-12">
<div class="personal-usage"><span>{{'DASHBOARD.PUBLIC-USAGE' | translate}}</span></div>
</div>

View File

@ -155,7 +155,7 @@
padding-left: 3rem;
}
.dmp-card,
.plan-card,
.description-card {
min-width: 712px;
/* min-height: 308px; */
@ -182,7 +182,7 @@ input[type="text"] {
padding-left: 15px;
}
.dmp-label {
.plan-label {
background: var(--primary-color) 0% 0% no-repeat padding-box;
border-radius: 4px 0px;
opacity: 1;
@ -213,7 +213,7 @@ input[type="text"] {
// padding-bottom: 0.4rem;
}
.dmp-subtitle,
.plan-subtitle,
.description-subtitle {
.icon-align {
@ -225,7 +225,7 @@ input[type="text"] {
}
.description-card-actions,
.dmp-card-actions {
.plan-card-actions {
display: flex;
flex-direction: row;
border-top: 1px solid #dbdbdb;
@ -234,24 +234,24 @@ input[type="text"] {
}
.description-card-actions a,
.dmp-card-actions a {
.plan-card-actions a {
color: #848484 !important;
text-decoration: none !important;
}
.description-card-actions a:hover,
.dmp-card-actions a:hover {
.plan-card-actions a:hover {
color: var(--primary-color) !important;
}
.dmp-description-descriptions-title {
.plan-description-descriptions-title {
color: #000000;
opacity: 0.6;
padding-top: 1.5rem;
padding-bottom: 0.8rem;
}
.dmp-description-descriptions-name {
.plan-description-descriptions-name {
color: #000000;
opacity: 0.6;
font-weight: 700;

View File

@ -57,7 +57,7 @@ export class DashboardComponent extends BaseComponent implements OnInit {
ngOnInit() {
this.route.queryParams.subscribe(params => {
let type = params['type'];
if (type || type == "recent" || (type == "drafts" && this.isAuthenticated()) || type == "dmps" || type == "descriptions") {
if (type || type == "recent" || (type == "drafts" && this.isAuthenticated()) || type == "plans" || type == "descriptions") {
this.currentType = type;
} else {
this.currentType = "recent";
@ -98,7 +98,7 @@ export class DashboardComponent extends BaseComponent implements OnInit {
if (this.currentType == "drafts") {
return 1;
}
if (this.currentType == "dmps") {
if (this.currentType == "plans") {
return this.isAuthenticated() ? 2 : 1;
}
if (this.currentType == "descriptions") {
@ -126,7 +126,7 @@ export class DashboardComponent extends BaseComponent implements OnInit {
}
}
public hasDmps(): boolean {
public hasPlans(): boolean {
if (this.dashboardStatistics) {
return this.dashboardStatistics.planCount !== 0
|| this.dashboardStatistics.descriptionCount !== 0
@ -167,7 +167,7 @@ export class DashboardComponent extends BaseComponent implements OnInit {
useOrb: true,
steps: [
{
selector: '.new-dmp-dialog',
selector: '.new-plan-dialog',
content: 'Step 1',
orientation: Orientation.BottomRight,
isStepUnique: false,
@ -199,10 +199,10 @@ export class DashboardComponent extends BaseComponent implements OnInit {
]
};
public setDashboardTourDmpText(): void {
const dmpText = this.language.instant('DASHBOARD.TOUR-GUIDE.PLAN') + '\n\n' +
public setDashboardTourPlanText(): void {
const planText = this.language.instant('DASHBOARD.TOUR-GUIDE.PLAN') + '\n\n' +
this.language.instant('DASHBOARD.TOUR-GUIDE.START-NEW');
this.dashboardTour.steps[0].title = dmpText;
this.dashboardTour.steps[0].title = planText;
}
public setDashboardImportFileText(): void {
@ -222,7 +222,7 @@ export class DashboardComponent extends BaseComponent implements OnInit {
}
openDashboardTour() {
this.setDashboardTourDmpText();
this.setDashboardTourPlanText();
this.setDashboardImportFileText();
this.setDashboardStartWizardText();
this.setDescriptionText();

View File

@ -31,14 +31,14 @@
<!-- End of Search Filter -->
</div>
<div *ngFor="let item of listingItems; let i = index">
<app-dmp-listing-item-component *ngIf="item.plan" [showDivider]="i != (listingItems.length - 1)" [dmp]="item.plan" [isPublic]="false"></app-dmp-listing-item-component>
<app-plan-listing-item-component *ngIf="item.plan" [showDivider]="i != (listingItems.length - 1)" [plan]="item.plan" [isPublic]="false"></app-plan-listing-item-component>
<app-description-listing-item-component *ngIf="item?.description" [showDivider]="i != (listingItems.length - 1)" [description]="item?.description" [isPublic]="false" ></app-description-listing-item-component>
</div>
<div class="text-muted d-flex justify-content-center mt-5" *ngIf="listingItems && listingItems.length > 0 && this.lookup.page.offset >= currentPage*pageSize">
{{'GENERAL.ACTIONS.NO-MORE-AVAILABLE' | translate}}
</div>
<div class="row justify-content-center mt-5" *ngIf="listingItems?.length == 0 && onlyDescriptions && hasDmps">
<div class="row justify-content-center mt-5" *ngIf="listingItems?.length == 0 && onlyDescriptions && hasPlans">
<div class="col-auto p-0 add-description">
<button mat-raised-button type="button" class="yellow-btn" (click)="addDescription()">{{'DASHBOARD.ACTIONS.ADD-DESCRIPTION' | translate}}</button>
</div>

View File

@ -13,7 +13,7 @@ input[type="text"] {
padding-left: 15px;
}
.dmp-label {
.plan-label {
background: var(--primary-color) 0% 0% no-repeat padding-box;
border-radius: 4px 0px;
opacity: 1;
@ -31,7 +31,7 @@ input[type="text"] {
}
.description-card-actions,
.dmp-card-actions {
.plan-card-actions {
display: flex;
flex-direction: row;
border-top: 1px solid #dbdbdb;
@ -40,7 +40,7 @@ input[type="text"] {
}
.description-card-actions,
.dmp-card-actions {
.plan-card-actions {
display: flex;
flex-direction: row;
border-top: 1px solid #dbdbdb;
@ -49,24 +49,24 @@ input[type="text"] {
}
.description-card-actions a,
.dmp-card-actions a {
.plan-card-actions a {
color: #848484 !important;
text-decoration: none !important;
}
.description-card-actions a:hover,
.dmp-card-actions a:hover {
.plan-card-actions a:hover {
color: var(--primary-color) !important;
}
.dmp-description-descriptions-title {
.plan-description-descriptions-title {
color: #000000;
opacity: 0.6;
padding-top: 1.5rem;
padding-bottom: 0.8rem;
}
.dmp-description-descriptions-name {
.plan-description-descriptions-name {
color: #000000;
opacity: 0.6;
font-weight: 700;

View File

@ -44,18 +44,18 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
@Input() type: string;
@Input() selectedType: string;
@Input() includeDescriptions: boolean = false;
@Input() includeDmps: boolean = false;
@Input() includePlans: boolean = false;
@Input() onlyDrafts: boolean = false;
@Input() hasDmps: boolean = false;
@Input() hasPlans: boolean = false;
@Output() addNewDescription: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
get onlyPlans(): boolean {
return this.includeDmps && !this.includeDescriptions;
return this.includePlans && !this.includeDescriptions;
}
get onlyDescriptions(): boolean {
return !this.includeDmps && this.includeDescriptions;
return !this.includePlans && this.includeDescriptions;
}
pageLessSize= this.pageSize;
@ -166,7 +166,7 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
this.lookup.like = this.formGroup.get('like').value;
this.lookup.project = {
fields : [
...(this.includeDmps ? this._getPlanLookup() : []),
...(this.includePlans ? this._getPlanLookup() : []),
...(this.includeDescriptions ? this._getDescriptionLookup() : [])
]
};

View File

@ -7,7 +7,7 @@
<div class="row mt-3">
<div class="col-12">
<mat-form-field class="w-100">
<app-single-auto-complete [formControl]="data.formGroup.get('planId')" placeholder="{{'DESCRIPTION-COPY-DIALOG.SELECT-PLAN' | translate}}" [configuration]="dmpAutoCompleteConfiguration">
<app-single-auto-complete [formControl]="data.formGroup.get('planId')" placeholder="{{'DESCRIPTION-COPY-DIALOG.SELECT-PLAN' | translate}}" [configuration]="planAutoCompleteConfiguration">
</app-single-auto-complete>
</mat-form-field>
</div>

View File

@ -26,10 +26,9 @@ import { DescriptionTemplatesInSection, PlanBlueprint, PlanBlueprintDefinition,
})
export class DescriptionCopyDialogComponent {
dmpModel: Plan;
sections: PlanBlueprintDefinitionSection[] = [];
descriptionDescriptionTemplateLabel: String;
dmpAutoCompleteConfiguration: SingleAutoCompleteConfiguration = { //TODO: add filter to only get DMPs that have connection with the same Description Template group.
planAutoCompleteConfiguration: SingleAutoCompleteConfiguration = { //TODO: add filter to only get plans that have connection with the same Description Template group.
initialItems: (data?: any) => this.planService.query(this.buildPlanLookup(null,null,null, this.planDescriptionTemplateLookup)).pipe(map(x => x.items)),
filterFn: (searchQuery: string, data?: any) => this.planService.query(this.buildPlanLookup(searchQuery, null, null, this.planDescriptionTemplateLookup)).pipe(map(x => x.items)),
getSelectedItem: (selectedItem: any) => this.planService.query(this.buildPlanLookup(null, null, [selectedItem])).pipe(map(x => x.items[0])),
@ -83,16 +82,16 @@ export class DescriptionCopyDialogComponent {
ngOnInit() {
}
findSection(dmp: Plan){
const availableSectionIds = dmp.planDescriptionTemplates?.filter(x => x.descriptionTemplateGroupId === this.data.descriptionTemplate.groupId && x.isActive == IsActive.Active).map(y => y.sectionId);
this.sections = dmp.blueprint.definition.sections.filter(x => x.hasTemplates == true && availableSectionIds?.includes(x.id)) || [];
findSection(plan: Plan){
const availableSectionIds = plan.planDescriptionTemplates?.filter(x => x.descriptionTemplateGroupId === this.data.descriptionTemplate.groupId && x.isActive == IsActive.Active).map(y => y.sectionId);
this.sections = plan.blueprint.definition.sections.filter(x => x.hasTemplates == true && availableSectionIds?.includes(x.id)) || [];
if(this.sections.length == 1){
this.data.formGroup.get('sectionId').setValue(this.sections[0].id);
}else {
this.data.formGroup.get('sectionId').setValue(null);
}
return dmp.id
return plan.id
}
cancel() {

View File

@ -57,14 +57,14 @@
color: var(--primary-color-3) !important;
}
.dmp-link {
.plan-link {
color: #3fafac;
font-weight: 400;
font-size: 16px;
cursor: pointer;
}
.dmp-link:hover {
.plan-link:hover {
text-decoration: underline;
}
}

View File

@ -15,9 +15,9 @@
<ng-template #viewOnlyTemplate>
<div class="description-title">{{'DESCRIPTION-EDITOR.TITLE-PREVIEW-DESCRIPTION' | translate}}</div>
</ng-template>
<div *ngIf="item?.plan?.id" class="d-flex flex-direction-row dmp-info">
<div class="col-auto description-to-dmp">{{'DESCRIPTION-EDITOR.TO-PLAN' | translate}}</div>
<div class="dmp-title p-0">:&nbsp;{{ item?.plan?.label }}</div>
<div *ngIf="item?.plan?.id" class="d-flex flex-direction-row plan-info">
<div class="col-auto description-to-plan">{{'DESCRIPTION-EDITOR.TO-PLAN' | translate}}</div>
<div class="plan-title p-0">:&nbsp;{{ item?.plan?.label }}</div>
<div class="col-auto d-flex align-items-center">
<a [routerLink]="routerUtils.generateUrl(['/plans/overview/', item.plan.id])" target="_blank" class="pointer open-in-new-icon">
<mat-icon class="size-18">open_in_new</mat-icon>
@ -86,11 +86,11 @@
<div class="row editor-content">
<div style="width: 22em;" class="d-flex flex-column">
<div class="stepper-back row">
<div class="col-auto d-flex align-items-center back-to-dmp" (click)="backToDmp(this.formGroup.get('planId').value)">
<div class="col-auto d-flex align-items-center back-to-plan" (click)="backToPlan(this.formGroup.get('planId').value)">
<mat-icon class="back-icon pointer">chevron_left</mat-icon>
<span class="pointer">{{'DESCRIPTION-EDITOR.ACTIONS.BACK-TO' | translate}}</span>
</div>
<div class="col-auto dmp-label ml-1">{{'DESCRIPTION-EDITOR.PLAN' | translate}}</div>
<div class="col-auto plan-label ml-1">{{'DESCRIPTION-EDITOR.PLAN' | translate}}</div>
</div>
<div class="row stepper-title">
<div class="col-12 pl-0 mb-1"><span>{{'DESCRIPTION-EDITOR.TOC.TITLE' | translate}}</span></div>
@ -178,7 +178,7 @@
[validationErrorModel]="editorModel.validationErrorModel"
[isNew]="isNew || isCopy"
[canReview]="canReview"
[dmpUsers]="item?.plan?.planUsers ?? []"
[planUsers]="item?.plan?.planUsers ?? []"
></app-description-form>
</div>
</div>

View File

@ -202,7 +202,7 @@
align-items: center;
}
.description-to-dmp {
.description-to-plan {
display: flex;
align-items: center;
padding: 0;
@ -213,11 +213,11 @@
line-height: 25px;
}
.dmp-info {
.plan-info {
padding-top: 0.75rem;
}
.dmp-label {
.plan-label {
min-width: 67px;
height: 37px;
background: var(--primary-color) 0% 0% no-repeat padding-box;
@ -229,7 +229,7 @@
justify-content: center;
}
.dmp-title {
.plan-title {
text-align: left;
font-weight: 700;
font-size: 1rem;
@ -345,7 +345,7 @@
}
}
.back-to-dmp:hover {
.back-to-plan:hover {
background: #ececec;
border-radius: 6px;
}

View File

@ -140,7 +140,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
const planSectionId = params['planSectionId'];
const isPublicDescription = params['public'];
const newDmpId = params['newDmpId'];
const newPlanId = params['newPlanId'];
this.scrollToField = this.route.snapshot.data['scrollToField'] ?? false
this.anchorFieldsetId = params['fieldsetId'] ?? null;
@ -151,7 +151,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
this.viewOnly = isPublicDescription;
//Regular Editor case
if (itemId != null && newDmpId == null) {
if (itemId != null && newPlanId == null) {
this.checkLock(this.item.id, LockTargetType.Description, 'DESCRIPTION-EDITOR.LOCKED-DIALOG.TITLE', 'DESCRIPTION-EDITOR.LOCKED-DIALOG.MESSAGE');
}
@ -333,7 +333,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
this.uiNotificationService.snackBarNotification(this.isNew ? this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-CREATION') : this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success);
const planId = this.formGroup.get('planId').value;
this.formGroup = null;
this.backToDmp(planId);
this.backToPlan(planId);
});
}
@ -414,7 +414,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
this.formService.validateAllFormFields(this.formGroup);
}
backToDmp(planId) {
backToPlan(planId) {
this.router.navigate([this.routerUtils.generateUrl(['/plans/', 'edit/', planId])]);
}
@ -756,12 +756,12 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
});
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
if (result) {
const dmpUserRemovePersist: DescriptionStatusPersist = {
const planUserRemovePersist: DescriptionStatusPersist = {
id: this.formGroup.get('id').value,
status: DescriptionStatus.Draft,
hash: this.formGroup.get('hash').value
};
this.descriptionService.persistStatus(dmpUserRemovePersist, DescriptionEditorEntityResolver.lookupFields()).pipe(takeUntil(this._destroyed))
this.descriptionService.persistStatus(planUserRemovePersist, DescriptionEditorEntityResolver.lookupFields()).pipe(takeUntil(this._destroyed))
.subscribe(data => {
this.isFinalized = false;
this.refreshData();

View File

@ -35,7 +35,7 @@ export class DescriptionFormFieldSetComponent extends BaseComponent {
@Input() hideAnnotations: boolean = false;
@Input() canReview: boolean = false;
@Input() numbering: string;
@Input() dmpUsers: PlanUser[] = [];
@Input() planUsers: PlanUser[] = [];
get isMultiplicityEnabled() {
return this.fieldSet.hasMultiplicity && this.fieldSet.multiplicity != null;
@ -186,7 +186,7 @@ export class DescriptionFormFieldSetComponent extends BaseComponent {
entityId: this.descriptionId,
anchor: fieldSetId,
entityType: AnnotationEntityType.Description,
planUsers: this.dmpUsers
planUsers: this.planUsers
}
});
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(changesMade => {

View File

@ -25,7 +25,7 @@
[isChild]="false"
[hideAnnotations]="isNew"
[canReview]="canReview"
[dmpUsers]="dmpUsers"
[planUsers]="planUsers"
></app-description-form-field-set>
</div>
</div>

View File

@ -26,7 +26,7 @@ export class DescriptionFormSectionComponent extends BaseComponent implements On
@Input() visibilityRulesService: VisibilityRulesService;
@Input() path: string;
@Input() descriptionId: Guid;
@Input() dmpUsers: PlanUser[] = [];
@Input() planUsers: PlanUser[] = [];
// @Input() descriptionTemplateId: String;

View File

@ -15,7 +15,7 @@
</mat-expansion-panel-header>
<ng-container *ngFor="let section of page.sections; let i = index;">
<div class="row" *ngIf="visibilityRulesService.isVisibleMap[section.id]">
<app-description-form-section class="col-12" [section]="section" [canReview]="canReview" [path]="(z+1)+'.'+(i+1)" [pathName]="'pages.'+z+'.sections.'+i" [propertiesFormGroup]="propertiesFormGroup" [descriptionId]="descriptionId" [visibilityRulesService]="visibilityRulesService" (askedToScroll)="onAskedToScroll(expansionPanel, $event)" [linkToScroll]="linkToScroll" [validationErrorModel]="validationErrorModel" [isNew]="isNew" [dmpUsers]="dmpUsers"></app-description-form-section>
<app-description-form-section class="col-12" [section]="section" [canReview]="canReview" [path]="(z+1)+'.'+(i+1)" [pathName]="'pages.'+z+'.sections.'+i" [propertiesFormGroup]="propertiesFormGroup" [descriptionId]="descriptionId" [visibilityRulesService]="visibilityRulesService" (askedToScroll)="onAskedToScroll(expansionPanel, $event)" [linkToScroll]="linkToScroll" [validationErrorModel]="validationErrorModel" [isNew]="isNew" [planUsers]="planUsers"></app-description-form-section>
</div>
</ng-container>
</mat-expansion-panel>

View File

@ -27,7 +27,7 @@ export class DescriptionFormComponent extends BaseComponent implements OnInit, O
@Input() datasetDescription: String;
@Input() linkToScroll: LinkToScroll;
@Input() validationErrorModel: ValidationErrorModel;
@Input() dmpUsers: PlanUser[] = [];
@Input() planUsers: PlanUser[] = [];
@Output() formChanged: EventEmitter<any> = new EventEmitter();

View File

@ -31,7 +31,7 @@ export class PrefillDescriptionDialogComponent extends BaseComponent implements
prefillSelected: boolean = false;
prefillForm: UntypedFormGroup;
dmp: Plan;
plan: Plan;
planSectionId: Guid;
availableDescriptionTemplates: DescriptionTemplate[] = [];
@ -43,13 +43,13 @@ export class PrefillDescriptionDialogComponent extends BaseComponent implements
@Inject(MAT_DIALOG_DATA) public data: any) {
super();
this.dmp = data.plan;
this.plan = data.plan;
this.planSectionId = data.planSectionId;
this.availableDescriptionTemplates = this.dmp.planDescriptionTemplates.filter(x => x.sectionId == this.planSectionId && x.isActive == IsActive.Active).map(x => x.currentDescriptionTemplate);
this.availableDescriptionTemplates = this.plan.planDescriptionTemplates.filter(x => x.sectionId == this.planSectionId && x.isActive == IsActive.Active).map(x => x.currentDescriptionTemplate);
}
ngOnInit() {
const availablePrefillingSourcesIds = this.dmp.blueprint.definition.sections.filter(x => x.id === this.planSectionId)[0].prefillingSources?.map(x => x.id) || null;
const availablePrefillingSourcesIds = this.plan.blueprint.definition.sections.filter(x => x.id === this.planSectionId)[0].prefillingSources?.map(x => x.id) || null;
this.singlePrefillingSourceAutoCompleteConfiguration = this.prefillingSourceService.getSingleAutocompleteConfiguration(availablePrefillingSourcesIds);
this.progressIndicationService.getProgressIndicationObservable().pipe(takeUntil(this._destroyed)).subscribe(x => {

View File

@ -34,7 +34,7 @@ export class DescriptionEditorEntityResolver extends BaseEditorResolver {
public static lookupFields(): string[] {
return [
...DescriptionEditorEntityResolver.descriptionLookupFields(),
...DescriptionEditorEntityResolver.dmpLookupFields(nameof<Description>(x => x.plan)),
...DescriptionEditorEntityResolver.planLookupFields(nameof<Description>(x => x.plan)),
...DescriptionEditorEntityResolver.descriptionTemplateLookupFieldsForDescrption(),
]
}
@ -115,7 +115,7 @@ export class DescriptionEditorEntityResolver extends BaseEditorResolver {
]
}
public static dmpLookupFields(prefix?: string): string[] {
public static planLookupFields(prefix?: string): string[] {
return [
(prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.id)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<Plan>(x => x.label)].join('.'),
@ -176,20 +176,20 @@ export class DescriptionEditorEntityResolver extends BaseEditorResolver {
}
return this.descriptionService.getSingle(Guid.parse(id), fields).pipe(tap(d => this.breadcrumbService.addIdResolvedValue(d.id.toString(), d.label)));
} else if (planId != null && planSectionId != null && copyPlanId == null) {
return this.planService.getSingle(Guid.parse(planId), DescriptionEditorEntityResolver.dmpLookupFields())
return this.planService.getSingle(Guid.parse(planId), DescriptionEditorEntityResolver.planLookupFields())
.pipe(tap(x => {
this.breadcrumbService.addExcludedParam(planId, true);
this.breadcrumbService.addIdResolvedValue(planSectionId, this.language.instant("DESCRIPTION-EDITOR.TITLE-NEW"));
}), takeUntil(this._destroyed), map(dmp => {
}), takeUntil(this._destroyed), map(plan => {
const description: Description = {};
description.plan = dmp;
description.plan = plan;
description.planDescriptionTemplate = {
sectionId: Guid.parse(planSectionId)
}
return description;
}));
} else if (copyPlanId != null && id != null && planSectionId != null) {
return this.planService.getSingle(Guid.parse(copyPlanId), DescriptionEditorEntityResolver.dmpLookupFields()).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(x.id?.toString(), x.label)), takeUntil(this._destroyed), concatMap(dmp => {
return this.planService.getSingle(Guid.parse(copyPlanId), DescriptionEditorEntityResolver.planLookupFields()).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(x.id?.toString(), x.label)), takeUntil(this._destroyed), concatMap(plan => {
return this.descriptionService.getSingle(Guid.parse(id), DescriptionEditorEntityResolver.cloneLookupFields())
.pipe(tap(x => {
this.breadcrumbService.addExcludedParam(copyPlanId, true)
@ -200,9 +200,9 @@ export class DescriptionEditorEntityResolver extends BaseEditorResolver {
description.id = null;
description.hash = null;
description.status = DescriptionStatus.Draft;
description.plan = dmp;
description.plan = plan;
description.planDescriptionTemplate = {
id: dmp.planDescriptionTemplates.filter(x => x.sectionId == Guid.parse(planSectionId) && x.descriptionTemplateGroupId == description.descriptionTemplate.groupId)[0].id,
id: plan.planDescriptionTemplates.filter(x => x.sectionId == Guid.parse(planSectionId) && x.descriptionTemplateGroupId == description.descriptionTemplate.groupId)[0].id,
sectionId: Guid.parse(planSectionId)
}
return description;

View File

@ -46,13 +46,13 @@ export class DescriptionEditorPermissionsResolver extends BaseEditorResolver {
}));
} else if (planId != null && planSectionId != null && copyPlanId == null) {
return this.planService.getSingle(Guid.parse(planId), DescriptionEditorEntityResolver.dmpLookupFields())
return this.planService.getSingle(Guid.parse(planId), DescriptionEditorEntityResolver.planLookupFields())
.pipe(tap(x => {
this.breadcrumbService.addExcludedParam(planId, true);
this.breadcrumbService.addIdResolvedValue(planSectionId, this.language.instant("DESCRIPTION-EDITOR.TITLE-NEW"));
}), takeUntil(this._destroyed), map(dmp => {
}), takeUntil(this._destroyed), map(plan => {
const description: Description = {};
description.plan = dmp;
description.plan = plan;
description.planDescriptionTemplate = {
sectionId: Guid.parse(planSectionId)
}
@ -67,7 +67,7 @@ export class DescriptionEditorPermissionsResolver extends BaseEditorResolver {
return this.descriptionService.getDescriptionSectionPermissions(descriptionSectionPermissionResolverModel).pipe(takeUntil(this._destroyed));
}));
} else if (copyPlanId != null && id != null && planSectionId != null) {
return this.planService.getSingle(Guid.parse(copyPlanId), DescriptionEditorEntityResolver.dmpLookupFields()).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(x.id?.toString(), x.label)), takeUntil(this._destroyed), concatMap(dmp => {
return this.planService.getSingle(Guid.parse(copyPlanId), DescriptionEditorEntityResolver.planLookupFields()).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(x.id?.toString(), x.label)), takeUntil(this._destroyed), concatMap(plan => {
//TODO
return this.descriptionService.getSingle(Guid.parse(id), DescriptionEditorEntityResolver.cloneLookupFields())
.pipe(tap(x => {
@ -79,9 +79,9 @@ export class DescriptionEditorPermissionsResolver extends BaseEditorResolver {
description.id = null;
description.hash = null;
description.status = DescriptionStatus.Draft;
description.plan = dmp;
description.plan = plan;
description.planDescriptionTemplate = {
id: dmp.planDescriptionTemplates.filter(x => x.sectionId == Guid.parse(planSectionId) && x.descriptionTemplateGroupId == description.descriptionTemplate.groupId)[0].id,
id: plan.planDescriptionTemplates.filter(x => x.sectionId == Guid.parse(planSectionId) && x.descriptionTemplateGroupId == description.descriptionTemplate.groupId)[0].id,
sectionId: Guid.parse(planSectionId)
}
return description;

View File

@ -16,7 +16,7 @@
padding-bottom: 2em;
}
.explore-dmp-content {
.explore-plan-content {
padding: 30px 15px;
}

View File

@ -54,7 +54,7 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
planId: string;
status: Number;
totalCount: number;
dmpSearchEnabled = true;
plansearchEnabled = true;
listingItems: any[] = [];
hasLoadedListingItems: boolean = false;
isPublic: boolean = false;
@ -207,7 +207,7 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
protected setupColumns() { }
public dashboardTour: GuidedTour = {
tourId: 'dmp-description-tour',
tourId: 'plan-description-tour',
useOrb: true,
steps: [
{
@ -290,12 +290,12 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
}
public restartTour(): void {
this.setDashboardTourDmpText();
this.setDashboardTourPlanText();
this.setDashboardTourDescriptionText();
this.guidedTourService.startTour(this.dashboardTour);
}
public setDashboardTourDmpText(): void {
public setDashboardTourPlanText(): void {
this.planText = this.language.instant('PLAN-LISTING.TEXT-INFO') + '\n\n' +
this.language.instant('PLAN-LISTING.TEXT-INFO-QUESTION') + ' ' +
this.language.instant('PLAN-LISTING.LINK-ZENODO') + ' ' +
@ -391,13 +391,13 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
lookup.descriptionTemplateSubQuery.ids = descriptionTemplates;
} else lookup.descriptionTemplateSubQuery = null;
// Dmps
let dmps = formGroup.get("associatedDmpIds")?.value ?? null; let addDmps = dmps && dmps?.length > 0;
// Plans
let plans = formGroup.get("associatedPlanIds")?.value ?? null; let addPlans = plans && plans?.length > 0;
let roles = formGroup.get("role")?.value !== null ? [formGroup.get("role")?.value] : null; let addRoles = roles && roles?.length > 0;
if (addDmps || addRoles) {
if (addPlans || addRoles) {
lookup.planSubQuery = DescriptionFilterService.initializePlanLookup();
if (addDmps) lookup.planSubQuery.ids = dmps?.length > 0 ? dmps : null;
if (addPlans) lookup.planSubQuery.ids = plans?.length > 0 ? plans : null;
if (addRoles) {
lookup.planSubQuery.planUserSubQuery = DescriptionFilterService.initializePlanUserLookup();
@ -434,7 +434,7 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
status: [lookup.statuses?.length > 0 ? lookup.statuses[0] : null],
role: lookup.planSubQuery?.planUserSubQuery?.userRoles ? lookup.planSubQuery?.planUserSubQuery?.userRoles[0] : [],
descriptionTemplates: lookup.descriptionTemplateSubQuery?.ids ? [lookup.descriptionTemplateSubQuery?.ids] : [],
associatedDmpIds: lookup.planSubQuery?.ids ? [lookup.planSubQuery?.ids] : [],
associatedPlanIds: lookup.planSubQuery?.ids ? [lookup.planSubQuery?.ids] : [],
tags: lookup.descriptionTagSubQuery?.tagIds ? [lookup.descriptionTagSubQuery?.tagIds] : [],
});
}

View File

@ -13,7 +13,7 @@ const routes: Routes = [
},
},
{
path: 'dmp/:planId',
path: 'plan/:planId',
component: DescriptionListingComponent,
canActivate: [AuthGuard],
data: {

View File

@ -1,5 +1,5 @@
<div class="dmp-criteria">
<div class="plan-criteria">
<div class="filters container-fluid">
<div class="row justify-content-center">
<div class="col-10">
@ -32,16 +32,16 @@
</div>
<!-- End of Related Dataset Templates Filters -->
<!-- Related DMP Filters -->
<!-- Related Plan Filters -->
<div class="col-10">
<h6 class="category-title">{{'DESCRIPTION-LISTING.FILTERS.ASSOCIATED-PLANS.NAME' | translate}}</h6>
<mat-form-field class="w-100">
<mat-label>{{'DESCRIPTION-LISTING.FILTERS.ASSOCIATED-PLANS.PLACEHOLDER' | translate }}</mat-label>
<app-multiple-auto-complete [formControl]="formGroup.get('associatedDmpIds')" [configuration]="dmpAutoCompleteConfiguration"></app-multiple-auto-complete>
<app-multiple-auto-complete [formControl]="formGroup.get('associatedPlanIds')" [configuration]="planAutoCompleteConfiguration"></app-multiple-auto-complete>
</mat-form-field>
<hr>
</div>
<!-- End of Related DMP Filters -->
<!-- End of Related Plan Filters -->
<!-- All Versions Filter-->
<!-- TODO -->
@ -57,10 +57,10 @@
<h6 class="category-title">{{'DESCRIPTION-LISTING.FILTERS.ROLE.NAME' | translate }}</h6>
<mat-radio-group aria-label="Select an option" [formControl]="formGroup.get('role')" class="row">
<mat-radio-button [value]="null" [checked]="formGroup.get('role').value == null" class="col-12">{{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.ANY' | translate }}</mat-radio-button>
<mat-radio-button [value]="dmpRole.Owner" class="col-12">{{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.OWNER' | translate }}</mat-radio-button>
<mat-radio-button [value]="dmpRole.Viewer" class="col-12">{{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.VIEWER' | translate }}</mat-radio-button>
<mat-radio-button [value]="dmpRole.DescriptionContributor" class="col-12">{{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.DESCRIPTION-CONTRIBUTOR' | translate }}</mat-radio-button>
<mat-radio-button [value]="dmpRole.Reviewer" class="col-12">{{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.REVIEWER' | translate }}</mat-radio-button>
<mat-radio-button [value]="planRole.Owner" class="col-12">{{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.OWNER' | translate }}</mat-radio-button>
<mat-radio-button [value]="planRole.Viewer" class="col-12">{{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.VIEWER' | translate }}</mat-radio-button>
<mat-radio-button [value]="planRole.DescriptionContributor" class="col-12">{{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.DESCRIPTION-CONTRIBUTOR' | translate }}</mat-radio-button>
<mat-radio-button [value]="planRole.Reviewer" class="col-12">{{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.REVIEWER' | translate }}</mat-radio-button>
</mat-radio-group>
<hr>
</div>

View File

@ -41,11 +41,11 @@ export class DescriptionFilterComponent extends BaseCriteriaComponent implements
public filteringTagsAsync = false;
statuses = DescriptionStatus;
dmpRole = PlanUserRole;
planRole = PlanUserRole;
options: UntypedFormGroup;
descriptionTemplateAutoCompleteConfiguration: MultipleAutoCompleteConfiguration;
dmpAutoCompleteConfiguration: MultipleAutoCompleteConfiguration;
planAutoCompleteConfiguration: MultipleAutoCompleteConfiguration;
tagAutoCompleteConfiguration: MultipleAutoCompleteConfiguration;
referenceTypeAutocompleteConfiguration: SingleAutoCompleteConfiguration;
referenceAutocompleteConfiguration: Map<string, MultipleAutoCompleteConfiguration>;
@ -71,7 +71,7 @@ export class DescriptionFilterComponent extends BaseCriteriaComponent implements
if (changes['filterFormGroup']) {
this.descriptionTemplateAutoCompleteConfiguration = this.descriptionTemplateService.buildMultipleAutocompleteConfiguration();
this.dmpAutoCompleteConfiguration = this.planService.multipleAutocompleteConfiguration;
this.planAutoCompleteConfiguration = this.planService.multipleAutocompleteConfiguration;
this.tagAutoCompleteConfiguration = this.tagService.multipleAutocompleteConfiguration;
this.referenceTypeAutocompleteConfiguration = this.getReferenceTypeAutocompleteConfiguration();
this.referenceAutocompleteConfiguration = new Map<string, MultipleAutoCompleteConfiguration>();

View File

@ -8,8 +8,8 @@
<div *ngIf="description.status === descriptionStatusEnum.Finalized" class="col-auto description-title">{{description.label}}</div>
<div *ngIf="description.status === descriptionStatusEnum.Draft" class="col-auto description-title-draft">{{description.label}}</div>
<div class="description-subtitle">
<span *ngIf="isUserDMPRelated()" class="col-auto">{{ enumUtils.toPlanUserRolesString(planService.getCurrentUserRolesInPlan(description?.plan?.planUsers)) }}</span>
<span *ngIf="isUserDMPRelated()">.</span>
<span *ngIf="isUserPlanRelated()" class="col-auto">{{ enumUtils.toPlanUserRolesString(planService.getCurrentUserRolesInPlan(description?.plan?.planUsers)) }}</span>
<span *ngIf="isUserPlanRelated()">.</span>
<span class="col-auto" *ngIf="description.status === descriptionStatusEnum.Finalized && description.plan.accessType === planAccessTypeEnum.Public"><span class="material-icons icon-align">public</span>{{'DESCRIPTION-LISTING.STATES.PUBLIC' | translate}}</span>
<span *ngIf="description.status === descriptionStatusEnum.Finalized && description.plan.accessType != planAccessTypeEnum.Public" class="col-auto"><span class="material-icons icon-align">done</span>{{ enumUtils.toDescriptionStatusString(description.status) }}</span>
<span *ngIf="description.status === descriptionStatusEnum.Draft" class=" col-auto draft"><span class="material-icons icon-align">create</span>{{ enumUtils.toDescriptionStatusString(description.status) }}</span>
@ -18,19 +18,19 @@
</div>
<div class="d-flex flex-direction-row pt-3 pb-3">
<div class="col-auto description-subtitle pr-0">{{'DESCRIPTION-LISTING.PART-OF' | translate}}
<div class="col-auto dmp-label ml-3">{{'DESCRIPTION-LISTING.PLAN' | translate}}</div>
<div class="col-auto plan-label ml-3">{{'DESCRIPTION-LISTING.PLAN' | translate}}</div>
</div>
<div class="col dmp-title">{{description.plan?.label}}</div>
<div class="col plan-title">{{description.plan?.label}}</div>
</div>
</a>
<div class="description-card-actions">
<a class="col-auto border-right pointer" *ngIf="fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Description) && fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Description).length > 0" [matMenuTriggerFor]="exportMenu"><span class="material-icons icon-align pr-2">open_in_new</span>{{'DESCRIPTION-LISTING.ACTIONS.EXPORT' | translate}}</a>
<a class="col-auto border-right pointer" *ngIf="canInvitePlanUsers" (click)="openShareDialog()"><span class="material-icons icon-align pr-2">group_add</span>{{'DESCRIPTION-LISTING.ACTIONS.INVITE-SHORT' | translate}}</a>
<a class="col-auto border-right pointer" *ngIf="isAuthenticated()" (click)="copyToDmp(description)"><span class="material-icons icon-align pr-2">file_copy</span>{{'DESCRIPTION-LISTING.ACTIONS.COPY-DESCRIPTION' | translate}}</a>
<a class="col-auto border-right pointer" *ngIf="isAuthenticated()" (click)="copyToPlan(description)"><span class="material-icons icon-align pr-2">file_copy</span>{{'DESCRIPTION-LISTING.ACTIONS.COPY-DESCRIPTION' | translate}}</a>
<a class="col-auto border-right pointer" *ngIf="canDelete" (click)="deleteClicked(description.id)"><span class="material-icons icon-align pr-2">delete</span>{{ 'DESCRIPTION-LISTING.ACTIONS.DELETE' | translate }}</a>
</div>
<mat-menu #actionsMenu="matMenu">
<button *ngIf="isAuthenticated()" mat-menu-item (click)="copyToDmp(description)" class="menu-item">
<button *ngIf="isAuthenticated()" mat-menu-item (click)="copyToPlan(description)" class="menu-item">
<mat-icon>file_copy</mat-icon>{{'DESCRIPTION-LISTING.ACTIONS.COPY-DESCRIPTION' | translate}}
</button>
<button *ngIf="canDelete" mat-menu-item (click)="deleteClicked(description.id)" class="menu-item">

View File

@ -77,7 +77,7 @@ p {
color: #08bd63;
}
.dmp-card,
.plan-card,
.description-card {
min-width: 712px;
/* min-height: 308px; */
@ -112,7 +112,7 @@ input[type="text"] {
opacity: 0.6;
}
.dmp-label {
.plan-label {
background: var(--primary-color) 0% 0% no-repeat padding-box;
border-radius: 4px 0px;
opacity: 1;
@ -135,7 +135,7 @@ input[type="text"] {
color: #212121;
}
.dmp-title,
.plan-title,
.description-title {
text-align: left;
font-weight: 600;
@ -174,7 +174,7 @@ input[type="text"] {
// padding-bottom: 0.4rem;
}
.dmp-subtitle,
.plan-subtitle,
.description-subtitle {
.icon-align {
@ -186,7 +186,7 @@ input[type="text"] {
}
.description-card-actions,
.dmp-card-actions {
.plan-card-actions {
display: flex;
flex-direction: row;
border-top: 1px solid #dbdbdb;
@ -195,24 +195,24 @@ input[type="text"] {
}
.description-card-actions a,
.dmp-card-actions a {
.plan-card-actions a {
color: #848484 !important;
text-decoration: none !important;
}
.description-card-actions a:hover,
.dmp-card-actions a:hover {
.plan-card-actions a:hover {
color: var(--primary-color) !important;
}
.dmp-description-descriptions-title {
.plan-description-descriptions-title {
color: #000000;
opacity: 0.6;
padding-top: 1.5rem;
padding-bottom: 0.8rem;
}
.dmp-description-descriptions-name {
.plan-description-descriptions-name {
color: #000000;
opacity: 0.6;
font-weight: 700;

View File

@ -109,7 +109,7 @@ export class DescriptionListingItemComponent extends BaseComponent implements On
}
}
isUserDMPRelated() {
isUserPlanRelated() {
const principalId: Guid = this.authService.userId();
return this.description.plan.planUsers?.some(x => (x.user.id === principalId));
}
@ -122,7 +122,7 @@ export class DescriptionListingItemComponent extends BaseComponent implements On
return this.isPublic ? this.routerUtils.generateUrl(['/explore-descriptions/overview/public/', this.description.id.toString()]) : this.routerUtils.generateUrl(['/descriptions/overview/', this.description.id.toString()]);
}
getDmpLink(): string[] {
getPlanLink(): string[] {
return this.isPublic ? [`/explore-plans/overview/public/${this.description.plan.id}`] : [`/plans/edit/${this.description.plan.id}`];
}
@ -135,13 +135,13 @@ export class DescriptionListingItemComponent extends BaseComponent implements On
restoreFocus: false,
data: {
planId: this.description.plan.id,
dmpName: this.description.plan.label,
planName: this.description.plan.label,
blueprint: this.description.plan.blueprint
}
});
}
copyToDmp(description: Description) {
copyToPlan(description: Description) {
const formGroup = this.fb.group({
planId: this.fb.control(null, Validators.required),
sectionId: this.fb.control(null, Validators.required),

View File

@ -57,7 +57,7 @@
</div>
</ng-template>
<div *ngIf="canEdit" class="col-auto pr-0">
<button (click)="openCopyToDmpDialog()" mat-mini-fab class="mr-3 actions-btn" matTooltip="{{'DESCRIPTION-OVERVIEW.ACTIONS.CLONE' | translate}}" matTooltipPosition="above">
<button (click)="openCopyToPlanDialog()" mat-mini-fab class="mr-3 actions-btn" matTooltip="{{'DESCRIPTION-OVERVIEW.ACTIONS.CLONE' | translate}}" matTooltipPosition="above">
<mat-icon class="mat-mini-fab-icon">content_copy</mat-icon>
</button>
</div>
@ -72,8 +72,8 @@
</div>
<div class="row">
<div class="col-12 col-lg-7">
<button class="w-100 dmp-btn p-1" (click)="dmpClicked(description.plan)">
<div class="dmp-btn-label">
<button class="w-100 plan-btn p-1" (click)="planClicked(description.plan)">
<div class="plan-btn-label">
{{ this.description.plan.label }}
</div>
<div class="w-auto">
@ -213,7 +213,7 @@
</p>
</div>
<div class="col-auto" *ngIf="canInvitePlanUsers && description.plan?.status === planStatusEnum.Draft && planUser.role != planUserRoleEnum.Owner">
<button (click)="removeUserFromDmp(planUser)" mat-mini-fab matTooltip="{{ 'DESCRIPTION-OVERVIEW.ACTIONS.REMOVE-AUTHOR' | translate}}" matTooltipPosition="above">
<button (click)="removeUserFromPlan(planUser)" mat-mini-fab matTooltip="{{ 'DESCRIPTION-OVERVIEW.ACTIONS.REMOVE-AUTHOR' | translate}}" matTooltipPosition="above">
<mat-icon class="mat-mini-fab-icon">delete</mat-icon>
</button>
</div>

View File

@ -59,7 +59,7 @@
align-self: center;
}
.dmp-btn {
.plan-btn {
width: 35em;
min-height: 2.3em;
background-color: var(--primary-color);
@ -69,8 +69,8 @@
border: none;
}
.dmp-btn,
.dmp-btn > mat-icon {
.plan-btn,
.plan-btn > mat-icon {
color: #ffffff;
// opacity: 0.8;
}
@ -185,7 +185,7 @@
margin-bottom: 1.875em;
}
.dmp-btn-label {
.plan-btn-label {
margin-right: 1em;
color: #ffffff;
opacity: 0.8;
@ -294,7 +294,7 @@
}
.description-label,
.dmp-btn,
.plan-btn,
.doi-panel,
.researcher {
display: flex;

View File

@ -248,16 +248,16 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
} else return false;
}
focusOnAuthor(dmpUserId: Guid, order: number): void {
this.authorFocus = `${dmpUserId}-${order}`;
focusOnAuthor(planUserId: Guid, order: number): void {
this.authorFocus = `${planUserId}-${order}`;
}
resetAuthorFocus(): void {
this.authorFocus = null;
}
isFocusedOnUser(dmpUserId: Guid, order: number): boolean {
return `${dmpUserId}-${order}` == this.authorFocus;
isFocusedOnUser(planUserId: Guid, order: number): boolean {
return `${planUserId}-${order}` == this.authorFocus;
}
openShareDialog() {
@ -266,7 +266,7 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
restoreFocus: false,
data: {
planId: this.description.plan.id,
dmpName: this.description.plan.label,
planName: this.description.plan.label,
blueprint: this.description.plan.blueprint
}
});
@ -308,11 +308,11 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
});
}
dmpClicked(dmp: Plan) {
planClicked(plan: Plan) {
if (this.isPublicView) {
this.router.navigate([this.routerUtils.generateUrl(['/explore-plans/overview/public/', dmp.id.toString()])]);
this.router.navigate([this.routerUtils.generateUrl(['/explore-plans/overview/public/', plan.id.toString()])]);
} else {
this.router.navigate([this.routerUtils.generateUrl(['/plans/overview/', dmp.id.toString()])]);
this.router.navigate([this.routerUtils.generateUrl(['/plans/overview/', plan.id.toString()])]);
}
}
@ -360,7 +360,7 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
return sections == null ? '' : sections[0].label;
}
openCopyToDmpDialog() {
openCopyToPlanDialog() {
const formGroup = this.fb.group({
planId: this.fb.control(null, Validators.required),
sectionId: this.fb.control(null, Validators.required),
@ -387,7 +387,7 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
});
}
removeUserFromDmp(dmpUser: PlanUser) {
removeUserFromPlan(planUser: PlanUser) {
const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: {
message: this.language.instant('GENERAL.CONFIRMATION-DIALOG.DELETE-USER'),
@ -398,12 +398,12 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
});
dialogRef.afterClosed().subscribe(result => {
if (result) {
const dmpUserRemovePersist: PlanUserRemovePersist = {
id: dmpUser.id,
const planUserRemovePersist: PlanUserRemovePersist = {
id: planUser.id,
planId: this.description.plan.id,
role: dmpUser.role
role: planUser.role
};
this.planService.removeUser(dmpUserRemovePersist).pipe(takeUntil(this._destroyed))
this.planService.removeUser(planUserRemovePersist).pipe(takeUntil(this._destroyed))
.subscribe(data => {
this.reloadPage();
}, (error: any) => this.httpErrorHandlingService.handleBackedRequestError(error));
@ -465,12 +465,12 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
});
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
if (result) {
const dmpUserRemovePersist: DescriptionStatusPersist = {
const planUserRemovePersist: DescriptionStatusPersist = {
id: description.id,
status: DescriptionStatus.Draft,
hash: description.hash
};
this.descriptionService.persistStatus(dmpUserRemovePersist).pipe(takeUntil(this._destroyed))
this.descriptionService.persistStatus(planUserRemovePersist).pipe(takeUntil(this._destroyed))
.subscribe(data => {
this.reloadPage();
this.onUpdateCallbackSuccess()

View File

@ -16,7 +16,7 @@
</div>
<div class="row mt-2">
<div class="col-auto pb-4">
<span>{{'DASHBOARD.ADD-NEW-DESCRIPTION.OPTIONS-NOT-ENOUGH' | translate}}</span>&nbsp;<span class="new-dmp" (click)="startNewPlan()">{{'DASHBOARD.ADD-NEW-DESCRIPTION.START-NEW-PLAN' | translate}}</span>
<span>{{'DASHBOARD.ADD-NEW-DESCRIPTION.OPTIONS-NOT-ENOUGH' | translate}}</span>&nbsp;<span class="new-plan" (click)="startNewPlan()">{{'DASHBOARD.ADD-NEW-DESCRIPTION.START-NEW-PLAN' | translate}}</span>
</div>
</div>
<div class="row">

View File

@ -92,7 +92,7 @@ min-width: 101px;
flex-direction: row;
}
.new-dmp {
.new-plan {
text-align: left;
text-decoration: underline;
letter-spacing: 0px;
@ -100,11 +100,11 @@ min-width: 101px;
cursor: pointer;
}
::ng-deep .dmp-form .mat-form-field-appearance-outline .mat-form-field-outline {
::ng-deep .plan-form .mat-form-field-appearance-outline .mat-form-field-outline {
// background: #fafafa !important;
}
::ng-deep .dmp-form .mat-form-field-appearance-outline .mat-form-field-infix {
::ng-deep .plan-form .mat-form-field-appearance-outline .mat-form-field-infix {
// font-size: 1rem;
// padding: 0.6em 0 1em 0 !important;
}

View File

@ -20,7 +20,7 @@
<div class="collapse navbar-collapse justify-content-end" id="navigation">
<div class="new-dmp-dialog col-md-auto ml-auto">
<div class="new-plan-dialog col-md-auto ml-auto">
<button type="button" class="normal-btn" (click)="openNewPlanDialog()">{{ 'NAV-BAR.START-NEW-PLAN' | translate }}</button>
</div>
<div class="col-md-auto pl-0" *ngIf="!(isAuthenticated() && onInvalidUrl())">

View File

@ -146,7 +146,7 @@ $mat-card-header-size: 40px !default;
border-radius: 6px;
}
.new-dmp-dialog {
.new-plan-dialog {
padding: 0em .5em 0em 0em;
}
::ng-deep .mat-option-text {

View File

@ -5,7 +5,7 @@
<mat-divider class="top-divider"></mat-divider>
<div class="profile-settings">
<a mat-button class="profile mt-2 w-100 ml-0 pl-1 d-inline-block" (click)="navigateToProfile()">{{'USER-DIALOG.USER-PROFILE-SETTINGS' | translate}}</a>
<a mat-button class="profile mb-2 w-100 ml-0 pl-1 d-inline-block" (click)="navigateToMyDmps()">{{'USER-PROFILE.ASSOCIATED-PLANS' | translate}}</a>
<a mat-button class="profile mb-2 w-100 ml-0 pl-1 d-inline-block" (click)="navigateToMyPlans()">{{'USER-PROFILE.ASSOCIATED-PLANS' | translate}}</a>
</div>
<mat-divider></mat-divider>
<div>

View File

@ -68,7 +68,7 @@ export class UserDialogComponent implements OnInit, OnDestroy {
this.router.navigate([this.routerUtils.generateUrl('/profile')]);
}
public navigateToMyDmps() {
public navigateToMyPlans() {
this.dialogRef.close();
this.router.navigate([this.routerUtils.generateUrl('/plans')]);
}

View File

@ -40,7 +40,7 @@
<mat-checkbox [checked]="allDescriptionsCompleted" [indeterminate]="someDescriptionsCompleted" (change)="toggleAllDescriptions($event.checked)">{{ 'PLAN-CLONE-DIALOG.ACTIONS.TOGGLE-DESCRIPTIONS' | translate }}</mat-checkbox>
</mat-card-header>
<mat-selection-list #selectedItems [formControl]="formGroup.get('descriptions')">
<mat-list-option *ngFor="let description of dmp.descriptions;" [value]="description.id">
<mat-list-option *ngFor="let description of plan.descriptions;" [value]="description.id">
<span class="text-truncate" [matTooltip]="description.label">{{description.label}}</span>
</mat-list-option>
</mat-selection-list>

View File

@ -19,7 +19,7 @@ import { HttpErrorResponse } from '@angular/common/http';
})
export class ClonePlanDialogComponent extends BaseComponent {
dmp: Plan;
plan: Plan;
editorModel: PlanCloneDialogEditorModel;
formGroup: UntypedFormGroup;
@ -32,12 +32,12 @@ export class ClonePlanDialogComponent extends BaseComponent {
@Inject(MAT_DIALOG_DATA) public data: any
) {
super();
this.dmp = data.plan;
this.plan = data.plan;
}
get allDescriptionsNo(): number{
return this.dmp.descriptions?.length ?? 0;
return this.plan.descriptions?.length ?? 0;
}
get checkedDescrionsNo(): number {
@ -58,7 +58,7 @@ export class ClonePlanDialogComponent extends BaseComponent {
}
hasDescriptions() {
return this.dmp.descriptions?.length > 0;
return this.plan.descriptions?.length > 0;
}
close() {
@ -73,14 +73,14 @@ export class ClonePlanDialogComponent extends BaseComponent {
if (!this.formGroup.valid) { return; }
const value: ClonePlanPersist = this.formGroup.value;
this.planService.clone(value, PlanEditorEntityResolver.lookupFields()).pipe(takeUntil(this._destroyed)).subscribe(
dmp => this.dialogRef.close(dmp),
plan => this.dialogRef.close(plan),
error => this.onCallbackError(error)
);
}
toggleAllDescriptions(event: any) {
if (event === true) {
this.formGroup.get('descriptions')?.setValue(this.dmp.descriptions?.map(d=> d.id));
this.formGroup.get('descriptions')?.setValue(this.plan.descriptions?.map(d=> d.id));
} else {
this.formGroup.get('descriptions')?.setValue([]);
}

View File

@ -26,7 +26,7 @@ import { nameof } from 'ts-simple-nameof';
})
export class PlanDepositDropdown extends BaseComponent implements OnInit {
@Input() inputRepos: DepositConfiguration[];
@Input() dmp: Plan;
@Input() plan: Plan;
outputRepos = [];
logos: Map<string, SafeResourceUrl> = new Map<string, SafeResourceUrl>();
@Output() outputReposEmitter: EventEmitter<EntityDoi[]> = new EventEmitter<EntityDoi[]>();
@ -49,8 +49,8 @@ export class PlanDepositDropdown extends BaseComponent implements OnInit {
}
ngOnInit(): void {
for (var i = 0; i < this.dmp?.entityDois?.length; i++) {
this.inputRepos = this.inputRepos.filter(r => this.hasDoi(r, this.dmp.entityDois, i));
for (var i = 0; i < this.plan?.entityDois?.length; i++) {
this.inputRepos = this.inputRepos.filter(r => this.hasDoi(r, this.plan.entityDois, i));
}
this.inputRepos.forEach(repo => {
if (repo.hasLogo) {
@ -76,12 +76,12 @@ export class PlanDepositDropdown extends BaseComponent implements OnInit {
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
switch (result) {
case 0:
this.showOauth2Dialog(this.depositOauth2DialogService.getLoginUrl(repo), repo, this.dmp);
this.showOauth2Dialog(this.depositOauth2DialogService.getLoginUrl(repo), repo, this.plan);
break;
case 1:
const depositRequest: DepositRequest = {
repositoryId: repo.repositoryId,
planId: this.dmp.id,
planId: this.plan.id,
authorizationCode: null,
project: this.EntityDoiFields()
};
@ -99,7 +99,7 @@ export class PlanDepositDropdown extends BaseComponent implements OnInit {
} else if (repo.depositType == DepositConfigurationStatus.System) {
const depositRequest: DepositRequest = {
repositoryId: repo.repositoryId,
planId: this.dmp.id,
planId: this.plan.id,
authorizationCode: null,
project: this.EntityDoiFields()
};
@ -121,14 +121,14 @@ export class PlanDepositDropdown extends BaseComponent implements OnInit {
this.uiNotificationService.snackBarNotification(error.error.message ? error.error.message : this.language.instant('PLAN-EDITOR.SNACK-BAR.UNSUCCESSFUL-DOI'), SnackBarNotificationLevel.Error);
}
showOauth2Dialog(url: string, repo: DepositConfiguration, dmp: Plan) {
showOauth2Dialog(url: string, repo: DepositConfiguration, plan: Plan) {
this.depositOauth2DialogService.login(url)
.pipe(takeUntil(this._destroyed))
.subscribe(code => {
if (code !== undefined) {
const depositRequest: DepositRequest = {
repositoryId: repo.repositoryId,
planId: dmp.id,
planId: plan.id,
authorizationCode: code,
project: this.EntityDoiFields()
};

View File

@ -1,18 +1,18 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { AuthService } from '@app/core/services/auth/auth.service';
import { DmpInvitationService } from '@app/core/services/plan/dmp-invitation.service';
import { PlanInvitationService } from '@app/core/services/plan/plan-invitation.service';
import { BaseComponent } from '@common/base/base.component';
import { takeUntil } from 'rxjs/operators';
@Component({
selector: 'app-dmp-invitation-accepted-component',
templateUrl: 'dmp-invitation-accepted.component.html',
selector: 'app-plan-invitation-accepted-component',
templateUrl: 'plan-invitation-accepted.component.html',
})
export class InvitationAcceptedComponent extends BaseComponent implements OnInit {
constructor(
private dmpInvitationService: DmpInvitationService,
private planInvitationService: PlanInvitationService,
private route: ActivatedRoute,
private router: Router,
private authentication: AuthService,
@ -27,7 +27,7 @@ export class InvitationAcceptedComponent extends BaseComponent implements OnInit
const id = params['id'];
if(this.isAuthenticated()){
this.dmpInvitationService.exchange(id)
this.planInvitationService.exchange(id)
.pipe(takeUntil(this._destroyed))
.subscribe(result => {
this.router.navigate(['plans/edit/' + result]);

View File

@ -1,4 +1,4 @@
<div class="dmp-invitation-dialog container-fluid" *ngIf="formGroup">
<div class="plan-invitation-dialog container-fluid" *ngIf="formGroup">
<div class="row">
<div class="col">
<h1 class="title">{{'PLAN-USER-INVITATION-DIALOG.TITLE' | translate}}</h1>

View File

@ -1,4 +1,4 @@
.dmp-invitation-dialog {
.plan-invitation-dialog {
padding: 2.5rem;
.form-container {

View File

@ -1,4 +1,4 @@
<div class="dmp-criteria">
<div class="plan-criteria">
<div class="filters container-fluid">
<div class="row justify-content-center">
<div class="col-10">
@ -29,16 +29,16 @@
</div>
<!-- End of Related Dataset Templates Filter -->
<!-- Dmp Blueprint Filter -->
<!-- Plan Blueprint Filter -->
<div class="col-10">
<h6 class="category-title">{{ 'PLAN-LISTING.FILTERS.ASSOCIATED-PLAN-BLUEPRINTS.NAME' | translate}}</h6>
<mat-form-field class="w-100">
<mat-label>{{ 'PLAN-LISTING.FILTERS.ASSOCIATED-PLAN-BLUEPRINTS.PLACEHOLDER' | translate }}</mat-label>
<app-multiple-auto-complete [formControl]="formGroup.get('dmpBlueprints')" [configuration]="dmpBlueprintAutoCompleteConfiguration"></app-multiple-auto-complete>
<app-multiple-auto-complete [formControl]="formGroup.get('planBlueprints')" [configuration]="planBlueprintAutoCompleteConfiguration"></app-multiple-auto-complete>
</mat-form-field>
<hr>
</div>
<!-- End of Dmp Blueprint Filter -->
<!-- End of Plan Blueprint Filter -->
<!-- Role Filter -->
<div *ngIf="isAuthenticated()" class="col-10">

View File

@ -1,4 +1,4 @@
.dmp-criteria {
.plan-criteria {
mat-form-field {
padding-bottom: 5px;
width: 100%;

View File

@ -41,7 +41,7 @@ export class PlanFilterComponent extends BaseCriteriaComponent implements OnInit
maxFileSize: number = 1048576;
descriptionTemplateAutoCompleteConfiguration: MultipleAutoCompleteConfiguration;
dmpBlueprintAutoCompleteConfiguration: MultipleAutoCompleteConfiguration;
planBlueprintAutoCompleteConfiguration: MultipleAutoCompleteConfiguration;
referenceTypeAutocompleteConfiguration: SingleAutoCompleteConfiguration;
referenceAutocompleteConfiguration: Map<string, MultipleAutoCompleteConfiguration>;
@ -65,7 +65,7 @@ export class PlanFilterComponent extends BaseCriteriaComponent implements OnInit
if (changes['filterFormGroup']) {
this.descriptionTemplateAutoCompleteConfiguration = this.descriptionTemplateService.buildDescriptionTempalteGroupMultipleAutocompleteConfiguration();
this.dmpBlueprintAutoCompleteConfiguration = this.planBlueprintService.multipleAutocompleteConfiguration;
this.planBlueprintAutoCompleteConfiguration = this.planBlueprintService.multipleAutocompleteConfiguration;
this.referenceTypeAutocompleteConfiguration = this.getReferenceTypeAutocompleteConfiguration();
this.referenceAutocompleteConfiguration = new Map<string, MultipleAutoCompleteConfiguration>();

View File

@ -1,56 +1,56 @@
<div class="dmp-card">
<a [routerLink]="isPublic ? this.routerUtils.generateUrl(['/explore-plans/overview/public/', dmp.id]) : this.routerUtils.generateUrl(['/plans/overview/', dmp.id])" class="pointer">
<div class="plan-card">
<a [routerLink]="isPublic ? this.routerUtils.generateUrl(['/explore-plans/overview/public/', plan.id]) : this.routerUtils.generateUrl(['/plans/overview/', plan.id])" class="pointer">
<div class="d-flex flex-direction-row">
<div class="col-auto dmp-label">{{ 'PLAN-LISTING.PLAN' | translate }}</div>
<div *ngIf="!isPublic" class="col-auto ml-auto edited-date">{{ 'PLAN-LISTING.EDITED' | translate }}: {{ dmp.updatedAt | dateTimeFormatter: "d MMMM y" }}</div>
<div *ngIf="isPublic" class="col-auto ml-auto edited-date">{{ 'PLAN-LISTING.PUBLISHED' | translate }}: {{ dmp.finalizedAt | dateTimeFormatter: "d MMMM y" }}</div>
<div class="col-auto plan-label">{{ 'PLAN-LISTING.PLAN' | translate }}</div>
<div *ngIf="!isPublic" class="col-auto ml-auto edited-date">{{ 'PLAN-LISTING.EDITED' | translate }}: {{ plan.updatedAt | dateTimeFormatter: "d MMMM y" }}</div>
<div *ngIf="isPublic" class="col-auto ml-auto edited-date">{{ 'PLAN-LISTING.PUBLISHED' | translate }}: {{ plan.finalizedAt | dateTimeFormatter: "d MMMM y" }}</div>
</div>
<div class="col-auto" [ngClass]="{'dmp-title': !isDraft, 'dmp-title-draft': isDraft}">{{dmp.label}}</div>
<div class="dmp-subtitle">
<span *ngIf="isUserPlanRelated()" class="col-auto">{{ enumUtils.toPlanUserRolesString(planService.getCurrentUserRolesInPlan(dmp?.planUsers)) }}</span>
<div class="col-auto" [ngClass]="{'plan-title': !isDraft, 'plan-title-draft': isDraft}">{{plan.label}}</div>
<div class="plan-subtitle">
<span *ngIf="isUserPlanRelated()" class="col-auto">{{ enumUtils.toPlanUserRolesString(planService.getCurrentUserRolesInPlan(plan?.planUsers)) }}</span>
<span *ngIf="isUserPlanRelated()">.</span>
<span class="col-auto" *ngIf="dmp.status === planStatusEnum.Finalized && isPublic"><span class="material-icons icon-align">public</span>{{'TYPES.PLAN-VISIBILITY.PUBLIC' | translate}}</span>
<span *ngIf="dmp.status === planStatusEnum.Finalized && !isPublic" class="col-auto"><span class="material-icons icon-align">done</span>{{ enumUtils.toPlanStatusString(dmp.status) }}</span>
<span *ngIf="dmp.status === planStatusEnum.Draft" class=" col-auto draft"><span class="material-icons icon-align">create</span>{{ enumUtils.toPlanStatusString(dmp.status) }}</span>
<span class="col-auto" *ngIf="plan.status === planStatusEnum.Finalized && isPublic"><span class="material-icons icon-align">public</span>{{'TYPES.PLAN-VISIBILITY.PUBLIC' | translate}}</span>
<span *ngIf="plan.status === planStatusEnum.Finalized && !isPublic" class="col-auto"><span class="material-icons icon-align">done</span>{{ enumUtils.toPlanStatusString(plan.status) }}</span>
<span *ngIf="plan.status === planStatusEnum.Draft" class=" col-auto draft"><span class="material-icons icon-align">create</span>{{ enumUtils.toPlanStatusString(plan.status) }}</span>
<span>.</span>
<span class="col-auto">{{'PLAN-LISTING.VERSION' | translate}} {{dmp.version}}</span>
<span class="col-auto">{{'PLAN-LISTING.VERSION' | translate}} {{plan.version}}</span>
<span>.</span>
<span class="col">{{ 'PLAN-LISTING.GRANT' | translate }}: {{referenceService.getReferencesForTypesFirstSafe(dmp?.planReferences, [this.referenceTypeService.getGrantReferenceType()])?.reference?.label}}</span>
<span class="col">{{ 'PLAN-LISTING.GRANT' | translate }}: {{referenceService.getReferencesForTypesFirstSafe(plan?.planReferences, [this.referenceTypeService.getGrantReferenceType()])?.reference?.label}}</span>
</div>
<div class="col-auto dmp-description-descriptions-title">{{'PLAN-LISTING.CONTAINED-DESCRIPTIONS' | translate}}: ({{ dmp.descriptions?.length }})
<div class="col-auto plan-description-descriptions-title">{{'PLAN-LISTING.CONTAINED-DESCRIPTIONS' | translate}}: ({{ plan.descriptions?.length }})
</div>
<div *ngFor="let description of dmp.descriptions; let i = index; let last = last" [ngClass]="{'pb-3': i === dmp.descriptions?.length - 1}">
<div *ngFor="let description of plan.descriptions; let i = index; let last = last" [ngClass]="{'pb-3': i === plan.descriptions?.length - 1}">
<div *ngIf="i < 3">
<div class="col-auto dmp-description-descriptions-name" *ngIf="!last && i !== 2">{{description.label}},</div>
<div class="col-auto dmp-description-descriptions-name" *ngIf="last || i == 2">{{description.label}}</div>
<div class="col-auto plan-description-descriptions-name" *ngIf="!last && i !== 2">{{description.label}},</div>
<div class="col-auto plan-description-descriptions-name" *ngIf="last || i == 2">{{description.label}}</div>
</div>
</div>
<a class="d-flex justify-content-center pb-3 show-more" *ngIf="dmp.descriptions?.length > 3" [routerLink]="isPublic ? this.routerUtils.generateUrl(['/explore-plans/overview/public/', dmp.id]) : this.routerUtils.generateUrl(['/plans/overview/', dmp.id])"><u>{{'GENERAL.ACTIONS.SHOW-MORE' | translate}}</u></a>
<a class="d-flex justify-content-center pb-3 show-more" *ngIf="plan.descriptions?.length > 3" [routerLink]="isPublic ? this.routerUtils.generateUrl(['/explore-plans/overview/public/', plan.id]) : this.routerUtils.generateUrl(['/plans/overview/', plan.id])"><u>{{'GENERAL.ACTIONS.SHOW-MORE' | translate}}</u></a>
</a>
<div class="dmp-card-actions">
<a class="col-auto border-right pointer" *ngIf="canExportPlan(dmp) && fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Dmp).length > 0" [matMenuTriggerFor]="exportMenu"><span class="material-icons icon-align pr-2">open_in_new</span>{{'PLAN-LISTING.ACTIONS.EXPORT' | translate}}</a>
<a class="col-auto border-right pointer" *ngIf="isDraftDmp(dmp) && canEditPlan(dmp)" [routerLink]="this.routerUtils.generateUrl(['/plans/edit/', dmp.id])" target="_blank"><span class="material-icons icon-align">add</span>{{'PLAN-LISTING.ACTIONS.ADD-DESCRIPTION-SHORT' | translate}}</a>
<a class="col-auto border-right pointer" *ngIf="canInvitePlanUsers(dmp)" (click)="inviteToDmp()"><span class="material-icons icon-align pr-2">group_add</span>{{'PLAN-LISTING.ACTIONS.INVITE-SHORT' | translate}}</a>
<a class="col-auto border-right pointer" *ngIf="canClonePlan(dmp)" (click)="cloneClicked()"><span class="material-icons icon-align pr-2">filter_none</span>{{'PLAN-LISTING.ACTIONS.CLONE' | translate}}</a>
<a class="col-auto border-right pointer" *ngIf="!isAuthenticated()" (click)="viewVersions(dmp)"><span class="material-icons icon-align pr-2">library_books</span>{{'PLAN-LISTING.ACTIONS.VIEW-VERSION' | translate}}</a>
<div class="plan-card-actions">
<a class="col-auto border-right pointer" *ngIf="canExportPlan() && fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Plan).length > 0" [matMenuTriggerFor]="exportMenu"><span class="material-icons icon-align pr-2">open_in_new</span>{{'PLAN-LISTING.ACTIONS.EXPORT' | translate}}</a>
<a class="col-auto border-right pointer" *ngIf="isDraftPlan(plan) && canEditPlan()" [routerLink]="this.routerUtils.generateUrl(['/plans/edit/', plan.id])" target="_blank"><span class="material-icons icon-align">add</span>{{'PLAN-LISTING.ACTIONS.ADD-DESCRIPTION-SHORT' | translate}}</a>
<a class="col-auto border-right pointer" *ngIf="canInvitePlanUsers()" (click)="inviteToPlan()"><span class="material-icons icon-align pr-2">group_add</span>{{'PLAN-LISTING.ACTIONS.INVITE-SHORT' | translate}}</a>
<a class="col-auto border-right pointer" *ngIf="canClonePlan()" (click)="cloneClicked()"><span class="material-icons icon-align pr-2">filter_none</span>{{'PLAN-LISTING.ACTIONS.CLONE' | translate}}</a>
<a class="col-auto border-right pointer" *ngIf="!isAuthenticated()" (click)="viewVersions(plan)"><span class="material-icons icon-align pr-2">library_books</span>{{'PLAN-LISTING.ACTIONS.VIEW-VERSION' | translate}}</a>
<a class="col-auto border-right pointer" *ngIf="isDraftDmp(dmp) && canDeletePlan(dmp)" (click)="deleteClicked(dmp.id)"><span class="material-icons icon-align pr-2">delete</span>{{ 'PLAN-LISTING.ACTIONS.DELETE' | translate }}</a>
<a class="col-auto border-right pointer" *ngIf="isDraftPlan(plan) && canDeletePlan()" (click)="deleteClicked(plan.id)"><span class="material-icons icon-align pr-2">delete</span>{{ 'PLAN-LISTING.ACTIONS.DELETE' | translate }}</a>
<a class="col-auto pointer" *ngIf="isAuthenticated()" [matMenuTriggerFor]="actionsMenu"><span class="material-icons icon-align pl-2">more_horiz</span></a>
</div>
<mat-menu #exportMenu="matMenu" xPosition="before">
<button mat-menu-item *ngFor='let fileTransformer of fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Dmp)' (click)="fileTransformerService.exportPlan(dmp.id, fileTransformer.repositoryId, fileTransformer.format)">
<button mat-menu-item *ngFor='let fileTransformer of fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Plan)' (click)="fileTransformerService.exportPlan(plan.id, fileTransformer.repositoryId, fileTransformer.format)">
<i class="fa pr-2" [ngClass]="fileTransformer.hasLogo ? fileTransformer.icon : 'fa-file-o'"></i>
<span>{{'GENERAL.FILE-TRANSFORMER.' + fileTransformer.format.toUpperCase() | translate}}</span>
</button>
</mat-menu>
<mat-menu #actionsMenu="matMenu" xPosition="before">
<button *ngIf="canCreateNewVersion(dmp)" mat-menu-item (click)="newVersionClicked()">
<button *ngIf="canCreateNewVersion()" mat-menu-item (click)="newVersionClicked()">
<mat-icon>queue</mat-icon>{{'PLAN-LISTING.ACTIONS.NEW-VERSION' | translate}}
</button>
<button mat-menu-item (click)="viewVersions(dmp)">
<button mat-menu-item (click)="viewVersions(plan)">
<mat-icon>library_books</mat-icon>{{'PLAN-LISTING.ACTIONS.VIEW-VERSION' | translate}}
</button>
<button mat-menu-item *ngIf="isDraftDmp(dmp) && canDeletePlan(dmp)" (click)="deleteClicked(dmp.id)" class="menu-item">
<button mat-menu-item *ngIf="isDraftPlan(plan) && canDeletePlan()" (click)="deleteClicked(plan.id)" class="menu-item">
<mat-icon>delete</mat-icon>{{ 'PLAN-LISTING.ACTIONS.DELETE' | translate }}
</button>
</mat-menu>

View File

@ -111,7 +111,7 @@ p {
min-width: 74px;
}
.dmp-card,
.plan-card,
.description-card {
min-width: 712px;
/* min-height: 308px; */
@ -147,7 +147,7 @@ input[type="text"] {
opacity: 0.6;
}
.dmp-label {
.plan-label {
background: var(--primary-color) 0% 0% no-repeat padding-box;
border-radius: 4px 0px;
opacity: 1;
@ -157,7 +157,7 @@ input[type="text"] {
line-height: 2.4;
}
.dmp-title,
.plan-title,
.description-title {
text-align: left;
font-weight: 600;
@ -169,7 +169,7 @@ input[type="text"] {
}
.description-subtitle,
.dmp-subtitle {
.plan-subtitle {
display: flex;
flex-direction: row;
text-align: left;
@ -180,7 +180,7 @@ input[type="text"] {
color: #848484;
}
.dmp-title-draft,
.plan-title-draft,
.description-title-draft {
text-align: left;
font-weight: 600;
@ -196,7 +196,7 @@ input[type="text"] {
vertical-align: middle;
}
.dmp-subtitle,
.plan-subtitle,
.description-subtitle {
.icon-align {
@ -208,7 +208,7 @@ input[type="text"] {
}
.description-card-actions,
.dmp-card-actions {
.plan-card-actions {
display: flex;
flex-direction: row;
border-top: 1px solid #dbdbdb;
@ -217,24 +217,24 @@ input[type="text"] {
}
.description-card-actions a,
.dmp-card-actions a {
.plan-card-actions a {
color: #848484 !important;
text-decoration: none !important;
}
.description-card-actions a:hover,
.dmp-card-actions a:hover {
.plan-card-actions a:hover {
color: var(--primary-color) !important;
}
.dmp-description-descriptions-title {
.plan-description-descriptions-title {
color: #000000;
opacity: 0.6;
padding-top: 1.5rem;
padding-bottom: 0.8rem;
}
.dmp-description-descriptions-name {
.plan-description-descriptions-name {
color: #000000;
opacity: 0.6;
font-weight: 700;

View File

@ -33,13 +33,13 @@ import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
@Component({
selector: 'app-dmp-listing-item-component',
selector: 'app-plan-listing-item-component',
templateUrl: './plan-listing-item.component.html',
styleUrls: ['./plan-listing-item.component.scss'],
})
export class PlanListingItemComponent extends BaseComponent implements OnInit {
@Input() dmp: Plan;
@Input() plan: Plan;
@Input() showDivider: boolean = true;
@Input() isPublic: boolean;
@Output() onClick: EventEmitter<Plan> = new EventEmitter();
@ -75,16 +75,16 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit {
ngOnInit() {
this.analyticsService.trackPageView(AnalyticsService.PlanListingItem);
if (this.dmp.status == PlanStatus.Draft) {
if (this.plan.status == PlanStatus.Draft) {
this.isDraft = true;
this.isFinalized = false;
this.isPublished = false;
}
else if (this.dmp.status == PlanStatus.Finalized) {
else if (this.plan.status == PlanStatus.Finalized) {
this.isDraft = false;
this.isFinalized = true;
this.isPublished = false;
if (this.dmp.status === PlanStatus.Finalized && this.dmp.accessType === PlanAccessType.Public) { this.isPublished = true }
if (this.plan.status === PlanStatus.Finalized && this.plan.accessType === PlanAccessType.Public) { this.isPublished = true }
}
}
@ -92,33 +92,33 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit {
return this.authentication.currentAccountIsAuthenticated();
}
inviteToDmp() {
inviteToPlan() {
const dialogRef = this.dialog.open(PlanInvitationDialogComponent, {
// height: '250px',
// width: '700px',
autoFocus: false,
restoreFocus: false,
data: {
planId: this.dmp.id,
dmpName: this.dmp.label,
blueprint: this.dmp.blueprint
planId: this.plan.id,
planName: this.plan.label,
blueprint: this.plan.blueprint
}
});
}
viewVersions(dmp: Plan) {
if (dmp.accessType == PlanAccessType.Public && dmp.status == PlanStatus.Finalized && !this.dmp.authorizationFlags?.some(x => x === AppPermission.EditPlan)) {
let url = this.router.createUrlTree(['/explore-plans/versions/', dmp.groupId]);
viewVersions(plan: Plan) {
if (plan.accessType == PlanAccessType.Public && plan.status == PlanStatus.Finalized && !this.plan.authorizationFlags?.some(x => x === AppPermission.EditPlan)) {
let url = this.router.createUrlTree(['/explore-plans/versions/', plan.groupId]);
window.open(url.toString(), '_blank');
} else {
let url = this.router.createUrlTree(['/plans/versions/', dmp.groupId]);
let url = this.router.createUrlTree(['/plans/versions/', plan.groupId]);
window.open(url.toString(), '_blank');
}
}
isUserPlanRelated() {
const principalId: Guid = this.authentication.userId();
return this.dmp.planUsers?.some(x => (x.user.id === principalId));
return this.plan.planUsers?.some(x => (x.user.id === principalId));
}
cloneClicked() {
@ -126,7 +126,7 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit {
maxWidth: '700px',
maxHeight: '80vh',
data: {
plan: this.dmp
plan: this.plan
}
});
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: Plan) => {
@ -142,7 +142,7 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit {
maxWidth: '700px',
maxHeight: '80vh',
data: {
plan: this.dmp
plan: this.plan
}
});
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: Plan) => {
@ -168,11 +168,11 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit {
openDeleteDialog(id: Guid) {
let dialogRef: any;
if (this.dmp.descriptions && this.dmp.descriptions.length > 0){
if (this.plan.descriptions && this.plan.descriptions.length > 0){
dialogRef = this.dialog.open(PlanDeleteDialogComponent, {
maxWidth: '300px',
data: {
descriptions: this.dmp.descriptions,
descriptions: this.plan.descriptions,
}
});
} else {
@ -210,7 +210,7 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit {
});
}
isDraftDmp(activity: Plan) {
isDraftPlan(activity: Plan) {
return activity.status == PlanStatus.Draft;
}
@ -230,35 +230,35 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit {
this.uiNotificationService.snackBarNotification(error.error.message ? error.error.message : this.language.instant('GENERAL.SNACK-BAR.UNSUCCESSFUL-DELETE'), SnackBarNotificationLevel.Error);
}
canEditPlan(dmp: Plan): boolean {
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.EditPlan) || this.authentication.hasPermission(AppPermission.EditPlan)) && this.isPublic == false && this.dmp.belongsToCurrentTenant != false;
canEditPlan(): boolean {
return (this.plan.authorizationFlags?.some(x => x === AppPermission.EditPlan) || this.authentication.hasPermission(AppPermission.EditPlan)) && this.isPublic == false && this.plan.belongsToCurrentTenant != false;
}
canCreateNewVersion(dmp: Plan): boolean {
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.CreateNewVersionPlan) || this.authentication.hasPermission(AppPermission.CreateNewVersionPlan)) && this.dmp.versionStatus === PlanVersionStatus.Current && this.isPublic == false && this.dmp.belongsToCurrentTenant != false;
canCreateNewVersion(): boolean {
return (this.plan.authorizationFlags?.some(x => x === AppPermission.CreateNewVersionPlan) || this.authentication.hasPermission(AppPermission.CreateNewVersionPlan)) && this.plan.versionStatus === PlanVersionStatus.Current && this.isPublic == false && this.plan.belongsToCurrentTenant != false;
}
canDeletePlan(dmp: Plan): boolean {
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.DeletePlan) || this.authentication.hasPermission(AppPermission.DeletePlan)) && this.isPublic == false && this.dmp.belongsToCurrentTenant != false;
canDeletePlan(): boolean {
return (this.plan.authorizationFlags?.some(x => x === AppPermission.DeletePlan) || this.authentication.hasPermission(AppPermission.DeletePlan)) && this.isPublic == false && this.plan.belongsToCurrentTenant != false;
}
canClonePlan(dmp: Plan): boolean {
return this.dmp.authorizationFlags?.some(x => x === AppPermission.ClonePlan) || this.authentication.hasPermission(AppPermission.ClonePlan);
canClonePlan(): boolean {
return this.plan.authorizationFlags?.some(x => x === AppPermission.ClonePlan) || this.authentication.hasPermission(AppPermission.ClonePlan);
}
canFinalizePlan(dmp: Plan): boolean {
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.FinalizePlan) || this.authentication.hasPermission(AppPermission.FinalizePlan)) && this.isPublic == false && this.dmp.belongsToCurrentTenant != false;
canFinalizePlan(): boolean {
return (this.plan.authorizationFlags?.some(x => x === AppPermission.FinalizePlan) || this.authentication.hasPermission(AppPermission.FinalizePlan)) && this.isPublic == false && this.plan.belongsToCurrentTenant != false;
}
canExportPlan(dmp: Plan): boolean {
return this.dmp.authorizationFlags?.some(x => x === AppPermission.ExportPlan) || this.authentication.hasPermission(AppPermission.ExportPlan);
canExportPlan(): boolean {
return this.plan.authorizationFlags?.some(x => x === AppPermission.ExportPlan) || this.authentication.hasPermission(AppPermission.ExportPlan);
}
canInvitePlanUsers(dmp: Plan): boolean {
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.InvitePlanUsers) || this.authentication.hasPermission(AppPermission.InvitePlanUsers)) && this.isPublic == false && this.dmp.belongsToCurrentTenant != false;
canInvitePlanUsers(): boolean {
return (this.plan.authorizationFlags?.some(x => x === AppPermission.InvitePlanUsers) || this.authentication.hasPermission(AppPermission.InvitePlanUsers)) && this.isPublic == false && this.plan.belongsToCurrentTenant != false;
}
canAssignPlanUsers(dmp: Plan): boolean {
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.AssignPlanUsers) || this.authentication.hasPermission(AppPermission.AssignPlanUsers)) && this.isPublic == false && this.dmp.belongsToCurrentTenant != false;
canAssignPlanUsers(): boolean {
return (this.plan.authorizationFlags?.some(x => x === AppPermission.AssignPlanUsers) || this.authentication.hasPermission(AppPermission.AssignPlanUsers)) && this.isPublic == false && this.plan.belongsToCurrentTenant != false;
}
}

View File

@ -4,7 +4,7 @@
<div *ngIf="hasLoadedListingItems && !hasListingItems && !hasFilters" class="col-12 card mt-0">
<div class="card-content info-text mb-0">
<p>{{'PLAN-LISTING.TEXT-INFO' | translate}}</p>
<p class="mt-4 pt-2">{{'PLAN-LISTING.TEXT-INFO-QUESTION' | translate}} <a class="zenodo-link" href="https://zenodo.org/communities/liber-dmp-cat/?page=1&size=20" target="_blank">{{'PLAN-LISTING.LINK-ZENODO' | translate}}</a> {{'PLAN-LISTING.GET-IDEA' | translate}}</p>
<p class="mt-4 pt-2">{{'PLAN-LISTING.TEXT-INFO-QUESTION' | translate}} <a class="zenodo-link" href="https://zenodo.org/communities/liber-plan-cat/?page=1&size=20" target="_blank">{{'PLAN-LISTING.LINK-ZENODO' | translate}}</a> {{'PLAN-LISTING.GET-IDEA' | translate}}</p>
<div class="d-flex">
<div *ngIf="!isPublic" class="col left-content" (click)="restartTour()">{{ 'GENERAL.ACTIONS.TAKE-A-TOUR'| translate }}</div>
<img class="col-auto ml-auto laptop-img" src="../../../assets/images/dashboard-popup.png">
@ -62,7 +62,7 @@
</div>
<div class="col-md-12 col-sm-12 col-md-9">
<div *ngFor="let item of listingItems; let i = index">
<app-dmp-listing-item-component [showDivider]="i != (listingItems.length - 1)" [dmp]="item" [isPublic]="isPublic"></app-dmp-listing-item-component>
<app-plan-listing-item-component [showDivider]="i != (listingItems.length - 1)" [plan]="item" [isPublic]="isPublic"></app-plan-listing-item-component>
</div>
<div *ngIf="hasListingItems && this.lookup?.page?.offset < this.totalCount - 1 && this.pageSize < this.totalCount - 1" class="d-flex justify-content-center">
<button type="button" class="btn-load-more" (click)="loadMore()">{{'GENERAL.ACTIONS.LOAD-MORE' | translate}}</button>

View File

@ -42,7 +42,7 @@
color: #999999 !important;
}
.dmp-label {
.plan-label {
color: #089dbb !important;
}
@ -78,7 +78,7 @@
padding-bottom: 2em;
}
.explore-dmp-content {
.explore-plan-content {
padding: 30px 15px;
}

View File

@ -150,11 +150,11 @@ export class PlanListingComponent extends BaseListingComponent<BasePlan, PlanLoo
}
public dashboardTour: GuidedTour = {
tourId: 'dmp-description-tour',
tourId: 'plan-description-tour',
useOrb: true,
steps: [
{
selector: '.dmp-tour',
selector: '.plan-tour',
content: 'Step 1',
orientation: Orientation.Right,
isStepUnique: false
@ -194,8 +194,8 @@ export class PlanListingComponent extends BaseListingComponent<BasePlan, PlanLoo
if (!result) { return []; }
this.totalCount = result.count;
if (this.lookup?.page?.offset === 0) this.listingItems = [];
const dmps = this._filterDmp([...result.items]);
this.listingItems.push(...dmps);
const plans = this._filterPlan([...result.items]);
this.listingItems.push(...plans);
this.hasLoadedListingItems = true;
}));
}
@ -299,12 +299,12 @@ export class PlanListingComponent extends BaseListingComponent<BasePlan, PlanLoo
return document.getElementById("main-page").scrollHeight > document.documentElement.clientHeight
}
public setDashboardTourDmpText(): void {
const dmpText = this.language.instant('PLAN-LISTING.TEXT-INFO') + '\n\n' +
public setDashboardTourPlanText(): void {
const planText = this.language.instant('PLAN-LISTING.TEXT-INFO') + '\n\n' +
this.language.instant('PLAN-LISTING.TEXT-INFO-QUESTION') + ' ' +
this.language.instant('PLAN-LISTING.LINK-ZENODO') + ' ' +
this.language.instant('PLAN-LISTING.GET-IDEA');
this.dashboardTour.steps[0].title = dmpText;
this.dashboardTour.steps[0].title = planText;
}
public setDashboardTourDescriptionText(): void {
@ -315,7 +315,7 @@ export class PlanListingComponent extends BaseListingComponent<BasePlan, PlanLoo
}
public restartTour(): void {
this.setDashboardTourDmpText();
this.setDashboardTourPlanText();
this.setDashboardTourDescriptionText();
this.guidedTourService.startTour(this.dashboardTour);
}
@ -365,13 +365,13 @@ export class PlanListingComponent extends BaseListingComponent<BasePlan, PlanLoo
// Blueprints
let dmpBlueprints = formGroup.get("dmpBlueprints")?.value ?? null;
if (dmpBlueprints && dmpBlueprints?.length > 0) {
let planBlueprints = formGroup.get("planBlueprints")?.value ?? null;
if (planBlueprints && planBlueprints?.length > 0) {
lookup.planBlueprintSubQuery = PlanFilterService.initializePlanBlueprintLookup();
lookup.planBlueprintSubQuery.ids = dmpBlueprints;
lookup.planBlueprintSubQuery.ids = planBlueprints;
} else lookup.planBlueprintSubQuery = null;
// Dmps
// plans
let roles = formGroup.get("role")?.value !== null ? [formGroup.get("role")?.value] : null;
if (roles && roles?.length > 0) {
lookup.planUserSubQuery = PlanFilterService.initializePlanUserLookup();
@ -399,7 +399,7 @@ export class PlanListingComponent extends BaseListingComponent<BasePlan, PlanLoo
return (new UntypedFormBuilder()).group({
status: [lookup.statuses?.length > 0 ? lookup.statuses[0] : null],
descriptionTemplates: lookup.planDescriptionTemplateSubQuery?.descriptionTemplateGroupIds ? [lookup.planDescriptionTemplateSubQuery?.descriptionTemplateGroupIds] : [],
dmpBlueprints: lookup.planBlueprintSubQuery?.ids ? [lookup.planBlueprintSubQuery?.ids]: [],
planBlueprints: lookup.planBlueprintSubQuery?.ids ? [lookup.planBlueprintSubQuery?.ids]: [],
role: lookup.planUserSubQuery?.userRoles ? lookup.planUserSubQuery?.userRoles[0] : null,
});
}
@ -416,11 +416,11 @@ export class PlanListingComponent extends BaseListingComponent<BasePlan, PlanLoo
return count;
}
private _filterDmp(dmps: BasePlan[]): BasePlan[] {
dmps.forEach((dmp: BasePlan) => {
dmp.descriptions = dmp.descriptions?.filter(d => d.isActive == IsActive.Active) ?? [];
private _filterPlan(plans: BasePlan[]): BasePlan[] {
plans.forEach((plan: BasePlan) => {
plan.descriptions = plan.descriptions?.filter(d => d.isActive == IsActive.Active) ?? [];
})
return dmps;
return plans;
}
private get _lookupFields(): string[] {

View File

@ -52,7 +52,7 @@
<mat-checkbox [checked]="allDescriptionsCompleted" [indeterminate]="someDescriptionsCompleted" (change)="toggleAllDescriptions($event.checked)">{{ 'PLAN-NEW-VERSION-DIALOG.ACTIONS.TOGGLE-DESCRIPTIONS' | translate }}</mat-checkbox>
</mat-card-header>
<mat-selection-list #selectedItems (selectionChange)="descriptionSelectionChanged($event)">
<ng-container *ngFor="let description of dmp.descriptions;">
<ng-container *ngFor="let description of plan.descriptions;">
<mat-list-option [value]="description.id" [selected]="isDefaultSelected(formGroup.get('descriptions'), description.id)" class="h-auto">
<div class="mat-mdc-form-field-bottom-align w-100"></div>
<mat-form-field class="w-100" (click)="selectTemplate($event)" floatLabel="never">

View File

@ -7,7 +7,7 @@ import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/serv
import { BaseComponent } from '@common/base/base.component';
import { TranslateService } from '@ngx-translate/core';
import { map, takeUntil } from 'rxjs/operators';
import { DmpNewVersionDialogEditorModel } from './plan-new-version-dialog.editor.model';
import { PlanNewVersionDialogEditorModel } from './plan-new-version-dialog.editor.model';
import { PlanBlueprintService } from '@app/core/services/plan/plan-blueprint.service';
import { PlanEditorEntityResolver } from '../plan-editor-blueprint/resolvers/plan-editor-enitity.resolver';
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
@ -32,8 +32,8 @@ import { Description } from '@app/core/model/description/description';
})
export class NewVersionPlanDialogComponent extends BaseComponent {
dmp: Plan;
editorModel: DmpNewVersionDialogEditorModel;
plan: Plan;
editorModel: PlanNewVersionDialogEditorModel;
formGroup: UntypedFormGroup;
selectedBlueprintSections: PlanBlueprintDefinitionSection[];
@ -83,8 +83,8 @@ export class NewVersionPlanDialogComponent extends BaseComponent {
@Inject(MAT_DIALOG_DATA) public data: any
) {
super();
this.dmp = data.plan;
this.dmp.planDescriptionTemplates = this.dmp.planDescriptionTemplates?.filter(x => x.isActive === IsActive.Active);
this.plan = data.plan;
this.plan.planDescriptionTemplates = this.plan.planDescriptionTemplates?.filter(x => x.isActive === IsActive.Active);
}
get allDescriptionsNo(): number{
@ -109,15 +109,15 @@ export class NewVersionPlanDialogComponent extends BaseComponent {
ngOnInit() {
this.selectedBlueprintSections = this.dmp.blueprint?.definition?.sections?.filter(x => x.hasTemplates) || null;
this.editorModel = new DmpNewVersionDialogEditorModel().fromModel(this.dmp, this.dmp.blueprint);
this.selectedBlueprintSections = this.plan.blueprint?.definition?.sections?.filter(x => x.hasTemplates) || null;
this.editorModel = new PlanNewVersionDialogEditorModel().fromModel(this.plan, this.plan.blueprint);
this.formGroup = this.editorModel.buildForm();
}
selectedBlueprintChanged(item: PlanBlueprint): void{
this.selectedBlueprintSections = item.definition?.sections?.filter(x => x.hasTemplates) || null;
if(this.selectedBlueprintSections && this.hasDescriptions()) {
this.formGroup = this.editorModel.fromModel(this.dmp, item, this.formGroup.get('label').value, this.formGroup.get('description').value).buildForm();
this.formGroup = this.editorModel.fromModel(this.plan, item, this.formGroup.get('label').value, this.formGroup.get('description').value).buildForm();
}
}
@ -170,7 +170,7 @@ export class NewVersionPlanDialogComponent extends BaseComponent {
}
hasDescriptions() {
return this.dmp.descriptions?.length > 0;
return this.plan.descriptions?.length > 0;
}
close() {
@ -188,7 +188,7 @@ export class NewVersionPlanDialogComponent extends BaseComponent {
formData.descriptions = formData.descriptions.filter(x => x.blueprintSectionId != null)
}
this.planService.newVersion(formData, PlanEditorEntityResolver.lookupFields()).pipe(takeUntil(this._destroyed)).subscribe(
dmp => this.dialogRef.close(dmp),
plan => this.dialogRef.close(plan),
error => this.onCallbackError(error)
);

View File

@ -6,12 +6,12 @@ import { ValidationErrorModel } from '@common/forms/validation/error-model/valid
import { Validation, ValidationContext } from '@common/forms/validation/validation-context';
import { Guid } from "@common/types/guid";
export class DmpNewVersionDialogEditorModel implements NewVersionPlanPersist {
export class PlanNewVersionDialogEditorModel implements NewVersionPlanPersist {
id: Guid;
label: string;
description: String;
blueprintId: Guid;
descriptions: NewVersionDmpDescriptionEditorModel[] = [];
descriptions: NewVersionPlanDescriptionEditorModel[] = [];
hash?: string;
public validationErrorModel: ValidationErrorModel = new ValidationErrorModel();
@ -19,7 +19,7 @@ export class DmpNewVersionDialogEditorModel implements NewVersionPlanPersist {
constructor() { }
public fromModel(item: Plan, blueprint: PlanBlueprint, label?: string, description?: string): DmpNewVersionDialogEditorModel {
public fromModel(item: Plan, blueprint: PlanBlueprint, label?: string, description?: string): PlanNewVersionDialogEditorModel {
if (item) {
this.id = item.id;
this.label = label != undefined ? label : item.label;
@ -32,16 +32,16 @@ export class DmpNewVersionDialogEditorModel implements NewVersionPlanPersist {
// initialize because blueprint changed
this.descriptions = [];
if (item.planDescriptionTemplates?.length > 0 && blueprint.id === item.blueprint.id) { // dmp's first blueprint
if (item.planDescriptionTemplates?.length > 0 && blueprint.id === item.blueprint.id) { // plan's first blueprint
item.descriptions.forEach(description => {
this.descriptions.push(new NewVersionDmpDescriptionEditorModel(this.validationErrorModel).fromModel(description.id, description.planDescriptionTemplate.sectionId));
this.descriptions.push(new NewVersionPlanDescriptionEditorModel(this.validationErrorModel).fromModel(description.id, description.planDescriptionTemplate.sectionId));
})
} else { // in case the user changes the blueprint from the dropdown and the new blueprint has prefilled templates
const selectedBlueprintSections = blueprint.definition?.sections?.filter(x => x.hasTemplates) || null;
if (selectedBlueprintSections != null){
item.descriptions.forEach(description => {
const matchingSection = selectedBlueprintSections.find(blueprintSection => blueprintSection.descriptionTemplates != null && blueprintSection.descriptionTemplates.map(y => y.descriptionTemplateGroupId).includes(description.descriptionTemplate.groupId)) || null;
this.descriptions.push(new NewVersionDmpDescriptionEditorModel(this.validationErrorModel).fromModel(description.id, matchingSection != null ? matchingSection.id : null));
this.descriptions.push(new NewVersionPlanDescriptionEditorModel(this.validationErrorModel).fromModel(description.id, matchingSection != null ? matchingSection.id : null));
})
}
}
@ -86,7 +86,7 @@ export class DmpNewVersionDialogEditorModel implements NewVersionPlanPersist {
}
}
export class NewVersionDmpDescriptionEditorModel implements NewVersionPlanDescriptionPersist {
export class NewVersionPlanDescriptionEditorModel implements NewVersionPlanDescriptionPersist {
descriptionId: Guid;
blueprintSectionId: Guid;
@ -96,7 +96,7 @@ export class NewVersionDmpDescriptionEditorModel implements NewVersionPlanDescri
public validationErrorModel: ValidationErrorModel = new ValidationErrorModel()
) { }
fromModel(descriptionId: Guid, blueprintSectionId: Guid): NewVersionDmpDescriptionEditorModel {
fromModel(descriptionId: Guid, blueprintSectionId: Guid): NewVersionPlanDescriptionEditorModel {
this.descriptionId = descriptionId;
this.blueprintSectionId = blueprintSectionId;
@ -110,7 +110,7 @@ export class NewVersionDmpDescriptionEditorModel implements NewVersionPlanDescri
}): UntypedFormGroup {
let { context = null, disabled = false, rootPath } = params ?? {}
if (context == null) {
context = NewVersionDmpDescriptionEditorModel.createValidationContext({
context = NewVersionPlanDescriptionEditorModel.createValidationContext({
validationErrorModel: this.validationErrorModel,
rootPath
});

View File

@ -1,6 +1,6 @@
<div class="start-new-dmp-dialog-wrapper">
<div class="start-new-plan-dialog-wrapper">
<div class="d-flex justify-content-between">
<div class="pl-0 col-auto"><a class="logo"><img class="logo" src="../../../assets/images/new-dmp-logo.png" onerror="this.style.display='none'"></a></div>
<div class="pl-0 col-auto"><a class="logo"><img class="logo" src="../../../assets/images/new-plan-logo.png" onerror="this.style.display='none'"></a></div>
<div class="col-auto close-btn" (click)="close()">
<mat-icon class="close-icon">close</mat-icon>
</div>

View File

@ -3,7 +3,7 @@
padding: 24px;
}
.start-new-dmp-dialog-wrapper {
.start-new-plan-dialog-wrapper {
width: 33.0rem;
min-height: 14rem;
padding: 0.28rem 0.34rem 0.875rem 0.625rem;

View File

@ -7,7 +7,7 @@ import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/serv
import { BaseComponent } from '@common/base/base.component';
import { TranslateService } from '@ngx-translate/core';
import { takeUntil } from 'rxjs/operators';
import { DmpUploadDialogComponent } from '../upload-dialogue/plan-upload-dialog.component';
import { PlanUploadDialogComponent } from '../upload-dialogue/plan-upload-dialog.component';
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
@ -58,7 +58,7 @@ export class StartNewPlanDialogComponent extends BaseComponent {
}
uploadFile(event) {
const dialogRef = this.dialog.open(DmpUploadDialogComponent, {
const dialogRef = this.dialog.open(PlanUploadDialogComponent, {
width: '528px',
data: {
fileList: FileList,

View File

@ -2,7 +2,7 @@ import { NgModule } from '@angular/core';
import { FormattingModule } from '@app/core/formatting.module';
import { CommonFormsModule } from '@common/forms/common-forms.module';
import { CommonUiModule } from '@common/ui/common-ui.module';
import { DmpUploadDialogModule } from '../upload-dialogue/plan-upload-dialog.module';
import { PlanUploadDialogModule } from '../upload-dialogue/plan-upload-dialog.module';
import { StartNewPlanDialogComponent } from './start-new-plan-dialog.component';
@NgModule({
@ -10,7 +10,7 @@ import { StartNewPlanDialogComponent } from './start-new-plan-dialog.component';
CommonUiModule,
CommonFormsModule,
FormattingModule,
DmpUploadDialogModule
PlanUploadDialogModule
],
declarations: [
StartNewPlanDialogComponent,

View File

@ -6,7 +6,7 @@ import { Guid } from "@common/types/guid";
import { PlanCommonModelConfig, PreprocessingPlanModel } from "@app/core/model/plan/plan-import";
import { DescriptionCommonModelConfig, PreprocessingDescriptionModel } from "@app/core/model/description/description-import";
export class DmpImportRdaConfigEditorModel implements PlanCommonModelConfig{
export class PlanImportRdaConfigEditorModel implements PlanCommonModelConfig{
fileId: Guid;
label: string;
blueprintId: Guid;
@ -18,7 +18,7 @@ export class DmpImportRdaConfigEditorModel implements PlanCommonModelConfig{
constructor() { }
fromModel(item: PreprocessingPlanModel, fileId: Guid): DmpImportRdaConfigEditorModel {
fromModel(item: PreprocessingPlanModel, fileId: Guid): PlanImportRdaConfigEditorModel {
this.fileId = fileId;
if (item){
this.label = item.label + '.json';

View File

@ -8,7 +8,7 @@ import { PlanService } from '@app/core/services/plan/plan.service';
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
import { BaseComponent } from '@common/base/base.component';
import { map, takeUntil } from 'rxjs/operators';
import { DmpImportRdaConfigEditorModel } from './plan-common-model-config.editor.model';
import { PlanImportRdaConfigEditorModel } from './plan-common-model-config.editor.model';
import { UntypedFormArray, UntypedFormGroup } from '@angular/forms';
import { DescriptionTemplateService } from '@app/core/services/description-template/description-template.service';
import { FormService } from '@common/forms/form-service';
@ -24,9 +24,9 @@ import { TranslateService } from '@ngx-translate/core';
templateUrl: './plan-upload-dialog.component.html',
styleUrls: ['./plan-upload-dialog.component.scss']
})
export class DmpUploadDialogComponent extends BaseComponent {
export class PlanUploadDialogComponent extends BaseComponent {
planTitle: string;
dmpBlueprints: any[] = [];
planBlueprints: any[] = [];
files: File[] = [];
selectedBlueprintSections: PlanBlueprintDefinitionSection[];
formGroup: UntypedFormGroup;
@ -44,7 +44,7 @@ export class DmpUploadDialogComponent extends BaseComponent {
constructor(
public dialogRef: MatDialogRef<DmpUploadDialogComponent>,
public dialogRef: MatDialogRef<PlanUploadDialogComponent>,
private _service: PlanService,
private dialog: MatDialog,
private httpClient: HttpClient,
@ -63,7 +63,7 @@ export class DmpUploadDialogComponent extends BaseComponent {
}
ngOnInit() {
this.analyticsService.trackPageView(AnalyticsService.DmpUploadDialog);
this.analyticsService.trackPageView(AnalyticsService.PlanUploadDialog);
}
cancel() {
@ -78,7 +78,7 @@ export class DmpUploadDialogComponent extends BaseComponent {
confirm() {
this.data.success = true;
this.data.planTitle = this.planTitle;
this.data.planBlueprints = this.dmpBlueprints;
this.data.planBlueprint = this.planBlueprints;
if (this.files.length > 0 && this.files[0].type.includes('/json') && this.formGroup){
this.formService.removeAllBackEndErrors(this.formGroup);
@ -121,7 +121,7 @@ export class DmpUploadDialogComponent extends BaseComponent {
.pipe(takeUntil(this._destroyed))
.subscribe(
(preprocessingData) => {
this.formGroup = new DmpImportRdaConfigEditorModel().fromModel(preprocessingData, storageFile[0].id,).buildForm();
this.formGroup = new PlanImportRdaConfigEditorModel().fromModel(preprocessingData, storageFile[0].id,).buildForm();
},
(error) => this.onCallbackEror(error.error)
);

View File

@ -3,7 +3,7 @@ import { FormattingModule } from '@app/core/formatting.module';
import { CommonFormsModule } from '@common/forms/common-forms.module';
import { CommonUiModule } from '@common/ui/common-ui.module';
import { NgxDropzoneModule } from 'ngx-dropzone';
import { DmpUploadDialogComponent } from './plan-upload-dialog.component';
import { PlanUploadDialogComponent } from './plan-upload-dialog.component';
import { ReactiveFormsModule } from '@angular/forms';
import { AutoCompleteModule } from '@app/library/auto-complete/auto-complete.module';
@ -17,10 +17,10 @@ import { AutoCompleteModule } from '@app/library/auto-complete/auto-complete.mod
NgxDropzoneModule
],
declarations: [
DmpUploadDialogComponent,
PlanUploadDialogComponent,
],
exports: [
DmpUploadDialogComponent,
PlanUploadDialogComponent,
]
})
export class DmpUploadDialogModule { }
export class PlanUploadDialogModule { }

View File

@ -1,6 +1,6 @@
<div class="main-content dmp-overview pl-5 pr-5">
<div class="main-content plan-overview pl-5 pr-5">
<div class="container-fluid pl-0 pr-0">
<div *ngIf="dmp">
<div *ngIf="plan">
<div class="row">
<div class="col-12 pl-2 mb-3">
<app-navigation-breadcrumb />
@ -15,43 +15,43 @@
<div class="row">
<div class="col-12 col-lg-8 pl-2">
<div class="row align-items-center">
<div class="col-auto"><span class="dmp-logo">{{ 'PLAN-OVERVIEW.TITLE' | translate }}</span></div>
<div class="col-auto pr-0 d-flex"><span class="dmp-label">{{ dmp.label }}</span></div>
<div class="col-auto pr-0 d-flex"><span class="mb-1" style="font-weight: 700;">.</span></div>
<div class="col-auto"><span class="plan-logo">{{ 'PLAN-OVERVIEW.TITLE' | translate }}</span></div>
<div class="col-auto pr-0 d-flex"><span class="plan-label">{{ plan.label }}</span></div>
<div class="col-auto pr-0"><span style="font-weight: 700;">.</span></div>
<div class="col-auto d-flex"><button mat-button [matMenuTriggerFor]="versions" style="border-radius: 100px; background-color: #eaeaea;">
<div class="pl-2 pr-1 d-flex align-items-center">{{'PLAN-OVERVIEW.VERSION' | translate}} {{selectedDmpVersion?.version}} <mat-icon class="ml-1">arrow_drop_down</mat-icon></div>
<div class="pl-2 pr-1 d-flex align-items-center">{{'PLAN-OVERVIEW.VERSION' | translate}} {{selectedPlanVersion?.version}} <mat-icon class="ml-1">arrow_drop_down</mat-icon></div>
</button></div>
<mat-menu #versions="matMenu">
<button mat-menu-item *ngFor="let version of dmp?.otherPlanVersions" (click)="versionChanged(version.id)" >Version {{version?.version}}</button>
<button mat-menu-item *ngFor="let version of plan?.otherPlanVersions" (click)="versionChanged(version.id)" >Version {{version?.version}}</button>
</mat-menu>
</div>
<div class="row align-items-center mt-3 mb-4 label-txt">
<div *ngIf="isUserDmpRelated()" class="col-auto d-flex">
<p class="ml-0 mb-0 label2-txt">{{ enumUtils.toPlanUserRolesString(planService.getCurrentUserRolesInPlan(dmp?.planUsers)) }}
<div *ngIf="isUserPlanRelated()" class="col-auto d-flex">
<p class="ml-0 mb-0 label2-txt">{{ enumUtils.toPlanUserRolesString(planService.getCurrentUserRolesInPlan(plan?.planUsers)) }}
</div>
<div *ngIf="isUserDmpRelated() && (isPublishedDmp() || isLocked)" class="col-auto"><span>.</span></div>
<div *ngIf="isPublishedDmp()" class="col-auto d-flex flex-row">
<div *ngIf="isUserPlanRelated() && (isPublishedPlan() || isLocked)" class="col-auto"><span>.</span></div>
<div *ngIf="isPublishedPlan()" class="col-auto d-flex flex-row">
<mat-icon class="status-icon">public</mat-icon>
{{'PLAN-OVERVIEW.PUBLIC' | translate}}
</div>
<div *ngIf="isPublishedDmp() && isLocked" class="col-auto"><span>.</span></div>
<div *ngIf="isPublishedPlan() && isLocked" class="col-auto"><span>.</span></div>
<div *ngIf="isLocked" class="col-auto d-flex flex-row">
<mat-icon class="status-icon">lock_outline</mat-icon>
{{'PLAN-OVERVIEW.LOCKED' | translate}}
</div>
<div class="col-auto d-flex">{{'PLAN-OVERVIEW.EDITED' | translate}} :
{{dmp.updatedAt | dateTimeFormatter: "d MMMM y"}}
{{plan.updatedAt | dateTimeFormatter: "d MMMM y"}}
</div>
<div class="col-auto d-flex">
<div *ngIf="dmp.status== planStatusEnum.Finalized" class="d-flex flex-row uppercase">
<div *ngIf="plan.status== planStatusEnum.Finalized" class="d-flex flex-row uppercase">
<mat-icon class="status-icon">check</mat-icon>
{{'PLAN-OVERVIEW.FINALISED' | translate}}
</div>
</div>
</div>
<div class="row" *ngIf="!lockStatus || canClonePlan() || (canDeletePlan() && !isLocked)">
<div *ngIf="canEditPlan(dmp) && !lockStatus; else previewButton" class="col-auto pr-0">
<div *ngIf="canEditPlan(plan) && !lockStatus; else previewButton" class="col-auto pr-0">
<button (click)="editClicked()" mat-mini-fab class="d-flex justify-content-center align-items-center" matTooltip="{{'PLAN-OVERVIEW.ACTIONS.EDIT' | translate}}" matTooltipPosition="above">
<mat-icon class="mat-mini-fab-icon">create</mat-icon>
</button>
@ -74,9 +74,9 @@
</button>
</div>
</div>
<ng-container *ngIf="referenceService.hasRerefenceOfTypes(dmp?.planReferences, [this.referenceTypeService.getGrantReferenceType()])">
<ng-container *ngIf="referenceService.hasRerefenceOfTypes(plan?.planReferences, [this.referenceTypeService.getGrantReferenceType()])">
<div class="row header"><div class="col-auto">{{'PLAN-OVERVIEW.GRANT' | translate}}</div></div>
<div class="row dmp-label"><div class="col-auto">{{referenceService.getReferencesForTypesFirstSafe(dmp?.planReferences, [this.referenceTypeService.getGrantReferenceType()])?.reference?.label}}</div></div>
<div class="row plan-label"><div class="col-auto">{{referenceService.getReferencesForTypesFirstSafe(plan?.planReferences, [this.referenceTypeService.getGrantReferenceType()])?.reference?.label}}</div></div>
</ng-container>
<div class="row header"><div class="col-auto">{{'DESCRIPTION-OVERVIEW.RESEARCHERS' | translate}}</div></div>
<div class="row">
@ -102,22 +102,22 @@
<div *ngIf="!researchers || researchers.length === 0" class="col-12"><span class="material-icons">horizontal_rule</span></div>
</div>
<div class="row header"><div class="col-12">{{'PLAN-OVERVIEW.DESCRIPTION' | translate}}</div></div>
<div class="row" *ngIf="dmp.description">
<div class="row" *ngIf="plan.description">
<div class="col-12">
<p class="desc-txt" [innerHTML]="dmp.description"></p>
<p class="desc-txt" [innerHTML]="plan.description"></p>
</div>
</div>
<div class="row" *ngIf="!dmp.description">
<div class="row" *ngIf="!plan.description">
<div class="col-12">
<span class="material-icons">horizontal_rule</span>
</div>
</div>
<div class="row header"><div class="col-12">{{'PLAN-OVERVIEW.DESCRIPTIONS' | translate}}</div></div>
<div class="row mb-4">
<ng-container *ngFor="let description of dmp.descriptions">
<ng-container *ngFor="let description of plan.descriptions">
<div class="col-12 col-lg-7 mt-1">
<a class="w-100 description" [routerLink]="isPublicView ? this.routerUtils.generateUrl(['/descriptions/overview/public/', description.id]) : this.routerUtils.generateUrl(['/descriptions/overview/' + description.id])" target="_blank">
<button class="w-100" [ngClass]="{'dmp-btn': description.status === descriptionStatusEnum.Draft, 'dmp-finalized-btn': description.status === descriptionStatusEnum.Finalized}">
<button class="w-100" [ngClass]="{'plan-btn': description.status === descriptionStatusEnum.Draft, 'plan-finalized-btn': description.status === descriptionStatusEnum.Finalized}">
<div matTooltip="{{ description.label }}" class="d-flex align-items-center justify-content-between">
<div class="description-btn-label">{{ description.label }}</div>
<mat-icon>launch</mat-icon>
@ -126,19 +126,19 @@
</a>
</div>
</ng-container>
<div class="col-12" *ngIf="!dmp.descriptions || dmp.descriptions.length === 0">
<div class="col-12" *ngIf="!plan.descriptions || plan.descriptions.length === 0">
<span class="material-icons">horizontal_rule</span>
</div>
</div>
</div>
<div class="col-12 col-lg-4">
<ng-container *ngIf="!hasDoi(dmp)">
<ng-container *ngIf="!hasDoi(plan)">
<div class="row mb-3">
<div class="col-auto"><span>{{'PLAN-OVERVIEW.DOI-PROVIDED' | translate}}: </span></div>
<ng-container *ngIf="selectedModel">
<div class="col">
<mat-select class="select-repo" [placeholder]="selectedModel.repositoryId">
<mat-option *ngFor="let entityDoi of dmp.entityDois" (click)="selectDoi(entityDoi)">
<mat-option *ngFor="let entityDoi of plan.entityDois" (click)="selectDoi(entityDoi)">
{{entityDoi.repositoryId}}
</mat-option>
</mat-select>
@ -147,7 +147,7 @@
</div>
<div class="row align-items-center">
<div class="col-12">
<ng-container *ngIf="dmp.entityDois && selectedModel">
<ng-container *ngIf="plan.entityDois && selectedModel">
<div class="container">
<div class="row doi-panel mb-3 pt-4 pb-3">
<div class="col d-flex align-items-center">
@ -173,8 +173,8 @@
<div class="row">
<div class="col-12">
<div class="frame mb-3 pt-4 pl-4 pr-5 pb-3">
<ng-container *ngIf="isDraftDmp() && canFinalizePlan() && !isLocked">
<div class="row align-items-center" (click)="finalize(dmp)">
<ng-container *ngIf="isDraftPlan() && canFinalizePlan() && !isLocked">
<div class="row align-items-center" (click)="finalize(plan)">
<div class="col-auto pr-0">
<button mat-mini-fab class="finalize-btn">
<mat-icon class="mat-mini-fab-icon">check</mat-icon>
@ -190,8 +190,8 @@
</div>
</div>
</ng-container>
<app-plan-deposit-dropdown *ngIf="(hasDoi(dmp) || moreDeposit()) && isFinalizedDmp(dmp) && !this.isPublicView && canDepositPlan(dmp) && inputRepos.length > 0" [inputRepos]="inputRepos" [dmp]="dmp" (outputReposEmitter)="afterDeposit($event)"></app-plan-deposit-dropdown>
<ng-container *ngIf="isFinalizedDmp(dmp) && hasDoi(dmp) && !isPublishedDmp(dmp) && canFinalizePlan(dmp)">
<app-plan-deposit-dropdown *ngIf="(hasDoi(plan) || moreDeposit()) && isFinalizedPlan(plan) && !this.isPublicView && canDepositPlan(plan) && inputRepos.length > 0" [inputRepos]="inputRepos" [plan]="plan" (outputReposEmitter)="afterDeposit($event)"></app-plan-deposit-dropdown>
<ng-container *ngIf="isFinalizedPlan(plan) && hasDoi(plan) && !isPublishedPlan(plan) && canFinalizePlan(plan)">
<div (click)="reverseFinalization()" class="row mb-3 align-items-center">
<div class="col-auto pr-0">
<button mat-mini-fab class="frame-btn">
@ -203,7 +203,7 @@
</div>
</div>
</ng-container>
<ng-container *ngIf="canExportPlan() && fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Dmp).length > 0">
<ng-container *ngIf="canExportPlan() && fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Plan).length > 0">
<div class="row mb-3 align-items-center">
<div class="col-auto pr-0">
<button mat-mini-fab class="frame-btn" [matMenuTriggerFor]="exportMenu">
@ -215,7 +215,7 @@
</div>
</div>
</ng-container>
<!-- <ng-container *ngIf="canCreateNewVersion()">
<ng-container *ngIf="canCreateNewVersion()">
<div class="row mb-3 align-items-center" (click)="newVersionClicked()">
<div class="col-auto pr-0">
<button mat-mini-fab class="frame-btn">
@ -226,9 +226,9 @@
<p class="mb-0 pl-2 frame-txt">{{ 'PLAN-OVERVIEW.ACTIONS.NEW-VERSION' | translate }}</p>
</div>
</div>
</ng-container> -->
</ng-container>
<mat-menu #exportMenu="matMenu" xPosition="before">
<button mat-menu-item *ngFor='let fileTransformer of fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Dmp)' (click)="fileTransformerService.exportPlan(dmp.id, fileTransformer.repositoryId, fileTransformer.format)">
<button mat-menu-item *ngFor='let fileTransformer of fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Plan)' (click)="fileTransformerService.exportPlan(plan.id, fileTransformer.repositoryId, fileTransformer.format)">
<i class="fa pr-2" [ngClass]="fileTransformer.icon ? fileTransformer.icon : 'fa-file-o'"></i>
<span>{{'GENERAL.FILE-TRANSFORMER.' + fileTransformer?.format?.toUpperCase() | translate}}</span>
</button>
@ -244,7 +244,7 @@
<p class="header">{{ 'PLAN-OVERVIEW.PLAN-AUTHORS' | translate }}</p>
</div>
<div class="col-12">
<div *ngFor="let planUser of dmp.planUsers; let i=index;" class="row authors pt-1" [ngClass]="{'author-focused': authorFocus && isFocusedOnUser(planUser.user?.id, i)}" (mouseover)="focusOnAuthor(planUser.user?.id, i)" (mouseout)="resetAuthorFocus()">
<div *ngFor="let planUser of plan.planUsers; let i=index;" class="row authors pt-1" [ngClass]="{'author-focused': authorFocus && isFocusedOnUser(planUser.user?.id, i)}" (mouseover)="focusOnAuthor(planUser.user?.id, i)" (mouseout)="resetAuthorFocus()">
<div class="col-auto d-flex flex-row pr-0">
<button class="account_btn mr-3 pl-0">
<mat-icon class="account-icon" [ngClass]="{'author-icon-focused': authorFocus && authorFocus == planUser.user?.id}">account_circle</mat-icon>
@ -266,15 +266,15 @@
<span *ngIf="planUser.sectionId">{{ getSectionNameById(planUser.sectionId) }}</span>
</p>
</div>
<div *ngIf="canAssignPlanUsers(dmp) && dmp.status === planStatusEnum.Draft && planUser.role != planUserRoleEnum.Owner" class="col-auto">
<button (click)="removeUserFromDmp(planUser)" mat-mini-fab matTooltip="{{ 'PLAN-OVERVIEW.ACTIONS.REMOVE-AUTHOR' | translate}}" matTooltipPosition="above">
<div *ngIf="canAssignPlanUsers(plan) && plan.status === planStatusEnum.Draft && planUser.role != planUserRoleEnum.Owner" class="col-auto">
<button (click)="removeUserFromPlan(planUser)" mat-mini-fab matTooltip="{{ 'PLAN-OVERVIEW.ACTIONS.REMOVE-AUTHOR' | translate}}" matTooltipPosition="above">
<mat-icon class="mat-mini-fab-icon">delete</mat-icon>
</button>
</div>
</div>
</div>
<div *ngIf="canInvitePlanUsers()" class="col-12 d-flex align-items-center justify-content-center mt-2">
<button mat-raised-button class="invite-btn" (click)="openShareDialog(dmp.id,dmp.label)">
<button mat-raised-button class="invite-btn" (click)="openShareDialog(plan.id,plan.label)">
<mat-icon>group_add</mat-icon>
{{'PLAN-OVERVIEW.ACTIONS.INVITE-SHORT' | translate}}
</button>

View File

@ -123,7 +123,7 @@
// ********TEXT********
.dmp-logo {
.plan-logo {
padding: 10px;
min-width: 4.8em;
height: 2.6em;
@ -147,7 +147,7 @@
font-weight: 400;
}
.dmp-label {
.plan-label {
font-weight: bold;
}
@ -168,7 +168,7 @@
margin-bottom: 0.5em;
}
.dmp-label,
.plan-label,
.header {
font-size: 1.25em;
color: #212121;
@ -289,7 +289,7 @@
.mat-mini-fab,
.mat-mini-fab-icon,
.status-icon,
.dmp-logo,
.plan-logo,
.frame-btn,
.finalize-btn {
display: flex;
@ -331,7 +331,7 @@
border-bottom: 1px solid #212121;
}
.dmp-btn {
.plan-btn {
min-height: 2.3em;
background-color: var(--secondary-color);
border-radius: 4px;
@ -340,7 +340,7 @@
border: none;
}
.dmp-finalized-btn {
.plan-finalized-btn {
min-height: 2.3em;
background-color: #b2f772;
border-radius: 4px;

View File

@ -52,15 +52,15 @@ import { NewVersionPlanDialogComponent } from '../new-version-dialog/plan-new-ve
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
@Component({
selector: 'app-dmp-overview',
selector: 'app-plan-overview',
templateUrl: './plan-overview.component.html',
styleUrls: ['./plan-overview.component.scss']
})
export class PlanOverviewComponent extends BaseComponent implements OnInit {
dmp: any;
plan: any;
selectedBlueprint: PlanBlueprint;
selectedDmpVersion: any;
selectedPlanVersion: any;
researchers: PlanReference[] = [];
isNew = true;
isFinalized = false;
@ -114,7 +114,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
ngOnInit() {
this.analyticsService.trackPageView(AnalyticsService.PlanOverview);
// Gets dmp data using parameter id
// Gets plan data using parameter id
this.route.params
.pipe(takeUntil(this._destroyed))
.subscribe((params: Params) => {
@ -128,28 +128,28 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
.subscribe(data => {
this.breadcrumbService.addIdResolvedValue(data.id?.toString(), data.label);
this.dmp = data;
this.dmp.planUsers = data.planUsers.filter(x => x.isActive === IsActive.Active);
this.dmp.otherPlanVersions = data.otherPlanVersions?.filter(x => x.isActive === IsActive.Active) || null;
if (this.dmp.descriptions) {
if (this.dmp.status == PlanStatus.Finalized) {
this.dmp.descriptions = data.descriptions.filter(x => x.isActive === IsActive.Active && x.status === DescriptionStatus.Finalized);
this.plan = data;
this.plan.planUsers = data.planUsers.filter(x => x.isActive === IsActive.Active);
this.plan.otherPlanVersions = data.otherPlanVersions?.filter(x => x.isActive === IsActive.Active) || null;
if (this.plan.descriptions) {
if (this.plan.status == PlanStatus.Finalized) {
this.plan.descriptions = data.descriptions.filter(x => x.isActive === IsActive.Active && x.status === DescriptionStatus.Finalized);
} else {
this.dmp.descriptions = data.descriptions.filter(x => x.isActive === IsActive.Active && x.status !== DescriptionStatus.Canceled);
this.plan.descriptions = data.descriptions.filter(x => x.isActive === IsActive.Active && x.status !== DescriptionStatus.Canceled);
}
}
if (data.entityDois && data.entityDois.length > 0) this.dmp.entityDois = data.entityDois.filter(x => x.isActive === IsActive.Active);
if (data.entityDois && data.entityDois.length > 0) this.plan.entityDois = data.entityDois.filter(x => x.isActive === IsActive.Active);
this.selectedBlueprint = data.blueprint;
this.researchers = this.referenceService.getReferencesForTypes(this.dmp?.planReferences, [this.referenceTypeService.getResearcherReferenceType()]);
this.researchers = this.referenceService.getReferencesForTypes(this.plan?.planReferences, [this.referenceTypeService.getResearcherReferenceType()]);
if (!this.hasDoi()) {
this.selectedModel = this.dmp.entityDois[0];
this.selectedModel = this.plan.entityDois[0];
}
this.selectedDmpVersion = this.dmp;
this.checkLockStatus(this.dmp.id);
this.selectedPlanVersion = this.plan;
this.checkLockStatus(this.plan.id);
// this.setIsUserOwner();
// const breadCrumbs = [];
// breadCrumbs.push({ parentComponentName: null, label: this.language.instant('NAV-BAR.MY-PLANS'), url: "/plans" });
// breadCrumbs.push({ parentComponentName: 'PlanListingComponent', label: this.dmp.label, url: '/plans/overview/' + this.dmp.id });
// breadCrumbs.push({ parentComponentName: 'PlanListingComponent', label: this.plan.label, url: '/plans/overview/' + this.plan.id });
// this.breadCrumbs = observableOf(breadCrumbs);
}, (error: any) => {
this.httpErrorHandlingService.handleBackedRequestError(error);
@ -172,12 +172,12 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
this.breadcrumbService.addExcludedParam('public', true);
this.breadcrumbService.addIdResolvedValue(data.id?.toString(), data.label);
this.dmp = data;
this.researchers = this.referenceService.getReferencesForTypes(this.dmp?.planReferences, [this.referenceTypeService.getResearcherReferenceType()]);
this.plan = data;
this.researchers = this.referenceService.getReferencesForTypes(this.plan?.planReferences, [this.referenceTypeService.getResearcherReferenceType()]);
if (!this.hasDoi()) {
this.selectedModel = this.dmp.entityDois[0];
this.selectedModel = this.plan.entityDois[0];
}
this.selectedDmpVersion = this.dmp;
this.selectedPlanVersion = this.plan;
}, (error: any) => {
this.httpErrorHandlingService.handleBackedRequestError(error);
@ -235,57 +235,57 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
} else return false;
}
focusOnAuthor(dmpUserId: Guid, order: number): void {
this.authorFocus = `${dmpUserId}-${order}`;
focusOnAuthor(planUserId: Guid, order: number): void {
this.authorFocus = `${planUserId}-${order}`;
}
resetAuthorFocus(): void {
this.authorFocus = null;
}
isFocusedOnUser(dmpUserId: Guid, order: number): boolean {
return `${dmpUserId}-${order}` == this.authorFocus;
isFocusedOnUser(planUserId: Guid, order: number): boolean {
return `${planUserId}-${order}` == this.authorFocus;
}
canEditPlan(): boolean {
return (this.isDraftDmp()) && (this.dmp.authorizationFlags?.some(x => x === AppPermission.EditPlan) || this.authentication.hasPermission(AppPermission.EditPlan)) && this.isPublicView == false && this.dmp.belongsToCurrentTenant != false;
return (this.isDraftPlan()) && (this.plan.authorizationFlags?.some(x => x === AppPermission.EditPlan) || this.authentication.hasPermission(AppPermission.EditPlan)) && this.isPublicView == false && this.plan.belongsToCurrentTenant != false;
}
canCreateNewVersion(): boolean {
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.CreateNewVersionPlan) || this.authentication.hasPermission(AppPermission.CreateNewVersionPlan)) && this.dmp.versionStatus === PlanVersionStatus.Current && this.isPublicView == false && this.dmp.belongsToCurrentTenant != false;
return (this.plan.authorizationFlags?.some(x => x === AppPermission.CreateNewVersionPlan) || this.authentication.hasPermission(AppPermission.CreateNewVersionPlan)) && this.plan.versionStatus === PlanVersionStatus.Current && this.isPublicView == false && this.plan.belongsToCurrentTenant != false;
}
canDeletePlan(): boolean {
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.DeletePlan) || this.authentication.hasPermission(AppPermission.DeletePlan)) && this.isPublicView == false && this.dmp.belongsToCurrentTenant != false;
return (this.plan.authorizationFlags?.some(x => x === AppPermission.DeletePlan) || this.authentication.hasPermission(AppPermission.DeletePlan)) && this.isPublicView == false && this.plan.belongsToCurrentTenant != false;
}
canClonePlan(): boolean {
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.ClonePlan) || this.authentication.hasPermission(AppPermission.ClonePlan));
return (this.plan.authorizationFlags?.some(x => x === AppPermission.ClonePlan) || this.authentication.hasPermission(AppPermission.ClonePlan));
}
canFinalizePlan(): boolean {
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.FinalizePlan) || this.authentication.hasPermission(AppPermission.FinalizePlan)) && this.isPublicView == false && this.dmp.belongsToCurrentTenant != false;
return (this.plan.authorizationFlags?.some(x => x === AppPermission.FinalizePlan) || this.authentication.hasPermission(AppPermission.FinalizePlan)) && this.isPublicView == false && this.plan.belongsToCurrentTenant != false;
}
canExportPlan(): boolean {
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.ExportPlan) || this.authentication.hasPermission(AppPermission.ExportPlan));
return (this.plan.authorizationFlags?.some(x => x === AppPermission.ExportPlan) || this.authentication.hasPermission(AppPermission.ExportPlan));
}
canInvitePlanUsers(): boolean {
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.InvitePlanUsers) || this.authentication.hasPermission(AppPermission.InvitePlanUsers)) && this.isPublicView == false && this.dmp.belongsToCurrentTenant != false;
return (this.plan.authorizationFlags?.some(x => x === AppPermission.InvitePlanUsers) || this.authentication.hasPermission(AppPermission.InvitePlanUsers)) && this.isPublicView == false && this.plan.belongsToCurrentTenant != false;
}
canAssignPlanUsers(): boolean {
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.AssignPlanUsers) || this.authentication.hasPermission(AppPermission.AssignPlanUsers)) && this.isPublicView == false && this.dmp.belongsToCurrentTenant != false;
return (this.plan.authorizationFlags?.some(x => x === AppPermission.AssignPlanUsers) || this.authentication.hasPermission(AppPermission.AssignPlanUsers)) && this.isPublicView == false && this.plan.belongsToCurrentTenant != false;
}
canDepositPlan(): boolean {
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.DepositPlan) || this.authentication.hasPermission(AppPermission.DepositPlan)) && this.isPublicView == false && this.dmp.belongsToCurrentTenant != false;
return (this.plan.authorizationFlags?.some(x => x === AppPermission.DepositPlan) || this.authentication.hasPermission(AppPermission.DepositPlan)) && this.isPublicView == false && this.plan.belongsToCurrentTenant != false;
}
editClicked() {
this.router.navigate([this.routerUtils.generateUrl(['/plans/edit', this.dmp.id], '/')]);
this.router.navigate([this.routerUtils.generateUrl(['/plans/edit', this.plan.id], '/')]);
}
cloneClicked() {
@ -293,7 +293,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
maxWidth: '700px',
maxHeight: '80vh',
data: {
plan: this.dmp
plan: this.plan
}
});
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: Plan) => {
@ -309,7 +309,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
maxWidth: '700px',
maxHeight: '80vh',
data: {
plan: this.dmp
plan: this.plan
}
});
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: Plan) => {
@ -322,11 +322,11 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
deleteClicked() {
let dialogRef: any;
if (this.dmp.descriptions && this.dmp.descriptions.length > 0) {
if (this.plan.descriptions && this.plan.descriptions.length > 0) {
dialogRef = this.dialog.open(PlanDeleteDialogComponent, {
maxWidth: '300px',
data: {
descriptions: this.dmp.descriptions,
descriptions: this.plan.descriptions,
}
});
} else {
@ -343,7 +343,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
if (result) {
this.planService.delete(this.dmp.id)
this.planService.delete(this.plan.id)
.pipe(takeUntil(this._destroyed))
.subscribe(
complete => { this.onDeleteCallbackSuccess() },
@ -371,40 +371,40 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
this.httpErrorHandlingService.handleBackedRequestError(error);
}
isUserDmpRelated(): boolean {
isUserPlanRelated(): boolean {
const principalId: Guid = this.authentication.userId();
return this.dmp.planUsers?.some(x => (x.user.id === principalId));
return this.plan.planUsers?.some(x => (x.user.id === principalId));
}
isDraftDmp() {
return this.dmp.status == PlanStatus.Draft;
isDraftPlan() {
return this.plan.status == PlanStatus.Draft;
}
isFinalizedDmp(dmp: Plan) {
return dmp.status == PlanStatus.Finalized;
isFinalizedPlan(plan: Plan) {
return plan.status == PlanStatus.Finalized;
}
isPublishedDmp() {
return (this.dmp.status == PlanStatus.Finalized && this.dmp.accessType === PlanAccessType.Public);
isPublishedPlan() {
return (this.plan.status == PlanStatus.Finalized && this.plan.accessType === PlanAccessType.Public);
}
hasDoi() {
return (this.dmp.entityDois == null || this.dmp.entityDois.length == 0);
return (this.plan.entityDois == null || this.plan.entityDois.length == 0);
}
afterDeposit(result: EntityDoi[]) {
if (result.length > 0) {
this.dmp.entityDois = result;
this.selectedModel = this.dmp.entityDois[this.dmp.entityDois.length - 1];
this.plan.entityDois = result;
this.selectedModel = this.plan.entityDois[this.plan.entityDois.length - 1];
}
}
get inputRepos() {
return this.depositRepos.filter(repo => !this.dmp.entityDois?.find(doi => doi.repositoryId === repo.repositoryId));
return this.depositRepos.filter(repo => !this.plan.entityDois?.find(doi => doi.repositoryId === repo.repositoryId));
}
moreDeposit() {
return (this.dmp.entityDois.length < this.depositRepos.length);
return (this.plan.entityDois.length < this.depositRepos.length);
}
finalize() {
@ -413,13 +413,13 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
restoreFocus: false,
autoFocus: false,
data: {
plan: this.dmp
plan: this.plan
}
});
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: PlanFinalizeDialogOutput) => {
if (result && !result.cancelled) {
this.planService.finalize(this.dmp.id, result.descriptionsToBeFinalized)
this.planService.finalize(this.plan.id, result.descriptionsToBeFinalized)
.pipe(takeUntil(this._destroyed))
.subscribe(data => {
this.reloadPage();
@ -452,7 +452,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
restoreFocus: false,
data: {
planId: rowId,
dmpName: rowName,
planName: rowName,
blueprint: this.selectedBlueprint
}
});
@ -460,9 +460,9 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
selectDoi(entityDoi: EntityDoi) {
this.selectedModel = entityDoi;
const foundIdx = this.dmp.entityDois.findIndex(el => el.id == entityDoi.id);
this.dmp.entityDois.splice(foundIdx, 1);
this.dmp.entityDois.unshift(entityDoi);
const foundIdx = this.plan.entityDois.findIndex(el => el.id == entityDoi.id);
this.plan.entityDois.splice(foundIdx, 1);
this.plan.entityDois.unshift(entityDoi);
}
createDoiLink(doiModel: any): string {
@ -488,7 +488,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
});
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
if (result) {
this.planService.undoFinalize(this.dmp.id, PlanEditorEntityResolver.lookupFields()).pipe(takeUntil(this._destroyed))
this.planService.undoFinalize(this.plan.id, PlanEditorEntityResolver.lookupFields()).pipe(takeUntil(this._destroyed))
.subscribe(data => {
this.reloadPage();
this.onUpdateCallbackSuccess()
@ -510,7 +510,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
});
}
removeUserFromDmp(dmpUser: PlanUser) {
removeUserFromPlan(planUser: PlanUser) {
const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: {
message: this.language.instant('GENERAL.CONFIRMATION-DIALOG.DELETE-USER'),
@ -521,12 +521,12 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
});
dialogRef.afterClosed().subscribe(result => {
if (result) {
const dmpUserRemovePersist: PlanUserRemovePersist = {
id: dmpUser.id,
planId: this.dmp.id,
role: dmpUser.role
const planUserRemovePersist: PlanUserRemovePersist = {
id: planUser.id,
planId: this.plan.id,
role: planUser.role
};
this.planService.removeUser(dmpUserRemovePersist).pipe(takeUntil(this._destroyed))
this.planService.removeUser(planUserRemovePersist).pipe(takeUntil(this._destroyed))
.subscribe(data => {
this.reloadPage();
this.onUpdateCallbackSuccess()
@ -566,7 +566,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
getSectionNameById(sectionId: Guid): string {
if (sectionId == null) return '';
let sections: PlanBlueprintDefinitionSection[] = this.dmp?.blueprint?.definition?.sections?.filter((section: PlanBlueprintDefinitionSection) => sectionId === section.id);
let sections: PlanBlueprintDefinitionSection[] = this.plan?.blueprint?.definition?.sections?.filter((section: PlanBlueprintDefinitionSection) => sectionId === section.id);
return sections == null ? '' : sections[0].label;
}

View File

@ -1,4 +1,4 @@
<div class="dmp-contact-prefill-dialog">
<div class="plan-contact-prefill-dialog">
<div class="row mt-3">
<div mat-dialog-title *ngIf="label">
<span class="mr-3 title">{{'PLAN-CONTACT-PREFILL-DIALOG.TITLE' | translate}}{{label}}</span>
@ -13,7 +13,7 @@
<div class="col-12 col-xl mt-3">
<mat-form-field class="w-100">
<mat-label>{{'PLAN-CONTACT-PREFILL-DIALOG.FIELDS.USER' | translate}}</mat-label>
<app-single-auto-complete [formControl]="formGroup" [configuration]="singleAutoCompleteDmpAssociatedUserConfiguration"></app-single-auto-complete>
<app-single-auto-complete [formControl]="formGroup" [configuration]="singleAutoCompletePlanAssociatedUserConfiguration"></app-single-auto-complete>
</mat-form-field>
</div>
<div class="row" style="justify-content: space-between;">

View File

@ -1,4 +1,4 @@
.dmp-contact-prefill-dialog {
.plan-contact-prefill-dialog {
padding: 24px;
overflow: hidden;

Some files were not shown because too many files have changed in this diff Show More