Skip to content

Commit

Permalink
refactor(web): stop exporting everything from components/questions
Browse files Browse the repository at this point in the history
  • Loading branch information
dgdavid committed Jul 31, 2024
1 parent 560f953 commit 7c7b049
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 17 deletions.
2 changes: 1 addition & 1 deletion web/src/components/questions/GenericQuestion.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import React from "react";
import { screen } from "@testing-library/react";
import { plainRender } from "~/test-utils";
import { GenericQuestion } from "~/components/questions";
import { Question } from "~/types/questions";
import GenericQuestion from "~/components/questions/GenericQuestion";

const question: Question = {
id: 1,
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/questions/GenericQuestion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import React from "react";
import { Text } from "@patternfly/react-core";
import { Popup } from "~/components/core";
import { QuestionActions } from "~/components/questions";
import { AnswerCallback, Question } from "~/types/questions";
import QuestionActions from "~/components/questions/QuestionActions";
import { _ } from "~/i18n";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import React from "react";
import { screen } from "@testing-library/react";
import { plainRender } from "~/test-utils";
import { LuksActivationQuestion } from "~/components/questions";
import { AnswerCallback, Question } from "~/types/questions";
import LuksActivationQuestion from "~/components/questions/LuksActivationQuestion";

let question: Question;
const questionMock: Question = {
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/questions/LuksActivationQuestion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import React, { useState } from "react";
import { Alert as PFAlert, Form, FormGroup, Text } from "@patternfly/react-core";
import { Icon } from "~/components/layout";
import { PasswordInput, Popup } from "~/components/core";
import { QuestionActions } from "~/components/questions";
import QuestionActions from "~/components/questions/QuestionActions";
import { _ } from "~/i18n";

/**
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/questions/QuestionActions.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import React from "react";
import { screen } from "@testing-library/react";
import { installerRender } from "~/test-utils";
import { QuestionActions } from "~/components/questions";
import { Question } from "~/types/questions";
import QuestionActions from "~/components/questions/QuestionActions";

let defaultOption = "sure";

Expand Down
2 changes: 1 addition & 1 deletion web/src/components/questions/QuestionWithPassword.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import React from "react";
import { screen } from "@testing-library/react";
import { plainRender } from "~/test-utils";
import { QuestionWithPassword } from "~/components/questions";
import { Question } from "~/types/questions";
import QuestionWithPassword from "~/components/questions/QuestionWithPassword";

const answerFn = jest.fn();
const question: Question = {
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/questions/QuestionWithPassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import React, { useState } from "react";
import { Form, FormGroup, Text } from "@patternfly/react-core";
import { Icon } from "~/components/layout";
import { PasswordInput, Popup } from "~/components/core";
import { QuestionActions } from "~/components/questions";
import { AnswerCallback, Question } from "~/types/questions";
import QuestionActions from "~/components/questions/QuestionActions";
import { _ } from "~/i18n";

/**
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/questions/Questions.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import React from "react";
import { screen } from "@testing-library/react";
import { installerRender, plainRender } from "~/test-utils";
import { Questions } from "~/components/questions";
import { Question, QuestionType } from "~/types/questions";
import Questions from "~/components/questions/Questions";
import * as GenericQuestionComponent from "~/components/questions/GenericQuestion";

let mockQuestions: Question[];
Expand Down
8 changes: 3 additions & 5 deletions web/src/components/questions/Questions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@
*/

import React from "react";
import {
GenericQuestion,
QuestionWithPassword,
LuksActivationQuestion,
} from "~/components/questions";
import GenericQuestion from "~/components/questions/GenericQuestion";
import QuestionWithPassword from "~/components/questions/QuestionWithPassword";
import LuksActivationQuestion from "~/components/questions/LuksActivationQuestion";
import { useQuestions, useQuestionsConfig, useQuestionsChanges } from "~/queries/questions";
import { AnswerCallback, QuestionType } from "~/types/questions";

Expand Down
4 changes: 0 additions & 4 deletions web/src/components/questions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,4 @@
* find current contact information at www.suse.com.
*/

export { default as QuestionActions } from "./QuestionActions";
export { default as GenericQuestion } from "./GenericQuestion";
export { default as QuestionWithPassword } from "./QuestionWithPassword";
export { default as LuksActivationQuestion } from "./LuksActivationQuestion";
export { default as Questions } from "./Questions";

0 comments on commit 7c7b049

Please sign in to comment.