Skip to content

Commit adef183

Browse files
authored
#140: make UI layout root name dynamic (#141)
1 parent ff22704 commit adef183

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

client/src/components/ActionsFlow.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
Background,
1515
BackgroundVariant,
1616
} from '@xyflow/react'
17+
import { sentenceCase } from "../utils/helpers";
1718
import { getCustomisation } from '../utils/page-customisation'
1819
import { GetListResponse } from '@refinedev/core'
1920
import { FC } from 'react'
@@ -30,7 +31,7 @@ const nameText =
3031
const initialRoots: Node[] = [
3132
{
3233
id: 'start',
33-
data: { label: nameText },
34+
data: { label: sentenceCase(nameText) },
3435
position: { x: 0, y: 0 },
3536
sourcePosition: Position.Right,
3637
targetPosition: Position.Right,

server/api.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ import (
2424
"github.com/launchrctl/launchr/pkg/action"
2525
)
2626

27+
// customizationPlatformNameKey used to set the layout-flow root name
28+
const customizationPlatformNameKey = "plasmactl_web_ui_platform_name"
29+
2730
type launchrServer struct {
2831
action.WithLogger
2932
action.WithTerm
@@ -67,6 +70,11 @@ func parseVarsFile(path string) (map[string]interface{}, error) {
6770

6871
func (l *launchrServer) GetCustomisationConfig(w http.ResponseWriter, _ *http.Request) {
6972
customisation := make(CustomisationConfig)
73+
currentDir, err := os.Getwd()
74+
if err == nil {
75+
customisation[customizationPlatformNameKey] = filepath.Base(currentDir)
76+
}
77+
7078
if l.customize.VarsFile != "" {
7179
vars := make(map[string]bool)
7280
for _, item := range l.customize.Variables {

0 commit comments

Comments
 (0)