Skip to content

Commit

Permalink
run formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
jschwarz2030 committed Jan 16, 2025
1 parent 0971cdf commit 0654cf8
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const jsSchema = (intl, user, project) => {
title: intl.formatMessage(messages.requireConfirmationLabel),
type: "boolean",
default: false,
}
},
},
required: ["displayName"],
};
Expand Down Expand Up @@ -98,9 +98,14 @@ export const uiSchema = (intl) => {
"ui:help": intl.formatMessage(messages.requireConfirmationDescription),
},
"ui:order": [
"featured", "displayName", "enabled", "description", "requireConfirmation", "isVirtual"
"featured",
"displayName",
"enabled",
"description",
"requireConfirmation",
"isVirtual",
],
}
};

return uiSchemaFields;
};
9 changes: 5 additions & 4 deletions src/components/AdminPane/Manage/EditProject/Messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,13 @@ export default defineMessages({
},

requireConfirmationLabel: {
id: 'Admin.EditProject.form.requireConfirmation.label',
id: "Admin.EditProject.form.requireConfirmation.label",
defaultMessage: "Require Confirmation",
},

requireConfirmationDescription: {
id: 'Admin.EditProject.form.requireConfirmation.description',
defaultMessage: "This will disable the option for users to bypass the task confirmation modal when they click 'I fixed it!'",
id: "Admin.EditProject.form.requireConfirmation.description",
defaultMessage:
"This will disable the option for users to bypass the task confirmation modal when they click 'I fixed it!'",
},
})
});
Original file line number Diff line number Diff line change
Expand Up @@ -772,13 +772,14 @@ will not be able to make sense of it.
},

requireConfirmationLabel: {
id: 'Admin.EditProject.form.requireConfirmation.label',
id: "Admin.EditProject.form.requireConfirmation.label",
defaultMessage: "Require Confirmation",
},

requireConfirmationDescription: {
id: 'Admin.EditProject.form.requireConfirmation.description',
defaultMessage: "This will disable the option for users to bypass the task confirmation modal when they click 'I fixed it!'",
id: "Admin.EditProject.form.requireConfirmation.description",
defaultMessage:
"This will disable the option for users to bypass the task confirmation modal when they click 'I fixed it!'",
},

instructionsDescription: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ export const jsSchema = (intl) => {
title: intl.formatMessage(messages.requireConfirmationLabel),
type: "boolean",
enum: [true, false],
enumNames: [
intl.formatMessage(messages.yesLabel),
intl.formatMessage(messages.noLabel),
],
enumNames: [intl.formatMessage(messages.yesLabel), intl.formatMessage(messages.noLabel)],
default: false,
},
presets: {
Expand Down Expand Up @@ -175,8 +172,8 @@ export const uiSchema = (intl, user, challengeData, extraErrors, options = {}) =
"ui:readonly": sourceReadOnly,
"ui:collapsed": isGroupCollapsed,
},
presetUiSchemas
}
presetUiSchemas,
},
);

return uiSchemaFields;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,45 +11,45 @@ import PropTypes from "prop-types";
import { Component, Fragment } from "react";
import { FormattedMessage, injectIntl } from "react-intl";
import { Link } from "react-router-dom";
import _get from 'lodash/get'
import _map from 'lodash/map'
import _pick from 'lodash/pick'
import _isEmpty from 'lodash/isEmpty'
import _remove from 'lodash/remove'
import _cloneDeep from 'lodash/cloneDeep'
import _isObject from 'lodash/isObject'
import _isFinite from 'lodash/isFinite'
import _isUndefined from 'lodash/isUndefined'
import { TaskStatus } from '../../../../services/Task/TaskStatus/TaskStatus'
import { allowedStatusProgressions, isCompletionStatus,
isFinalStatus, messagesByStatus }
from '../../../../services/Task/TaskStatus/TaskStatus'
import { TaskReviewStatus } from '../../../../services/Task/TaskReview/TaskReviewStatus'
import { TaskReviewLoadMethod } from '../../../../services/Task/TaskReview/TaskReviewLoadMethod'
import { Editor } from '../../../../services/Editor/Editor'
import { OPEN_STREET_MAP } from '../../../../services/VisibleLayer/LayerSources'
import AsCooperativeWork from '../../../../interactions/Task/AsCooperativeWork'
import SignInButton from '../../../SignInButton/SignInButton'
import WithSearch from '../../../HOCs/WithSearch/WithSearch'
import WithChallengePreferences
from '../../../HOCs/WithChallengePreferences/WithChallengePreferences'
import WithVisibleLayer from '../../../HOCs/WithVisibleLayer/WithVisibleLayer'
import WithTaskReview from '../../../HOCs/WithTaskReview/WithTaskReview'
import WithTaskTags from '../../../HOCs/WithTaskTags/WithTaskTags'
import WithKeyboardShortcuts
from '../../../HOCs/WithKeyboardShortcuts/WithKeyboardShortcuts'
import WithTaskFeatureProperties from '../../../HOCs/WithTaskFeatureProperties/WithTaskFeatureProperties'
import TaskCompletionStep from './TaskCompletionStep/TaskCompletionStep'
import CooperativeWorkControls from './CooperativeWorkControls/CooperativeWorkControls'
import TaskNextControl from './TaskNextControl/TaskNextControl'
import TaskConfirmationModal
from '../../../TaskConfirmationModal/TaskConfirmationModal'
import TaskTags from '../../../TaskTags/TaskTags'
import messages from './Messages'
import { constructChangesetUrl } from '../../../../utils/constructChangesetUrl'
import { replacePropertyTags } from '../../../../hooks/UsePropertyReplacement/UsePropertyReplacement'
import './ActiveTaskControls.scss'
import { TASK_STATUS_FIXED } from '../../../../services/Task/TaskStatus/TaskStatus';
import _get from "lodash/get";
import _map from "lodash/map";
import _pick from "lodash/pick";
import _isEmpty from "lodash/isEmpty";
import _remove from "lodash/remove";
import _cloneDeep from "lodash/cloneDeep";
import _isObject from "lodash/isObject";
import _isFinite from "lodash/isFinite";
import _isUndefined from "lodash/isUndefined";
import { TaskStatus } from "../../../../services/Task/TaskStatus/TaskStatus";
import {
allowedStatusProgressions,
isCompletionStatus,
isFinalStatus,
messagesByStatus,
} from "../../../../services/Task/TaskStatus/TaskStatus";
import { TaskReviewStatus } from "../../../../services/Task/TaskReview/TaskReviewStatus";
import { TaskReviewLoadMethod } from "../../../../services/Task/TaskReview/TaskReviewLoadMethod";
import { Editor } from "../../../../services/Editor/Editor";
import { OPEN_STREET_MAP } from "../../../../services/VisibleLayer/LayerSources";
import AsCooperativeWork from "../../../../interactions/Task/AsCooperativeWork";
import SignInButton from "../../../SignInButton/SignInButton";
import WithSearch from "../../../HOCs/WithSearch/WithSearch";
import WithChallengePreferences from "../../../HOCs/WithChallengePreferences/WithChallengePreferences";
import WithVisibleLayer from "../../../HOCs/WithVisibleLayer/WithVisibleLayer";
import WithTaskReview from "../../../HOCs/WithTaskReview/WithTaskReview";
import WithTaskTags from "../../../HOCs/WithTaskTags/WithTaskTags";
import WithKeyboardShortcuts from "../../../HOCs/WithKeyboardShortcuts/WithKeyboardShortcuts";
import WithTaskFeatureProperties from "../../../HOCs/WithTaskFeatureProperties/WithTaskFeatureProperties";
import TaskCompletionStep from "./TaskCompletionStep/TaskCompletionStep";
import CooperativeWorkControls from "./CooperativeWorkControls/CooperativeWorkControls";
import TaskNextControl from "./TaskNextControl/TaskNextControl";
import TaskConfirmationModal from "../../../TaskConfirmationModal/TaskConfirmationModal";
import TaskTags from "../../../TaskTags/TaskTags";
import messages from "./Messages";
import { constructChangesetUrl } from "../../../../utils/constructChangesetUrl";
import { replacePropertyTags } from "../../../../hooks/UsePropertyReplacement/UsePropertyReplacement";
import "./ActiveTaskControls.scss";
import { TASK_STATUS_FIXED } from "../../../../services/Task/TaskStatus/TaskStatus";

const hiddenShortcutGroup = "taskCompletion";
const hiddenShortcuts = ["skip", "falsePositive", "fixed", "tooHard", "alreadyFixed"];
Expand Down Expand Up @@ -191,24 +191,29 @@ export class ActiveTaskControls extends Component {
const message = intl.formatMessage(messages.rapidDiscardUnsavedChanges);

if (!this.props.rapidEditorState.hasUnsavedChanges || window.confirm(message)) {
const requireConfirmation = this.props.challenge.requireConfirmation || this.props.challenge.parent.requireConfirmation;
const disableTaskConfirm = !requireConfirmation && this.props.user.settings.disableTaskConfirm
const requireConfirmation =
this.props.challenge.requireConfirmation || this.props.challenge.parent.requireConfirmation;
const disableTaskConfirm =
!requireConfirmation && this.props.user.settings.disableTaskConfirm;

if (taskStatus === TASK_STATUS_FIXED && disableTaskConfirm) {
this.setState({
osmComment: `${this.props.task.parent.checkinComment}${constructChangesetUrl(this.props.task)}`,
confirmingStatus: taskStatus,
submitRevision,
}, () => {
this.confirmCompletion()
})
this.setState(
{
osmComment: `${this.props.task.parent.checkinComment}${constructChangesetUrl(this.props.task)}`,
confirmingStatus: taskStatus,
submitRevision,
},
() => {
this.confirmCompletion();
},
);
} else {
this.setState({
confirmingTask: this.props.task,
osmComment: `${this.props.task.parent.checkinComment}${constructChangesetUrl(this.props.task)}`,
confirmingStatus: taskStatus,
submitRevision,
})
});
}
}
};
Expand Down Expand Up @@ -374,7 +379,7 @@ export class ActiveTaskControls extends Component {
}

render() {
console.log(this.props.user.settings, this.props.user.settings.disableTaskConfirm)
console.log(this.props.user.settings, this.props.user.settings.disableTaskConfirm);
// If the user is not logged in, show a sign-in button instead of controls.
if (!this.props.user?.isLoggedIn) {
return (
Expand Down
5 changes: 2 additions & 3 deletions src/pages/Profile/Messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,12 @@ export default defineMessages({
disableTaskConfirmDescription: {
id: "Profile.form.disableTaskConfirm.description",
defaultMessage:
"This will allow the user to bypass the task confirmation modal when a user clicks 'I fixed it!'. Be aware some projects and challenges won't allow this behavior."
"This will allow the user to bypass the task confirmation modal when a user clicks 'I fixed it!'. Be aware some projects and challenges won't allow this behavior.",
},

disableTaskConfirmLabel: {
id: "Profile.form.disableTaskConfirm.label",
defaultMessage:
"Disable Task Confirmation Modal"
defaultMessage: "Disable Task Confirmation Modal",
},

apiKey: {
Expand Down

0 comments on commit 0654cf8

Please sign in to comment.