Skip to content

Commit

Permalink
feat: allow fivenet to use own users, jobs, etc., tables
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Trost <[email protected]>
  • Loading branch information
galexrt committed Jan 8, 2025
1 parent 86c76d0 commit 0fd794b
Show file tree
Hide file tree
Showing 61 changed files with 321 additions and 520 deletions.
7 changes: 6 additions & 1 deletion app/components/auth/CharacterSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ const onSubmitThrottle = useThrottleFn(async (charId: number) => {
:error="error"
:retry="refresh"
/>
<DataNoDataBlock v-else-if="!chars || chars.length === 0" :type="$t('common.character', 2)" />
<DataNoDataBlock
v-else-if="!chars || chars.length === 0"
:type="$t('common.character', 2)"
:retry="refresh"
class="w-full min-w-64"
/>

<UCarousel
v-else
Expand Down
15 changes: 11 additions & 4 deletions gen/go/proto/services/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ import (

var (
tAccounts = table.FivenetAccounts
tUsers = tables.Users.AS("user")
tUserProps = table.FivenetUserProps.AS("user_props")
tJobs = tables.Jobs
tJobGrades = tables.JobGrades
tJobProps = table.FivenetJobProps.AS("jobprops")
)

Expand Down Expand Up @@ -486,6 +483,10 @@ func (s *Server) GetCharacters(ctx context.Context, req *GetCharactersRequest) (
}

// Load chars from database
tUsers := tables.Users().AS("user")
tJobs := tables.Jobs()
tJobGrades := tables.JobGrades()

stmt := tUsers.
SELECT(
tUsers.ID,
Expand Down Expand Up @@ -571,6 +572,10 @@ func buildCharSearchIdentifier(license string) string {
}

func (s *Server) getCharacter(ctx context.Context, charId int32) (*users.User, *users.JobProps, string, error) {
tUsers := tables.Users().AS("user")
tJobs := tables.Jobs()
tJobGrades := tables.JobGrades()

stmt := tUsers.
SELECT(
tUsers.ID,
Expand Down Expand Up @@ -839,7 +844,9 @@ func (s *Server) SetSuperUserMode(ctx context.Context, req *SetSuperUserModeRequ
}

func (s *Server) getJobWithProps(ctx context.Context, jobName string) (*users.Job, int32, *users.JobProps, error) {
tJobs := tJobs.AS("job")
tJobs := tables.Jobs().AS("job")
tJobGrades := tables.JobGrades()

stmt := tJobs.
SELECT(
tJobs.Name,
Expand Down
4 changes: 0 additions & 4 deletions gen/go/proto/services/calendar/calendar.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/fivenet-app/fivenet/pkg/perms"
"github.com/fivenet-app/fivenet/pkg/server/audit"
"github.com/fivenet-app/fivenet/pkg/storage"
"github.com/fivenet-app/fivenet/pkg/utils/dbutils/tables"
"github.com/fivenet-app/fivenet/query/fivenet/table"
"go.uber.org/fx"
"google.golang.org/grpc"
Expand All @@ -29,9 +28,6 @@ var (
tCJobAccess = table.FivenetCalendarJobAccess.AS("calendar_job_access")
tCUserAccess = table.FivenetCalendarUserAccess.AS("calendar_user_access")

tUsers = tables.Users.AS("user_short")
tCreator = tUsers.AS("creator")

tUserProps = table.FivenetUserProps
)

Expand Down
Loading

0 comments on commit 0fd794b

Please sign in to comment.