This is a minor rework of PR #10738. I noticed an inconsistency with how Select options are passed as props. Many files use constants stored in external files to pass options props to Select objects. This allows for code reusability. Some files are not passing options in this format. I modified more files so that they use this method of passing options props. I made changes to: - WorkerQueueMetricsSection.tsx - SettingsDataModelFieldBooleanForm.tsx - SettingsDataModelFieldTextForm.tsx - SettingsDataModelFieldNumberForm.tsx - PlaygroundSetupForm.tsx - ViewPickerContentCreateMode.tsx I also noticed that some of these files were incorrectly using useLingui(), so I fixed the import and usage where needed. --------- Co-authored-by: Beau Smith <bsmith26@iastate.edu> Co-authored-by: Charles Bochet <charles@twenty.com>
26 lines
709 B
Bash
26 lines
709 B
Bash
#!/bin/sh
|
|
|
|
echo "Injecting runtime environment variables into index.html..."
|
|
|
|
CONFIG_BLOCK=$(cat << EOF
|
|
<script id="twenty-env-config">
|
|
window._env_ = {
|
|
REACT_APP_SERVER_BASE_URL: "$REACT_APP_SERVER_BASE_URL"
|
|
};
|
|
</script>
|
|
<!-- END: Twenty Config -->
|
|
EOF
|
|
)
|
|
# Use sed to replace the config block in index.html
|
|
# Using pattern space to match across multiple lines
|
|
echo "$CONFIG_BLOCK" | sed -i.bak '
|
|
/<!-- BEGIN: Twenty Config -->/,/<!-- END: Twenty Config -->/{
|
|
/<!-- BEGIN: Twenty Config -->/!{
|
|
/<!-- END: Twenty Config -->/!d
|
|
}
|
|
/<!-- BEGIN: Twenty Config -->/r /dev/stdin
|
|
/<!-- END: Twenty Config -->/d
|
|
}
|
|
' build/index.html
|
|
rm -f build/index.html.bak
|