diff --git a/src/components/Buttons/PrimaryButton/PrimaryButton.module.scss b/src/components/Buttons/PrimaryButton/PrimaryButton.module.scss index 08682483..b311d684 100644 --- a/src/components/Buttons/PrimaryButton/PrimaryButton.module.scss +++ b/src/components/Buttons/PrimaryButton/PrimaryButton.module.scss @@ -14,6 +14,18 @@ border: none; padding: 0 20px; + // don't underline if button is done as a link + &:hover { + text-decoration: none; + } + + // hide outline for buttons and links + &:focus, + &:active, + &:visited { + outline: none; + } + span { color: $white; } diff --git a/src/components/ChallengeEditor/index.js b/src/components/ChallengeEditor/index.js index a9681444..3170656d 100644 --- a/src/components/ChallengeEditor/index.js +++ b/src/components/ChallengeEditor/index.js @@ -44,6 +44,7 @@ import AlertModal from '../Modal/AlertModal' import PhaseInput from '../PhaseInput' import LegacyLinks from '../LegacyLinks' import AssignedMemberField from './AssignedMember-Field' +import Tooltip from '../Tooltip' const theme = { container: styles.modalContainer @@ -639,15 +640,24 @@ class ChallengeEditor extends Component { return false } - return !(Object.values(pick([ + const requiredFields = [ 'trackId', 'typeId', 'name', 'description', 'tags', 'prizeSets' - ], challenge)).filter(v => !v.length).length || - _.isEmpty(this.state.currentTemplate)) + ] + let isRequiredMissing = false + + requiredFields.forEach((key) => { + const value = challenge[key] + + // this check works for string and array values + isRequiredMissing = isRequiredMissing || !value || !value.length + }) + + return !(isRequiredMissing || _.isEmpty(this.state.currentTemplate)) } validateChallenge () { @@ -1184,9 +1194,18 @@ class ChallengeEditor extends Component {
- { isDraft &&
- -
} + {isDraft && ( +
+ {challenge.legacyId ? ( + + ) : ( + + {/* Don't disable button for real inside tooltip, otherwise mouseEnter/Leave events work not good */} + + + )} +
+ )} } {!isLoading && isActive &&
{/*
diff --git a/src/components/LegacyLinks/LegacyLinks.module.scss b/src/components/LegacyLinks/LegacyLinks.module.scss index 6260feb6..a6f48d60 100644 --- a/src/components/LegacyLinks/LegacyLinks.module.scss +++ b/src/components/LegacyLinks/LegacyLinks.module.scss @@ -13,19 +13,4 @@ outline: none; white-space: nowrap; } - - a { - &:hover { - text-decoration: none; - } - &:focus, - &:active, - &:visited { - outline: none; - } - - button:focus { - outline: none; - } - } }