Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Coscine
backend
apis
Project
Commits
64f2c417
Commit
64f2c417
authored
Jun 19, 2020
by
Marcel Nellesen
Browse files
Merge branch 'Sprint/2020-10' into 'master'
Sprint/2020-10 See merge request coscine/api/project!93
parents
0c1c70ab
8cef53c7
Changes
10
Pipelines
5
Hide whitespace changes
Inline
Side-by-side
src/Project.Tests/DefaultControllerTests.cs
View file @
64f2c417
...
...
@@ -110,11 +110,12 @@ namespace Coscine.Api.Project.Tests
StartDate
=
DateTime
.
Now
,
EndDate
=
DateTime
.
Now
.
AddYears
(
1
),
Keywords
=
"Test1;Test2"
,
GrantId
=
"testid"
,
PrincipleInvestigators
=
"TestInvestigator"
,
VisibilityId
=
Visibility
.
Id
VisibilityId
=
Visibility
.
Id
,
Slug
=
Guid
.
NewGuid
().
ToString
()
};
projectModel
.
Insert
(
project
);
...
...
@@ -149,7 +150,8 @@ namespace Coscine.Api.Project.Tests
GrantId
=
"testid"
,
PrincipleInvestigators
=
"TestInvestigator"
,
VisibilityId
=
Visibility
.
Id
VisibilityId
=
Visibility
.
Id
,
Slug
=
Guid
.
NewGuid
().
ToString
()
};
projectModel
.
Insert
(
project2
);
Projects
.
Add
(
projectModel
.
GetById
(
project2
.
Id
));
...
...
src/Project.Tests/Project.Tests.csproj
View file @
64f2c417
...
...
@@ -56,17 +56,17 @@
<Reference
Include=
"Consul, Version=0.7.2.6, Culture=neutral, PublicKeyToken=20a6ad9a81df1d95, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Consul.0.7.2.6\lib\net45\Consul.dll
</HintPath>
</Reference>
<Reference
Include=
"Coscine.Action, Version=1.1
2
.0.0, Culture=neutral, processorArchitecture=AMD64"
>
<HintPath>
..\packages\Coscine.Action.1.1
2
.0\lib\net461\Coscine.Action.dll
</HintPath>
<Reference
Include=
"Coscine.Action, Version=1.1
3
.0.0, Culture=neutral, processorArchitecture=AMD64"
>
<HintPath>
..\packages\Coscine.Action.1.1
3
.0\lib\net461\Coscine.Action.dll
</HintPath>
</Reference>
<Reference
Include=
"Coscine.ApiCommons, Version=1.
7.2
.0, Culture=neutral, PublicKeyToken=af4c1345df96546b, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.ApiCommons.1.
7.2
\lib\net461\Coscine.ApiCommons.dll
</HintPath>
<Reference
Include=
"Coscine.ApiCommons, Version=1.
8.0
.0, Culture=neutral, PublicKeyToken=af4c1345df96546b, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.ApiCommons.1.
8.0
\lib\net461\Coscine.ApiCommons.dll
</HintPath>
</Reference>
<Reference
Include=
"Coscine.Configuration, Version=1.5.0.0, Culture=neutral, PublicKeyToken=ce3d7a32d7dc1e5a, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.Configuration.1.5.0\lib\net461\Coscine.Configuration.dll
</HintPath>
</Reference>
<Reference
Include=
"Coscine.Database, Version=1.1
9
.0.0, Culture=neutral, PublicKeyToken=767d77427707b70a, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.Database.1.1
9
.0\lib\net461\Coscine.Database.dll
</HintPath>
<Reference
Include=
"Coscine.Database, Version=1.
2
1.0.0, Culture=neutral, PublicKeyToken=767d77427707b70a, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.Database.1.
2
1.0\lib\net461\Coscine.Database.dll
</HintPath>
</Reference>
<Reference
Include=
"Coscine.Logging, Version=1.2.0.0, Culture=neutral, PublicKeyToken=e1ed402bc3f6525e, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.Logging.1.2.0\lib\net461\Coscine.Logging.dll
</HintPath>
...
...
src/Project.Tests/ProjectControllerTests.cs
View file @
64f2c417
...
...
@@ -115,7 +115,7 @@ namespace Coscine.Api.Project.Tests
ProjectObject
newProjectObject
=
new
ProjectObject
(
Guid
.
NewGuid
(),
"NewProject"
,
"NewDisplayName"
,
DateTime
.
Now
,
DateTime
.
Now
.
AddYears
(
1
),
"test2;test3"
,
"abc"
,
"investigator"
,
"grandId"
,
new
List
<
DisciplineObject
>()
{
new
DisciplineObject
(
Discipline
.
Id
,
Discipline
.
Url
,
Discipline
.
DisplayNameDe
,
Discipline
.
DisplayNameEn
)
},
new
List
<
OrganizationObject
>()
{
new
OrganizationObject
(
Organization
,
Organization
)
},
new
VisibilityObject
(
Visibility
.
Id
,
Visibility
.
DisplayName
));
new
VisibilityObject
(
Visibility
.
Id
,
Visibility
.
DisplayName
)
,
Guid
.
NewGuid
().
ToString
()
);
var
stream
=
ObjectFactory
<
ProjectObject
>.
SerializeToStream
(
newProjectObject
);
...
...
@@ -150,7 +150,7 @@ namespace Coscine.Api.Project.Tests
ProjectObject
newProjectObject
=
new
ProjectObject
(
Guid
.
NewGuid
(),
"NewProject"
,
"NewDisplayName"
,
DateTime
.
Now
,
DateTime
.
Now
.
AddYears
(
1
),
"test2;test3"
,
"abc"
,
"investigator"
,
"grandId"
,
new
List
<
DisciplineObject
>()
{
new
DisciplineObject
(
Discipline
.
Id
,
Discipline
.
Url
,
Discipline
.
DisplayNameDe
,
Discipline
.
DisplayNameEn
)
},
new
List
<
OrganizationObject
>()
{
new
OrganizationObject
(
Organization
,
Organization
)
},
new
VisibilityObject
(
Visibility
.
Id
,
Visibility
.
DisplayName
));
new
VisibilityObject
(
Visibility
.
Id
,
Visibility
.
DisplayName
)
,
Guid
.
NewGuid
().
ToString
()
);
var
stream
=
ObjectFactory
<
ProjectObject
>.
SerializeToStream
(
newProjectObject
);
...
...
@@ -188,7 +188,7 @@ namespace Coscine.Api.Project.Tests
ProjectObject
newProjectObject
=
new
ProjectObject
(
Guid
.
NewGuid
(),
"NewProject"
,
"NewDisplayName"
,
DateTime
.
Now
,
DateTime
.
Now
.
AddYears
(
1
),
"test2;test3"
,
"abc"
,
"investigator"
,
"grandId"
,
new
List
<
DisciplineObject
>()
{
new
DisciplineObject
(
Discipline
.
Id
,
Discipline
.
Url
,
Discipline
.
DisplayNameDe
,
Discipline
.
DisplayNameEn
)
},
new
List
<
OrganizationObject
>()
{
new
OrganizationObject
(
Organization
,
Organization
)
},
new
VisibilityObject
(
Visibility
.
Id
,
Visibility
.
DisplayName
));
new
VisibilityObject
(
Visibility
.
Id
,
Visibility
.
DisplayName
)
,
Guid
.
NewGuid
().
ToString
()
);
var
stream
=
ObjectFactory
<
ProjectObject
>.
SerializeToStream
(
newProjectObject
);
...
...
@@ -203,7 +203,7 @@ namespace Coscine.Api.Project.Tests
newProjectObject
=
new
ProjectObject
(
Guid
.
NewGuid
(),
"NewProject"
,
"NewDisplayName"
,
DateTime
.
Now
,
DateTime
.
Now
.
AddYears
(
1
),
"test2;test3"
,
"abc"
,
"investigator"
,
"grandId"
,
new
List
<
DisciplineObject
>()
{
new
DisciplineObject
(
Discipline
.
Id
,
Discipline
.
Url
,
Discipline
.
DisplayNameDe
,
Discipline
.
DisplayNameEn
)
},
new
List
<
OrganizationObject
>()
{
new
OrganizationObject
(
Organization
,
Organization
)
},
new
VisibilityObject
(
Visibility
.
Id
,
Visibility
.
DisplayName
),
new
VisibilityObject
(
Visibility
.
Id
,
Visibility
.
DisplayName
),
Guid
.
NewGuid
().
ToString
(),
createdProjectObject
.
Id
);
stream
=
ObjectFactory
<
ProjectObject
>.
SerializeToStream
(
newProjectObject
);
...
...
@@ -235,7 +235,7 @@ namespace Coscine.Api.Project.Tests
ProjectObject
newProjectObject
=
new
ProjectObject
(
Guid
.
NewGuid
(),
"NewProject"
,
"NewDisplayName"
,
DateTime
.
Now
,
DateTime
.
Now
.
AddYears
(
1
),
"test2;test3"
,
"abc"
,
"investigator"
,
"grandId"
,
new
List
<
DisciplineObject
>()
{
new
DisciplineObject
(
Discipline
.
Id
,
Discipline
.
Url
,
Discipline
.
DisplayNameDe
,
Discipline
.
DisplayNameEn
)
},
new
List
<
OrganizationObject
>()
{
new
OrganizationObject
(
Organization
,
Organization
)
},
new
VisibilityObject
(
Visibility
.
Id
,
Visibility
.
DisplayName
));
new
VisibilityObject
(
Visibility
.
Id
,
Visibility
.
DisplayName
)
,
Guid
.
NewGuid
().
ToString
()
);
var
stream
=
ObjectFactory
<
ProjectObject
>.
SerializeToStream
(
newProjectObject
);
FakeControllerContext
(
Users
[
0
],
stream
);
...
...
@@ -247,7 +247,7 @@ namespace Coscine.Api.Project.Tests
ProjectObject
newSubProjectObject
=
new
ProjectObject
(
Guid
.
NewGuid
(),
"NewSubProject"
,
"NewDisplayNameSub"
,
DateTime
.
Now
,
DateTime
.
Now
.
AddYears
(
1
),
"test2;test3"
,
"abc"
,
"investigator"
,
"grandId"
,
new
List
<
DisciplineObject
>()
{
new
DisciplineObject
(
Discipline
.
Id
,
Discipline
.
Url
,
Discipline
.
DisplayNameDe
,
Discipline
.
DisplayNameEn
)
},
new
List
<
OrganizationObject
>()
{
new
OrganizationObject
(
Organization
,
Organization
)
},
new
VisibilityObject
(
Visibility
.
Id
,
Visibility
.
DisplayName
),
new
VisibilityObject
(
Visibility
.
Id
,
Visibility
.
DisplayName
),
Guid
.
NewGuid
().
ToString
(),
createdProjectObject
.
Id
);
var
subStream
=
ObjectFactory
<
ProjectObject
>.
SerializeToStream
(
newSubProjectObject
);
...
...
src/Project.Tests/app.config
View file @
64f2c417
...
...
@@ -88,7 +88,7 @@
</
dependentAssembly
>
<
dependentAssembly
>
<
assemblyIdentity
name
=
"Coscine.Database"
publicKeyToken
=
"767d77427707b70a"
culture
=
"neutral"
/>
<
bindingRedirect
oldVersion
=
"0.0.0.0-1.1
9
.0.0"
newVersion
=
"1.1
9
.0.0"
/>
<
bindingRedirect
oldVersion
=
"0.0.0.0-1.
2
1.0.0"
newVersion
=
"1.
2
1.0.0"
/>
</
dependentAssembly
>
<
dependentAssembly
>
<
assemblyIdentity
name
=
"System.IdentityModel.Tokens.Jwt"
publicKeyToken
=
"31bf3856ad364e35"
culture
=
"neutral"
/>
...
...
src/Project.Tests/packages.config
View file @
64f2c417
...
...
@@ -4,10 +4,10 @@
<
package
id
=
"AutoMapper.Extensions.Microsoft.DependencyInjection"
version
=
"6.0.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Castle.Core"
version
=
"4.4.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Consul"
version
=
"0.7.2.6"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Action"
version
=
"1.1
2
.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.ApiCommons"
version
=
"1.
7.2
"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Action"
version
=
"1.1
3
.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.ApiCommons"
version
=
"1.
8.0
"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Configuration"
version
=
"1.5.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Database"
version
=
"1.1
9
.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Database"
version
=
"1.
2
1.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Logging"
version
=
"1.2.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.ProxyApi"
version
=
"1.2.1"
targetFramework
=
"net472"
/>
<
package
id
=
"EntityFramework"
version
=
"6.2.0"
targetFramework
=
"net472"
/>
...
...
src/Project/App.config
View file @
64f2c417
...
...
@@ -91,7 +91,7 @@
</
dependentAssembly
>
<
dependentAssembly
>
<
assemblyIdentity
name
=
"Coscine.Database"
publicKeyToken
=
"767d77427707b70a"
culture
=
"neutral"
/>
<
bindingRedirect
oldVersion
=
"0.0.0.0-1.1
9
.0.0"
newVersion
=
"1.1
9
.0.0"
/>
<
bindingRedirect
oldVersion
=
"0.0.0.0-1.
2
1.0.0"
newVersion
=
"1.
2
1.0.0"
/>
</
dependentAssembly
>
<
dependentAssembly
>
<
assemblyIdentity
name
=
"System.IdentityModel.Tokens.Jwt"
publicKeyToken
=
"31bf3856ad364e35"
culture
=
"neutral"
/>
...
...
src/Project/Controllers/ProjectController.cs
View file @
64f2c417
...
...
@@ -15,6 +15,7 @@ using Microsoft.Extensions.Logging;
using
Newtonsoft.Json.Linq
;
using
Coscine.Database.DataModel
;
using
System.Collections.Generic
;
using
System.Text.RegularExpressions
;
namespace
Coscine.Api.Project.Controllers
{
...
...
src/Project/Controllers/SearchController.cs
View file @
64f2c417
...
...
@@ -171,7 +171,7 @@ namespace Coscine.Api.Project.Controllers
jd
.
DisplayNameDe
.
Contains
(
searchQuery
)
||
jd
.
DisplayNameEn
.
Contains
(
searchQuery
))
select
new
{
p
.
Id
,
p
.
DisplayName
}).
OrderBy
(
element
=>
element
.
DisplayName
).
Distinct
();
select
new
{
p
.
Id
,
p
.
DisplayName
,
p
.
Slug
}).
OrderBy
(
element
=>
element
.
DisplayName
).
Distinct
();
return
JToken
.
Parse
(
JsonConvert
.
SerializeObject
(
results
));
});
}
...
...
@@ -215,7 +215,7 @@ namespace Coscine.Api.Project.Controllers
jd
.
DisplayNameDe
.
Contains
(
searchQuery
)
||
jd
.
DisplayNameEn
.
Contains
(
searchQuery
))
select
new
{
r
.
Id
,
r
.
DisplayName
,
jpr
.
ProjectId
}).
OrderBy
(
element
=>
element
.
DisplayName
).
Distinct
();
select
new
{
r
.
Id
,
r
.
DisplayName
,
jpr
.
ProjectId
,
jp
.
Slug
}).
OrderBy
(
element
=>
element
.
DisplayName
).
Distinct
();
return
JToken
.
Parse
(
JsonConvert
.
SerializeObject
(
results
));
...
...
src/Project/Project.csproj
View file @
64f2c417
...
...
@@ -49,17 +49,17 @@
<Reference
Include=
"Consul, Version=0.7.2.6, Culture=neutral, PublicKeyToken=20a6ad9a81df1d95, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Consul.0.7.2.6\lib\net45\Consul.dll
</HintPath>
</Reference>
<Reference
Include=
"Coscine.Action, Version=1.1
2
.0.0, Culture=neutral, processorArchitecture=AMD64"
>
<HintPath>
..\packages\Coscine.Action.1.1
2
.0\lib\net461\Coscine.Action.dll
</HintPath>
<Reference
Include=
"Coscine.Action, Version=1.1
3
.0.0, Culture=neutral, processorArchitecture=AMD64"
>
<HintPath>
..\packages\Coscine.Action.1.1
3
.0\lib\net461\Coscine.Action.dll
</HintPath>
</Reference>
<Reference
Include=
"Coscine.ApiCommons, Version=1.
7.2
.0, Culture=neutral, PublicKeyToken=af4c1345df96546b, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.ApiCommons.1.
7.2
\lib\net461\Coscine.ApiCommons.dll
</HintPath>
<Reference
Include=
"Coscine.ApiCommons, Version=1.
8.0
.0, Culture=neutral, PublicKeyToken=af4c1345df96546b, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.ApiCommons.1.
8.0
\lib\net461\Coscine.ApiCommons.dll
</HintPath>
</Reference>
<Reference
Include=
"Coscine.Configuration, Version=1.5.0.0, Culture=neutral, PublicKeyToken=ce3d7a32d7dc1e5a, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.Configuration.1.5.0\lib\net461\Coscine.Configuration.dll
</HintPath>
</Reference>
<Reference
Include=
"Coscine.Database, Version=1.1
9
.0.0, Culture=neutral, PublicKeyToken=767d77427707b70a, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.Database.1.1
9
.0\lib\net461\Coscine.Database.dll
</HintPath>
<Reference
Include=
"Coscine.Database, Version=1.
2
1.0.0, Culture=neutral, PublicKeyToken=767d77427707b70a, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.Database.1.
2
1.0\lib\net461\Coscine.Database.dll
</HintPath>
</Reference>
<Reference
Include=
"Coscine.Logging, Version=1.2.0.0, Culture=neutral, PublicKeyToken=e1ed402bc3f6525e, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.Logging.1.2.0\lib\net461\Coscine.Logging.dll
</HintPath>
...
...
src/Project/packages.config
View file @
64f2c417
...
...
@@ -4,10 +4,10 @@
<
package
id
=
"AutoMapper.Extensions.Microsoft.DependencyInjection"
version
=
"6.0.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Castle.Core"
version
=
"4.4.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Consul"
version
=
"0.7.2.6"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Action"
version
=
"1.1
2
.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.ApiCommons"
version
=
"1.
7.2
"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Action"
version
=
"1.1
3
.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.ApiCommons"
version
=
"1.
8.0
"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Configuration"
version
=
"1.5.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Database"
version
=
"1.1
9
.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Database"
version
=
"1.
2
1.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Logging"
version
=
"1.2.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.ProxyApi"
version
=
"1.2.1"
targetFramework
=
"net472"
/>
<
package
id
=
"EntityFramework"
version
=
"6.2.0"
targetFramework
=
"net472"
/>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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