Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Coscine
backend
apis
Project
Commits
41ea14d2
Commit
41ea14d2
authored
Aug 23, 2019
by
Benedikt Heinrichs
Browse files
Update: Add DisplayName to Resource (coscine/issues#234)
parent
f91a1c23
Changes
9
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/Project.Tests/DefaultControllerTests.cs
View file @
41ea14d2
...
...
@@ -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
};
...
...
src/Project.Tests/Project.Tests.csproj
View file @
41ea14d2
...
...
@@ -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>
...
...
src/Project.Tests/ResourceControllerTests.cs
View file @
41ea14d2
...
...
@@ -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
);
...
...
src/Project.Tests/app.config
View file @
41ea14d2
...
...
@@ -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
>
...
...
src/Project.Tests/packages.config
View file @
41ea14d2
...
...
@@ -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"
/>
...
...
src/Project/Controllers/ProjectController.cs
View file @
41ea14d2
...
...
@@ -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
...
...
src/Project/Controllers/ResourceController.cs
View file @
41ea14d2
...
...
@@ -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
{
...
...
src/Project/Models/ResourceModel.cs
View file @
41ea14d2
...
...
@@ -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
)
};
...
...
src/Project/ReturnObjects/ResourceObject.cs
View file @
41ea14d2
...
...
@@ -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
;
}
}
...
...
Ghost User
@ghost
mentioned in commit
c44d1dc2
·
Aug 30, 2019
mentioned in commit
c44d1dc2
mentioned in commit c44d1dc25e04accc707607b53bb8ef4040511eb5
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment