Move frontendcomponents into ui-core

The new architecture has been implemented.

Co-authored-by: Eduard Heimbuch<eduard.heimbuch@cloudogu.com>
Committed-by: Eduard Heimbuch<eduard.heimbuch@cloudogu.com>
Pushed-by: Tarik Gürsoy<tarik.guersoy@cloudogu.com>
Committed-by: Tarik Gürsoy<tarik.guersoy@cloudogu.com>
Pushed-by: Eduard Heimbuch<eduard.heimbuch@cloudogu.com>
Co-authored-by: Tarik Gürsoy<tarik.guersoy@cloudogu.com>


Reviewed-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
This commit is contained in:
Tarik Gürsoy
2024-01-24 10:38:17 +01:00
parent 0cc3d3f598
commit 3ffbdd8d17
184 changed files with 1356 additions and 1535 deletions

View File

@@ -30,6 +30,10 @@ type Props = Omit<ComponentProps<typeof Notification>, "type" | "role"> & {
error: BackendError;
};
/**
* @deprecated Please import the identical module from "@scm-manager/ui-core"
*/
const BackendErrorNotification: FC<Props> = ({ error, ...props }) => {
const [t] = useTranslation("plugins");

View File

@@ -50,6 +50,9 @@ const BasicErrorMessage: FC<Omit<ComponentProps<typeof Notification>, "type" | "
);
};
/**
* @deprecated Please import the identical module from "@scm-manager/ui-core"
*/
const ErrorNotification: FC<Props> = ({ error, ...props }) => {
const [t] = useTranslation("commons");
if (error) {

View File

@@ -31,6 +31,9 @@ type Props = {
className?: string;
};
/**
* @deprecated Please import the identical module from "@scm-manager/ui-core"
*/
class Image extends React.Component<Props> {
createImageSrc = () => {
const { src } = this.props;

View File

@@ -40,6 +40,10 @@ const FixedSizedImage = styled(Image)`
height: 128px;
`;
/**
* @deprecated Please import the identical module from "@scm-manager/ui-core"
*/
class Loading extends React.Component<Props> {
render() {
const { message, t } = this.props;

View File

@@ -34,6 +34,10 @@ type Props = {
role?: string;
};
/**
* @deprecated Please import the identical module from "@scm-manager/ui-core"
*/
const Notification: FC<Props> = ({ type = "info", onClose, className, children, role }) => {
const renderCloseButton = () => {
if (onClose) {

View File

@@ -71110,7 +71110,7 @@ exports[`Storyshots Repositories/RepositoryEntry Archived 1`] = `
</div>
</div>
<div
className="sc-iBkjds idsAPT is-flex is-flex-direction-column is-justify-content-center is-flex-grow-1 is-overflow-hidden is-overflow-wrap-anywhere"
className="Card__RowsContainer-sc-16vnzfd-0 rKDzD is-flex is-flex-direction-column is-justify-content-center is-flex-grow-1 is-overflow-hidden is-overflow-wrap-anywhere"
style={
Object {
"gap": "0.25rem",
@@ -71238,7 +71238,7 @@ exports[`Storyshots Repositories/RepositoryEntry Avatar EP 1`] = `
</div>
</div>
<div
className="sc-iBkjds idsAPT is-flex is-flex-direction-column is-justify-content-center is-flex-grow-1 is-overflow-hidden is-overflow-wrap-anywhere"
className="Card__RowsContainer-sc-16vnzfd-0 rKDzD is-flex is-flex-direction-column is-justify-content-center is-flex-grow-1 is-overflow-hidden is-overflow-wrap-anywhere"
style={
Object {
"gap": "0.25rem",
@@ -71354,7 +71354,7 @@ exports[`Storyshots Repositories/RepositoryEntry Before Title EP 1`] = `
</div>
</div>
<div
className="sc-iBkjds idsAPT is-flex is-flex-direction-column is-justify-content-center is-flex-grow-1 is-overflow-hidden is-overflow-wrap-anywhere"
className="Card__RowsContainer-sc-16vnzfd-0 rKDzD is-flex is-flex-direction-column is-justify-content-center is-flex-grow-1 is-overflow-hidden is-overflow-wrap-anywhere"
style={
Object {
"gap": "0.25rem",
@@ -71473,7 +71473,7 @@ exports[`Storyshots Repositories/RepositoryEntry Default 1`] = `
</div>
</div>
<div
className="sc-iBkjds idsAPT is-flex is-flex-direction-column is-justify-content-center is-flex-grow-1 is-overflow-hidden is-overflow-wrap-anywhere"
className="Card__RowsContainer-sc-16vnzfd-0 rKDzD is-flex is-flex-direction-column is-justify-content-center is-flex-grow-1 is-overflow-hidden is-overflow-wrap-anywhere"
style={
Object {
"gap": "0.25rem",
@@ -71589,7 +71589,7 @@ exports[`Storyshots Repositories/RepositoryEntry Exporting 1`] = `
</div>
</div>
<div
className="sc-iBkjds idsAPT is-flex is-flex-direction-column is-justify-content-center is-flex-grow-1 is-overflow-hidden is-overflow-wrap-anywhere"
className="Card__RowsContainer-sc-16vnzfd-0 rKDzD is-flex is-flex-direction-column is-justify-content-center is-flex-grow-1 is-overflow-hidden is-overflow-wrap-anywhere"
style={
Object {
"gap": "0.25rem",
@@ -71717,7 +71717,7 @@ exports[`Storyshots Repositories/RepositoryEntry HealthCheck Failure 1`] = `
</div>
</div>
<div
className="sc-iBkjds idsAPT is-flex is-flex-direction-column is-justify-content-center is-flex-grow-1 is-overflow-hidden is-overflow-wrap-anywhere"
className="Card__RowsContainer-sc-16vnzfd-0 rKDzD is-flex is-flex-direction-column is-justify-content-center is-flex-grow-1 is-overflow-hidden is-overflow-wrap-anywhere"
style={
Object {
"gap": "0.25rem",
@@ -71846,7 +71846,7 @@ exports[`Storyshots Repositories/RepositoryEntry MultiRepositoryTags 1`] = `
</div>
</div>
<div
className="sc-iBkjds idsAPT is-flex is-flex-direction-column is-justify-content-center is-flex-grow-1 is-overflow-hidden is-overflow-wrap-anywhere"
className="Card__RowsContainer-sc-16vnzfd-0 rKDzD is-flex is-flex-direction-column is-justify-content-center is-flex-grow-1 is-overflow-hidden is-overflow-wrap-anywhere"
style={
Object {
"gap": "0.25rem",
@@ -71986,7 +71986,7 @@ exports[`Storyshots Repositories/RepositoryEntry RepositoryFlag EP 1`] = `
</div>
</div>
<div
className="sc-iBkjds idsAPT is-flex is-flex-direction-column is-justify-content-center is-flex-grow-1 is-overflow-hidden is-overflow-wrap-anywhere"
className="Card__RowsContainer-sc-16vnzfd-0 rKDzD is-flex is-flex-direction-column is-justify-content-center is-flex-grow-1 is-overflow-hidden is-overflow-wrap-anywhere"
style={
Object {
"gap": "0.25rem",
@@ -72115,7 +72115,7 @@ exports[`Storyshots Repositories/RepositoryEntry With long texts 1`] = `
</div>
</div>
<div
className="sc-iBkjds idsAPT is-flex is-flex-direction-column is-justify-content-center is-flex-grow-1 is-overflow-hidden is-overflow-wrap-anywhere"
className="Card__RowsContainer-sc-16vnzfd-0 rKDzD is-flex is-flex-direction-column is-justify-content-center is-flex-grow-1 is-overflow-hidden is-overflow-wrap-anywhere"
style={
Object {
"gap": "0.25rem",

View File

@@ -26,6 +26,10 @@
// @ts-ignore scmStage is set on the index page
export const isDevBuild = () => (window.scmStage || "").toUpperCase() !== "PRODUCTION";
/**
* @deprecated Please import the identical module from "@scm-manager/ui-core"
*/
export const createAttributesForTesting = (testId?: string) => {
if (!testId) {
return undefined;

View File

@@ -31,6 +31,10 @@ type Props = {
right?: ReactNode;
};
/**
* @deprecated Please import the identical module from "@scm-manager/ui-core"
*/
export default class Level extends React.Component<Props> {
render() {
const { className, left, children, right } = this.props;

View File

@@ -28,6 +28,10 @@ type Props = {
className?: string;
};
/**
* @deprecated Please import the identical module from "@scm-manager/ui-core"
*/
class SubSubtitle extends React.Component<Props> {
render() {
const { className, children } = this.props;

View File

@@ -29,6 +29,10 @@ type Props = {
className?: string;
};
/**
* @deprecated Please import the identical module from "@scm-manager/ui-core"
*/
const Subtitle: FC<Props> = ({ subtitle, className, children }) => {
if (subtitle) {
return <h2 className={classNames("subtitle", className)}>{subtitle}</h2>;

View File

@@ -31,6 +31,10 @@ type Props = {
className?: string;
};
/**
* @deprecated Please import the identical module from "@scm-manager/ui-core"
*/
const Title: FC<Props> = ({ title, preventRefreshingPageTitle, customPageTitle, className, children }) => {
useEffect(() => {
if (!preventRefreshingPageTitle) {

View File

@@ -22,10 +22,11 @@
* SOFTWARE.
*/
import { useMemo } from "react";
let counter = 0;
import { useAriaId } from "@scm-manager/ui-core";
/**
* @deprecated Please import the identical module from "@scm-manager/ui-core"
*/
export default function useGeneratedId(fallback?: string) {
return useMemo(() => fallback ?? `scm-id-${++counter}`, [fallback]);
return useAriaId(fallback);
}