fix(config): cast configuration values into proper types (#9829)
Refs #9808
This commit is contained in:
@@ -9,12 +9,12 @@ export const taggedOperations = (oriSelector, system) => (state, ...args) => {
|
||||
// Filter, if requested
|
||||
let filter = layoutSelectors.currentFilter()
|
||||
if (filter) {
|
||||
if (filter !== true && filter !== "true" && filter !== "false") {
|
||||
if (filter !== true) {
|
||||
taggedOps = fn.opsFilter(taggedOps, filter)
|
||||
}
|
||||
}
|
||||
// Limit to [max] items, if specified
|
||||
if (maxDisplayedTags && !isNaN(maxDisplayedTags) && maxDisplayedTags >= 0) {
|
||||
if (maxDisplayedTags >= 0) {
|
||||
taggedOps = taggedOps.slice(0, maxDisplayedTags)
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,5 @@ export const loaded = (ori, system) => (...args) => {
|
||||
ori(...args)
|
||||
const value = system.getConfigs().withCredentials
|
||||
|
||||
if(value !== undefined) {
|
||||
system.fn.fetch.withCredentials = typeof value === "string" ? (value === "true") : !!value
|
||||
}
|
||||
system.fn.fetch.withCredentials = value
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
import React from "react"
|
||||
import PropTypes from "prop-types"
|
||||
import ReactSyntaxHighlighter from "react-syntax-highlighter/dist/esm/light"
|
||||
import get from "lodash/get"
|
||||
|
||||
const SyntaxHighlighter = ({
|
||||
language,
|
||||
@@ -13,8 +12,7 @@ const SyntaxHighlighter = ({
|
||||
syntaxHighlighting = {},
|
||||
children = "",
|
||||
}) => {
|
||||
const configs = getConfigs()
|
||||
const theme = get(configs, "syntaxHighlight.theme")
|
||||
const theme = getConfigs().syntaxHighlight.theme
|
||||
const { styles, defaultStyle } = syntaxHighlighting
|
||||
const style = styles?.[theme] ?? defaultStyle
|
||||
|
||||
|
||||
@@ -3,12 +3,10 @@
|
||||
*/
|
||||
import React from "react"
|
||||
import PropTypes from "prop-types"
|
||||
import get from "lodash/get"
|
||||
|
||||
const SyntaxHighlighterWrapper = (Original, system) => {
|
||||
const SyntaxHighlighter = ({ renderPlainText, children, ...rest }) => {
|
||||
const configs = system.getConfigs()
|
||||
const canSyntaxHighlight = !!get(configs, "syntaxHighlight.activated")
|
||||
const canSyntaxHighlight = system.getConfigs().syntaxHighlight.activated
|
||||
const PlainTextViewer = system.getComponent("PlainTextViewer")
|
||||
|
||||
if (!canSyntaxHighlight && typeof renderPlainText === "function") {
|
||||
|
||||
Reference in New Issue
Block a user