-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add new visibility value: "unlisted"
move visibility enum into its own package as its shared among 3 kinds of resource
- Loading branch information
1 parent
3be2653
commit aa76f69
Showing
24 changed files
with
181 additions
and
171 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1921,6 +1921,7 @@ components: | |
type: string | ||
enum: | ||
- draft | ||
- unlisted | ||
- review | ||
- published | ||
|
||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package visibility | ||
|
||
import ( | ||
"github.com/Southclaws/storyden/internal/ent/collection" | ||
"github.com/Southclaws/storyden/internal/ent/node" | ||
"github.com/Southclaws/storyden/internal/ent/post" | ||
) | ||
|
||
//go:generate go run -mod=mod github.com/Southclaws/enumerator | ||
|
||
type visibilityEnum string | ||
|
||
const ( | ||
visibilityDraft visibilityEnum = "draft" | ||
visibilityUnlisted visibilityEnum = "unlisted" | ||
visibilityReview visibilityEnum = "review" | ||
visibilityPublished visibilityEnum = "published" | ||
) | ||
|
||
func NewVisibilityFromEnt[T post.Visibility | node.Visibility | collection.Visibility](in T) Visibility { | ||
return Visibility{visibilityEnum(in)} | ||
} |
2 changes: 1 addition & 1 deletion
2
app/resources/post/post_enum_gen.go → ...sources/visibility/visibility_enum_gen.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
Oops, something went wrong.