Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [TASK-89, TASK-91, TASK-116, TASK-112] Embeds forms and Subscribers #77

Closed
wants to merge 94 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
8da5c4b
fix(cicd): change github token
yacosta738 Jan 17, 2024
6b75535
feat(subscriber): get all subscribers
yacosta738 Jan 18, 2024
9d9578b
Merge branch 'main' into embeds-forms
yacosta738 Jan 18, 2024
a746b28
fix(deps): update all dependencies
yacosta738 Jan 18, 2024
dac59d6
feat(frontend): Add confetti component
yacosta738 Jan 18, 2024
4e9bc2a
refactor(frontend): Change layout Email CTA component
yacosta738 Jan 18, 2024
0f73cef
refactor(frontend): Change layout Email CTA component
yacosta738 Jan 18, 2024
6fb0b28
refactor(frontend): Rename layout components
yacosta738 Jan 18, 2024
04d48aa
feat(frontend): Basic embed forms layout
yacosta738 Jan 18, 2024
75feb6f
feat(frontend): Basic embed forms layout
yacosta738 Jan 18, 2024
1ad8172
feat(frontend): Split UI components
yacosta738 Jan 19, 2024
b1eec6b
feat(frontend): Split UI components
yacosta738 Jan 19, 2024
71b6ea8
fix(frontend): Vue UI component dynamic render
yacosta738 Jan 19, 2024
181d695
fix(frontend): Vue UI component dynamic render
yacosta738 Jan 19, 2024
38f6c31
fix(frontend): Vue UI component dynamic render
yacosta738 Jan 20, 2024
696f9ce
fix(frontend): Crud Subscriber Data Table
yacosta738 Jan 21, 2024
27b5aca
fix(frontend): Crud Subscriber Data Table
yacosta738 Jan 21, 2024
b6673b6
fix(frontend): global tailwind css
yacosta738 Jan 21, 2024
d59f512
fix(frontend): call backend get all subscriber endpoints
yacosta738 Jan 21, 2024
d209b97
fix(frontend): call backend get all subscriber endpoints
yacosta738 Jan 21, 2024
2139998
feat(backend): implement filter criteria and sort with pagination
yacosta738 Jan 24, 2024
6988966
feat(frontend): pagination in subscriber table
yacosta738 Jan 24, 2024
0786c57
feat(frontend): base select input
yacosta738 Jan 25, 2024
d8b2503
feat(frontend): base select input
yacosta738 Jan 25, 2024
96315cd
feat(frontend): implement filter for subscribers page
yacosta738 Jan 26, 2024
d16ae02
feat(frontend): implement filter for subscribers page
yacosta738 Jan 26, 2024
6da517a
feat(frontend): implement per-page on subscribers page
yacosta738 Jan 26, 2024
13a1697
feat(frontend): implement per-page on subscribers page
yacosta738 Jan 26, 2024
3b02304
feat(frontend): data table loader
yacosta738 Jan 26, 2024
f07ed22
feat(frontend): merge config for stylelint, eslint and prettier
yacosta738 Jan 27, 2024
75854cd
feat(frontend): merge config for stylelint, eslint and prettier
yacosta738 Jan 27, 2024
525ebc6
feat(frontend): dynamic filter component
yacosta738 Feb 8, 2024
3077906
test(frontend): dynamic filter component
yacosta738 Feb 9, 2024
f8a3f30
test(frontend): dynamic filter component
yacosta738 Feb 9, 2024
01b03ef
test(frontend): dynamic base data table and select components
yacosta738 Feb 9, 2024
d2e8b43
test(frontend): dynamic base data table and select components
yacosta738 Feb 9, 2024
056270a
test(frontend): remove console log
yacosta738 Feb 9, 2024
993bb4a
test(frontend): remove console log
yacosta738 Feb 9, 2024
49def2b
test(frontend): add global test script
yacosta738 Feb 9, 2024
680d086
test(frontend): add global test script
yacosta738 Feb 9, 2024
49aaa13
refactor(core): remove test on pre-commit hook
yacosta738 Feb 9, 2024
c506139
fix(frontend): hide add filter button after all filter rules are added.
yacosta738 Feb 10, 2024
abb4a28
fix(frontend): hide add filter button after all filter rules are added.
yacosta738 Feb 10, 2024
5ccb1bb
refactor(frontend): move pagination component to common ui module
yacosta738 Feb 10, 2024
bb97a4a
fix(frontend): add options to the converter property to field property
yacosta738 Feb 10, 2024
3518dae
fix(frontend): add options to the converter property to field property
yacosta738 Feb 10, 2024
b91d897
fix(frontend): add min height in the app layout
yacosta738 Feb 10, 2024
dca66c8
fix(frontend): add min height in the app layout
yacosta738 Feb 10, 2024
7d3154e
test(frontend): testing pagination
yacosta738 Feb 11, 2024
66303b9
test(frontend): testing pagination
yacosta738 Feb 11, 2024
8da387e
feat(frontend): create a new input component
yacosta738 Feb 11, 2024
d1537b8
feat(frontend): create a new input component
yacosta738 Feb 11, 2024
369e03c
feat(frontend): create a new input component
yacosta738 Feb 11, 2024
b425b93
feat(frontend): create a new input component
yacosta738 Feb 11, 2024
84278aa
feat(frontend): sort functionality by backend and frontend
yacosta738 Feb 11, 2024
7742776
feat(frontend): sort functionality by backend and frontend
yacosta738 Feb 11, 2024
b403427
feat: cursor pagination
yacosta738 Feb 25, 2024
ecb79a5
refactor: filter and sort parameters in SubscriberService
yacosta738 Feb 27, 2024
3cf2791
refactor: filter and sort parameters in SubscriberService
yacosta738 Feb 27, 2024
46043a8
chore: Update dependencies and build configurations
yacosta738 Feb 27, 2024
0cd3f1a
chore: Update dependencies and build configurations
yacosta738 Feb 27, 2024
62d6ef0
Merge remote-tracking branch 'origin/main' into embeds-forms
yacosta738 Feb 27, 2024
5aa695c
chore: renovate group dependencies
yacosta738 Feb 27, 2024
4622207
chore: Update dependencies
yacosta738 Feb 27, 2024
792123d
chore: Update dependencies
yacosta738 Feb 27, 2024
5e20a90
feat: replace tailwincss for unocss
yacosta738 Mar 2, 2024
49fa79a
feat: replace tailwincss for unocss
yacosta738 Mar 2, 2024
3507560
fix: stylelint cjs
yacosta738 Mar 2, 2024
e9745bf
feat: add new eslint rules for vue components
yacosta738 Mar 2, 2024
7f80d6f
Merge branch 'main' into embeds-forms
yacosta738 Mar 3, 2024
b770140
feat: add new eslint rules for vue components
yacosta738 Mar 3, 2024
783e3d4
fix: build process
yacosta738 Mar 3, 2024
eb8284b
Merge remote-tracking branch 'origin/embeds-forms' into embeds-forms
yacosta738 Mar 3, 2024
ee81bca
fix: build process fixed
yacosta738 Mar 4, 2024
30b083a
chore: merge from main
yacosta738 Mar 4, 2024
2dee471
chore: add revert and merge to the commit-msg git hook
yacosta738 Mar 4, 2024
ac63d3b
Merge branch 'main' into embeds-forms
yacosta738 Mar 4, 2024
532b0c6
refactor: script check and add composite check steps
yacosta738 Mar 4, 2024
8fcf2be
fix: add missing shell type
yacosta738 Mar 4, 2024
f05640a
chore: Update dependencies
yacosta738 Mar 4, 2024
f5cfc2e
refactor: replace gradle/gradle-build-action for gradle/actions/setup…
yacosta738 Mar 4, 2024
5a9d273
refactor: replace gradle/gradle-build-action for gradle/actions/setup…
yacosta738 Mar 4, 2024
6f00da3
feat: add node_version file
yacosta738 Mar 4, 2024
54bc011
Merge branch 'main' into embeds-forms
yacosta738 Mar 4, 2024
251cdf6
chore(actions): replace github-script with sticky-pr-comment
yacosta738 Mar 4, 2024
e438afb
chore(actions): replace github-script with sticky-pr-comment
yacosta738 Mar 4, 2024
72c20f2
chore(actions): update pnpm/action-setup@v3
yacosta738 Mar 4, 2024
93d2dfb
chore(actions): update permission to PR
yacosta738 Mar 5, 2024
20f1606
Merge branch 'main' into embeds-forms
yacosta738 Mar 5, 2024
b426ebc
fix(actions): recreate parameter on comment action properties
yacosta738 Mar 5, 2024
2abd98d
Merge remote-tracking branch 'origin/embeds-forms' into embeds-forms
yacosta738 Mar 5, 2024
8dcca0d
refactor: load theme script on common layout
yacosta738 Mar 5, 2024
f522441
refactor: load theme script on common layout
yacosta738 Mar 5, 2024
ebcd66c
test: set permissions in the step Add Build Scan URL as PR comment
yacosta738 Mar 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 53 additions & 3 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,67 @@ module.exports = {
es2022: true,
browser: true,
},
extends: ['eslint:recommended', 'plugin:astro/recommended'],
extends: [
'eslint:recommended',
'plugin:astro/recommended',
'plugin:astro/jsx-a11y-recommended',
'prettier',
],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
rules: {
'no-mixed-spaces-and-tabs': 'off',
},
settings: {
},
plugins: ['vue'],
settings: {},
overrides: [
{
files: ['*.vue'],
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 'latest',
sourceType: 'module',
},
extends: [
'eslint:recommended',
'plugin:vue/vue3-recommended',
'@vue/eslint-config-prettier',
'@vue/eslint-config-typescript',
],
rules: {
'vue/multi-word-component-names': 'off',
'vue/attribute-hyphenation': 'off',
'vue/v-on-event-hyphenation': 'off',

'vue/block-lang': ['error', { script: { lang: 'ts' } }],
'vue/block-order': ['error', { order: ['script[setup]', 'template', 'style[scoped]'] }],
'vue/block-tag-newline': [
'error',
{ singleline: 'always', multiline: 'always', maxEmptyLines: 1 },
],
'vue/component-api-style': ['error', ['script-setup']],
'vue/component-name-in-template-casing': [
'error',
'PascalCase',
{ registeredComponentsOnly: true },
],
'vue/component-options-name-casing': ['error', 'PascalCase'],
'vue/custom-event-name-casing': ['error', 'camelCase'],
'vue/define-emits-declaration': ['error', 'type-based'],
'vue/define-macros-order': [
'error',
{
order: ['defineOptions', 'defineModel', 'defineProps', 'defineEmits', 'defineSlots'],
defineExposeLast: true,
},
],
'vue/define-props-declaration': ['error', 'type-based'],
'vue/html-button-has-type': ['error', { button: true, submit: true, reset: true }],
},
},
{
files: ['*.astro'],
parser: 'astro-eslint-parser',
Expand Down
6 changes: 6 additions & 0 deletions .githooks/commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ convetional_commit_regex="^(build|chore|ci|docs|feat|fix|perf|refactor|revert|st
# temporary file which holds the message).
commit_message=$(cat "$1")

# Check if the commit message is a merge or revert commit
if [[ "$commit_message" =~ ^(Merge|Revert).* ]]; then
echo -e "\e[32mMerge or Revert commit, skipping validation...\e[0m"
exit 0
fi

# Check the message, if we match, all good baby.
if [[ "$commit_message" =~ $convetional_commit_regex ]]; then
echo -e "\e[32mCommit message meets Conventional Commit standards...\e[0m"
Expand Down
1 change: 0 additions & 1 deletion .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ git stash -q --keep-index
$PACKAGE_MANAGER install
$PACKAGE_MANAGER run format
$PACKAGE_MANAGER run lint
$PACKAGE_MANAGER run test

./gradlew detektAll --no-daemon --stacktrace

Expand Down
17 changes: 17 additions & 0 deletions .github/actions/check/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Check Project Integrity
description: |
This workflow checks the integrity of the project by running various checks
such as Validate Gradle wrapper, Install Tools & Dependencies, and Run Check.

runs:
using: composite
steps:
- name: Validate Gradle wrapper
uses: gradle/[email protected]

- name: Install Tools & Dependencies
uses: ./.github/actions/install/node

- name: Run Check
run: pnpm run check
shell: bash
21 changes: 10 additions & 11 deletions .github/actions/install/java/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ inputs:
default: 'projects'
github_token:
description: 'GITHUB_TOKEN'
default: '${{ github.token }}'
default: ${{ github.token }}

runs:
using: composite
Expand All @@ -30,21 +30,20 @@ runs:
shell: bash

- name: ⚙️ Setup Gradle 🐘
uses: gradle/[email protected]
uses: gradle/actions/setup-gradle@v3
id: gradle
with:
arguments: ${{ inputs.gradle-arguments }}
dependency-graph: generate-and-submit

- name: Add Build Scan URL as PR comment
uses: actions/github-script@v7
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request' && failure()
permissions:
pull-requests: write
with:
github-token: ${{ inputs.github_token }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '❌ ${{ github.workflow }} failed: ${{ steps.gradle.outputs.build-scan-url }}'
})
recreate: true
header: build-scan-url
message: |
❌ ${{ github.workflow }} failed: ${{ steps.gradle.outputs.build-scan-url }}
GITHUB_TOKEN: ${{ inputs.github_token }}
2 changes: 1 addition & 1 deletion .github/actions/install/node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ runs:
using: composite
steps:
- name: Setup PNPM
uses: pnpm/action-setup@v2.4.0
uses: pnpm/action-setup@v3

- name: Setup Node
uses: actions/setup-node@v4
Expand Down
17 changes: 5 additions & 12 deletions .github/workflows/deploy-main-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ permissions:
packages: write
contents: write
issues: write
pull-requests: write

jobs:
validation:
Expand All @@ -27,16 +28,8 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Validate Gradle wrapper
uses: gradle/[email protected]

- name: Install Tools & Dependencies
uses: ./.github/actions/install/node

- name: Run Check
run: pnpm run check

- name: Check Project Integrity
uses: ./.github/actions/check
build:
name: Build and Test 🧪
needs: [ validation ]
Expand All @@ -57,11 +50,11 @@ jobs:
with:
token: ${{ env.CI_GITHUB_TOKEN }}

- name: Install Java Tools & Dependencies
- name: Install Java Tools & Dependencies
uses: ./.github/actions/install/java
with:
java-version: 21
gradle-arguments: build --scan
gradle-arguments: build --scan --no-daemon --stacktrace

- name: Source code vulnerability scanning
uses: aquasecurity/trivy-action@master
Expand Down
14 changes: 4 additions & 10 deletions .github/workflows/dev-commit-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ permissions:
packages: write
contents: write
issues: write
pull-requests: write

jobs:
validation:
Expand All @@ -27,15 +28,8 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Validate Gradle wrapper
uses: gradle/[email protected]

- name: Install Tools & Dependencies
uses: ./.github/actions/install/node

- name: Run Check
run: pnpm run check
- name: Check Project Integrity
uses: ./.github/actions/check
build:
name: Build and Test 🧪
needs: [ validation ]
Expand All @@ -58,7 +52,7 @@ jobs:
uses: ./.github/actions/install/java
with:
java-version: 21
gradle-arguments: build --scan
gradle-arguments: build --scan --no-daemon --stacktrace

- name: Source code vulnerability scanning
uses: aquasecurity/trivy-action@master
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/pre-release-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,9 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check Project Integrity
uses: ./.github/actions/check

- name: Validate Gradle wrapper
uses: gradle/[email protected]

- name: Install Tools & Dependencies
uses: ./.github/actions/install/node

- name: Run Check
run: pnpm run check
build:
name: Build and Test 🧪
needs: [ validation ]
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
HELP.md
.gradle
build/
**/build/**
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/
Expand Down Expand Up @@ -37,8 +37,8 @@ out/
.vscode/

# build output
dist/

**/dist/
**/node/
# generated types
.astro/

Expand Down
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.11.1
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": true,
"plugins": ["prettier-plugin-astro", "prettier-plugin-tailwindcss"],
"plugins": ["prettier-plugin-astro", "prettier-plugin-tailwindcss", "eslint-plugin-prettier-vue"],
"overrides": [
{
"files": [".*", "*.json", "*.md", "*.mdx", "*.toml", "*.yml"],
Expand Down
3 changes: 3 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/build/*
**/node_modules/*
**/dist/*
1 change: 1 addition & 0 deletions apps/backend/backend.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ dependencies {
implementation("org.springframework:spring-r2dbc")
implementation("org.springframework.data:spring-data-r2dbc")
implementation("org.postgresql:r2dbc-postgresql")
runtimeOnly("org.postgresql:postgresql:42.3.1")

implementation(libs.spring.dotenv)
implementation(libs.sendgrid)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import org.springframework.context.annotation.FilterType

@SpringBootApplication
@ComponentScan(
basePackages = ["com.lyra"],
basePackages = ["com.lyra.*"],
basePackageClasses = [
EventConfiguration::class,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import com.lyra.app.newsletter.infrastructure.persistence.converter.SubscriberCo
import com.lyra.app.newsletter.infrastructure.persistence.converter.SubscriberStatusWriterConverter
import io.r2dbc.postgresql.codec.EnumCodec
import io.r2dbc.postgresql.codec.EnumCodec.Builder.RegistrationPriority
import io.r2dbc.postgresql.extension.CodecRegistrar
import io.r2dbc.spi.ConnectionFactoryOptions
import io.r2dbc.spi.Option
import org.slf4j.LoggerFactory
import org.springframework.boot.autoconfigure.r2dbc.ConnectionFactoryOptionsBuilderCustomizer
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
Expand All @@ -21,18 +21,19 @@ import org.springframework.transaction.annotation.EnableTransactionManagement

@Configuration
@EnableTransactionManagement
@EnableR2dbcRepositories
@EnableR2dbcRepositories(basePackages = ["com.lyra.*"])
@EnableR2dbcAuditing
class DatabaseConfig {
/**
* Use the customizer to add EnumCodec to R2DBC
*/
@Bean
fun connectionFactoryOptionsBuilderCustomizer(): ConnectionFactoryOptionsBuilderCustomizer {
log.debug("Adding EnumCodec to R2DBC")
return ConnectionFactoryOptionsBuilderCustomizer { builder: ConnectionFactoryOptions.Builder ->
builder.option(
Option.valueOf("extensions"),
listOf<CodecRegistrar>(
listOf(
EnumCodec.builder()
.withEnum("subscriber_status", SubscriberStatus::class.java)
.withRegistrationPriority(RegistrationPriority.FIRST)
Expand All @@ -47,6 +48,7 @@ class DatabaseConfig {
*/
@Bean
fun r2dbcCustomConversions(databaseClient: DatabaseClient): R2dbcCustomConversions {
log.debug("Registering custom converters to R2DBC")
val dialect = DialectResolver.getDialect(databaseClient.connectionFactory)
val converters: MutableList<Any?> = ArrayList(dialect.converters)
converters.addAll(R2dbcCustomConversions.STORE_CONVERTERS)
Expand All @@ -58,4 +60,8 @@ class DatabaseConfig {
),
)
}

companion object {
private val log = LoggerFactory.getLogger(DatabaseConfig::class.java)
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.lyra.app.newsletter.application

import com.lyra.app.newsletter.domain.Subscriber
import com.lyra.common.domain.bus.query.Response

data class SubscribersResponse(val subscribers: List<SubscriberResponse>) : Response
Expand All @@ -9,4 +10,17 @@ data class SubscriberResponse(
val email: String,
val name: String,
val status: String,
) : Response
val createdAt: String? = null,
val updatedAt: String? = null,
) : Response {
companion object {
fun from(subscriber: Subscriber) = SubscriberResponse(
id = subscriber.id.value.toString(),
email = subscriber.email.value,
name = subscriber.name.fullName(),
status = subscriber.status.name,
createdAt = subscriber.createdAt.toString(),
updatedAt = subscriber.updatedAt?.toString(),
)
}
}
Loading
Loading