diff --git a/.editorconfig b/.editorconfig index 4096f5d..82789d7 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,7 +7,7 @@ indent_size = 4 insert_final_newline = true trim_trailing_whitespace = true -[*.{vue,yml,yaml}] +[*.{vue,yml,yaml,html,css}] indent_size = 2 [*.md] diff --git a/README.md b/README.md index 645848b..fcec039 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,17 @@ ### Versions: - **NodeJS**: LTS 18 - - **NPM**: ^9.8 + - **NPM**: ^10.2 - **Java**: LTS 17 OpenJDK # Run Project -### [API (Backend)](/todo-api/README.md) -### [UI (Frontend)](/todo-ui/README.md) +### [Build API (Backend)](/todo-api/README.md) +### [Build UI (Frontend)](/todo-ui/README.md) + + #### open browser: ``` diff --git a/todo-api/README.md b/todo-api/README.md index f590154..ebed65e 100644 --- a/todo-api/README.md +++ b/todo-api/README.md @@ -9,20 +9,15 @@ cd todo-api ./gradlew i ``` + + ### Run with Hot-Reload for Development In your IDE (Eclipse, IntelliJ IDEA, Visual Studio Code, etc). Don't worry about the database; Spring will automatically initialize it for you using Docker - -### Compile and Minify for Production - -**Compile**: -```sh -./gradlew build -``` - -**Run**: -```sh -java -Dspring.profiles.active=build -jar build/libs/todo-1.jar -``` diff --git a/todo-api/build.gradle b/todo-api/build.gradle index 52f4010..24800de 100644 --- a/todo-api/build.gradle +++ b/todo-api/build.gradle @@ -4,13 +4,18 @@ plugins { id 'io.spring.dependency-management' version '1.1.0' id 'org.hibernate.orm' version '6.2.2.Final' //id 'org.graalvm.buildtools.native' version '0.9.20' + //id 'pl.allegro.tech.build.axion-release' version '1.13.6' + //id 'com.palantir.docker' version '0.31.0' } +//version = scmVersion.version + group = 'io.github.gulybyte' version = '1' java { - sourceCompatibility = '17' + sourceCompatibility(JavaVersion.VERSION_17) + targetCompatibility(JavaVersion.VERSION_17) } configurations { @@ -58,4 +63,13 @@ hibernate { associationManagement true } } +/* +String imageName = "todo:$version" +docker { + name imageName + files "build/libs/${bootJar.archiveFileName.get()}" + buildArgs([JAR_FILE: bootJar.archiveFileName.get()]) + dockerfile file("src/docker/Dockerfile") +} + */ diff --git a/todo-api/compose.yaml b/todo-api/compose.yaml index 22b74c9..e94fbd7 100644 --- a/todo-api/compose.yaml +++ b/todo-api/compose.yaml @@ -1,13 +1,13 @@ volumes: - postgres-data: + todo-api-volume-postgres: networks: - backend: - + todo-api-network: + driver: bridge services: postgres: - image: 'postgres:15.2-alpine' + image: 'postgres:16.1-alpine' environment: - 'POSTGRES_DB=todo-api' - 'POSTGRES_PASSWORD=postgres' @@ -15,6 +15,6 @@ services: ports: - '15432:5432' networks: - - backend + - todo-api-network volumes: - - postgres-data:/var/lib/postgresql/data + - todo-api-volume-postgres:/var/lib/postgresql/data diff --git a/todo-api/src/main/java/io/github/gulybyte/todo/config/cors/CorsFilter.java b/todo-api/src/main/java/io/github/gulybyte/todo/config/cors/CorsFilter.java index 1631c7b..dcf553a 100644 --- a/todo-api/src/main/java/io/github/gulybyte/todo/config/cors/CorsFilter.java +++ b/todo-api/src/main/java/io/github/gulybyte/todo/config/cors/CorsFilter.java @@ -35,8 +35,12 @@ public void doFilter(final ServletRequest req,final ServletResponse res, final F var allowDomains = todoProperty.getDomains().split(","); var allowOrigins = new HashSet<>(Arrays.asList(allowDomains)); - if(allowOrigins.contains(origin)){ + if(allowOrigins.contains("dev-mode")) { + response.setHeader("Access-Control-Allow-Origin", "*"); + } else if(allowOrigins.contains(origin)){ response.setHeader("Access-Control-Allow-Origin", origin); + } else { + // TODO: exception } response.setHeader("Access-Control-Allow-Credentials", "true"); diff --git a/todo-api/src/main/java/io/github/gulybyte/todo/controller/ControllerTodo.java b/todo-api/src/main/java/io/github/gulybyte/todo/controller/ControllerTodo.java index c9a6924..c2a613c 100644 --- a/todo-api/src/main/java/io/github/gulybyte/todo/controller/ControllerTodo.java +++ b/todo-api/src/main/java/io/github/gulybyte/todo/controller/ControllerTodo.java @@ -18,7 +18,8 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.github.gulybyte.todo.filter.body.TodoPutFilter; +import io.github.gulybyte.todo.filter.body.TodoPutContextFilter; +import io.github.gulybyte.todo.filter.body.TodoPutDescriptionFilter; import io.github.gulybyte.todo.model.Todo; import io.github.gulybyte.todo.service.ServiceTodo; import jakarta.validation.Valid; @@ -37,10 +38,14 @@ public ResponseEntity save(@RequestBody @Valid Todo todo) { @PutMapping("update-description") - public ResponseEntity updateDescription(@RequestBody @Valid TodoPutFilter todoBody) { + public ResponseEntity updateDescription(@RequestBody @Valid TodoPutDescriptionFilter todoBody) { return ResponseEntity.ok(service.updateDescription(todoBody)); } + @PutMapping("update-context") + public ResponseEntity updateContext(@RequestBody @Valid TodoPutContextFilter todoBody) { + return ResponseEntity.ok(service.updateContext(todoBody)); + } @GetMapping public ResponseEntity> findAllWithoutMarkDone(){ diff --git a/todo-api/src/main/java/io/github/gulybyte/todo/filter/body/TodoPutContextFilter.java b/todo-api/src/main/java/io/github/gulybyte/todo/filter/body/TodoPutContextFilter.java new file mode 100644 index 0000000..9e765d8 --- /dev/null +++ b/todo-api/src/main/java/io/github/gulybyte/todo/filter/body/TodoPutContextFilter.java @@ -0,0 +1,20 @@ +package io.github.gulybyte.todo.filter.body; + +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data @Builder +@AllArgsConstructor @NoArgsConstructor +public class TodoPutContextFilter { + + @NotNull(message = "Id cannot be null.") + private Long id; + + @Size(max = 20, message = "Your context of the todo is too long (max: 20 characters)") + private String context; + +} diff --git a/todo-api/src/main/java/io/github/gulybyte/todo/filter/body/TodoPutFilter.java b/todo-api/src/main/java/io/github/gulybyte/todo/filter/body/TodoPutDescriptionFilter.java similarity index 93% rename from todo-api/src/main/java/io/github/gulybyte/todo/filter/body/TodoPutFilter.java rename to todo-api/src/main/java/io/github/gulybyte/todo/filter/body/TodoPutDescriptionFilter.java index b577fc6..0bfda2c 100644 --- a/todo-api/src/main/java/io/github/gulybyte/todo/filter/body/TodoPutFilter.java +++ b/todo-api/src/main/java/io/github/gulybyte/todo/filter/body/TodoPutDescriptionFilter.java @@ -10,7 +10,7 @@ @Data @Builder @AllArgsConstructor @NoArgsConstructor -public class TodoPutFilter { +public class TodoPutDescriptionFilter { @NotNull(message = "Id cannot be null.") private Long id; diff --git a/todo-api/src/main/java/io/github/gulybyte/todo/model/Todo.java b/todo-api/src/main/java/io/github/gulybyte/todo/model/Todo.java index b701ff9..86284d2 100644 --- a/todo-api/src/main/java/io/github/gulybyte/todo/model/Todo.java +++ b/todo-api/src/main/java/io/github/gulybyte/todo/model/Todo.java @@ -32,9 +32,13 @@ public class Todo { @Column @NotBlank(message = "The description cannot be blank.") - @Size(max = 350, message = "Description is too long (max: 350 characters).") + @Size(max = 350, message = "Your description is too long (max: 350 characters).") private String description; + @Column + @Size(max = 20, message = "Your context of the todo is too long (max: 20 characters).") + private String contextTodo; + @Column private Boolean done; @@ -47,6 +51,8 @@ public void beforeSave() { final var DATE_TIME_NOW = LocalDateTime.now(); setCreatedDate(DATE_TIME_NOW); setOrderTodo(DATE_TIME_NOW); + if (getContextTodo() == null || getContextTodo() == "") + setContextTodo("none"); } diff --git a/todo-api/src/main/java/io/github/gulybyte/todo/service/ServiceTodo.java b/todo-api/src/main/java/io/github/gulybyte/todo/service/ServiceTodo.java index 3629256..f6d05ea 100644 --- a/todo-api/src/main/java/io/github/gulybyte/todo/service/ServiceTodo.java +++ b/todo-api/src/main/java/io/github/gulybyte/todo/service/ServiceTodo.java @@ -4,13 +4,15 @@ import org.springframework.data.domain.Page; -import io.github.gulybyte.todo.filter.body.TodoPutFilter; +import io.github.gulybyte.todo.filter.body.TodoPutContextFilter; +import io.github.gulybyte.todo.filter.body.TodoPutDescriptionFilter; import io.github.gulybyte.todo.model.Todo; public interface ServiceTodo { Todo save(Todo todo); - Todo updateDescription(TodoPutFilter todoBody); + Todo updateDescription(TodoPutDescriptionFilter todoBody); + Todo updateContext(TodoPutContextFilter todoBody); List findAllWithoutMarkDone(); Page findAllWithMarkDone(int pageNumber); diff --git a/todo-api/src/main/java/io/github/gulybyte/todo/service/impl/ServiceTodoImpl.java b/todo-api/src/main/java/io/github/gulybyte/todo/service/impl/ServiceTodoImpl.java index 2402538..8f5e8c3 100644 --- a/todo-api/src/main/java/io/github/gulybyte/todo/service/impl/ServiceTodoImpl.java +++ b/todo-api/src/main/java/io/github/gulybyte/todo/service/impl/ServiceTodoImpl.java @@ -12,7 +12,8 @@ import io.github.gulybyte.todo.exception.status.ConflictException; import io.github.gulybyte.todo.exception.status.NotFoundException; -import io.github.gulybyte.todo.filter.body.TodoPutFilter; +import io.github.gulybyte.todo.filter.body.TodoPutContextFilter; +import io.github.gulybyte.todo.filter.body.TodoPutDescriptionFilter; import io.github.gulybyte.todo.model.Todo; import io.github.gulybyte.todo.repository.TodoRepository; import io.github.gulybyte.todo.service.ServiceTodo; @@ -34,7 +35,7 @@ public Todo save(Todo todo) { @Override @Transactional - public Todo updateDescription(TodoPutFilter todoBody) { + public Todo updateDescription(TodoPutDescriptionFilter todoBody) { var todoToSave = repository.findById(todoBody.getId()).map(todo -> { if (todo.getDescription().equals(todoBody.getDescription())) throw new ConflictException("Feature description remains the same"); @@ -47,6 +48,20 @@ public Todo updateDescription(TodoPutFilter todoBody) { } + @Override @Transactional + public Todo updateContext(TodoPutContextFilter todoBody) { + var todoToSave = repository.findById(todoBody.getId()).map(todo -> { + if (todo.getContextTodo().equals(todoBody.getContext())) + throw new ConflictException("Feature context remains the same"); + todo.setContextTodo(todoBody.getContext()); + return todo; + }) + .orElseThrow(() -> new NotFoundException(NOT_FOUND)); + + return repository.save(todoToSave); + } + + @Override public List findAllWithoutMarkDone() { var todo = repository.findAllWithoutMarkDone(); diff --git a/todo-api/src/main/resources/application-build.properties b/todo-api/src/main/resources/application-build.properties index a1aff3b..6ccf8f8 100644 --- a/todo-api/src/main/resources/application-build.properties +++ b/todo-api/src/main/resources/application-build.properties @@ -1,4 +1,4 @@ -todoapi.domains=http://localhost:5173,http://localhost:4173,http://localhost:8080 +todoapi.domains=dev-mode spring.datasource.url=jdbc:postgresql://localhost:15432/todo-api spring.datasource.username=postgres diff --git a/todo-api/src/main/resources/application-dev.properties b/todo-api/src/main/resources/application-dev.properties index 44ccfb1..0374d87 100644 --- a/todo-api/src/main/resources/application-dev.properties +++ b/todo-api/src/main/resources/application-dev.properties @@ -1,6 +1,5 @@ -todoapi.domains=http://localhost:5173,http://localhost:4173,http://localhost:8080 +todoapi.domains=dev-mode spring.datasource.url=jdbc:postgresql://localhost:15432/todo-api -#jdbc:postgresql://localhost:5432/todo-api spring.datasource.username=postgres spring.datasource.password=postgres @@ -8,6 +7,5 @@ spring.datasource.password=postgres spring.docker.compose.file=./todo-api/compose.yaml spring.docker.compose.lifecycle-management=start-and-stop - server.address=0.0.0.0 server.port=8080 diff --git a/todo-api/src/main/resources/banner.txt b/todo-api/src/main/resources/banner.txt index d5227c7..2d9ce40 100644 --- a/todo-api/src/main/resources/banner.txt +++ b/todo-api/src/main/resources/banner.txt @@ -7,3 +7,12 @@ \/_//_/ \/_____/ \ \ \/ \/____/ \/_/\/_/ \/_____/ \/___/ \/___/ \/_/ \/____/ \/____/ \ \_\ \/_/ + +Java: 17 +Dependency Management: Gradle - Groovy +Spring Boot: 3.1.0 + +GitHub: https://github.com/gulybyte/sample-todo +Licence: Creative Commons Zero v1.0 Universal + +_________________________________________________________________________________________________________ diff --git a/todo-api/src/main/resources/db/migration/V01__create-table.sql b/todo-api/src/main/resources/db/migration/V01__create-table.sql index acadded..36079f4 100644 --- a/todo-api/src/main/resources/db/migration/V01__create-table.sql +++ b/todo-api/src/main/resources/db/migration/V01__create-table.sql @@ -7,3 +7,6 @@ CREATE TABLE todo ( order_todo timestamp(6) NULL, CONSTRAINT todo_pkey PRIMARY KEY (id) ); + +INSERT INTO todo (created_date,description,done,done_date,order_todo) VALUES + ('2022-11-11 12:03:03.604757','Welcome!.',false,NULL,'2022-11-11 12:03:03.604757'); diff --git a/todo-api/src/main/resources/db/migration/V02__alter-table-add-column.sql b/todo-api/src/main/resources/db/migration/V02__alter-table-add-column.sql new file mode 100644 index 0000000..dae3d5b --- /dev/null +++ b/todo-api/src/main/resources/db/migration/V02__alter-table-add-column.sql @@ -0,0 +1,3 @@ +ALTER TABLE todo ADD context_todo varchar(20); + +UPDATE todo SET context_todo = 'none' WHERE context_todo IS NULL; diff --git a/todo-api/src/test/java/io/github/gulybyte/todo/repository/TodoRepositoryTestSuccess.java b/todo-api/src/test/java/io/github/gulybyte/todo/repository/TodoRepositoryTestSuccess.java index 690657c..2223c79 100644 --- a/todo-api/src/test/java/io/github/gulybyte/todo/repository/TodoRepositoryTestSuccess.java +++ b/todo-api/src/test/java/io/github/gulybyte/todo/repository/TodoRepositoryTestSuccess.java @@ -13,7 +13,7 @@ import io.github.gulybyte.todo.model.Todo; import io.github.gulybyte.todo.util.TodoCreator; -import static io.github.gulybyte.todo.util.ArgumentosMatchersTodo.*; +import static io.github.gulybyte.todo.util.ArgumentsMatchersTodo.*; import static org.junit.jupiter.api.Assertions.*; diff --git a/todo-api/src/test/java/io/github/gulybyte/todo/service/impl/todo/ServiceTodoTestSuccess.java b/todo-api/src/test/java/io/github/gulybyte/todo/service/impl/todo/ServiceTodoTestSuccess.java index 2eac443..1329cb4 100644 --- a/todo-api/src/test/java/io/github/gulybyte/todo/service/impl/todo/ServiceTodoTestSuccess.java +++ b/todo-api/src/test/java/io/github/gulybyte/todo/service/impl/todo/ServiceTodoTestSuccess.java @@ -14,7 +14,7 @@ import io.github.gulybyte.todo.repository.TodoRepository; import io.github.gulybyte.todo.service.impl.ServiceTodoImpl; import io.github.gulybyte.todo.util.TodoCreator; -import static io.github.gulybyte.todo.util.ArgumentosMatchersTodo.*; +import static io.github.gulybyte.todo.util.ArgumentsMatchersTodo.*; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.*; @@ -61,7 +61,7 @@ void updateDescription() { when(repository.findById(anyLong())).thenReturn(anyOptionalTodo()); when(repository.save(todoParamCaptor.capture())).thenReturn(anyTodo()); - var response = service.updateDescription(anyTodoPutFilter(TodoCreator.createTodoPutFilterWithNewDescription())); + var response = service.updateDescription(anyTodoPutDescriptionFilter(TodoCreator.createTodoPutDescriptionFilterWithNewDescription())); var capturedParameterResponse = todoParamCaptor.getValue(); assertEquals(response, repository.save(any())); diff --git a/todo-api/src/test/java/io/github/gulybyte/todo/service/impl/todo/exceptions/ServiceTodoTestConflictException.java b/todo-api/src/test/java/io/github/gulybyte/todo/service/impl/todo/exceptions/ServiceTodoTestConflictException.java index 71730c6..0196d2f 100644 --- a/todo-api/src/test/java/io/github/gulybyte/todo/service/impl/todo/exceptions/ServiceTodoTestConflictException.java +++ b/todo-api/src/test/java/io/github/gulybyte/todo/service/impl/todo/exceptions/ServiceTodoTestConflictException.java @@ -13,7 +13,7 @@ import io.github.gulybyte.todo.service.impl.ServiceTodoImpl; import io.github.gulybyte.todo.util.TodoCreator; -import static io.github.gulybyte.todo.util.ArgumentosMatchersTodo.*; +import static io.github.gulybyte.todo.util.ArgumentsMatchersTodo.*; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.*; @@ -40,7 +40,7 @@ void updateDescription() { when(repository.findById(anyLong())).thenReturn(anyOptionalTodo()); assertThrows(ConflictException.class, - () -> service.updateDescription(anyTodoPutFilter(TodoCreator.createTodoPutFilterDefault()))); + () -> service.updateDescription(anyTodoPutDescriptionFilter(TodoCreator.createTodoPutDescriptionFilterDefault()))); } diff --git a/todo-api/src/test/java/io/github/gulybyte/todo/service/impl/todo/exceptions/ServiceTodoTestNotFoundException.java b/todo-api/src/test/java/io/github/gulybyte/todo/service/impl/todo/exceptions/ServiceTodoTestNotFoundException.java index 5bd82ef..df42630 100644 --- a/todo-api/src/test/java/io/github/gulybyte/todo/service/impl/todo/exceptions/ServiceTodoTestNotFoundException.java +++ b/todo-api/src/test/java/io/github/gulybyte/todo/service/impl/todo/exceptions/ServiceTodoTestNotFoundException.java @@ -13,7 +13,7 @@ import io.github.gulybyte.todo.service.impl.ServiceTodoImpl; import io.github.gulybyte.todo.util.TodoCreator; -import static io.github.gulybyte.todo.util.ArgumentosMatchersTodo.*; +import static io.github.gulybyte.todo.util.ArgumentsMatchersTodo.*; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.*; @@ -40,7 +40,7 @@ void updateDescription() { when(repository.findById(anyLong())).thenReturn(anyEmptyOptionalTodo()); assertThrows(NotFoundException.class, - () -> service.updateDescription(anyTodoPutFilter(TodoCreator.createTodoPutFilterDefault()))); + () -> service.updateDescription(anyTodoPutDescriptionFilter(TodoCreator.createTodoPutDescriptionFilterDefault()))); } diff --git a/todo-api/src/test/java/io/github/gulybyte/todo/util/ArgumentosMatchersTodo.java b/todo-api/src/test/java/io/github/gulybyte/todo/util/ArgumentsMatchersTodo.java similarity index 76% rename from todo-api/src/test/java/io/github/gulybyte/todo/util/ArgumentosMatchersTodo.java rename to todo-api/src/test/java/io/github/gulybyte/todo/util/ArgumentsMatchersTodo.java index 4fccc05..c9ed1ec 100644 --- a/todo-api/src/test/java/io/github/gulybyte/todo/util/ArgumentosMatchersTodo.java +++ b/todo-api/src/test/java/io/github/gulybyte/todo/util/ArgumentsMatchersTodo.java @@ -7,10 +7,10 @@ import org.springframework.data.domain.Page; import org.springframework.data.domain.PageImpl; -import io.github.gulybyte.todo.filter.body.TodoPutFilter; +import io.github.gulybyte.todo.filter.body.TodoPutDescriptionFilter; import io.github.gulybyte.todo.model.Todo; -public class ArgumentosMatchersTodo { +public class ArgumentsMatchersTodo { public static final Integer INDEX = 0; @@ -54,11 +54,11 @@ public static Page anyEmptyPageTodo() { - public static TodoPutFilter anyTodoPutFilter() { - return TodoCreator.createTodoPutFilterDefault(); + public static TodoPutDescriptionFilter anyTodoPutDescriptionFilter() { + return TodoCreator.createTodoPutDescriptionFilterDefault(); } - public static TodoPutFilter anyTodoPutFilter(TodoPutFilter TodoPutFilter) { - return TodoPutFilter; + public static TodoPutDescriptionFilter anyTodoPutDescriptionFilter(TodoPutDescriptionFilter TodoPutDescriptionFilter) { + return TodoPutDescriptionFilter; } } diff --git a/todo-api/src/test/java/io/github/gulybyte/todo/util/TodoCreator.java b/todo-api/src/test/java/io/github/gulybyte/todo/util/TodoCreator.java index fdf08d6..df89d86 100644 --- a/todo-api/src/test/java/io/github/gulybyte/todo/util/TodoCreator.java +++ b/todo-api/src/test/java/io/github/gulybyte/todo/util/TodoCreator.java @@ -2,7 +2,7 @@ import java.time.LocalDateTime; -import io.github.gulybyte.todo.filter.body.TodoPutFilter; +import io.github.gulybyte.todo.filter.body.TodoPutDescriptionFilter; import io.github.gulybyte.todo.model.Todo; public class TodoCreator { @@ -53,15 +53,15 @@ public static Todo createTodoDefault(){ .build(); } - public static TodoPutFilter createTodoPutFilterDefault(){ - return TodoPutFilter.builder() + public static TodoPutDescriptionFilter createTodoPutDescriptionFilterDefault(){ + return TodoPutDescriptionFilter.builder() .id(DEFAULT_LONG) .description(DEFAULT_STRING) .build(); } - public static TodoPutFilter createTodoPutFilterWithNewDescription(){ - return TodoPutFilter.builder() + public static TodoPutDescriptionFilter createTodoPutDescriptionFilterWithNewDescription(){ + return TodoPutDescriptionFilter.builder() .id(DEFAULT_LONG) .description("new description") .build(); diff --git a/todo-api/src/test/resource/application-test.yml b/todo-api/src/test/resources/application-test.yml similarity index 100% rename from todo-api/src/test/resource/application-test.yml rename to todo-api/src/test/resources/application-test.yml diff --git a/todo-ui/README.md b/todo-ui/README.md index b5e5405..b39c3d1 100644 --- a/todo-ui/README.md +++ b/todo-ui/README.md @@ -7,7 +7,7 @@ npm i ### Compile and Hot-Reload for Development ```sh -npm run dev +npm run dev -- --host --port=5173 ``` ### Compile and Minify for Production @@ -19,5 +19,5 @@ npm run build ### Preview Build ```sh -npm run preview +npm run preview -- --host --port=4173 ``` diff --git a/todo-ui/src/assets/base.css b/todo-ui/src/assets/base.css index 9bd6199..3b6f5df 100644 --- a/todo-ui/src/assets/base.css +++ b/todo-ui/src/assets/base.css @@ -1,4 +1,4 @@ -@import "primevue/resources/themes/lara-dark-purple/theme.css"; +@import "primevue/resources/themes/lara-dark-teal/theme.css"; @import "primevue/resources/primevue.min.css"; @import "primeflex/primeflex.css"; @import "primeicons/primeicons.css"; @@ -10,7 +10,8 @@ body { height: 100%; - background-image: url('image.webp'); + background: rgb(6,13,21); + background: linear-gradient(142deg, rgba(6,13,21,1) 0%, rgba(32,10,79,1) 38%, rgba(47,8,112,1) 64%, rgba(111,0,255,1) 100%); background-size: 100%; background-attachment: fixed; } @@ -19,6 +20,24 @@ body { margin-bottom: 0.5rem; } -body::-webkit-scrollbar-track{background: #060D15 } +.mr-05rem { + margin-right: 0.5rem; +} + +.ml-05rem { + margin-left: 0.5rem; +} + +.mt-05rem { + margin-top: 0.5rem; +} + +*::placeholder { + font-weight: bold; + opacity: 0.5; + color: 060D15; +} + +body::-webkit-scrollbar-track{background: #060D15 } body::-webkit-scrollbar{width: 7px;} -body::-webkit-scrollbar-thumb{ background-color: rgb(111, 0, 255) ; } \ No newline at end of file +body::-webkit-scrollbar-thumb{ background-color: rgba(111,0,255,1) ; } diff --git a/todo-ui/src/assets/image.webp b/todo-ui/src/assets/image.webp deleted file mode 100644 index bb7ce92..0000000 Binary files a/todo-ui/src/assets/image.webp and /dev/null differ diff --git a/todo-ui/src/main.js b/todo-ui/src/main.js index b1a5994..2cac06a 100644 --- a/todo-ui/src/main.js +++ b/todo-ui/src/main.js @@ -12,6 +12,8 @@ import Column from 'primevue/column'; import ColumnGroup from 'primevue/columngroup'; import Row from 'primevue/row'; import ProgressSpinner from 'primevue/progressspinner'; +import Tag from 'primevue/tag'; +import Dialog from 'primevue/dialog'; const app = createApp(App) @@ -26,6 +28,9 @@ app.component('Column', Column) app.component('ColumnGroup', ColumnGroup) app.component('Row', Row) app.component('ProgressSpinner', ProgressSpinner) +app.component('Tag', Tag) +app.component('Dialog', Dialog) + diff --git a/todo-ui/src/views/HomeView.vue b/todo-ui/src/views/HomeView.vue index a587d99..81fa7c3 100644 --- a/todo-ui/src/views/HomeView.vue +++ b/todo-ui/src/views/HomeView.vue @@ -3,11 +3,13 @@
- + - + +
@@ -18,8 +20,8 @@ -