Skip to content

Commit

Permalink
chore(editor): remove old editor interface
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Bétrancourt <[email protected]>
  • Loading branch information
rclsilver committed Apr 28, 2023
1 parent 9290d3c commit 5343a29
Show file tree
Hide file tree
Showing 52 changed files with 3 additions and 27,198 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ ui/dashboard/coverage
ui/dashboard/dist.tar.gz
ui/dashboard/node_modules
ui/dashboard/src/environments/environment.ts
ui/editor/dist
ui/editor/dist.tar.gz
ui/editor/node_modules

# Related to config
config/*
Expand Down
7 changes: 1 addition & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,18 @@ COPY ./ui /home/node/ui
WORKDIR /home/node/ui/dashboard
RUN BASEHREF=___UTASK_DASHBOARD_BASEHREF___ PREFIX_API_BASE_URL=___UTASK_DASHBOARD_PREFIXAPIBASEURL___ SENTRY_DSN=___UTASK_DASHBOARD_SENTRY_DSN___ make build-prod

# editor
WORKDIR /home/node/ui/editor
RUN BASEHREF=___UTASK_EDITOR_BASEHREF___ SENTRY_DSN=___UTASK_DASHBOARD_SENTRY_DSN___ make build-prod

FROM golang:1.19

COPY . /go/src/github.com/ovh/utask
WORKDIR /go/src/github.com/ovh/utask
RUN make re && \
mv hack/Makefile-child Makefile && \
mkdir -p /app/plugins /app/templates /app/config /app/init /app/static/dashboard /app/static/editor && \
mkdir -p /app/plugins /app/templates /app/config /app/init /app/static/dashboard && \
mv hack/wait-for-it/wait-for-it.sh /wait-for-it.sh && \
chmod +x /wait-for-it.sh
WORKDIR /app

COPY --from=js-builder /home/node/ui/dashboard/dist/utask-ui/ /app/static/dashboard/
COPY --from=js-builder /home/node/ui/editor/dist/utask-editor/ /app/static/editor/

RUN cp /go/src/github.com/ovh/utask/utask /app/utask && \
chmod +x /app/utask && \
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -816,9 +816,9 @@ To visualize API routes, a swagger-ui interface is available with the docker ima

### Frontend

µTask serves two graphical interfaces: one for general use of the tool (`dashboard`), the other one for task template authoring (`editor`). They're found in the `ui` folder and each have their own Makefile for development purposes.
µTask serves a graphical interface for general use of the tool (`dashboard`). It is found in the `ui` folder and has its own Makefile for development purposes.

Run `make dev` to launch a live-reloading on your machine. The editor is a standalone GUI, while the dashboard needs a backing µTask api (see above to run a server).
Run `make dev` to launch a live-reloading on your machine. The dashboard needs a backing µTask api (see above to run a server).

### Run the tests

Expand Down
1 change: 0 additions & 1 deletion api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ func TestMain(m *testing.M) {
srv.SetDashboardPathPrefix("")
srv.SetDashboardAPIPathPrefix("")
srv.SetDashboardSentryDSN("")
srv.SetEditorPathPrefix("")

go srv.ListenAndServe()
srvx := &http.Server{Addr: fmt.Sprintf(":%d", utask.FPort)}
Expand Down
14 changes: 0 additions & 14 deletions api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ type Server struct {
dashboardPathPrefix string
dashboardAPIPathPrefix string
dashboardSentryDSN string
editorPathPrefix string
maxBodyBytes int64
customMiddlewares []gin.HandlerFunc
pluginRoutes []PluginRouterGroup
Expand Down Expand Up @@ -107,13 +106,6 @@ func (s *Server) SetDashboardSentryDSN(dashboardSentryDSN string) {
s.dashboardSentryDSN = dashboardSentryDSN
}

// SetEditorPathPrefix configures a custom path prefix for editor static files hosting.
// It doesn't change the path used by utask API to serve the files, it's only used inside UI files
// in order that editor can be aware of a ProxyPass configuration.
func (s *Server) SetEditorPathPrefix(editorPathPrefix string) {
s.editorPathPrefix = editorPathPrefix
}

// SetMaxBodyBytes
func (s *Server) SetMaxBodyBytes(max int64) {
s.maxBodyBytes = max
Expand Down Expand Up @@ -193,12 +185,6 @@ func (s *Server) build(ctx context.Context) {
s.dashboardSentryDSN)).
StaticFS("/ui/dashboard", http.Dir("./static/dashboard"))

ginEngine.Group("/",
StaticFilePatternReplaceMiddleware(
"___UTASK_EDITOR_BASEHREF___",
generateBaseHref(s.editorPathPrefix, "/ui/editor"))).
StaticFS("/ui/editor", http.Dir("./static/editor"))

ginEngine.
Group("/",
StaticFilePatternReplaceMiddleware(
Expand Down
1 change: 0 additions & 1 deletion cmd/utask/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ var rootCmd = &cobra.Command{
}
server.SetDashboardPathPrefix(cfg.DashboardPathPrefix)
server.SetDashboardAPIPathPrefix(cfg.DashboardAPIPathPrefix)
server.SetEditorPathPrefix(cfg.EditorPathPrefix)
server.SetDashboardSentryDSN(cfg.DashboardSentryDSN)
server.SetMaxBodyBytes(cfg.ServerOptions.MaxBodyBytes)

Expand Down
3 changes: 0 additions & 3 deletions config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,6 @@ postgres://user:pass@db/utask?sslmode=disable
// dashboard_path_prefix defines the path prefix for the dashboard UI. Should be used if the uTask instance is hosted with a ProxyPass, on a custom path
// default: empty, no prefix
"dashboard_path_prefix": "/my-utask-instance",
// editor_path_prefix defines the path prefix for the editor UI. Should be used if the uTask instance is hosted with a ProxyPass, on a custom path
// default: empty, no prefix
"editor_path_prefix": "/my-utask-instance",
// dashboard_api_path_prefix defines the path prefix for the uTask API. Should be used if the uTask instance is hosted with a ProxyPass, on a custom path.
// dashboard_api_path_prefix will be used by Dashboard UI to contact the uTask API
// default: empty, no prefix
Expand Down
1 change: 0 additions & 1 deletion pkg/plugins/builtin/callback/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ func TestMain(m *testing.M) {
srv.SetDashboardPathPrefix("")
srv.SetDashboardAPIPathPrefix("")
srv.SetDashboardSentryDSN("")
srv.SetEditorPathPrefix("")

svc := &plugins.Service{Store: store, Server: srv}

Expand Down
1 change: 0 additions & 1 deletion ui/editor/.gitignore

This file was deleted.

49 changes: 0 additions & 49 deletions ui/editor/Makefile

This file was deleted.

27 changes: 0 additions & 27 deletions ui/editor/README.md

This file was deleted.

134 changes: 0 additions & 134 deletions ui/editor/angular.json

This file was deleted.

12 changes: 0 additions & 12 deletions ui/editor/browserslist

This file was deleted.

32 changes: 0 additions & 32 deletions ui/editor/e2e/protractor.conf.js

This file was deleted.

Loading

0 comments on commit 5343a29

Please sign in to comment.