Skip to content

Commit

Permalink
Merge commit '45f7396507a0a38989ebab4027646c9804c63016'
Browse files Browse the repository at this point in the history
  • Loading branch information
diyor28 committed Feb 25, 2025
2 parents 9d8d224 + 45f7396 commit 2760ff8
Show file tree
Hide file tree
Showing 84 changed files with 1,779 additions and 3,225 deletions.
14 changes: 11 additions & 3 deletions .air.testing.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,24 @@ testdata_dir = "testdata"

[build]
cmd = "go test -v ./..."
args = [] # Replace default args with test command
args = [] # Replace default args with test command
# Binary name after build (not used in this setup)
bin = ""
# Specify working directory if needed
full_bin = ""
# Timeout for the build process
delay = 2000 # in milliseconds
delay = 2000 # in milliseconds
kill_signal = "SIGINT"
# Patterns to watch
exclude_dir = ["tmp", "vendor", "testdata", "postgres-data", "static", "py-embed", "e2e"]
exclude_dir = [
"tmp",
"vendor",
"testdata",
"postgres-data",
"static",
"py-embed",
"e2e",
]
exclude_file = []
exclude_regex = []
exclude_unchanged = false
Expand Down
20 changes: 17 additions & 3 deletions .air.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,28 @@ args_bin = []
bin = "./tmp/main"
cmd = "go build -o ./tmp/main cmd/server/main.go"
delay = 1000
exclude_dir = ["tmp", "vendor", "testdata", "postgres-data", "static", "py-embed", "e2e"]
exclude_file = []
exclude_dir = [
"tmp",
"vendor",
"testdata",
"postgres-data",
"static",
"py-embed",
"e2e",
]
exclude_file = [
".air.toml",
".air.testing.toml",
"compose.yml",
"compose.dev.yml",
"compose.testing.yml",
]
exclude_regex = ["_test.go"]
exclude_unchanged = false
follow_symlink = false
full_bin = ""
include_dir = []
include_ext = ["go", "html", "json", "js", "css"]
include_ext = ["go", "html", "json", "js", "css", "toml", "yml", "yaml"]
include_file = []
kill_delay = "0s"
log = "build-errors.log"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
- name: Test Makefile targets
# running seeds twice to verify that they are idempotent
run: |
make migrate-up
make migrate up
make seed
make seed
make css
Expand Down Expand Up @@ -123,4 +123,4 @@ jobs:
- name: Test database migrate down
# e2e tests require database to have the seed data. We can only down the migrations after cypress.
run: |
make migrate-down
make migrate down
18 changes: 7 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,8 @@ localdb:
clear-localdb:
rm -rf postgres-data/

# Apply database migrations (up)
migrate-up:
go run cmd/migrate/main.go up

# Downgrade database migrations (down)
migrate-down:
go run cmd/migrate/main.go down
migrate:
go run cmd/migrate/main.go $(filter-out $@,$(MAKECMDGOALS))

# Compile TailwindCSS (with watch)
css-watch:
Expand All @@ -74,9 +69,6 @@ release-local:
clean:
rm -rf $(TAILWIND_OUTPUT)

# Full setup
setup: deps localdb migrate-up css lint

## Linter targets
#.PHONY: build-iota-linter run-iota-linter clean-iota-linter

Expand All @@ -102,4 +94,8 @@ build-docker-base:
build-docker-prod:
docker buildx build --push --platform linux/amd64,linux/arm64 -t iotauz/sdk:$v --target production .

.PHONY: default deps test test-watch localdb migrate-up migrate-down dev css-watch css lint release release-local clean setup build-iota-linter run-iota-linter clean-iota-linter collect-migrations
# Prevents make from treating the argument as an undefined target
%:
@:

.PHONY: default deps test test-watch localdb migrate migrate-down dev css-watch css lint release release-local clean setup build-iota-linter run-iota-linter clean-iota-linter collect-migrations
2 changes: 2 additions & 0 deletions cmd/seed/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
coreseed "github.com/iota-uz/iota-sdk/modules/core/seed"
"github.com/iota-uz/iota-sdk/modules/crm"
"github.com/iota-uz/iota-sdk/modules/finance"
"github.com/iota-uz/iota-sdk/modules/hrm"
"github.com/iota-uz/iota-sdk/modules/warehouse"
"github.com/iota-uz/iota-sdk/modules/website"
"github.com/iota-uz/iota-sdk/pkg/application"
Expand Down Expand Up @@ -52,6 +53,7 @@ func main() {
}
app.RegisterNavItems(core.NavItems...)
app.RegisterNavItems(bichat.NavItems...)
app.RegisterNavItems(hrm.NavItems...)
app.RegisterNavItems(finance.NavItems...)
app.RegisterNavItems(warehouse.NavItems...)
app.RegisterNavItems(crm.NavItems...)
Expand Down
2 changes: 2 additions & 0 deletions cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/iota-uz/iota-sdk/modules/core/presentation/controllers"
"github.com/iota-uz/iota-sdk/modules/crm"
"github.com/iota-uz/iota-sdk/modules/finance"
"github.com/iota-uz/iota-sdk/modules/hrm"
"github.com/iota-uz/iota-sdk/modules/warehouse"
"github.com/iota-uz/iota-sdk/modules/website"
"github.com/iota-uz/iota-sdk/pkg/application"
Expand Down Expand Up @@ -49,6 +50,7 @@ func main() {
}
app.RegisterNavItems(core.NavItems...)
app.RegisterNavItems(bichat.NavItems...)
app.RegisterNavItems(hrm.NavItems...)
app.RegisterNavItems(warehouse.NavItems...)
app.RegisterNavItems(finance.NavItems...)
app.RegisterNavItems(crm.NavItems...)
Expand Down
63 changes: 60 additions & 3 deletions components/base/dialog/drawer.templ
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package dialog

import "fmt"
import (
"fmt"
icons "github.com/iota-uz/icons/phosphor"
)

type Direction int

Expand All @@ -19,16 +22,27 @@ var directions = map[Direction]string{
}

type DrawerProps struct {
ID string
Open bool
Direction Direction
Action string
Attrs templ.Attributes
Classes templ.CSSClasses
}

templ Drawer(props DrawerProps) {
{{
listener := fmt.Sprintf("@%s.window", props.Action)
attrs := templ.Attributes{
"x-data": templ.SafeScriptInline("dialog", props.Open),
listener: "toggle",
}
if props.ID != "" {
attrs["id"] = props.ID
}
}}
<div
x-data="dialog"
{ templ.Attributes{fmt.Sprintf("@%s.window", props.Action): "toggle"}... }
{ attrs... }
>
<dialog
x-bind="dialog"
Expand All @@ -46,3 +60,46 @@ templ Drawer(props DrawerProps) {
</dialog>
</div>
}

type StdDrawerProps struct {
ID string
Title string
Action string
Open bool
Attrs templ.Attributes
}

templ StdViewDrawer(props StdDrawerProps) {
@Drawer(DrawerProps{
ID: props.ID,
Direction: RTL,
Open: props.Open,
Action: props.Action,
Classes: templ.Classes("flex items-stretch"),
Attrs: props.Attrs,
}) {
<div class="bg-white w-3/4 md:w-2/3 ml-auto">
<form
method="dialog"
class="flex flex-col h-full"
>
<div
class={
"flex justify-between px-4 py-3",
"border-b border-primary",
}
>
<h3 class="font-medium">
{ props.Title }
</h3>
<div>
<button class="cursor-pointer">
@icons.XCircle(icons.Props{Size: "20"})
</button>
</div>
</div>
{ children... }
</form>
</div>
}
}
136 changes: 133 additions & 3 deletions components/base/dialog/drawer_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2760ff8

Please sign in to comment.