Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Coscine
B
backend
apis
Project
Commits
9ba1e94d
Commit
9ba1e94d
authored
Nov 11, 2019
by
Marcel Nellesen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'Sprint/201920' into 'master'
Sprint/201920 See merge request coscine/api/project!33
parents
7f90a434
62925642
Changes
15
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
75 additions
and
57 deletions
+75
-57
src/Project.Tests/DefaultControllerTests.cs
src/Project.Tests/DefaultControllerTests.cs
+2
-1
src/Project.Tests/Project.Tests.csproj
src/Project.Tests/Project.Tests.csproj
+4
-4
src/Project.Tests/ProjectControllerTests.cs
src/Project.Tests/ProjectControllerTests.cs
+6
-6
src/Project.Tests/ResourceControllerTests.cs
src/Project.Tests/ResourceControllerTests.cs
+1
-1
src/Project.Tests/app.config
src/Project.Tests/app.config
+1
-1
src/Project.Tests/packages.config
src/Project.Tests/packages.config
+2
-2
src/Project/App.config
src/Project/App.config
+1
-1
src/Project/Controllers/DisciplineController.cs
src/Project/Controllers/DisciplineController.cs
+1
-1
src/Project/Controllers/ProjectController.cs
src/Project/Controllers/ProjectController.cs
+12
-26
src/Project/Controllers/ProjectRoleController.cs
src/Project/Controllers/ProjectRoleController.cs
+30
-2
src/Project/Models/ProjectModel.cs
src/Project/Models/ProjectModel.cs
+2
-2
src/Project/Models/ResourceModel.cs
src/Project/Models/ResourceModel.cs
+1
-1
src/Project/Project.csproj
src/Project/Project.csproj
+4
-4
src/Project/ReturnObjects/DisciplineObject.cs
src/Project/ReturnObjects/DisciplineObject.cs
+6
-3
src/Project/packages.config
src/Project/packages.config
+2
-2
No files found.
src/Project.Tests/DefaultControllerTests.cs
View file @
9ba1e94d
...
...
@@ -46,7 +46,8 @@ namespace Coscine.Api.Project.Tests
DisciplineModel
disciplineModel
=
new
DisciplineModel
();
Discipline
=
new
Discipline
()
{
DisplayName
=
"TestDiscipline"
,
DisplayNameDe
=
"TestDiscipline"
,
DisplayNameEn
=
"TestDiscipline"
,
Url
=
"http://rwth-aachen.de"
};
disciplineModel
.
Insert
(
Discipline
);
...
...
src/Project.Tests/Project.Tests.csproj
View file @
9ba1e94d
...
...
@@ -56,8 +56,8 @@
<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.
5
.0.0, Culture=neutral, processorArchitecture=AMD64"
>
<HintPath>
..\packages\Coscine.Action.1.
5
.0\lib\net461\Coscine.Action.dll
</HintPath>
<Reference
Include=
"Coscine.Action, Version=1.
6
.0.0, Culture=neutral, processorArchitecture=AMD64"
>
<HintPath>
..\packages\Coscine.Action.1.
6
.0\lib\net461\Coscine.Action.dll
</HintPath>
</Reference>
<Reference
Include=
"Coscine.ApiCommons, Version=1.2.2.0, Culture=neutral, PublicKeyToken=af4c1345df96546b, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.ApiCommons.1.2.2\lib\net461\Coscine.ApiCommons.dll
</HintPath>
...
...
@@ -65,8 +65,8 @@
<Reference
Include=
"Coscine.Configuration, Version=1.4.0.0, Culture=neutral, PublicKeyToken=ce3d7a32d7dc1e5a, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.Configuration.1.4.0\lib\net461\Coscine.Configuration.dll
</HintPath>
</Reference>
<Reference
Include=
"Coscine.Database, Version=1.
8
.0.0, Culture=neutral, PublicKeyToken=767d77427707b70a, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.Database.1.
8
.0\lib\net461\Coscine.Database.dll
</HintPath>
<Reference
Include=
"Coscine.Database, Version=1.
9
.0.0, Culture=neutral, PublicKeyToken=767d77427707b70a, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.Database.1.
9
.0\lib\net461\Coscine.Database.dll
</HintPath>
</Reference>
<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>
...
...
src/Project.Tests/ProjectControllerTests.cs
View file @
9ba1e94d
...
...
@@ -105,7 +105,7 @@ namespace Coscine.Api.Project.Tests
public
void
TestControllerStore
()
{
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
.
DisplayName
)
},
new
List
<
DisciplineObject
>()
{
new
DisciplineObject
(
Discipline
.
Id
,
Discipline
.
Url
,
Discipline
.
DisplayName
De
,
Discipline
.
DisplayNameEn
)
},
new
List
<
InstituteObject
>()
{
new
InstituteObject
(
Institute
.
Id
,
Institute
.
IKZ
,
Institute
.
DisplayName
)
},
new
VisibilityObject
(
Visibility
.
Id
,
Visibility
.
DisplayName
));
...
...
@@ -140,7 +140,7 @@ namespace Coscine.Api.Project.Tests
public
void
TestControllerDelete
()
{
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
.
DisplayName
)
},
new
List
<
DisciplineObject
>()
{
new
DisciplineObject
(
Discipline
.
Id
,
Discipline
.
Url
,
Discipline
.
DisplayName
De
,
Discipline
.
DisplayNameEn
)
},
new
List
<
InstituteObject
>()
{
new
InstituteObject
(
Institute
.
Id
,
Institute
.
IKZ
,
Institute
.
DisplayName
)
},
new
VisibilityObject
(
Visibility
.
Id
,
Visibility
.
DisplayName
));
...
...
@@ -174,7 +174,7 @@ namespace Coscine.Api.Project.Tests
public
void
TestControllerDeleteWithSubProjects
()
{
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
.
DisplayName
)
},
new
List
<
DisciplineObject
>()
{
new
DisciplineObject
(
Discipline
.
Id
,
Discipline
.
Url
,
Discipline
.
DisplayName
De
,
Discipline
.
DisplayNameEn
)
},
new
List
<
InstituteObject
>()
{
new
InstituteObject
(
Institute
.
Id
,
Institute
.
IKZ
,
Institute
.
DisplayName
)
},
new
VisibilityObject
(
Visibility
.
Id
,
Visibility
.
DisplayName
));
...
...
@@ -189,7 +189,7 @@ namespace Coscine.Api.Project.Tests
stream
.
Close
();
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
.
DisplayName
)
},
new
List
<
DisciplineObject
>()
{
new
DisciplineObject
(
Discipline
.
Id
,
Discipline
.
Url
,
Discipline
.
DisplayName
De
,
Discipline
.
DisplayNameEn
)
},
new
List
<
InstituteObject
>()
{
new
InstituteObject
(
Institute
.
Id
,
Institute
.
IKZ
,
Institute
.
DisplayName
)
},
new
VisibilityObject
(
Visibility
.
Id
,
Visibility
.
DisplayName
),
createdProjectObject
.
Id
);
...
...
@@ -217,7 +217,7 @@ namespace Coscine.Api.Project.Tests
public
void
TestControllerStoreWithSubProject
()
{
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
.
DisplayName
)
},
new
List
<
DisciplineObject
>()
{
new
DisciplineObject
(
Discipline
.
Id
,
Discipline
.
Url
,
Discipline
.
DisplayName
De
,
Discipline
.
DisplayNameEn
)
},
new
List
<
InstituteObject
>()
{
new
InstituteObject
(
Institute
.
Id
,
Institute
.
IKZ
,
Institute
.
DisplayName
)
},
new
VisibilityObject
(
Visibility
.
Id
,
Visibility
.
DisplayName
));
...
...
@@ -229,7 +229,7 @@ namespace Coscine.Api.Project.Tests
ProjectObject
createdProjectObject
=
(
ProjectObject
)
okObjectResult
.
Value
;
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
.
DisplayName
)
},
new
List
<
DisciplineObject
>()
{
new
DisciplineObject
(
Discipline
.
Id
,
Discipline
.
Url
,
Discipline
.
DisplayName
De
,
Discipline
.
DisplayNameEn
)
},
new
List
<
InstituteObject
>()
{
new
InstituteObject
(
Institute
.
Id
,
Institute
.
IKZ
,
Institute
.
DisplayName
)
},
new
VisibilityObject
(
Visibility
.
Id
,
Visibility
.
DisplayName
),
createdProjectObject
.
Id
);
...
...
src/Project.Tests/ResourceControllerTests.cs
View file @
9ba1e94d
...
...
@@ -94,7 +94,7 @@ namespace Coscine.Api.Project.Tests
"keys"
,
"usageR"
,
new
ResourceTypeObject
(
Resources
[
0
].
Type
.
Id
,
Resources
[
0
].
Type
.
DisplayName
),
new
List
<
DisciplineObject
>()
{
new
DisciplineObject
(
Discipline
.
Id
,
Discipline
.
Url
,
Discipline
.
DisplayName
)
},
new
List
<
DisciplineObject
>()
{
new
DisciplineObject
(
Discipline
.
Id
,
Discipline
.
Url
,
Discipline
.
DisplayName
De
,
Discipline
.
DisplayNameEn
)
},
new
VisibilityObject
(
Visibility
.
Id
,
Visibility
.
DisplayName
),
new
LicenseObject
(
License
.
Id
,
License
.
DisplayName
),
JObject
.
FromObject
(
new
RDSResourceTypeObject
(
Guid
.
NewGuid
(),
"PITLABTTEST"
,
"accesskey"
,
"secretkey"
))
...
...
src/Project.Tests/app.config
View file @
9ba1e94d
...
...
@@ -88,7 +88,7 @@
</
dependentAssembly
>
<
dependentAssembly
>
<
assemblyIdentity
name
=
"Coscine.Database"
publicKeyToken
=
"767d77427707b70a"
culture
=
"neutral"
/>
<
bindingRedirect
oldVersion
=
"0.0.0.0-1.
8
.0.0"
newVersion
=
"1.
8
.0.0"
/>
<
bindingRedirect
oldVersion
=
"0.0.0.0-1.
9
.0.0"
newVersion
=
"1.
9
.0.0"
/>
</
dependentAssembly
>
<
dependentAssembly
>
<
assemblyIdentity
name
=
"System.IdentityModel.Tokens.Jwt"
publicKeyToken
=
"31bf3856ad364e35"
culture
=
"neutral"
/>
...
...
src/Project.Tests/packages.config
View file @
9ba1e94d
...
...
@@ -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.
5
.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Action"
version
=
"1.
6
.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.ApiCommons"
version
=
"1.2.2"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Configuration"
version
=
"1.4.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Database"
version
=
"1.
8
.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Database"
version
=
"1.
9
.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.ProxyApi"
version
=
"1.2.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.SharePoint.Webparts.Vue"
version
=
"1.4.0"
targetFramework
=
"net472"
/>
<
package
id
=
"EntityFramework"
version
=
"6.2.0"
targetFramework
=
"net472"
/>
...
...
src/Project/App.config
View file @
9ba1e94d
...
...
@@ -91,7 +91,7 @@
</
dependentAssembly
>
<
dependentAssembly
>
<
assemblyIdentity
name
=
"Coscine.Database"
publicKeyToken
=
"767d77427707b70a"
culture
=
"neutral"
/>
<
bindingRedirect
oldVersion
=
"0.0.0.0-1.
8
.0.0"
newVersion
=
"1.
8
.0.0"
/>
<
bindingRedirect
oldVersion
=
"0.0.0.0-1.
9
.0.0"
newVersion
=
"1.
9
.0.0"
/>
</
dependentAssembly
>
<
dependentAssembly
>
<
assemblyIdentity
name
=
"System.IdentityModel.Tokens.Jwt"
publicKeyToken
=
"31bf3856ad364e35"
culture
=
"neutral"
/>
...
...
src/Project/Controllers/DisciplineController.cs
View file @
9ba1e94d
...
...
@@ -26,7 +26,7 @@ namespace Coscine.Api.Project.Controllers
{
return
Ok
(
_authenticator
.
ValidateAndExecute
((
user
)
=>
{
return
_disciplineModel
.
GetAll
().
Select
((
discipline
)
=>
new
DisciplineObject
(
discipline
.
Id
,
discipline
.
Url
,
discipline
.
DisplayName
));
return
_disciplineModel
.
GetAll
().
OrderBy
(
discipline
=>
discipline
.
DisplayNameDe
.
Substring
(
discipline
.
DisplayNameDe
.
Length
-
3
)).
Select
((
discipline
)
=>
new
DisciplineObject
(
discipline
.
Id
,
discipline
.
Url
,
discipline
.
DisplayName
De
,
discipline
.
DisplayNameEn
));
}));
}
}
...
...
src/Project/Controllers/ProjectController.cs
View file @
9ba1e94d
...
...
@@ -11,24 +11,22 @@ using Microsoft.AspNetCore.Mvc;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
Coscine.Configuration
;
namespace
Coscine.Api.Project.Controllers
{
public
class
ProjectController
:
Controller
{
private
readonly
Authenticator
_authenticator
;
private
readonly
List
<
IProjectAction
>
_projectActions
;
private
readonly
ProjectModel
_projectModel
;
private
readonly
IConfiguration
_configuration
;
private
readonly
Emitter
_emitter
;
public
ProjectController
()
{
_authenticator
=
new
Authenticator
(
this
,
Program
.
Configuration
);
_projectActions
=
new
List
<
IProjectAction
>()
{
new
PIDAction
(),
new
SharePointSiteAction
()
};
_configuration
=
Program
.
Configuration
;
_projectModel
=
new
ProjectModel
();
_emitter
=
new
Emitter
(
this
.
_configuration
);
}
[
Route
(
"[controller]"
)]
...
...
@@ -164,16 +162,9 @@ namespace Coscine.Api.Project.Controllers
projectInstituteModel
.
Delete
(
projectInstitute
);
}
FireEvents
((
projectAction
,
projectEventArgs
)
=>
_emitter
.
EmitProjectDelete
(
new
ProjectEventArgs
(
_configuration
)
{
try
{
projectAction
.
OnProjectDelete
(
project
,
projectEventArgs
);
}
catch
(
Exception
)
{
// Filter exception, because sometimes the PID or SharePoint site might not be generated in e.g. tests
}
Project
=
project
});
_projectModel
.
Delete
(
project
);
...
...
@@ -195,19 +186,14 @@ namespace Coscine.Api.Project.Controllers
subProjectModel
.
LinkSubProject
(
projectObject
.
ParentId
,
project
.
Id
);
}
FireEvents
((
projectAction
,
projectEventArgs
)
=>
projectAction
.
OnProjectCreate
(
project
,
projectEventArgs
));
_emitter
.
EmitProjectCreate
(
new
ProjectEventArgs
(
_configuration
)
{
Project
=
project
,
ProjectOwner
=
user
});
return
_projectModel
.
CreateReturnObjectFromDatabaseObject
(
project
);
}));
}
private
void
FireEvents
(
Action
<
IProjectAction
,
ProjectEventArgs
>
eventAction
)
{
ProjectEventArgs
projectEventArgs
=
new
ProjectEventArgs
(
Program
.
Configuration
,
new
object
[
0
]);
foreach
(
var
projectAction
in
_projectActions
)
{
eventAction
(
projectAction
,
projectEventArgs
);
}
}
}
}
src/Project/Controllers/ProjectRoleController.cs
View file @
9ba1e94d
using
Coscine.Api.Project.Models
;
using
Coscine.Action
;
using
Coscine.Action.EventArgs
;
using
Coscine.Action.Implementations.User
;
using
Coscine.Api.Project.Models
;
using
Coscine.Api.Project.ReturnObjects
;
using
Coscine.ApiCommons
;
using
Coscine.ApiCommons.Exceptions
;
...
...
@@ -17,11 +20,15 @@ namespace Coscine.Api.Project.Controllers
{
private
readonly
Authenticator
_authenticator
;
private
readonly
ProjectRoleModel
_projectRoleModel
;
private
readonly
Emitter
_emitter
;
private
readonly
Coscine
.
Configuration
.
IConfiguration
_configuration
;
public
ProjectRoleController
()
{
_emitter
=
new
Emitter
(
Program
.
Configuration
);
_authenticator
=
new
Authenticator
(
this
,
Program
.
Configuration
);
_projectRoleModel
=
new
ProjectRoleModel
();
_configuration
=
Program
.
Configuration
;
}
[
Route
(
"[controller]/{projectId}"
)]
...
...
@@ -89,8 +96,19 @@ namespace Coscine.Api.Project.Controllers
{
ProjectRoleObject
projectRoleObject
=
ObjectFactory
<
ProjectRoleObject
>.
DeserializeFromStream
(
Request
.
Body
);
ProjectModel
projectModel
=
new
ProjectModel
();
if
(
projectModel
.
OwnsProject
(
user
,
projectModel
.
GetById
(
projectRoleObject
.
ProjectId
)))
var
project
=
projectModel
.
GetById
(
projectRoleObject
.
ProjectId
);
RoleModel
roleModel
=
new
RoleModel
();
var
role
=
roleModel
.
GetById
(
projectRoleObject
.
Role
.
Id
);
UserModel
userModel
=
new
UserModel
();
var
userToAdd
=
userModel
.
GetById
(
projectRoleObject
.
User
.
Id
);
if
(
projectModel
.
OwnsProject
(
user
,
project
))
{
_emitter
.
EmitUserAdd
(
new
UserEventArgs
(
this
.
_configuration
)
{
Project
=
project
,
Role
=
role
,
User
=
userToAdd
});
return
_projectRoleModel
.
SetFromObject
(
projectRoleObject
);
}
else
...
...
@@ -110,6 +128,16 @@ namespace Coscine.Api.Project.Controllers
{
_projectRoleModel
.
CheckIfLastOwnerWillBeRemoved
(
roleId
,
projectId
);
var
project
=
projectModel
.
GetById
(
projectId
);
UserModel
userModel
=
new
UserModel
();
var
userToRemove
=
userModel
.
GetById
(
userId
);
_emitter
.
EmitUserRemove
(
new
UserEventArgs
(
this
.
_configuration
)
{
Project
=
project
,
User
=
userToRemove
});
return
_projectRoleModel
.
Delete
(
_projectRoleModel
.
GetWhere
((
projectRole
)
=>
projectRole
.
ProjectId
==
projectId
&&
projectRole
.
UserId
==
userId
...
...
src/Project/Models/ProjectModel.cs
View file @
9ba1e94d
...
...
@@ -172,11 +172,11 @@ namespace Coscine.Api.Project.Models
{
DisciplineModel
disciplineModel
=
new
DisciplineModel
();
disciplines
=
disciplineModel
.
GetAllWhere
((
discipline
)
=>
(
from
relation
in
discipline
.
ProjectDisciplineDisciplineIdIds
where
relation
.
ProjectId
==
project
.
Id
select
relation
).
Any
())
.
Select
((
discipline
)
=>
new
DisciplineObject
(
discipline
.
Id
,
discipline
.
Url
,
discipline
.
DisplayName
));
.
Select
((
discipline
)
=>
new
DisciplineObject
(
discipline
.
Id
,
discipline
.
Url
,
discipline
.
DisplayName
De
,
discipline
.
DisplayNameEn
));
}
else
{
disciplines
=
project
.
ProjectDisciplineProjectIdIds
.
Select
((
discipline
)
=>
new
DisciplineObject
(
discipline
.
Discipline
.
Id
,
discipline
.
Discipline
.
Url
,
discipline
.
Discipline
.
DisplayName
));
disciplines
=
project
.
ProjectDisciplineProjectIdIds
.
Select
((
discipline
)
=>
new
DisciplineObject
(
discipline
.
Discipline
.
Id
,
discipline
.
Discipline
.
Url
,
discipline
.
Discipline
.
DisplayName
De
,
discipline
.
Discipline
.
DisplayNameEn
));
}
IEnumerable
<
InstituteObject
>
institutes
=
new
List
<
InstituteObject
>();
if
(
project
.
ProjectInstituteProjectIdIds
==
null
)
...
...
src/Project/Models/ResourceModel.cs
View file @
9ba1e94d
...
...
@@ -234,7 +234,7 @@ namespace Coscine.Api.Project.Models
(
from
relation
in
discipline
.
ResourceDisciplineDisciplineIdIds
where
relation
.
ResourceId
==
resource
.
Id
select
relation
).
Any
())
.
Select
((
discipline
)
=>
new
DisciplineObject
(
discipline
.
Id
,
discipline
.
Url
,
discipline
.
DisplayName
));
.
Select
((
discipline
)
=>
new
DisciplineObject
(
discipline
.
Id
,
discipline
.
Url
,
discipline
.
DisplayName
De
,
discipline
.
DisplayNameEn
));
if
(
resource
.
Visibility
==
null
&&
resource
.
VisibilityId
!=
null
)
{
...
...
src/Project/Project.csproj
View file @
9ba1e94d
...
...
@@ -45,8 +45,8 @@
<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.
5
.0.0, Culture=neutral, processorArchitecture=AMD64"
>
<HintPath>
..\packages\Coscine.Action.1.
5
.0\lib\net461\Coscine.Action.dll
</HintPath>
<Reference
Include=
"Coscine.Action, Version=1.
6
.0.0, Culture=neutral, processorArchitecture=AMD64"
>
<HintPath>
..\packages\Coscine.Action.1.
6
.0\lib\net461\Coscine.Action.dll
</HintPath>
</Reference>
<Reference
Include=
"Coscine.ApiCommons, Version=1.2.2.0, Culture=neutral, PublicKeyToken=af4c1345df96546b, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.ApiCommons.1.2.2\lib\net461\Coscine.ApiCommons.dll
</HintPath>
...
...
@@ -54,8 +54,8 @@
<Reference
Include=
"Coscine.Configuration, Version=1.4.0.0, Culture=neutral, PublicKeyToken=ce3d7a32d7dc1e5a, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.Configuration.1.4.0\lib\net461\Coscine.Configuration.dll
</HintPath>
</Reference>
<Reference
Include=
"Coscine.Database, Version=1.
8
.0.0, Culture=neutral, PublicKeyToken=767d77427707b70a, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.Database.1.
8
.0\lib\net461\Coscine.Database.dll
</HintPath>
<Reference
Include=
"Coscine.Database, Version=1.
9
.0.0, Culture=neutral, PublicKeyToken=767d77427707b70a, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.Database.1.
9
.0\lib\net461\Coscine.Database.dll
</HintPath>
</Reference>
<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>
...
...
src/Project/ReturnObjects/DisciplineObject.cs
View file @
9ba1e94d
...
...
@@ -13,13 +13,16 @@ namespace Coscine.Api.Project.ReturnObjects
public
Guid
Id
{
get
;
set
;
}
public
string
Url
{
get
;
set
;
}
public
string
DisplayName
{
get
;
set
;
}
public
string
DisplayName
De
{
get
;
set
;
}
public
DisciplineObject
(
Guid
id
,
string
url
,
string
displayName
)
public
string
DisplayNameEn
{
get
;
set
;
}
public
DisciplineObject
(
Guid
id
,
string
url
,
string
displayNameDe
,
string
displayNameEn
)
{
Id
=
id
;
Url
=
url
;
DisplayName
=
displayName
;
DisplayNameDe
=
displayNameDe
;
DisplayNameEn
=
displayNameEn
;
}
}
}
src/Project/packages.config
View file @
9ba1e94d
...
...
@@ -3,10 +3,10 @@
<
package
id
=
"AutoMapper"
version
=
"8.0.0"
targetFramework
=
"net472"
/>
<
package
id
=
"AutoMapper.Extensions.Microsoft.DependencyInjection"
version
=
"6.0.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Consul"
version
=
"0.7.2.6"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Action"
version
=
"1.
5
.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Action"
version
=
"1.
6
.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.ApiCommons"
version
=
"1.2.2"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Configuration"
version
=
"1.4.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Database"
version
=
"1.
8
.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Database"
version
=
"1.
9
.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.ProxyApi"
version
=
"1.2.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.SharePoint.Webparts.Vue"
version
=
"1.4.0"
targetFramework
=
"net472"
/>
<
package
id
=
"EntityFramework"
version
=
"6.2.0"
targetFramework
=
"net472"
/>
...
...
Write
Preview
Markdown
is supported
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