Skip to content

Commit

Permalink
Fix remaining mentions of scramble VS result
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorbg committed Oct 24, 2024
1 parent 27c160c commit 3cedbd2
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 6 deletions.
1 change: 1 addition & 0 deletions app/webpacker/components/EditResult/Create.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ function NewResult({
return (
<CreateEntry
initDataItem={result}
dataType="result"
EditForm={InlineEditForm}
/>
);
Expand Down
1 change: 1 addition & 0 deletions app/webpacker/components/EditResult/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function EditResult({
<EditEntry
id={id}
dataUrlFn={resultUrl}
dataType="result"
DisplayTable={ShowSingleResult}
EditForm={InlineEditForm}
/>
Expand Down
1 change: 1 addition & 0 deletions app/webpacker/components/EditScramble/Create.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ function NewScramble({
return (
<CreateEntry
initDataItem={scramble}
dataType="scramble"
EditForm={InlineEditForm}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Message, List } from 'semantic-ui-react';

import {
adminCheckExistingResultsUrl,
competitionAllResultsUrl,
competitionScramblesUrl,
competitionUrl,
} from '../../../lib/requests/routes.js.erb';

Expand Down Expand Up @@ -41,7 +41,7 @@ function AfterActionMessage({
</List>
You can also
{' '}
<a href={competitionAllResultsUrl(competitionId, eventId)}>go back to the results</a>
<a href={competitionScramblesUrl(competitionId, eventId)}>go back to the scrambles</a>
.
</div>
</Message>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function SaveMessage({ response }) {
<Message
error
list={response.errors}
header="Something went wrong when saving the result."
header="Something went wrong when saving the scramble."
/>
)}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function ScrambleForm({
// Attempts-related state.
const [scrambleInfo, setScrambleInfo] = useState(scrambleInfoFromScramble(scramble));

// Populate the original states whenever the original result changes.
// Populate the original states whenever the original scramble changes.
useEffect(() => {
setRoundData(roundDataFromScramble(scramble));
setScrambleInfo(scrambleInfoFromScramble(scramble));
Expand Down
1 change: 1 addition & 0 deletions app/webpacker/components/EditScramble/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function EditScramble({
<EditEntry
id={id}
dataUrlFn={scrambleUrl}
dataType="scramble"
DisplayTable={ShowSingleScramble}
EditForm={InlineEditForm}
competitionIdKey="competitionId"
Expand Down
8 changes: 7 additions & 1 deletion app/webpacker/components/ResultsData/Panel/CreateEntry.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import React from 'react';
import _ from 'lodash';

function CreateEntry({
initDataItem,
dataType,
EditForm,
}) {
return (
<>
<h3>Creating a new result</h3>
<h3>
Creating a new
{' '}
{_.upperFirst(dataType)}
</h3>
<EditForm dataItem={initDataItem} sync={() => {}} />
</>
);
Expand Down
6 changes: 5 additions & 1 deletion app/webpacker/components/ResultsData/Panel/EditEntry.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';

import _ from 'lodash';
import useLoadedData from '../../../lib/hooks/useLoadedData';
import { competitionUrl } from '../../../lib/requests/routes.js.erb';

Expand All @@ -9,6 +10,7 @@ import Errored from '../../Requests/Errored';
function EditEntry({
id,
dataUrlFn,
dataType,
DisplayTable,
EditForm,
competitionIdKey = 'competition_id',
Expand All @@ -26,7 +28,9 @@ function EditEntry({
{!loading && (
<>
<h3>
Entry previously saved in the database
{_.upperFirst(dataType)}
{' '}
previously saved in the database
{' '}
-
{' '}
Expand Down

0 comments on commit 3cedbd2

Please sign in to comment.