diff --git a/src/main/java/io/codeka/gaia/modules/controller/ModulesMVCController.java b/src/main/java/io/codeka/gaia/modules/controller/ModulesMVCController.java
index 099e4629d..ada6efa74 100644
--- a/src/main/java/io/codeka/gaia/modules/controller/ModulesMVCController.java
+++ b/src/main/java/io/codeka/gaia/modules/controller/ModulesMVCController.java
@@ -35,6 +35,11 @@ public String modulesList(){
return "modules";
}
+ @GetMapping("/modules/import")
+ public String importModule() {
+ return "modules_import";
+ }
+
@GetMapping("/modules/{id}")
public String module(@PathVariable String id, Model model, User user){
var module = terraformModuleRepository.findById(id).orElseThrow(ModuleNotFoundException::new);
diff --git a/src/main/resources/static/css/style.css b/src/main/resources/static/css/style.css
index 12f533a29..24ecf2931 100755
--- a/src/main/resources/static/css/style.css
+++ b/src/main/resources/static/css/style.css
@@ -2274,7 +2274,7 @@ i.icon {
/** button section **/
.btn {
- font-size: 14px;
+ /*font-size: 14px;*/
}
.button_sction {
diff --git a/src/main/resources/templates/modules.html b/src/main/resources/templates/modules.html
index f0adc5c09..1dc8a6113 100644
--- a/src/main/resources/templates/modules.html
+++ b/src/main/resources/templates/modules.html
@@ -27,9 +27,16 @@
-
diff --git a/src/main/resources/templates/modules_import.html b/src/main/resources/templates/modules_import.html
new file mode 100644
index 000000000..b230fee25
--- /dev/null
+++ b/src/main/resources/templates/modules_import.html
@@ -0,0 +1,235 @@
+
+
+
+
+ Gaia - Import Module
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ from Github
+
+
+
+
+
+ Import an existing module code from existing Github repository
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ manually
+
+
+
+
+
+ Import a module manually (only for users with superpowers)
+
+
+
+
+
+
+
+
+
+
+
+ Oops! No repository found.
+
+
+
+ Import this repository !
+
+
+
+
+
+
+
+
+
+
+
+ Import manually
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/resources/templates/vue_templates/breadcrumb.vue b/src/main/resources/templates/vue_templates/breadcrumb.vue
index 8d9c30f0f..7fa22d1ac 100644
--- a/src/main/resources/templates/vue_templates/breadcrumb.vue
+++ b/src/main/resources/templates/vue_templates/breadcrumb.vue
@@ -12,6 +12,7 @@
new_stack: [{text: 'Modules', href: '/modules'}, {text: 'Stack creation'}],
module: [{text: 'Modules', href: '/modules'}, {text: 'Module edition'}],
module_description: [{text: 'Modules', href: '/modules'}, {text: 'Module description'},],
+ module_import: [{text: 'Modules', href: '/modules'}, {text: 'Module import'},],
stacks: [{text: 'Stacks'}],
stack: [{text: 'Stacks', href: '/stacks'}, {text: 'Stack'}],
users: [{text: 'Users'}],
diff --git a/src/test/java/io/codeka/gaia/modules/controller/ModulesMVCControllerTest.java b/src/test/java/io/codeka/gaia/modules/controller/ModulesMVCControllerTest.java
index 17d6e5225..df480db19 100644
--- a/src/test/java/io/codeka/gaia/modules/controller/ModulesMVCControllerTest.java
+++ b/src/test/java/io/codeka/gaia/modules/controller/ModulesMVCControllerTest.java
@@ -92,8 +92,6 @@ void readme_shouldReturnReadmeContent() {
@Test
void readme_shouldThrowExceptionIfModuleNotFound() {
- // given
-
// when
when(moduleRepository.findById(anyString())).thenReturn(Optional.empty());
assertThrows(NoSuchElementException.class, () -> controller.readme("TEST"));
@@ -105,9 +103,6 @@ void readme_shouldThrowExceptionIfModuleNotFound() {
@Test
void modulesList_shouldShowModulesView(){
- // given
- var model = mock(Model.class);
-
// when
var res = controller.modulesList();
@@ -115,6 +110,15 @@ void modulesList_shouldShowModulesView(){
assertEquals("modules", res);
}
+ @Test
+ void importModule_shouldShowImportModuleView(){
+ // when
+ var res = controller.importModule();
+
+ // then
+ assertEquals("modules_import", res);
+ }
+
@Test
void module_shouldShowModule_forAuthorizedUser(){
// given