Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • Fix/xxxx-activateGitlab
  • Fix/xxxx-resourceVisibility
  • Hotfix/1262-fixStatuscode
  • Hotfix/1308-versionConflict
  • Hotfix/1357-ymlFile
  • Hotfix/1370-swaggerDescription
  • Hotfix/1383-topLevel
  • Hotfix/1433-defaultQuota
  • Hotfix/1466-projectCreationTimeout
  • Hotfix/1584-fixResourceLoader
  • Hotfix/1590-quotaFix
  • Hotfix/1615-membersCreatingProject
  • Hotfix/1668-versionResourceConfigDepVersion
  • Hotfix/1669-RDS-S3QuotaManagement
  • Hotfix/1704-FixingArchiveFlag
  • Hotfix/1796-projectDdos
  • Hotfix/1917-PublicFilesVisibility
  • Hotfix/2015-PublicFilesVisibility
  • Hotfix/2077-fixSupportAdminLog
  • Hotfix/2087-efNet6
  • Hotfix/2202-fixNaNQuota
  • Hotfix/2203-quotaMembersFix
  • Hotfix/2224-quotaSizeAnalytics
  • Hotfix/2371-fixGitLabinRCV
  • Hotfix/64-releaseUDE
  • Issue/1321-pidEnquiryOverhaul
  • Issue/1825-codeQualityPipelines
  • Issue/1825-codeQualityPipelinesNew
  • Issue/1860-searchScoping
  • Issue/1861-searchMetadata
  • Issue/1866-ExtendResourceTypeConfigurationTUDo
  • Issue/1877-ExtendResourceTypeConfigurationNRWFHs
  • Issue/1910-MigrationtoNET6.0
  • Issue/1927-projectAppMigration
  • Issue/1940ResouceKeysForNRWAndTUDO
  • Issue/1951-quotaImplementation
  • Issue/1957-resourceAppMigrationNew
  • Issue/1971-projectEditCreateMigration
  • Issue/1971-projectForDev
  • Issue/2000-gitlabResourcesAPI
  • Issue/2001-extendAnalyticsLogger
  • Issue/2008-quotaManagement
  • Issue/2061-activateResourceTypeRdss3nrw
  • Issue/2072-wormResourceType
  • Issue/2101-gitLabResTypeUi
  • Issue/2221-projectDateCreated
  • Issue/2246-quotaResoval
  • Issue/2259-updatePids
  • Issue/2287-guestRole
  • Issue/2309-docs
  • Issue/2328-noFailOnLog
  • Issue/2349-gitlabHttps
  • Issue/2355-topLevelOrg
  • Issue/2449-GuidPidSlugToProjectSettings
  • Issues/0028-maxQuotaFix
  • Product/1100-fdsS3
  • Product/1154-resourceTypeDefinition
  • Product/1188-LoggingExtended
  • Product/1215-gitlabCleanUp
  • Product/1287-dotnet5Sharepoint
  • Product/1414-fhPrivileges
  • Product/1442-projectInviteMngmnt
  • Product/1548-projectInviteMngmnt
  • Product/1600-rdsS3QuotaManagement
  • Product/1629-onboardingOtherUniversities
  • Product/202-userInvitation
  • Product/588-quotaManagement
  • Product/932-docuProjectApi
  • Sprint/2020-20
  • Sprint/2020-21
  • Sprint/2020-22
  • Sprint/2021-01
  • Sprint/2021-02
  • Sprint/2021-03
  • Sprint/2021-05
  • Sprint/2021-08
  • Sprint/2021-09
  • Sprint/2021-10
  • Sprint/2021-11
  • Sprint/2021-12
  • Sprint/2021-13
  • Sprint/2021-15
  • Sprint/2021-19
  • Sprint/2021-2022
  • Sprint/2021-23
  • Sprint/2022-01
  • Sprint/2022-05
  • Test/xxxx-enablingGitLab
  • Topic/1115-docuProjectApi
  • Topic/1159-rtdApi
  • Topic/1221-LogginExtendedNew
  • Topic/1221-LoggingExtended
  • Topic/1279-quotaManagement
  • Topic/1292-FdsS3
  • Topic/1335-dotnet5Apis
  • Topic/1425-fhPrivileges
  • Topic/1453-userInvitation
  • Topic/1529-HandleExternalUserInvitation
  • Topic/1530-invitationUserManagement
  • Topic/1531-UseMangmntTableView
  • v1.0.0
  • v1.1.0
  • v1.10.0
  • v1.11.0
  • v1.11.1
  • v1.12.0
  • v1.13.0
  • v1.13.1
  • v1.14.0
  • v1.15.0
  • v1.15.1
  • v1.16.0
  • v1.16.1
  • v1.17.0
  • v1.17.1
  • v1.18.0
  • v1.19.0
  • v1.2.0
  • v1.2.1
  • v1.20.0
  • v1.20.1
  • v1.20.2
  • v1.21.0
  • v1.21.1
  • v1.22.0
  • v1.23.0
  • v1.23.1
  • v1.23.2
  • v1.23.3
  • v1.24.0
  • v1.24.1
  • v1.25.0
  • v1.25.1
  • v1.3.0
  • v1.4.0
  • v1.4.1
  • v1.5.0
  • v1.5.1
  • v1.6.0
  • v1.6.1
  • v1.6.2
  • v1.7.0
  • v1.7.1
  • v1.8.0
  • v1.9.0
  • v2.0.0
  • v2.0.1
  • v2.0.2
  • v2.1.0
  • v2.1.1
  • v2.1.2
  • v2.2.0
  • v2.2.1
  • v2.2.2
  • v2.2.3
  • v2.2.4
  • v2.2.5
  • v2.3.0
  • v2.4.0
  • v2.4.1
  • v2.4.2
  • v2.4.3
  • v2.5.0
  • v2.5.1
  • v2.5.2
  • v2.5.3
  • v2.5.4
  • v2.6.0
  • v2.6.1
  • v2.6.2
  • v2.7.0
  • v2.8.0
  • v2.8.1
  • v2.8.2
  • v2.8.3
  • v2.8.4
  • v2.9.0
  • v3.0.0
  • v3.0.1
  • v4.0.0
  • v4.0.1
  • v4.0.2
  • v4.0.3
  • v4.1.0
  • v4.1.1
  • v4.2.0
  • v4.2.1
  • v4.2.2
  • v4.2.3
  • v4.2.4
  • v4.2.5
  • v4.2.6
  • v4.2.7
  • v4.2.8
  • v4.3.0
  • v4.3.1
  • v4.3.2
  • v4.3.3
  • v4.3.4
  • v4.4.0
200 results

Target

Select target project
  • coscine/backend/apis/project
1 result
Select Git revision
  • Fix/xxxx-activateGitlab
  • Fix/xxxx-resourceVisibility
  • Hotfix/1262-fixStatuscode
  • Hotfix/1308-versionConflict
  • Hotfix/1357-ymlFile
  • Hotfix/1370-swaggerDescription
  • Hotfix/1383-topLevel
  • Hotfix/1433-defaultQuota
  • Hotfix/1466-projectCreationTimeout
  • Hotfix/1584-fixResourceLoader
  • Hotfix/1590-quotaFix
  • Hotfix/1615-membersCreatingProject
  • Hotfix/1668-versionResourceConfigDepVersion
  • Hotfix/1669-RDS-S3QuotaManagement
  • Hotfix/1704-FixingArchiveFlag
  • Hotfix/1796-projectDdos
  • Hotfix/1917-PublicFilesVisibility
  • Hotfix/2015-PublicFilesVisibility
  • Hotfix/2077-fixSupportAdminLog
  • Hotfix/2087-efNet6
  • Hotfix/2202-fixNaNQuota
  • Hotfix/2203-quotaMembersFix
  • Hotfix/2224-quotaSizeAnalytics
  • Hotfix/2371-fixGitLabinRCV
  • Hotfix/64-releaseUDE
  • Issue/1321-pidEnquiryOverhaul
  • Issue/1825-codeQualityPipelines
  • Issue/1825-codeQualityPipelinesNew
  • Issue/1860-searchScoping
  • Issue/1861-searchMetadata
  • Issue/1866-ExtendResourceTypeConfigurationTUDo
  • Issue/1877-ExtendResourceTypeConfigurationNRWFHs
  • Issue/1910-MigrationtoNET6.0
  • Issue/1927-projectAppMigration
  • Issue/1940ResouceKeysForNRWAndTUDO
  • Issue/1951-quotaImplementation
  • Issue/1957-resourceAppMigrationNew
  • Issue/1971-projectEditCreateMigration
  • Issue/1971-projectForDev
  • Issue/2000-gitlabResourcesAPI
  • Issue/2001-extendAnalyticsLogger
  • Issue/2008-quotaManagement
  • Issue/2061-activateResourceTypeRdss3nrw
  • Issue/2072-wormResourceType
  • Issue/2101-gitLabResTypeUi
  • Issue/2221-projectDateCreated
  • Issue/2246-quotaResoval
  • Issue/2259-updatePids
  • Issue/2287-guestRole
  • Issue/2309-docs
  • Issue/2328-noFailOnLog
  • Issue/2349-gitlabHttps
  • Issue/2355-topLevelOrg
  • Issue/2449-GuidPidSlugToProjectSettings
  • Issues/0028-maxQuotaFix
  • Product/1100-fdsS3
  • Product/1154-resourceTypeDefinition
  • Product/1188-LoggingExtended
  • Product/1215-gitlabCleanUp
  • Product/1287-dotnet5Sharepoint
  • Product/1414-fhPrivileges
  • Product/1442-projectInviteMngmnt
  • Product/1548-projectInviteMngmnt
  • Product/1600-rdsS3QuotaManagement
  • Product/1629-onboardingOtherUniversities
  • Product/202-userInvitation
  • Product/588-quotaManagement
  • Product/932-docuProjectApi
  • Sprint/2020-20
  • Sprint/2020-21
  • Sprint/2020-22
  • Sprint/2021-01
  • Sprint/2021-02
  • Sprint/2021-03
  • Sprint/2021-05
  • Sprint/2021-08
  • Sprint/2021-09
  • Sprint/2021-10
  • Sprint/2021-11
  • Sprint/2021-12
  • Sprint/2021-13
  • Sprint/2021-15
  • Sprint/2021-19
  • Sprint/2021-2022
  • Sprint/2021-23
  • Sprint/2022-01
  • Sprint/2022-05
  • Test/xxxx-enablingGitLab
  • Topic/1115-docuProjectApi
  • Topic/1159-rtdApi
  • Topic/1221-LogginExtendedNew
  • Topic/1221-LoggingExtended
  • Topic/1279-quotaManagement
  • Topic/1292-FdsS3
  • Topic/1335-dotnet5Apis
  • Topic/1425-fhPrivileges
  • Topic/1453-userInvitation
  • Topic/1529-HandleExternalUserInvitation
  • Topic/1530-invitationUserManagement
  • Topic/1531-UseMangmntTableView
  • v1.0.0
  • v1.1.0
  • v1.10.0
  • v1.11.0
  • v1.11.1
  • v1.12.0
  • v1.13.0
  • v1.13.1
  • v1.14.0
  • v1.15.0
  • v1.15.1
  • v1.16.0
  • v1.16.1
  • v1.17.0
  • v1.17.1
  • v1.18.0
  • v1.19.0
  • v1.2.0
  • v1.2.1
  • v1.20.0
  • v1.20.1
  • v1.20.2
  • v1.21.0
  • v1.21.1
  • v1.22.0
  • v1.23.0
  • v1.23.1
  • v1.23.2
  • v1.23.3
  • v1.24.0
  • v1.24.1
  • v1.25.0
  • v1.25.1
  • v1.3.0
  • v1.4.0
  • v1.4.1
  • v1.5.0
  • v1.5.1
  • v1.6.0
  • v1.6.1
  • v1.6.2
  • v1.7.0
  • v1.7.1
  • v1.8.0
  • v1.9.0
  • v2.0.0
  • v2.0.1
  • v2.0.2
  • v2.1.0
  • v2.1.1
  • v2.1.2
  • v2.2.0
  • v2.2.1
  • v2.2.2
  • v2.2.3
  • v2.2.4
  • v2.2.5
  • v2.3.0
  • v2.4.0
  • v2.4.1
  • v2.4.2
  • v2.4.3
  • v2.5.0
  • v2.5.1
  • v2.5.2
  • v2.5.3
  • v2.5.4
  • v2.6.0
  • v2.6.1
  • v2.6.2
  • v2.7.0
  • v2.8.0
  • v2.8.1
  • v2.8.2
  • v2.8.3
  • v2.8.4
  • v2.9.0
  • v3.0.0
  • v3.0.1
  • v4.0.0
  • v4.0.1
  • v4.0.2
  • v4.0.3
  • v4.1.0
  • v4.1.1
  • v4.2.0
  • v4.2.1
  • v4.2.2
  • v4.2.3
  • v4.2.4
  • v4.2.5
  • v4.2.6
  • v4.2.7
  • v4.2.8
  • v4.3.0
  • v4.3.1
  • v4.3.2
  • v4.3.3
  • v4.3.4
  • v4.4.0
200 results
Show changes
Commits on Source (8)
{
"version": 1,
"isRoot": true,
"tools": {
"gitversion.tool": {
"version": "5.6.6",
"commands": [
"dotnet-gitversion"
]
},
"dotnet-version-cli": {
"version": "2.1.1",
"commands": [
"dotnet-version"
]
}
}
}
\ No newline at end of file
......@@ -271,3 +271,6 @@ dist/
#linq2db
src/.tools/
# Dotnet Tool Manifest
.config/*
......@@ -38,7 +38,7 @@ namespace Coscine.Api.Project.Controllers
private readonly ResourceTypeModel _resourceTypeModel;
private readonly ResourceModel _resourceModel;
private readonly CoscineLogger _coscineLogger;
private readonly AnalyticsLogObject _analyticsLogObject;
private readonly VisibilityModel _visibilityModel;
private readonly int _maxAvailable = 100;
/// <summary>
......@@ -57,7 +57,7 @@ namespace Coscine.Api.Project.Controllers
_resourceModel = new ResourceModel();
_projectQuotaModel = new ProjectQuotaModel();
_coscineLogger = new CoscineLogger(logger);
_analyticsLogObject = new AnalyticsLogObject();
_visibilityModel = new VisibilityModel();
}
/// <summary>
......@@ -72,11 +72,6 @@ namespace Coscine.Api.Project.Controllers
.Select((project) => _projectModel.CreateReturnObjectFromDatabaseObject(project))
.OrderBy(element => element.DisplayName);
if (Request.Query != null && Request.Query["noanalyticslog"] != "true")
{
LogAnalytics("List Projects", result);
}
return Ok(result);
}
......@@ -88,16 +83,16 @@ namespace Coscine.Api.Project.Controllers
public ActionResult<IEnumerable<ProjectObject>> GetTopLevelProjects()
{
var user = _authenticator.GetUser();
var result = _projectModel.GetTopLevelWithAccess(user, UserRoles.Member, UserRoles.Owner).ToList()
var projects = _projectModel.GetTopLevelWithAccess(user, UserRoles.Member, UserRoles.Owner).ToList()
.Select((project) => _projectModel.CreateReturnObjectFromDatabaseObject(project))
.OrderBy(element => element.DisplayName);
if (Request.Query != null && Request.Query["noanalyticslog"] != "true")
{
LogAnalytics("View Home", result);
LogAnalyticsViewHome(projects.Select(x => x.Id.ToString()).ToList());
}
return Ok(result);
return Ok(projects);
}
/// <summary>
......@@ -153,7 +148,8 @@ namespace Coscine.Api.Project.Controllers
}).OrderBy(element => element.DisplayName);
if (Request.Query != null && Request.Query["noanalyticslog"] != "true")
{
LogAnalytics("View Project", null, resources, id, user); // intentionally log as view project to help identify the related user action
var projectObject = _projectModel.CreateReturnObjectFromDatabaseObject(_projectModel.GetById(project.Id));
LogAnalyticsViewProject(project, resources.ToList(), projectObject.Disciplines, projectObject.Organizations, user);
}
return Json(resources);
}
......@@ -190,14 +186,12 @@ namespace Coscine.Api.Project.Controllers
return Unauthorized("The user is not authorized to perform a get on the selected project!");
}
var projectQuotas =
_projectQuotaModel.GetAllWhere((projectQuota) =>
projectQuota.ProjectId == projectGuid
&& projectQuota.ResourceType.Enabled == true);
var resourceTypes = _resourceTypeModel.GetAllWhere(x => x.Enabled.HasValue && x.Enabled.Value);
return Json(resourceTypes.Select(x =>
return Json(resourceTypes.Select(x => CreateProjectQuotaReturnObject(x, projectGuid)));
}
private ProjectQuotaReturnObject CreateProjectQuotaReturnObject(ResourceType x, Guid projectGuid)
{
var projectQuota = _projectQuotaModel.GetWhere((y) =>
y.ProjectId == projectGuid &&
......@@ -209,7 +203,6 @@ namespace Coscine.Api.Project.Controllers
Used = CalculateUsed(x, projectGuid),
Allocated = projectQuota == null ? 0 : projectQuota.Quota
};
}));
}
private int CalculateUsed(ResourceType resourceType, Guid projectId)
......@@ -276,7 +269,8 @@ namespace Coscine.Api.Project.Controllers
Id = resourceTypeGuid,
Name = resourceType.DisplayName,
Used = CalculateUsed(resourceType, projectGuid),
Allocated = projectQuota.Quota};
Allocated = projectQuota.Quota
};
return Json(projectQuotaReturnObject);
}
......@@ -402,7 +396,7 @@ namespace Coscine.Api.Project.Controllers
var project = _projectModel.GetById(Guid.Parse(id));
if (_projectModel.HasAccess(user, project, UserRoles.Owner))
{
LogAnalytics("Edit Project", null, null, id, user);
LogAnalyticsEditProject(project, _projectModel.GetMetadataCompleteness(projectObject), projectObject.Disciplines, projectObject.Organizations, user);
return Ok(_projectModel.UpdateByObject(project, projectObject));
}
else
......@@ -423,7 +417,8 @@ namespace Coscine.Api.Project.Controllers
var project = _projectModel.GetById(Guid.Parse(id));
if (_projectModel.HasAccess(user, project, UserRoles.Owner))
{
LogAnalytics("Delete Project", null, null, id, user);
var projectObject = _projectModel.CreateReturnObjectFromDatabaseObject(_projectModel.GetById(project.Id));
LogAnalyticsDeleteProject(project, projectObject.Disciplines, projectObject.Organizations, user);
DeleteProject(project);
return Json(_projectModel.CreateReturnObjectFromDatabaseObject(project));
}
......@@ -557,7 +552,7 @@ namespace Coscine.Api.Project.Controllers
ProjectOwner = user
});
LogAnalytics("Add Project", null, null, project.Id.ToString(), user);
LogAnalyticsAddProject(project, _projectModel.GetMetadataCompleteness(projectObject), projectObject.Disciplines, projectObject.Organizations, user);
return Json(_projectModel.CreateReturnObjectFromDatabaseObject(project));
}
......@@ -570,7 +565,7 @@ namespace Coscine.Api.Project.Controllers
private bool IsRWTHMember(User user)
{
var externalIds = new ExternalIdModel().GetAllWhere((externalId) => externalId.UserId == user.Id);
if(externalIds.Count() == 0)
if (!externalIds.Any())
{
return false;
}
......@@ -580,57 +575,101 @@ namespace Coscine.Api.Project.Controllers
{
externalIdList.Add(externalId.ExternalId1);
}
return new RdfStoreConnector(Program.Configuration.GetStringAndWait("coscine/local/virtuoso/additional/url")).GetTriples(new Uri("https://ror.org/04xfq0f34"), null, null, 1, externalIdList).Count() != 0;
return new RdfStoreConnector(Program.Configuration.GetStringAndWait("coscine/local/virtuoso/additional/url")).GetTriples(new Uri("https://ror.org/04xfq0f34"), null, null, 1, externalIdList).Any();
}
/// <summary>
/// LogAnalytics
/// </summary>
/// <param name="operation">Operation</param>
/// <param name="projects">Projects</param>
/// <param name="resources">Resources</param>
/// <param name="projectId">Id of the project</param>
/// <param name="user">User object</param>
private void LogAnalytics(string operation,
IEnumerable<ProjectObject> projects = null,
IEnumerable<ResourceObject> resources = null,
string projectId = null,
User user = null
)
private void LogAnalyticsViewHome(List<string> projectIds)
{
if (CoscineLoggerConfiguration.IsLogLevelActivated(LogType.Analytics))
_coscineLogger.AnalyticsLog(
new AnalyticsLogObject
{
_analyticsLogObject.Type = "Action";
_analyticsLogObject.Operation = operation;
Type = "Action",
Operation = "View Home",
ProjectList = projectIds
});
}
if (projects != null)
private void LogAnalyticsViewProject(Database.DataModel.Project project, List<ResourceObject> resources, IEnumerable<DisciplineObject> disciplines, IEnumerable<OrganizationObject> organizations, User user)
{
List<string> projectList = new List<string>();
foreach (var entry in projects)
var resourceTypes = _resourceTypeModel.GetAllWhere(x => x.Enabled.HasValue && x.Enabled.Value);
var objects = resourceTypes.Select(x => CreateProjectQuotaReturnObject(x, project.Id));
_coscineLogger.AnalyticsLog(
new AnalyticsLogObject
{
projectList.Add(entry.Id.ToString());
}
_analyticsLogObject.ProjectList = projectList;
Type = "Action",
Operation = "View Project",
RoleId = _projectRoleModel.GetGetUserRoleForProject(project.Id, user.Id).ToString(),
ProjectId = project.Id.ToString(),
QuotaSize = objects.Select(x => $"{x.Name}: {x.Used}/{x.Allocated}").ToList(),
Disciplines = disciplines.Select(x => x.DisplayNameEn).ToList(),
Organizations = organizations.Select(x => x.DisplayName).ToList(),
Visibility = project.VisibilityId.HasValue ? _visibilityModel.GetById(project.VisibilityId.Value)?.DisplayName : null,
ResourceList = resources.Select(x => x.Id.ToString()).ToList(),
});
}
if (resources != null)
private void LogAnalyticsEditProject(Database.DataModel.Project project, string metadataCompletness, IEnumerable<DisciplineObject> disciplines, IEnumerable<OrganizationObject> organizations, User user)
{
List<string> shownResources = new List<string>();
foreach (var entry in resources)
var resourceTypes = _resourceTypeModel.GetAllWhere(x => x.Enabled.HasValue && x.Enabled.Value);
var objects = resourceTypes.Select(x => CreateProjectQuotaReturnObject(x, project.Id));
_coscineLogger.AnalyticsLog(
new AnalyticsLogObject
{
shownResources.Add(entry.Id.ToString());
}
_analyticsLogObject.ResourceList = shownResources;
Type = "Action",
Operation = "Edit Project",
RoleId = _projectRoleModel.GetGetUserRoleForProject(project.Id, user.Id).ToString(),
ProjectId = project.Id.ToString(),
QuotaSize = objects.Select(x => $"{x.Name}: {x.Used}/{x.Allocated}").ToList(),
MetadataCompleteness = metadataCompletness,
Disciplines = disciplines.Select(x => x.DisplayNameEn).ToList(),
Organizations = organizations.Select(x => x.DisplayName).ToList(),
Visibility = project.VisibilityId.HasValue ? _visibilityModel.GetById(project.VisibilityId.Value)?.DisplayName : null,
});
}
if (projectId != null)
private void LogAnalyticsAddProject(Database.DataModel.Project project, string metadataCompletness, IEnumerable<DisciplineObject> disciplines, IEnumerable<OrganizationObject> organizations, User user)
{
_analyticsLogObject.ProjectId = projectId;
if (user != null)
var resourceTypes = _resourceTypeModel.GetAllWhere(x => x.Enabled.HasValue && x.Enabled.Value);
var objects = resourceTypes.Select(x => CreateProjectQuotaReturnObject(x, project.Id));
_coscineLogger.AnalyticsLog(
new AnalyticsLogObject
{
_analyticsLogObject.RoleId = _projectRoleModel.GetGetUserRoleForProject(new Guid(_analyticsLogObject.ProjectId), user.Id).ToString();
}
}
_coscineLogger.AnalyticsLog(_analyticsLogObject);
Type = "Action",
Operation = "Add Project",
RoleId = _projectRoleModel.GetGetUserRoleForProject(project.Id, user.Id).ToString(),
ProjectId = project.Id.ToString(),
QuotaSize = objects.Select(x => $"{x.Name}: {x.Used}/{x.Allocated}").ToList(),
MetadataCompleteness = metadataCompletness,
Disciplines = disciplines.Select(x => x.DisplayNameEn).ToList(),
Organizations = organizations.Select(x => x.DisplayName).ToList(),
Visibility = project.VisibilityId.HasValue ? _visibilityModel.GetById(project.VisibilityId.Value)?.DisplayName : null,
});
}
private void LogAnalyticsDeleteProject(Database.DataModel.Project project, IEnumerable<DisciplineObject> disciplines, IEnumerable<OrganizationObject> organizations, User user)
{
var resourceTypes = _resourceTypeModel.GetAllWhere(x => x.Enabled.HasValue && x.Enabled.Value);
var objects = resourceTypes.Select(x => CreateProjectQuotaReturnObject(x, project.Id));
_coscineLogger.AnalyticsLog(
new AnalyticsLogObject
{
Type = "Action",
Operation = "Delete Project",
RoleId = _projectRoleModel.GetGetUserRoleForProject(project.Id, user.Id).ToString(),
ProjectId = project.Id.ToString(),
QuotaSize = objects.Select(x => $"{x.Name}: {x.Used}/{x.Allocated}").ToList(),
Disciplines = disciplines.Select(x => x.DisplayNameEn).ToList(),
Organizations = organizations.Select(x => x.DisplayName).ToList(),
Visibility = project.VisibilityId.HasValue ? _visibilityModel.GetById(project.VisibilityId.Value)?.DisplayName : null,
});
}
}
}
......@@ -3,8 +3,9 @@
<OutputType>Exe</OutputType>
<RootNamespace>Coscine.Api.Project</RootNamespace>
<AssemblyName>Coscine.Api.Project</AssemblyName>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TargetFramework>net5.0</TargetFramework>
<Version>2.0.2</Version>
<Version>2.1.0</Version>
</PropertyGroup>
<PropertyGroup>
<Authors>RWTH Aachen University</Authors>
......@@ -18,6 +19,8 @@
<ItemGroup>
<PackageReference Include="Coscine.Action" Version="2.*-*" />
<PackageReference Include="Coscine.ApiCommons" Version="2.*-*" />
<PackageReference Include="Coscine.Database" Version="2.*-*" />
<PackageReference Include="Coscine.Logging" Version="2.*-*" />
<PackageReference Include="Coscine.Metadata" Version="2.*-*" />
<PackageReference Include="Coscine.ResourceLoader" Version="2.*-*" />
</ItemGroup>
......