mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-16 10:16:16 +01:00
Add plugin wizard initialization step (#2045)
Adds a new initialization step after setting up the initial administration account that allows administrators to initialize the instance with a selection of plugin sets. Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com> Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com> Co-authored-by: Matthias Thieroff <matthias.thieroff@cloudogu.com>
This commit is contained in:
committed by
Eduard Heimbuch
parent
6216945f0d
commit
1b18191c57
@@ -29,18 +29,31 @@ import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Mapper
|
||||
public abstract class PluginCenterDtoMapper {
|
||||
|
||||
PluginCenterDtoMapper() {}
|
||||
|
||||
static final PluginCenterDtoMapper INSTANCE = Mappers.getMapper(PluginCenterDtoMapper.class);
|
||||
|
||||
abstract PluginInformation map(PluginCenterDto.Plugin plugin);
|
||||
|
||||
abstract PluginCondition map(PluginCenterDto.Condition condition);
|
||||
|
||||
Set<AvailablePlugin> map(PluginCenterDto pluginCenterDto) {
|
||||
abstract PluginSet map(PluginCenterDto.PluginSet set);
|
||||
abstract PluginSet.Description map(PluginCenterDto.Description description);
|
||||
|
||||
PluginCenterResult map(PluginCenterDto pluginCenterDto) {
|
||||
Set<AvailablePlugin> plugins = new HashSet<>();
|
||||
Set<PluginSet> pluginSets = pluginCenterDto
|
||||
.getEmbedded()
|
||||
.getPluginSets()
|
||||
.stream()
|
||||
.map(this::map)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
for (PluginCenterDto.Plugin plugin : pluginCenterDto.getEmbedded().getPlugins()) {
|
||||
// plugin center api returns always a download link,
|
||||
// but for cloudogu plugin without authentication the href is an empty string
|
||||
@@ -51,7 +64,7 @@ public abstract class PluginCenterDtoMapper {
|
||||
);
|
||||
plugins.add(new AvailablePlugin(descriptor));
|
||||
}
|
||||
return plugins;
|
||||
return new PluginCenterResult(plugins, pluginSets);
|
||||
}
|
||||
|
||||
private String getInstallLink(PluginCenterDto.Plugin plugin) {
|
||||
|
||||
Reference in New Issue
Block a user