model = val!">
diff --git a/frontend/src/feature/cards/model/card.ts b/frontend/src/feature/cards/model/card.ts
index 7df1aff..01fe699 100644
--- a/frontend/src/feature/cards/model/card.ts
+++ b/frontend/src/feature/cards/model/card.ts
@@ -42,33 +42,14 @@ export const clone = (card: Card) : Card => {
};
};
-export const generateNewCard = (cardType: CardType) : Card =>{
- const card = {} as Card;
-
- // shared fields of all types of card
- card.tags = [];
- card.title = '';
- card.question = '';
-
- switch (cardType) {
- case CardType.SIMPLEQA:
- card.type = CardType.SIMPLEQA;
- card.answer = '';
- break;
- case CardType.MULTIPLE_CHOICE:
- card.type = CardType.MULTIPLE_CHOICE;
- card.correctOptions = [];
- card.options = [''];
- break;
- case CardType.SINGLE_CHOICE:
- card.type = CardType.SINGLE_CHOICE;
- card.options = [''];
- card.correctOption = 0;
- break;
- default:
- break;
- }
- return card;
+export const emptyCard = (cardType: CardType) : Card =>{
+ return {
+ type: cardType,
+ question: '',
+ tags: [],
+ options: [],
+ correctOptions: [],
+ };
};
export const translateType = (type: CardType) : string => {
diff --git a/frontend/src/feature/cards/pages/CardsPage.vue b/frontend/src/feature/cards/pages/CardsPage.vue
index 1167fcd..fbd65e7 100644
--- a/frontend/src/feature/cards/pages/CardsPage.vue
+++ b/frontend/src/feature/cards/pages/CardsPage.vue
@@ -1,16 +1,18 @@
-
+
-
-
+
+
+
+
+
+
+
+
+
+
-
-
+
+
diff --git a/frontend/src/feature/dataio/pages/DataExport.vue b/frontend/src/feature/dataio/pages/DataExport.vue
index 45129b6..96db951 100644
--- a/frontend/src/feature/dataio/pages/DataExport.vue
+++ b/frontend/src/feature/dataio/pages/DataExport.vue
@@ -12,19 +12,17 @@
Photo by Maksym Kaharlytskyi on Maksym
+ Kaharlytskyi on Unsplash
-
-
-
- Start Export
-
-
+
+ Start Export
+
diff --git a/server/src/test/java/org/hyperskill/community/flashcards/integration/CardControllerIT.java b/server/src/test/java/org/hyperskill/community/flashcards/integration/CardControllerIT.java
index c8b71bb..9006b36 100644
--- a/server/src/test/java/org/hyperskill/community/flashcards/integration/CardControllerIT.java
+++ b/server/src/test/java/org/hyperskill/community/flashcards/integration/CardControllerIT.java
@@ -14,7 +14,6 @@
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository;
-import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.aot.DisabledInAotMode;
import org.springframework.test.web.servlet.MockMvc;
@@ -35,7 +34,6 @@
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@SpringBootTest(classes = TestMongoConfiguration.class)
-@TestPropertySource(properties = {"spring.profiles.active=test"})
@AutoConfigureMockMvc
@DisabledInAotMode
class CardControllerIT {
diff --git a/server/src/test/java/org/hyperskill/community/flashcards/integration/CardServiceIT.java b/server/src/test/java/org/hyperskill/community/flashcards/integration/CardServiceIT.java
index f9abfc2..1aa42be 100644
--- a/server/src/test/java/org/hyperskill/community/flashcards/integration/CardServiceIT.java
+++ b/server/src/test/java/org/hyperskill/community/flashcards/integration/CardServiceIT.java
@@ -28,7 +28,6 @@
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.TestPropertySource;
import java.io.IOException;
import java.util.Arrays;
@@ -47,7 +46,6 @@
@DataMongoTest
@EnableMongoAuditing
@ContextConfiguration(classes = TestMongoConfiguration.class)
-@TestPropertySource(properties = {"spring.profiles.active=test"})
class CardServiceIT {
private static final String PATH = "/json/cards.json";
diff --git a/server/src/test/java/org/hyperskill/community/flashcards/integration/CategoryControllerIT.java b/server/src/test/java/org/hyperskill/community/flashcards/integration/CategoryControllerIT.java
index 91b3672..9585c0a 100644
--- a/server/src/test/java/org/hyperskill/community/flashcards/integration/CategoryControllerIT.java
+++ b/server/src/test/java/org/hyperskill/community/flashcards/integration/CategoryControllerIT.java
@@ -10,7 +10,6 @@
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository;
-import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.aot.DisabledInAotMode;
import org.springframework.test.web.servlet.MockMvc;
@@ -29,7 +28,6 @@
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@SpringBootTest(classes = TestMongoConfiguration.class)
-@TestPropertySource(properties = {"spring.profiles.active=test"})
@AutoConfigureMockMvc
@DisabledInAotMode
class CategoryControllerIT {
diff --git a/server/src/test/java/org/hyperskill/community/flashcards/integration/CategoryServiceIT.java b/server/src/test/java/org/hyperskill/community/flashcards/integration/CategoryServiceIT.java
index 4c88b2d..b75f4ae 100644
--- a/server/src/test/java/org/hyperskill/community/flashcards/integration/CategoryServiceIT.java
+++ b/server/src/test/java/org/hyperskill/community/flashcards/integration/CategoryServiceIT.java
@@ -18,7 +18,6 @@
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.TestPropertySource;
import java.util.HashMap;
import java.util.HashSet;
@@ -32,7 +31,6 @@
@DataMongoTest
@ContextConfiguration(classes = TestMongoConfiguration.class)
-@TestPropertySource(properties = {"spring.profiles.active=test"})
class CategoryServiceIT {
@Autowired
diff --git a/server/src/test/java/org/hyperskill/community/flashcards/integration/ExampleDataInitializerIT.java b/server/src/test/java/org/hyperskill/community/flashcards/integration/ExampleDataInitializerIT.java
index a45bc79..de693ea 100644
--- a/server/src/test/java/org/hyperskill/community/flashcards/integration/ExampleDataInitializerIT.java
+++ b/server/src/test/java/org/hyperskill/community/flashcards/integration/ExampleDataInitializerIT.java
@@ -7,12 +7,10 @@
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository;
-import org.springframework.test.context.TestPropertySource;
import static org.assertj.core.api.Assertions.assertThat;
@SpringBootTest(classes = TestMongoConfiguration.class)
-@TestPropertySource(properties = {"spring.profiles.active=test"})
class ExampleDataInitializerIT {
// needed since otherwise test tries to connect to Authorization server on AppContext creation
diff --git a/server/src/test/java/org/hyperskill/community/flashcards/integration/RedirectControllerIT.java b/server/src/test/java/org/hyperskill/community/flashcards/integration/RedirectControllerIT.java
index 2e738cd..39460b2 100644
--- a/server/src/test/java/org/hyperskill/community/flashcards/integration/RedirectControllerIT.java
+++ b/server/src/test/java/org/hyperskill/community/flashcards/integration/RedirectControllerIT.java
@@ -15,7 +15,6 @@
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository;
-import org.springframework.test.context.TestPropertySource;
import org.springframework.test.web.servlet.MockMvc;
import java.util.Set;
@@ -38,7 +37,6 @@
@WebMvcTest({RedirectController.class, CategoryController.class,
AuthenticationResolver.class, ObservabilityConfiguration.class})
-@TestPropertySource(properties = {"spring.profiles.active=test"})
class RedirectControllerIT {
// needed since otherwise test tries to connect to Authorization server on Spring security context creation
diff --git a/server/src/test/java/org/hyperskill/community/flashcards/integration/RegistrationIT.java b/server/src/test/java/org/hyperskill/community/flashcards/integration/RegistrationIT.java
index 8119684..e148a86 100644
--- a/server/src/test/java/org/hyperskill/community/flashcards/integration/RegistrationIT.java
+++ b/server/src/test/java/org/hyperskill/community/flashcards/integration/RegistrationIT.java
@@ -13,7 +13,6 @@
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository;
-import org.springframework.test.context.TestPropertySource;
import org.springframework.test.web.servlet.MockMvc;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -22,7 +21,6 @@
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@SpringBootTest(classes = TestMongoConfiguration.class)
-@TestPropertySource(properties = {"spring.profiles.active=test"})
@AutoConfigureMockMvc
class RegistrationIT {
diff --git a/server/src/test/resources/application.properties b/server/src/test/resources/application.properties
new file mode 100644
index 0000000..5681c24
--- /dev/null
+++ b/server/src/test/resources/application.properties
@@ -0,0 +1,14 @@
+spring.profiles.active=test
+
+spring.security.oauth2.client.registration.spring.provider=spring
+spring.security.oauth2.client.registration.spring.client-id=flashcards
+spring.security.oauth2.client.registration.spring.client-secret=secret
+spring.security.oauth2.client.registration.spring.client-authentication-method=client_secret_basic
+spring.security.oauth2.client.registration.spring.authorization-grant-type=authorization_code
+spring.security.oauth2.client.registration.spring.redirect-uri={baseUrl}/login/oauth2/code/{registrationId}
+spring.security.oauth2.client.registration.spring.scope=user.read,user.write,openid
+
+spring.security.oauth2.client.provider.spring.issuer-uri=http://localhost:8000
+spring.security.oauth2.resourceserver.jwt.issuer-uri=http://localhost:8000
+
+logging.level.org.hyperskill.community=trace