Browse Source

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>
pull/1886/head
Gabe Kangas 5 years ago committed by GitHub
parent
commit
ea1ed11e72
  1. 11
      web/components/config/edit-instance-details.tsx
  2. 3
      web/styles/globals.scss
  3. 5
      web/utils/config-constants.tsx

11
web/components/config/edit-instance-details.tsx

@ -124,13 +124,12 @@ export default function EditInstanceDetails() { @@ -124,13 +124,12 @@ export default function EditInstanceDetails() {
Learn more
</a>
.
{!yp.instanceUrl && (
<div>
<br />
You must set your server URL above to enable the directory.
</div>
)}
</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">
<ToggleSwitch

3
web/styles/globals.scss

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

5
web/utils/config-constants.tsx

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

Loading…
Cancel
Save