Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion cmd/fireback/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ var xapp = &fireback.FirebackApp{
abac.AppMenuSyncSeeders()
},

InjectSearchEndpoint: fireback.InjectReactiveSearch,
PublicFolders: []fireback.PublicFolderInfo{
// You can set a series of static folders to be served along with fireback.
// This is only for static content. For advanced MVX render templates, you need to
Expand Down
108 changes: 0 additions & 108 deletions e2e/react-bed/src/sdk/modules/abac/useReactivereactiveSearch.ts

This file was deleted.

41 changes: 41 additions & 0 deletions e2e/react-bed/src/sdk/modules/fireback/ReactiveSearch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { WebSocketX } from "../../sdk/common/WebSocketX";
import { buildUrl } from "../../sdk/common/buildUrl";
import { useWebSocketX } from "../../sdk/react/useWebSocketX";
/**
* Action to communicate with the action ReactiveSearch
*/
export type ReactiveSearchActionOptions = {
queryKey?: unknown[];
qs?: URLSearchParams;
};
export const useReactiveSearchAction = (options?: {
qs?: URLSearchParams;
overrideUrl?: string;
}) => {
return useWebSocketX(() =>
ReactiveSearchAction.Create(options?.overrideUrl, options?.qs),
);
};
/**
* ReactiveSearchAction
*/
export class ReactiveSearchAction {
//
static URL = "/reactive-search";
static NewUrl = (qs?: URLSearchParams) =>
buildUrl(ReactiveSearchAction.URL, undefined, qs);
static Method = "reactive";
static Create = (overrideUrl?: string, qs?: URLSearchParams) => {
const url = overrideUrl ?? ReactiveSearchAction.NewUrl(qs);
return new WebSocketX<unknown, unknown>(url, undefined, {
MessageFactoryClass: undefined,
});
};
static Definition = {
name: "ReactiveSearch",
url: "/reactive-search",
method: "reactive",
description:
"Reactive search is a general purpose search mechanism for different modules, and could be used in mobile apps or front-end to quickly search for a entity.",
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ var xapp = &fireback.FirebackApp{

},

InjectSearchEndpoint: fireback.InjectReactiveSearch,
PublicFolders: []fireback.PublicFolderInfo{
PublicFolders: []fireback.PublicFolderInfo{
// You can set a series of static folders to be served along with fireback.
// This is only for static content. For advanced MVX render templates, you need to
// Bootstrap those themes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ var xapp = &fireback.FirebackApp{

},

InjectSearchEndpoint: fireback.InjectReactiveSearch,
PublicFolders: []fireback.PublicFolderInfo{
PublicFolders: []fireback.PublicFolderInfo{
// You can set a series of static folders to be served along with fireback.
// This is only for static content. For advanced MVX render templates, you need to
// Bootstrap those themes
Expand Down
29 changes: 0 additions & 29 deletions modules/abac/AbacCustomActions.dyno.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,18 +236,6 @@ var SignoutActionCmd cli.Command = cli.Command{
fireback.HandleActionInCli(c, result, err, map[string]map[string]string{})
},
}
var ReactiveSearchSecurityModel *fireback.SecurityModel = nil
var ReactiveSearchActionImp = fireback.DefaultEmptyReactiveAction

// Reactive action does not have that
var ReactiveSearchActionCmd cli.Command = cli.Command{
Name: "reactive-search",
Usage: `Reactive search is a general purpose search mechanism for different modules, and could be used in mobile apps or front-end to quickly search for a entity.`,
Action: func(c *cli.Context) {
query := fireback.CommonCliQueryDSLBuilderAuthorize(c, ReactiveSearchSecurityModel)
fireback.CliReactivePipeHandler(query, ReactiveSearchActionImp)
},
}
var ImportUserSecurityModel *fireback.SecurityModel = nil

type ImportUserActionReqDto struct {
Expand Down Expand Up @@ -1303,21 +1291,6 @@ func AbacCustomActions() []fireback.Module3Action {
Entity: "",
},
},
{
Method: "REACTIVE",
Url: "reactive-search",
SecurityModel: ReactiveSearchSecurityModel,
Name: "reactiveSearch",
Description: "Reactive search is a general purpose search mechanism for different modules, and could be used in mobile apps or front-end to quickly search for a entity.",
Handlers: []gin.HandlerFunc{
fireback.ReactiveSocketHandler(ReactiveSearchActionImp),
},
Format: "REACTIVE",
ResponseEntity: string(""),
Out: &fireback.Module3ActionBody{
Entity: "",
},
},
{
Method: "POST",
Url: "/user/import",
Expand Down Expand Up @@ -1465,7 +1438,6 @@ var AbacCustomActionsCli = []cli.Command{
UserInvitationsActionCmd,
QueryUserRoleWorkspacesActionCmd,
SignoutActionCmd,
ReactiveSearchActionCmd,
ImportUserActionCmd,
SendEmailActionCmd,
SendEmailWithProviderActionCmd,
Expand Down Expand Up @@ -1504,7 +1476,6 @@ var AbacCliActionsBundle = &fireback.CliActionsBundle{
UserInvitationsActionCmd,
QueryUserRoleWorkspacesActionCmd,
SignoutActionCmd,
ReactiveSearchActionCmd,
ImportUserActionCmd,
SendEmailActionCmd,
SendEmailWithProviderActionCmd,
Expand Down
60 changes: 27 additions & 33 deletions modules/abac/AbacModule.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,33 @@ func AppMenuWriteQueryCteMock(ctx fireback.MockQueryContext) {
}
}

func workspaceModuleCore(module *fireback.ModuleProvider) {
type MicroserviceSetupConfig struct {
AuthorizationResolver WithAuthorizationPureImpl
}

// Inject this into any project as a complete solution
func AbacCompleteModules() []*fireback.ModuleProvider {
return []*fireback.ModuleProvider{
WorkspaceModuleSetup(),
DriveModuleSetup(),
NotificationModuleSetup(),
PassportsModuleSetup(),
}
}

func WorkspaceModuleSetup() *fireback.ModuleProvider {

// Default Fireback authorization. You can Override this on microservices
fireback.WithAuthorizationPure = WithAuthorizationPureDefault
fireback.WithAuthorizationFn = WithAuthorizationFn
fireback.WithSocketAuthorization = WithSocketAuthorization

module := &fireback.ModuleProvider{
Name: "abac",
Definitions: &Module3Definitions,
OnEnvInit: OnInitEnvHook,
GoMigrateDirectory: &migrations.MigrationsFs,
}

module.ProvidePermissionHandler(
ALL_WORKSPACE_CONFIG_PERMISSIONS,
Expand Down Expand Up @@ -88,38 +114,6 @@ func workspaceModuleCore(module *fireback.ModuleProvider) {
return RepairTheWorkspaces()
})

}

type MicroserviceSetupConfig struct {
AuthorizationResolver WithAuthorizationPureImpl
}

// Inject this into any project as a complete solution
func AbacCompleteModules() []*fireback.ModuleProvider {
return []*fireback.ModuleProvider{
WorkspaceModuleSetup(),
DriveModuleSetup(),
NotificationModuleSetup(),
PassportsModuleSetup(),
}
}

func WorkspaceModuleSetup() *fireback.ModuleProvider {

// Default Fireback authorization. You can Override this on microservices
fireback.WithAuthorizationPure = WithAuthorizationPureDefault
fireback.WithAuthorizationFn = WithAuthorizationFn
fireback.WithSocketAuthorization = WithSocketAuthorization

module := &fireback.ModuleProvider{
Name: "abac",
Definitions: &Module3Definitions,
OnEnvInit: OnInitEnvHook,
GoMigrateDirectory: &migrations.MigrationsFs,
}

workspaceModuleCore(module)

module.ProvideMockWriterHandler(func(languages []string) {
// WorkspaceTypeWriteQueryMock(MockQueryContext{Languages: languages})
// GsmProviderWriteQueryMock(MockQueryContext{Languages: languages})
Expand Down
23 changes: 0 additions & 23 deletions modules/abac/AbacModule3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,22 +72,6 @@ dtom:
type: string
- name: workspaceTypeId
type: string
- name: reactiveSearchResult
fields:
- type: string
name: uniqueId
- type: string
name: phrase
- type: string
name: icon
- type: string
name: description
- type: string
name: group
- type: string
name: uiLocation
- type: string
name: actionFn
- name: assignRole
fields:
- name: roleId
Expand Down Expand Up @@ -651,13 +635,6 @@ actions:
description: Signout the user, clears cookies or does anything else if needed.
method: post

- name: reactiveSearch
description:
Reactive search is a general purpose search mechanism for different modules,
and could be used in mobile apps or front-end to quickly search for a entity.
url: reactive-search
method: reactive
format: reactive
- name: importUser
url: /user/import
method: post
Expand Down
10 changes: 0 additions & 10 deletions modules/abac/ReactiveSearchAction.go

This file was deleted.

Loading
Loading