-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow mapping of org/project during ship import (#4816)
- Loading branch information
1 parent
7e5f9a0
commit e99d912
Showing
20 changed files
with
262 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
ship/src/main/scala/ch/epfl/bluebrain/nexus/ship/ProjectMapper.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package ch.epfl.bluebrain.nexus.ship | ||
|
||
import ch.epfl.bluebrain.nexus.delta.sourcing.model.ProjectRef | ||
import ch.epfl.bluebrain.nexus.ship.config.ShipConfig.ProjectMapping | ||
|
||
trait ProjectMapper { | ||
def map(project: ProjectRef): ProjectRef | ||
} | ||
|
||
object ProjectMapper { | ||
|
||
def apply(projectMapping: ProjectMapping): ProjectMapper = | ||
(project: ProjectRef) => | ||
projectMapping match { | ||
case m if m.isEmpty => project | ||
case mapping => mapping.getOrElse(project, project) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 15 additions & 1 deletion
16
ship/src/main/scala/ch/epfl/bluebrain/nexus/ship/config/ShipConfig.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.