0

Changing server url was resetting other updated fields (#86)

* changing url was resetting other fields. Closes https://github.com/owncast/owncast/issues/854

* specify config path for various instanceDetails fields instead

* fix react warning

Co-authored-by: gingervitis <omqmail@gmail.com>
This commit is contained in:
Gabe Kangas 2021-03-24 14:12:22 -07:00 committed by GitHub
parent 396eafcbd2
commit ea1ed11e72
3 changed files with 13 additions and 6 deletions

View File

@ -124,13 +124,12 @@ export default function EditInstanceDetails() {
Learn more Learn more
</a> </a>
. .
{!yp.instanceUrl && (
<div>
<br />
You must set your server URL above to enable the directory.
</div>
)}
</p> </p>
{!yp.instanceUrl && (
<p className="description">
You must set your <strong>Server URL</strong> above to enable the directory.
</p>
)}
<div className="config-yp-container"> <div className="config-yp-container">
<ToggleSwitch <ToggleSwitch

View File

@ -50,6 +50,9 @@ code {
font-size: .88em; font-size: .88em;
} }
strong {
font-weight: 600;
}
.logo-svg { .logo-svg {
height: 2rem; height: 2rem;

View File

@ -46,6 +46,7 @@ export async function postConfigUpdateToAPI(args: ApiPostArgs) {
// Some default props to help build out a TextField // Some default props to help build out a TextField
export const TEXTFIELD_PROPS_SERVER_NAME = { export const TEXTFIELD_PROPS_SERVER_NAME = {
apiPath: API_SERVER_NAME, apiPath: API_SERVER_NAME,
configPath: 'instanceDetails',
maxLength: TEXT_MAXLENGTH, maxLength: TEXT_MAXLENGTH,
placeholder: 'Owncast site name', // like "gothland" placeholder: 'Owncast site name', // like "gothland"
label: 'Name', label: 'Name',
@ -53,6 +54,7 @@ export const TEXTFIELD_PROPS_SERVER_NAME = {
}; };
export const TEXTFIELD_PROPS_STREAM_TITLE = { export const TEXTFIELD_PROPS_STREAM_TITLE = {
apiPath: API_STREAM_TITLE, apiPath: API_STREAM_TITLE,
configPath: 'instanceDetails',
maxLength: 100, maxLength: 100,
placeholder: 'Doing cool things...', placeholder: 'Doing cool things...',
label: 'Stream Title', label: 'Stream Title',
@ -60,6 +62,7 @@ export const TEXTFIELD_PROPS_STREAM_TITLE = {
}; };
export const TEXTFIELD_PROPS_SERVER_SUMMARY = { export const TEXTFIELD_PROPS_SERVER_SUMMARY = {
apiPath: API_SERVER_SUMMARY, apiPath: API_SERVER_SUMMARY,
configPath: 'instanceDetails',
maxLength: 500, maxLength: 500,
placeholder: '', placeholder: '',
label: 'About', label: 'About',
@ -67,6 +70,7 @@ export const TEXTFIELD_PROPS_SERVER_SUMMARY = {
}; };
export const TEXTFIELD_PROPS_SERVER_WELCOME_MESSAGE = { export const TEXTFIELD_PROPS_SERVER_WELCOME_MESSAGE = {
apiPath: API_SERVER_WELCOME_MESSAGE, apiPath: API_SERVER_WELCOME_MESSAGE,
configPath: 'instanceDetails',
maxLength: 500, maxLength: 500,
placeholder: '', placeholder: '',
label: 'Welcome Message', label: 'Welcome Message',
@ -75,6 +79,7 @@ export const TEXTFIELD_PROPS_SERVER_WELCOME_MESSAGE = {
}; };
export const TEXTFIELD_PROPS_LOGO = { export const TEXTFIELD_PROPS_LOGO = {
apiPath: API_LOGO, apiPath: API_LOGO,
configPath: 'instanceDetails',
maxLength: 255, maxLength: 255,
placeholder: '/img/mylogo.png', placeholder: '/img/mylogo.png',
label: 'Logo', label: 'Logo',