Commit 41ea14d2 authored by Benedikt Heinrichs's avatar Benedikt Heinrichs

Update: Add DisplayName to Resource (coscine/issues#234)

parent f91a1c23
......@@ -92,6 +92,7 @@ namespace Coscine.Api.Project.Tests
{
ExternalId = "123",
Url = "http://rwth-aachen.de/test",
DisplayName = "ResourceTest1",
TypeId = resourceType.Id,
Type = resourceType
};
......@@ -103,6 +104,7 @@ namespace Coscine.Api.Project.Tests
{
ExternalId = "12345",
Url = "http://rwth-aachen.de/test2",
DisplayName = "ResourceTest2",
TypeId = resourceType.Id,
Type = resourceType
};
......
......@@ -70,8 +70,8 @@
<Reference Include="Coscine.ProxyApi, Version=1.2.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.ProxyApi.1.2.0\lib\net461\Coscine.ProxyApi.dll</HintPath>
</Reference>
<Reference Include="Coscine.SharePoint.Webparts.Vue, Version=1.3.0.0, Culture=neutral, PublicKeyToken=0fe8d3e516df6d98, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.SharePoint.Webparts.Vue.1.3.0\lib\net461\Coscine.SharePoint.Webparts.Vue.dll</HintPath>
<Reference Include="Coscine.SharePoint.Webparts.Vue, Version=1.4.0.0, Culture=neutral, PublicKeyToken=0fe8d3e516df6d98, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.SharePoint.Webparts.Vue.1.4.0\lib\net461\Coscine.SharePoint.Webparts.Vue.dll</HintPath>
</Reference>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll</HintPath>
......@@ -346,6 +346,9 @@
<Reference Include="Microsoft.Extensions.WebEncoders, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.WebEncoders.2.2.0\lib\netstandard2.0\Microsoft.Extensions.WebEncoders.dll</HintPath>
</Reference>
<Reference Include="microsoft.identitymodel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.7.0.0\lib\net35\microsoft.identitymodel.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.JsonWebTokens, Version=5.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.JsonWebTokens.5.5.0\lib\net461\Microsoft.IdentityModel.JsonWebTokens.dll</HintPath>
</Reference>
......
......@@ -83,7 +83,7 @@ namespace Coscine.Api.Project.Tests
[Test]
public void TestControllerStoreToProject()
{
ResourceObject resourceObject = new ResourceObject(Guid.NewGuid(), "externalId", "http://rwth-aachen.de/newTest", new ResourceTypeObject(ResourceTypes[0].Id, ResourceTypes[0].DisplayName));
ResourceObject resourceObject = new ResourceObject(Guid.NewGuid(), "externalId", "http://rwth-aachen.de/newTest", "TestResource", new ResourceTypeObject(ResourceTypes[0].Id, ResourceTypes[0].DisplayName));
Stream stream = ObjectFactory<ResourceObject>.SerializeToStream(resourceObject);
......
......@@ -100,7 +100,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Coscine.SharePoint.Webparts.Vue" publicKeyToken="0fe8d3e516df6d98" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0" />
<bindingRedirect oldVersion="0.0.0.0-1.4.0.0" newVersion="1.4.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
......
......@@ -9,7 +9,7 @@
<package id="Coscine.Configuration" version="1.4.0" targetFramework="net472" />
<package id="Coscine.Database" version="1.4.0" targetFramework="net472" />
<package id="Coscine.ProxyApi" version="1.2.0" targetFramework="net472" />
<package id="Coscine.SharePoint.Webparts.Vue" version="1.3.0" targetFramework="net472" />
<package id="Coscine.SharePoint.Webparts.Vue" version="1.4.0" targetFramework="net472" />
<package id="EntityFramework" version="6.2.0" targetFramework="net472" />
<package id="linq2db" version="2.6.4" targetFramework="net472" />
<package id="linq2db.SqlServer" version="2.6.4" targetFramework="net472" />
......@@ -107,6 +107,7 @@
<package id="Microsoft.Extensions.Options.ConfigurationExtensions" version="2.2.0" targetFramework="net472" />
<package id="Microsoft.Extensions.Primitives" version="2.2.0" targetFramework="net472" />
<package id="Microsoft.Extensions.WebEncoders" version="2.2.0" targetFramework="net472" />
<package id="Microsoft.IdentityModel" version="7.0.0" targetFramework="net472" />
<package id="Microsoft.IdentityModel.JsonWebTokens" version="5.5.0" targetFramework="net472" />
<package id="Microsoft.IdentityModel.Logging" version="5.5.0" targetFramework="net472" />
<package id="Microsoft.IdentityModel.Tokens" version="5.5.0" targetFramework="net472" />
......
......@@ -83,7 +83,7 @@ namespace Coscine.Api.Project.Controllers
{
resourceType = resourceTypeModel.GetById(resource.TypeId);
}
return new ResourceObject(resource.Id, resource.ExternalId, resource.Url, new ResourceTypeObject(resourceType.Id, resourceType.DisplayName));
return new ResourceObject(resource.Id, resource.ExternalId, resource.Url, resource.DisplayName, new ResourceTypeObject(resourceType.Id, resourceType.DisplayName));
});
}
else
......
......@@ -32,7 +32,7 @@ namespace Coscine.Api.Project.Controllers
&& projectRole.Role.DisplayName == "Owner"
select projectRole).Any()
select projectResource).Any()
).Select((resource) => new ResourceObject(resource.Id, resource.ExternalId, resource.Url, new ResourceTypeObject(resource.Type.Id, resource.Type.DisplayName)));
).Select((resource) => new ResourceObject(resource.Id, resource.ExternalId, resource.Url, resource.DisplayName, new ResourceTypeObject(resource.Type.Id, resource.Type.DisplayName)));
}));
}
......@@ -51,7 +51,7 @@ namespace Coscine.Api.Project.Controllers
ResourceTypeModel resourceTypeModel = new ResourceTypeModel();
resource.Type = resourceTypeModel.GetById(resource.TypeId);
}
return new ResourceObject(resource.Id, resource.ExternalId, resource.Url, new ResourceTypeObject(resource.Type.Id, resource.Type.DisplayName));
return new ResourceObject(resource.Id, resource.ExternalId, resource.Url, resource.DisplayName, new ResourceTypeObject(resource.Type.Id, resource.Type.DisplayName));
}
else
{
......@@ -93,7 +93,7 @@ namespace Coscine.Api.Project.Controllers
projectModel.AddResource(project, resource);
return new ResourceObject(resource.Id, resource.ExternalId, resource.Url, new ResourceTypeObject(resource.Type.Id, resource.Type.DisplayName));
return new ResourceObject(resource.Id, resource.ExternalId, resource.Url, resource.DisplayName, new ResourceTypeObject(resource.Type.Id, resource.Type.DisplayName));
}
else
{
......
......@@ -21,6 +21,7 @@ namespace Coscine.Api.Project.Models
{
ExternalId = resourceObject.ExternalId,
Url = resourceObject.Url,
DisplayName = resourceObject.DisplayName,
TypeId = resourceObject.Type.Id,
Type = new ResourceTypeModel().GetById(resourceObject.Type.Id)
};
......
......@@ -10,14 +10,16 @@ namespace Coscine.Api.Project.ReturnObjects
public string ExternalId { get; set; }
public string Url { get; set; }
public string DisplayName { get; set; }
public ResourceTypeObject Type { get; set; }
public ResourceObject(Guid id, string externalId, string url, ResourceTypeObject type)
public ResourceObject(Guid id, string externalId, string url, string displayName, ResourceTypeObject type)
{
Id = id;
ExternalId = externalId;
Url = url;
DisplayName = displayName;
Type = type;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment