Skip to content

Commit

Permalink
Move prompt and alert (#990)
Browse files Browse the repository at this point in the history
  • Loading branch information
tschumpr authored Jan 29, 2024
2 parents 15f80cb + 908a124 commit 424c705
Show file tree
Hide file tree
Showing 31 changed files with 35 additions and 33 deletions.
7 changes: 1 addition & 6 deletions src/client/cypress/e2e/editor/completion-v2.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
createBorehole,
startBoreholeEditing,
loginAsAdmin,
handlePrompt,
} from "../helpers/testHelpers";
import {
setInput,
Expand Down Expand Up @@ -58,12 +59,6 @@ const isTabSelected = index => {
.should("eq", "true");
};

const handlePrompt = (title, action) => {
cy.get('[data-cy="prompt"]').should("exist");
cy.contains(title);
cy.get('[data-cy="prompt-button-' + action + '"]').click();
};

describe("completion crud tests", () => {
it("add, edit, copy and delete completions", () => {
createBorehole({ "extended.original_name": "INTEADAL" }).as("borehole_id");
Expand Down
6 changes: 6 additions & 0 deletions src/client/cypress/e2e/helpers/testHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,3 +366,9 @@ export const createStratigraphy = (boreholeId, kindId) => {
});
});
};

export const handlePrompt = (title, action) => {
cy.get('[data-cy="prompt"]').should("exist");
cy.contains(title);
cy.get('[data-cy="prompt-button-' + action + '"]').click();
};
4 changes: 2 additions & 2 deletions src/client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import EditorComponent from "./pages/editor/editorComponent";
import SettingCmp from "./pages/settings/settingCmp";
import DataLoader from "./pages/settings/dataLoader";
import AcceptTerms from "./pages/term/accept";
import { AlertProvider } from "./commons/alert/alertContext";
import { AlertBanner } from "./commons/alert/alertBanner";
import { AlertProvider } from "./components/alert/alertContext";
import { AlertBanner } from "./components/alert/alertBanner";

const queryClient = new QueryClient();

Expand Down
2 changes: 1 addition & 1 deletion src/client/src/commons/feedback/feedbackComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { connect } from "react-redux";
import { withTranslation } from "react-i18next";

import { Form, Button } from "semantic-ui-react";
import { AlertContext } from "../alert/alertContext";
import { AlertContext } from "../../components/alert/alertContext";
import { createFeedback } from "../../api-lib/index";

class Feedback extends React.Component {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import FilesTableComponent from "./filesTableComponent";
import TranslationText from "../../form/translationText";
import { Button } from "semantic-ui-react";
import { AlertContext } from "../../alert/alertContext";
import { AlertContext } from "../../../components/alert/alertContext";
import { withTranslation } from "react-i18next";

class EditorBoreholeFilesTable extends Component {
Expand Down
2 changes: 1 addition & 1 deletion src/client/src/commons/form/borehole/boreholeForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import LocationSegment from "./segments/locationSegment";
import WaterIngress from "./hydrogeology/waterIngress";
import GroundwaterLevelMeasurement from "./hydrogeology/groundwaterLevelMeasurement";
import Hydrotest from "./hydrogeology/hydrotest";
import { AlertContext } from "../../alert/alertContext";
import { AlertContext } from "../../../components/alert/alertContext";
import FieldMeasurement from "./hydrogeology/fieldMeasurement";
import ChronostratigraphyPanel from "./stratigraphy/chronostratigraphyPanel";
import LithostratigraphyPanel from "./stratigraphy/lithostratigraphyPanel";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
import CompletionContent from "./completionContent";
import CompletionHeaderInput from "./completionHeaderInput";
import CompletionHeaderDisplay from "./completionHeaderDisplay";
import Prompt from "../../../prompt/prompt";
import Prompt from "../../../../components/prompt/prompt";

const Completion = props => {
const { isEditable, boreholeId } = props;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
FormSelect,
FormCheckbox,
} from "../../../../components/form/form";
import Prompt from "../../../prompt/prompt";
import Prompt from "../../../../components/prompt/prompt";

const CompletionHeaderInput = props => {
const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import { useDomains } from "../../../../api/fetchApiV2";
import CheckIcon from "@mui/icons-material/Check";
import { useTranslation } from "react-i18next";
import { AlertContext } from "../../../alert/alertContext";
import { AlertContext } from "../../../../components/alert/alertContext";
import ObservationInput from "./observationInput";
import { ObservationType } from "./observationType";
import { hydrogeologySchemaConstants } from "./hydrogeologySchemaConstants";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import { useDomains } from "../../../../api/fetchApiV2";
import CheckIcon from "@mui/icons-material/Check";
import { useTranslation } from "react-i18next";
import { AlertContext } from "../../../alert/alertContext";
import { AlertContext } from "../../../../components/alert/alertContext";
import ObservationInput from "./observationInput";
import { ObservationType } from "./observationType";
import { hydrogeologySchemaConstants } from "./hydrogeologySchemaConstants";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import AddCircleIcon from "@mui/icons-material/AddCircle";
import CancelIcon from "@mui/icons-material/Cancel";
import { useTranslation } from "react-i18next";
import { useHydrotestDomains, useDomains } from "../../../../api/fetchApiV2";
import { AlertContext } from "../../../alert/alertContext";
import { AlertContext } from "../../../../components/alert/alertContext";
import { ObservationType } from "./observationType";
import { hydrogeologySchemaConstants } from "./hydrogeologySchemaConstants";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import DeleteIcon from "@mui/icons-material/Delete";
import CheckIcon from "@mui/icons-material/Check";
import { useDomains } from "../../../../api/fetchApiV2";
import { TestResultParameterUnits } from "./parameterUnits";
import { AlertContext } from "../../../alert/alertContext";
import { AlertContext } from "../../../../components/alert/alertContext";
import { hydrogeologySchemaConstants } from "./hydrogeologySchemaConstants";

const HydrotestResultTable = ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import { useDomains } from "../../../../api/fetchApiV2";
import CheckIcon from "@mui/icons-material/Check";
import { useTranslation } from "react-i18next";
import { AlertContext } from "../../../alert/alertContext";
import { AlertContext } from "../../../../components/alert/alertContext";
import ObservationInput from "./observationInput";
import { ObservationType } from "./observationType";
import { hydrogeologySchemaConstants } from "./hydrogeologySchemaConstants";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import _ from "lodash";
import DomainDropdown from "../../domain/dropdown/domainDropdown";
import DomainText from "../../domain/domainText";
import TranslationText from "../../translationText";
import { AlertContext } from "../../../alert/alertContext";
import { AlertContext } from "../../../../components/alert/alertContext";
import { Form, Icon, Input, Segment } from "semantic-ui-react";
import { removeIdentifier, addIdentifier } from "../../../../api-lib";
import { useTranslation } from "react-i18next";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useTranslation } from "react-i18next";
import ProfileAttributeList from "./components/profileAttributeList/profileAttributeList";
import { useSelector } from "react-redux";
import { useQueryClient } from "react-query";
import { AlertContext } from "../../../../alert/alertContext";
import { AlertContext } from "../../../../../components/alert/alertContext";
import {
fetchLayerById,
layerQueryKey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { useTranslation } from "react-i18next";
import { getData, sendProfile } from "./api";
import _ from "lodash";
import useCasingList from "../../hooks/useCasingList";
import { AlertContext } from "../../../../alert/alertContext";
import { AlertContext } from "../../../../../components/alert/alertContext";

const ProfileInfo = props => {
const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from "../../../../../../../api/fetchApiV2";
import { NumericFormat } from "react-number-format";
import { parseIfString } from "../../../../../formUtils";
import { AlertContext } from "../../../../../../alert/alertContext";
import { AlertContext } from "../../../../../../../components/alert/alertContext";
import { produce } from "immer";

const Instrument = props => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
addBedrock,
} from "../../../../../../../api/fetchApiV2";
import ErrorTypes from "./errorTypes";
import { AlertContext } from "../../../../../../alert/alertContext";
import { AlertContext } from "../../../../../../../components/alert/alertContext";

const ProfileLayersError = props => {
const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { NumericFormat } from "react-number-format";
import { withTranslation } from "react-i18next";
import * as Styled from "./styles";
import { deleteLayer } from "../../../../../../../api-lib";
import { AlertContext } from "../../../../../../alert/alertContext";
import { AlertContext } from "../../../../../../../components/alert/alertContext";
import { useLithostratigraphies } from "../../../../../../../api/fetchApiV2";

const ProfileLayersList = props => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import {
import AddCircleIcon from "@mui/icons-material/AddCircle";
import { withTranslation } from "react-i18next";
import { useMutation, useQueryClient } from "react-query";
import { AlertContext } from "../../../../alert/alertContext";
import { AlertContext } from "../../../../../components/alert/alertContext";
import { profileKind } from "../../constance";

const ProfileLayers = props => {
Expand Down
2 changes: 1 addition & 1 deletion src/client/src/commons/form/workflow/workflowForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
rejectWorkflow,
resetWorkflow,
} from "../../../api-lib/index";
import { AlertContext } from "../../alert/alertContext";
import { AlertContext } from "../../../components/alert/alertContext";
import CommentArea from "./commentArea";
import DateText from "../dateText";
import TranslationText from "../../form/translationText";
Expand Down
2 changes: 1 addition & 1 deletion src/client/src/commons/menu/editor/menuEditorSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Box, Stack, MenuItem, Select, FormControl } from "@mui/material/";
import { Button, Header, Icon, Menu, Modal, Segment } from "semantic-ui-react";

import { createBorehole } from "../../../api-lib/index";
import { AlertContext } from "../../alert/alertContext";
import { AlertContext } from "../../../components/alert/alertContext";
import SearchEditorComponent from "../../search/editor/searchEditorComponent";
import { downloadCodelistCsv, importBoreholes } from "../../../api/fetchApiV2";
import Downloadlink from "../../files/downloadlink";
Expand Down
2 changes: 1 addition & 1 deletion src/client/src/commons/table/boreholeEditorTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
getdBoreholeIds,
deleteBoreholes,
} from "../../api-lib/index";
import { AlertContext } from "../alert/alertContext";
import { AlertContext } from "../../components/alert/alertContext";

class BoreholeEditorTable extends TTable {
static contextType = AlertContext;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { styled } from "@mui/system";

export const PromptButton = styled(Button)({
fontFamily: "Lato",
fontSize: "16px",
textTransform: "none",
color: "rgba(0, 0, 0, 0.8)",
"&:hover": {
Expand Down
2 changes: 1 addition & 1 deletion src/client/src/pages/settings/admin/adminSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import { connect } from "react-redux";
import PropTypes from "prop-types";
import { withTranslation } from "react-i18next";
import { AlertContext } from "../../../commons/alert/alertContext";
import { AlertContext } from "../../../components/alert/alertContext";
import { fetchUsers } from "../../../api/fetchApiV2";

import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
Segment,
} from "semantic-ui-react";
import { getWms } from "../../../../api-lib/index";
import { AlertContext } from "../../../../commons/alert/alertContext";
import { AlertContext } from "../../../../components/alert/alertContext";
import TranslationText from "../../../../commons/form/translationText";
import WMTSCapabilities from "ol/format/WMTSCapabilities";
import WMSCapabilities from "ol/format/WMSCapabilities";
Expand Down
2 changes: 1 addition & 1 deletion src/client/src/pages/settings/editor/identifierSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import { connect } from "react-redux";
import PropTypes from "prop-types";
import { withTranslation } from "react-i18next";
import { AlertContext } from "../../../commons/alert/alertContext";
import { AlertContext } from "../../../components/alert/alertContext";

import { Button, Icon, Form, Modal, Header } from "semantic-ui-react";

Expand Down
2 changes: 1 addition & 1 deletion src/client/src/pages/settings/explorerSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { lithologyFilterEditorData } from "./data/lithologyFilterEditorData";
import { lithologyFieldEditorData } from "./data/lithologyFieldEditorData";
import EditorSettingList from "./components/editorSettingList/editorSettingList";
import MapSettings from "./components/editorSettingList/mapSettings";
import { AlertContext } from "../../commons/alert/alertContext";
import { AlertContext } from "../../components/alert/alertContext";

const projections = {
"EPSG:21781":
Expand Down
2 changes: 1 addition & 1 deletion src/client/src/pages/settings/loginScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { connect } from "react-redux";
import PropTypes from "prop-types";
import { withTranslation } from "react-i18next";
import { Button, Form, Modal, TextArea } from "semantic-ui-react";
import { AlertContext } from "../../commons/alert/alertContext";
import { AlertContext } from "../../components/alert/alertContext";
import LoginPreview from "../../commons/form/loginPreview";
import TranslationKeys from "../../commons/translationKeys";

Expand Down

0 comments on commit 424c705

Please sign in to comment.