Conversation
- Renamed `Login` data class to `LoginDto` for clarity. - Updated Ktor version from 3.2.0 to 3.1.3 in `gradle/libs.versions.toml`. - Adjusted references to `Login` to `LoginDto` across multiple files in the authentication module.
- Add `GetNotesDto.kt` for fetching a list of notes. - Add `NoteDto.kt` representing a single note. - Add `LoginUsernameDto.kt` for login response. - Update `Routes.kt` to include a `NOTES` endpoint.
- Rename `GetNotesDto` to `NotesDto`. - Add `NotesRemoteDataSource` interface for note operations. - Correct typo in `Routes.REGISTRATION` from `REGISTATION`. - Add `DELETE_NOTE` endpoint to `Routes`. - Enhance `DataError.Network` with more specific error types and descriptions (`BAD_REQUEST`, `METHOD_NOT_ALLOWED`, `TOO_MANY_REQUESTS`, `CONFLICT`). - Update `NetworkUtils` to handle `METHOD_NOT_ALLOWED` error and map `JsonConvertException` to `JSON_CONVERT`.
- Moved `NotesRemoteDataSource.kt` from `me.androidbox.notes.data` to `me.androidbox.notes.data.datasources`. - Added `NotesRemoteDataSourceImp.kt` implementing `NotesRemoteDataSource` with TODOs for each method. - Added `NotesRepository.kt` interface in `me.androidbox.notes.domain`. - Added `NotesRepositoryImp.kt` implementing `NotesRepository` and utilizing `NotesRemoteDataSource`.
- Modified `createNote` and `updateNote` methods in `NotesRepository`, `NotesRepositoryImp`, `NotesRemoteDataSource`, and `NotesRemoteDataSourceImp` to accept a `NoteDto` as a parameter. This `NoteDto` is now used as the request body for the respective API calls.
- Implemented the `createNote`, `updateNote`, `deleteNote`, and `fetchNotes` methods in `NotesRemoteDataSourceImp` using an `HttpClient` to make network requests.
- `createNote` performs a POST request to `Routes.NOTES`.
- `updateNote` performs a PUT request to `Routes.NOTES`.
- `deleteNote` performs a DELETE request to `Routes.NOTES/{id}`.
- `fetchNotes` performs a GET request to `Routes.NOTES` with `page` and `size` as query parameters.
- Added `SIZE` and `PAGE` constants to the `Routes.kt` object for use in pagination.
- Add Room database library (version 2.7.1) for local data persistence. - Add Kermit logging library (version 2.0.6) for multiplatform logging. - Update `gradle/libs.versions.toml` with new library versions and plugin definitions for Room and KSP. - Update `composeApp/build.gradle.kts` to apply Room and KSP plugins and include Room and Kermit dependencies. - Configure Room schema directory in `composeApp/build.gradle.kts`.
- Add `kotlinx-datetime` to `composeApp/build.gradle.kts` for commonMain dependencies.
- Add `kotlinx-datetime` to `composeApp/build.gradle.kts` for commonMain dependencies.
- Resolved merge conflict in .gitignore. - Added `composeApp/schema/` to .gitignore. - Removed duplicated entries and ensured standard Android and Gradle ignores are present.
- Added `NotesLocalDataSource.kt` interface for local note data operations. - Added `NoteLocalDataSourceImp.kt` as an implementation for `NotesLocalDataSource`. - `NoteLocalDataSourceImp` includes methods to save, update, and retrieve all notes from `NoteMarkDatabase`.
…e Factory - Injected `NotesLocalDataSource` into `NotesRepositoryImp` for local data operations. - Added a `NoteMarkDatabase` factory method to `androidSpecificModule.kt` using Room.
- Provided `CoroutineScope` with `Dispatchers.Default + SupervisorJob()` for dependency injection.
…in layers - Updated `Note` to `NoteItem` in `NoteListUiState`, `NoteItem` composable, and related usages. - Adjusted previews and replaced `noteList` with `noteItemList` in `Previews.kt`. - Added `createdAt` and `lastEditedAt` fields to `NoteItemEntity` for improved data tracking.
- Added `DeleteNoteUseCase`, `FetchNotesUseCase`, and `SaveNoteUseCase` interfaces and implementations. - Created mappers to convert between `NoteItem`, `NoteItemDto`, and `NoteItemEntity`. - Updated `NotesRepository` and related components to accommodate the new use cases. - Integrated use cases into `NoteMarkModule` for dependency injection.
…iewModel - Added `OnSaveNote` action to `EditNoteActions` for saving notes. - Injected `SaveNoteUseCase` into `EditNoteViewModel`. - Implemented save note functionality using `SaveNoteUseCase` and `Clock` for timestamp management.
- Added Kotzilla SDK and analytics setup in Koin initialization. - Introduced `kotzilla-plugin` dependencies and configuration in Gradle files. - Refactored `EditNote` module: - Renamed package from `edit_note.presentation` to `notes.presentation`. - Updated imports and usages across the codebase. - Injected `EditNoteViewModel` into `NoteMarkModule` and registered data sources for dependency injection.
- Updated `EditNoteViewModel` to use `SaveNoteUseCase` for saving notes and added logging. - Modified `EditNoteScreenRoot` to use `koinViewModel` and `collectAsStateWithLifecycle`. - Enabled save functionality in `EditNoteScreenPortrait` by calling `EditNoteActions.OnSaveNote`. - Removed Kotzilla analytics initialization from `NoteMarkApplication` and `InitializeKoin`. - Added Room KSP plugin and dependency in `composeApp/build.gradle.kts`. - Refactored `EditNoteViewModel` instantiation in `noteMarkModule.kt` to explicitly provide `SaveNoteUseCase`. - Changed `EditNoteActions.OnSaveNote` from a data class to a data object. - Updated `kotzilla.key`.
…i call to upload the note to the remote
…UseCase integration
… saved navigate back to notes list screen, (*fixed one small bug in EditNoteScreen.kt)
Delete note dialog and Note saved
- Added `id` field to `User` and `UserEntity`. - Modified `UserRepository.fetchUser` to return `Either<User?, DataError.Local>` for better error handling. - Updated `UserRepositoryImp` to implement the new `fetchUser` signature. - Updated `UserMapper` to include the `id` field. - Updated Kotlin version to 2.2.0. - Updated `kotzilla.key`.
- Rename User table to UserEntity in UserEntity.kt - Update NoteMarkDao to query UserEntity table - Modify NoteMarkModule to provide NoteMarkDatabase to UserLocalDataSourceImp - Adjust UserLocalDataSourceImp to use NoteMarkDatabase for user data operations
- Moved UserEntity to `me.androidbox.authentication.register.data` package. - Updated RegisterViewModel to use UserRepository to save the user upon successful registration. - Adjusted UserEntity in `me.androidbox.user.domain` to have a default id. - Updated import paths for UserEntity in various files.
… logic This commit introduces UserRepository into LoginViewModel to fetch user data. It also refactors the user fetching mechanism across UserRepository, UserLocalDataSource, and NoteMarkDao to ensure a non-null User/UserEntity is returned or a DataError.Local in case of issues. Specific changes include: - LoginViewModel now uses UserRepository to fetch the username for the loginV2 use case. - UserRepository's `fetchUser` method now returns `Either<User, DataError.Local>` instead of `Either<User?, DataError.Local>`. - UserLocalDataSource's `fetchUser` method now returns `Either<UserEntity, DataError.Local>` instead of `Either<UserEntity?, DataError.Local>`. - NoteMarkDao's `getUser` method is now a suspend function. - Updated logic in UserLocalDataSourceImp and UserRepositoryImp to reflect the non-nullable return types.
This commit updates the `LoginViewModel` to use the `loginUseCase` instead of `loginUseCaseV2`. The `loginUseCase` now takes email and password from the state for authentication.
… saved navigate back to notes list screen, (*fixed one small bug in EditNoteScreen.kt)
Implemented delete note dialog, and implemented logic for when note's saved navigate back to notes list screen, (*fixed one small bug in EditNoteScreen.kt)
- Changed `NoteItemEntity` primary key `id` from `Int` to `String` and disabled auto-generation. - Implemented `generateUUID()` function for Android and iOS platforms to create unique note IDs. - Updated `EditNoteViewModel` to use `generateUUID()` for new notes. - Modified `NoteMappers` to correctly map the `String` ID between `NoteItem` and `NoteItemEntity`. - In `LoginViewModel`, added functionality to save access and refresh tokens to `NoteMarkPreferences` upon successful login.
- Changed `NoteItemEntity` primary key `id` from `Int` to `String` and disabled auto-generation. - Implemented `generateUUID()` function for Android and iOS platforms to create unique note IDs. - Updated `EditNoteViewModel` to use `generateUUID()` for new notes. - Modified `NoteMappers` to correctly map the `String` ID between `NoteItem` and `NoteItemEntity`. - In `LoginViewModel`, added functionality to save access and refresh tokens to `NoteMarkPreferences` upon successful login.
The `getProfilePicture` function in `NoteListViewModel.kt` has been removed as it was not being used.
- Removed `userRepository` and `getProfilePictureUseCase` dependencies. - Deleted commented out call to `getProfilePicture()` in the initialization block.
…y id functionality (dao query, repository function, use case), fixed some small bugs
Update, Discard Note features've been implemented
usmon/update-discard-feature
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 18043967 | Triggered | Generic High Entropy Secret | 6cdba73 | composeApp/kotzilla.json | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.