Skip to content

Commit

Permalink
Merge pull request #3365 from harehare/add_button_to_lock_diagram_edi…
Browse files Browse the repository at this point in the history
…ting

v0.15.0
  • Loading branch information
harehare authored Dec 27, 2023
2 parents 395ca05 + e161b99 commit 3447ae8
Show file tree
Hide file tree
Showing 41 changed files with 628 additions and 562 deletions.
6 changes: 3 additions & 3 deletions backend/gqlgen.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
schema:
- graphql/*.graphql
exec:
filename: pkg/presentation/graphql/generated.go
filename: internal/presentation/graphql/generated.go
package: graphql
model:
filename: pkg/presentation/graphql/models.go
filename: internal/presentation/graphql/models.go
package: graphql
resolver:
filename: pkg/presentation/graphql/resolver.go
filename: internal/presentation/graphql/resolver.go
package: graphql
autobind: []
models:
Expand Down
2 changes: 2 additions & 0 deletions backend/graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ type Settings {
zoomControl: Boolean
scale: Float
toolbar: Boolean
lockEditing: Boolean
}

type Color {
Expand Down Expand Up @@ -137,6 +138,7 @@ input InputSettings {
zoomControl: Boolean = false
scale: Float = 1.0
toolbar: Boolean = true
lockEditing: Boolean = false
}

input InputColor {
Expand Down
1 change: 1 addition & 0 deletions backend/internal/domain/model/settings/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type Settings struct {
ZoomControl *bool `json:"zoomControl"`
Scale *float64 `json:"scale"`
Toolbar *bool `json:"toolbar"`
LockEditing *bool `json:"lockEditing"`
}

type Color struct {
Expand Down
253 changes: 130 additions & 123 deletions backend/internal/presentation/graphql/generated.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions backend/internal/presentation/graphql/models.go

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

4 changes: 4 additions & 0 deletions backend/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ embed-build:
go build -tags embed -o textusm-embed {{ main }}

generate:
go get golang.org/x/tools/go/packages
go get golang.org/x/tools/go/ast/astutil
go get golang.org/x/tools/imports
go get github.com/urfave/cli/v2
go generate {{ target }}

test:
Expand Down
4 changes: 2 additions & 2 deletions frontend/package-lock.json

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

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "textusm",
"description": "Online tool for Generate a User Story Mapping from indented text.",
"version": "0.14.4",
"version": "0.14.5",
"author": "harehare",
"bugs": {
"url": "https://github.com/harehare/textusm/issues"
Expand Down
8 changes: 5 additions & 3 deletions frontend/src/Graphql/Graphql/InputObject.elm
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ buildInputSettings required____ fillOptionals____ =
let
optionals____ =
fillOptionals____
{ textColor = Absent, zoomControl = Absent, scale = Absent, toolbar = Absent }
{ textColor = Absent, zoomControl = Absent, scale = Absent, toolbar = Absent, lockEditing = Absent }
in
{ font = required____.font, width = required____.width, height = required____.height, backgroundColor = required____.backgroundColor, activityColor = required____.activityColor, taskColor = required____.taskColor, storyColor = required____.storyColor, lineColor = required____.lineColor, labelColor = required____.labelColor, textColor = optionals____.textColor, zoomControl = optionals____.zoomControl, scale = optionals____.scale, toolbar = optionals____.toolbar }
{ font = required____.font, width = required____.width, height = required____.height, backgroundColor = required____.backgroundColor, activityColor = required____.activityColor, taskColor = required____.taskColor, storyColor = required____.storyColor, lineColor = required____.lineColor, labelColor = required____.labelColor, textColor = optionals____.textColor, zoomControl = optionals____.zoomControl, scale = optionals____.scale, toolbar = optionals____.toolbar, lockEditing = optionals____.lockEditing }


type alias InputSettingsRequiredFields =
Expand All @@ -174,6 +174,7 @@ type alias InputSettingsOptionalFields =
, zoomControl : OptionalArgument Bool
, scale : OptionalArgument Float
, toolbar : OptionalArgument Bool
, lockEditing : OptionalArgument Bool
}


Expand All @@ -193,6 +194,7 @@ type alias InputSettings =
, zoomControl : OptionalArgument Bool
, scale : OptionalArgument Float
, toolbar : OptionalArgument Bool
, lockEditing : OptionalArgument Bool
}


Expand All @@ -201,7 +203,7 @@ type alias InputSettings =
encodeInputSettings : InputSettings -> Value
encodeInputSettings input____ =
Encode.maybeObject
[ ( "font", Encode.string input____.font |> Just ), ( "width", Encode.int input____.width |> Just ), ( "height", Encode.int input____.height |> Just ), ( "backgroundColor", Encode.string input____.backgroundColor |> Just ), ( "activityColor", encodeInputColor input____.activityColor |> Just ), ( "taskColor", encodeInputColor input____.taskColor |> Just ), ( "storyColor", encodeInputColor input____.storyColor |> Just ), ( "lineColor", Encode.string input____.lineColor |> Just ), ( "labelColor", Encode.string input____.labelColor |> Just ), ( "textColor", Encode.string |> Encode.optional input____.textColor ), ( "zoomControl", Encode.bool |> Encode.optional input____.zoomControl ), ( "scale", Encode.float |> Encode.optional input____.scale ), ( "toolbar", Encode.bool |> Encode.optional input____.toolbar ) ]
[ ( "font", Encode.string input____.font |> Just ), ( "width", Encode.int input____.width |> Just ), ( "height", Encode.int input____.height |> Just ), ( "backgroundColor", Encode.string input____.backgroundColor |> Just ), ( "activityColor", encodeInputColor input____.activityColor |> Just ), ( "taskColor", encodeInputColor input____.taskColor |> Just ), ( "storyColor", encodeInputColor input____.storyColor |> Just ), ( "lineColor", Encode.string input____.lineColor |> Just ), ( "labelColor", Encode.string input____.labelColor |> Just ), ( "textColor", Encode.string |> Encode.optional input____.textColor ), ( "zoomControl", Encode.bool |> Encode.optional input____.zoomControl ), ( "scale", Encode.float |> Encode.optional input____.scale ), ( "toolbar", Encode.bool |> Encode.optional input____.toolbar ), ( "lockEditing", Encode.bool |> Encode.optional input____.lockEditing ) ]


buildInputShareItem :
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/Graphql/Graphql/Object/Settings.elm
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,8 @@ scale =
toolbar : SelectionSet (Maybe Bool) Graphql.Object.Settings
toolbar =
Object.selectionForField "(Maybe Bool)" "toolbar" [] (Decode.bool |> Decode.nullable)


lockEditing : SelectionSet (Maybe Bool) Graphql.Object.Settings
lockEditing =
Object.selectionForField "(Maybe Bool)" "lockEditing" [] (Decode.bool |> Decode.nullable)
1 change: 1 addition & 0 deletions frontend/src/elm/Api/Graphql/Selection.elm
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ settingsSelection =
|> with Graphql.Object.Settings.zoomControl
|> with (SelectionSet.map (Maybe.map Scale.fromFloat) Graphql.Object.Settings.scale)
|> with Graphql.Object.Settings.toolbar
|> with Graphql.Object.Settings.lockEditing


colorSelection : SelectionSet DiagramSettings.ColorSetting Graphql.Object.Color
Expand Down
Loading

0 comments on commit 3447ae8

Please sign in to comment.