Skip to content

Commit

Permalink
#81 fix: jest,repo,ci> fix troubles with enums + change CI services a…
Browse files Browse the repository at this point in the history
…fter changed Owners of repo
  • Loading branch information
cybermerlin committed Dec 27, 2022
1 parent b699864 commit b7cc1eb
Show file tree
Hide file tree
Showing 20 changed files with 101 additions and 112 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ jobs:
with:
# Additional arguments for the sonarcloud scanner
args:
-Dsonar.projectKey=dm-rybalchenko_excel-app
-Dsonar.organization=dm-rybalchenko
-Dsonar.projectKey=cybermerlin_family-budget
-Dsonar.organization=cybermerlin

finish:
needs: review
Expand Down
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Develop health](https://github.com/dm-rybalchenko/family_budget/actions/workflows/review.yml/badge.svg?branch=develop)](https://github.com/dm-rybalchenko/family_budget/actions/workflows/review.yml)
[![Coverage Status](https://coveralls.io/repos/github/dm-rybalchenko/family_budget/badge.svg?branch=develop)](https://coveralls.io/github/dm-rybalchenko/family_budget?branch=develop)
[![Develop health](https://github.com/cybermerlin/family_budget/actions/workflows/review.yml/badge.svg?branch=develop)](https://github.com/cybermerlin/family_budget/actions/workflows/review.yml)
[![Coverage Status](https://coveralls.io/repos/github/cybermerlin/family_budget/badge.svg?branch=develop)](https://coveralls.io/github/cybermerlin/family_budget?branch=develop)
[![Visit docs](https://img.shields.io/badge/docs-visit%20site-orange)](https://formidable.com/open-source/family_budget/wiki/)
[<img alt="GitHub Discussions: Chat With Us" src="https://badgen.net/badge/discussions/chat%20with%20us/purple" />](https://github.com/dm-rybalchenko/family_budget/discussions)
[<img alt="GitHub Discussions: Chat With Us" src="https://badgen.net/badge/discussions/chat%20with%20us/purple" />](https://github.com/cybermerlin/family_budget/discussions)
[![License: GPL](https://img.shields.io/badge/License-GPL-yellow.svg)](LICENSE)

# Family Budget
Expand Down Expand Up @@ -65,8 +65,8 @@ Run only the necessary commands.
- Make Fork repository from GitHub (copy all branches).

- Used to target an existing repository and create a clone, or copy of the target repository.
- source of code ```git clone https://github.com/dm-rybalchenko/family_budget```
- source of **Wiki** ```git clone https://github.com/dm-rybalchenko/family_budget.wiki.git```
- source of code ```git clone https://github.com/cybermerlin/family_budget```
- source of **Wiki** ```git clone https://github.com/cybermerlin/family_budget.wiki.git```

- Go to the project folder.
```cd ./family_budget```
Expand All @@ -85,4 +85,3 @@ And then open the browser and enter the address that the system will write in th

## [Documentaions](docs/index.md)

*look\click at the link of this header.*
6 changes: 0 additions & 6 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
### [Learn More](react/more.md)

*click by header.*

#### [React](react/index.md)

*click by header.*

### [Components](react/components.md)

*click by header.*

### TypeScript Definitions

Expand All @@ -31,14 +28,11 @@ file:

### [GraphQL](GraphQL/index.md)

*click by header.*

### Infrastructure

#### [DevOps](infrastructure/DevOps.md)

*click by header.*

#### [NodeJS](nodejs/index.md)

*click by header.*
24 changes: 11 additions & 13 deletions docs/react/jest.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
- [React Testing Library Cheatsheet](https://testing-library.com/docs/react-testing-library/cheatsheet)
- [Jest DOM matchers cheatsheet](https://github.com/testing-library/jest-dom)


##### Debugging

1. Open in the Chrome browser: [Inspector](chrome://inspect/#devices)
Expand All @@ -26,20 +25,19 @@
"testEnvironment": "jsdom",
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
"moduleFileExtensions": [
"js",
"ts",
"jsx",
"tsx",
"json",
"node",
"web.js",
"web.ts",
"web.tsx",
"web.jsx"
"js",
"ts",
"jsx",
"tsx",
"json",
"node",
"web.js",
"web.ts",
"web.tsx",
"web.jsx"
],
"setupFilesAfterEnv": [
"<rootDir>/src/setupTests.ts"
"<rootDir>/src/setupTests.ts"
]
}
```

20 changes: 1 addition & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"prod": "CI=false && react-scripts build",
"start": "react-scripts start",
"storybook": "start-storybook -p 6006 -s public",
"test": "react-scripts test",
"test": "react-scripts test --bail",
"test-dbg": "node --inspect-brk ./node_modules/jest/bin/jest.js --runInBand",
"test-zero": "node ./node_modules/jest/bin/jest.js"
},
Expand Down Expand Up @@ -162,24 +162,6 @@
"transformIgnorePatterns": [
"[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs|cjs|ts|tsx)$",
"^.+\\.module\\.(css|sass|scss)$"
],
"bail": true,
"testEnvironment": "jsdom",
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
"moduleFileExtensions": [
"js",
"ts",
"jsx",
"tsx",
"json",
"node",
"web.js",
"web.ts",
"web.tsx",
"web.jsx"
],
"setupFilesAfterEnv": [
"<rootDir>/src/setupTests.ts"
]
}
}
6 changes: 3 additions & 3 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
sonar.projectKey=dm-rybalchenko_excel-app
sonar.organization=dm-rybalchenko
sonar.projectKey=cybermerlin_family_budget
sonar.organization=cybermerlin

# This is the name and version displayed in the SonarCloud UI.
sonar.projectName=excel-app
sonar.projectName=family_budget
sonar.projectVersion=0.0

# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
Expand Down
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ApolloClient, ApolloProvider, HttpLink, InMemoryCache } from '@apollo/client';
import { ApolloClient, ApolloProvider, InMemoryCache } from '@apollo/client';
import React from 'react';
import ReactDOM from 'react-dom/client';
import { Provider } from 'react-redux';
Expand Down
1 change: 1 addition & 0 deletions src/lib/editableGrid/Cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useCallback, useEffect, useRef, useState } from 'react';
import ContentEditable from 'react-contenteditable';
import { createPortal } from 'react-dom';
import { usePopper } from 'react-popper';
import { EActionTypes, EDataTypes, TCellProps } from 'src/lib/editableGrid/types/EditableGrid';
import { findFormula } from 'src/plugins/math/pureMath/handlersCountCellsData';
import Badge from './Badge';
import { gray } from './colors';
Expand Down
1 change: 1 addition & 0 deletions src/lib/editableGrid/EditableGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useEffect, useReducer } from 'react';

import './style.scss';
import Table from './Table';
import { EActionTypes, EDataTypes, TAction } from './types/EditableGrid';
import { makeData, randomColor, shortId } from './utils';


Expand Down
2 changes: 2 additions & 0 deletions src/lib/editableGrid/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { useEffect, useState } from 'react';
import { usePopper } from 'react-popper';

import { EActionTypes, EDataTypes } from 'src/lib/editableGrid/types/EditableGrid';
import { THeaderProps } from 'src/lib/editableGrid/types/Header';
import { gray } from './colors';
import ArrowDownIcon from './img/ArrowDown';
import ArrowLeftIcon from './img/ArrowLeft';
Expand Down
3 changes: 3 additions & 0 deletions src/lib/editableGrid/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import clsx from 'clsx';
import { useCallback, useMemo } from 'react';
import { useBlockLayout, useResizeColumns, useSortBy, useTable } from 'react-table';
import { FixedSizeList } from 'react-window';
import { EActionTypes } from 'src/lib/editableGrid/types/EditableGrid';

import { TRowCells, TTableProps } from './types/Table';
import Cell from './Cell';
import Header from './Header';
import PlusIcon from './img/Plus';
Expand All @@ -22,6 +24,7 @@ let defaultColumn = {
* This variable is used to count and assign row id's
*/
let idRow = 0;

export default function Table({
columns,
data,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
declare type TState = {
columns: any[];
data: any[];
skipReset: boolean;
}

declare type TAction = {
export type TAction = {
type: EActionTypes;
value?: string;
columnId?: string;
Expand All @@ -17,9 +11,9 @@ declare type TAction = {
}

/**
* For actions for the EditableGrid
* For actions for the EditableGrid column's header
*/
declare enum EActionTypes {
export enum EActionTypes {
ADD_OPTION_TO_COLUMN = 'add_option_to_column',
ADD_ROW = 'add_row',
UPDATE_COLUMN_TYPE = 'update_column_type',
Expand All @@ -31,9 +25,16 @@ declare enum EActionTypes {
ENABLE_RESET = 'enable_reset'
}

declare enum EDataTypes {
export enum EDataTypes {
NUMBER = 'number',
TEXT = 'text',
SELECT = 'select',
UNDEFINED = 'null'
}

export type TCellProps = {
value: string;
row: { index: number };
column: { id: string, dataType: EDataTypes, options: TOptionsColumn[] };
dataDispatch: (arg: { [key: string]: any }) => void;
};
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
export {};
import { EDataTypes } from "./EditableGrid";

declare type THeaderProps = {

export declare type THeaderProps = {
column: THeaderColumn;
setSortBy: (arg: any[]) => void;
dataDispatch: (arg: { [key: EDataTypes]: any }) => void;
dataDispatch: (arg: Record<string, any>) => void;
}
declare type THeaderColumn = {

export declare type THeaderColumn = {
id: string;
created?: boolean;
label: string;
dataType: EDataTypes;
getResizerProps: () => any[];
getHeaderProps: () => any[];
}
declare type TButtonEvent = React.MouseEvent<Element>;
30 changes: 30 additions & 0 deletions src/lib/editableGrid/types/Table.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { EDataTypes } from './EditableGrid';


export type TColumn = {
id: string;
label: string;
accessor?: string;
dataType: EDataTypes;
options?: TOptionsColumn[];
width?: number;
maxWidth?: number;
minWidth?: number;
disableResizing?: boolean;
isResizing?: boolean;
}

export declare type TRowCells = {
column: TColumn[];
row: TRow[];
value?: string | number;
getCellProps: () => { [key: string]: any };
render: (type?: string, props?: { [key: string]: any }) => any;
}

export declare type TTableProps = {
columns: TColumn[];
data: any[];
skipReset: boolean;
dispatch: (arg?: Record<string, any>) => void;
}
Original file line number Diff line number Diff line change
@@ -1,32 +1,13 @@
declare type TTableProps = {
columns: TColumn[];
declare type TButtonEvent = React.MouseEvent<Element>;

declare type TState = {
columns: any[];
data: any[];
skipReset: boolean;
dispatch: (arg?: { [key: string]: any }) => void;
}
declare type TRenderRowProps = {
index: number,
style: {
heigth: number,
left: number,
right?: number,
position: string,
top: number,
width: string,
}
}
declare type TColumn = {
id: string;
label: string;
accessor?: string;
dataType: EDataTypes;
options?: TOptionsColumn[];
width?: number;
maxWidth?: number;
minWidth?: number;
disableResizing?: boolean;
isResizing?: boolean;
}

declare type TOptionsColumn = { label: string, backgroundColor: string }

declare type TRow = {
allCells: TRowCells[];
cells: TRowCells[];
Expand All @@ -39,13 +20,6 @@ declare type TRow = {
subRows: any[];
values?: string | number;
}
declare type TRowCells = {
column: TColumn[];
row: TRow[];
value?: string | number;
getCellProps: () => { [key: string]: any };
render: (type?: string, props?: { [key: string]: any }) => any;
}
declare type TRowOriginal = {
ID: number;
age: number;
Expand All @@ -65,5 +39,17 @@ declare type TUseTableProps = {
declare type THeaderGroups = {
getFooterGroupProps: (props?: { [key: string]: any }) => any;
getHeaderGroupProps: (props?: { [key: string]: any }) => any;
headers: { [key: string]: any }[];
headers: Record<string, any>[];
}

declare type TRenderRowProps = {
index: number,
style: {
heigth: number,
left: number,
right?: number,
position: string,
top: number,
width: string,
}
}
8 changes: 0 additions & 8 deletions src/lib/editableGrid/types/typesCell.d.ts

This file was deleted.

2 changes: 2 additions & 0 deletions src/lib/editableGrid/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { faker } from '@faker-js/faker/locale/ru';
import { EDataTypes } from 'src/lib/editableGrid/types/EditableGrid';
import { TColumn } from 'src/lib/editableGrid/types/Table';

//#region StringOfLength
type StringOfLength<TMin extends number, TMax extends number> = string & {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/counter/Counter.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Button } from 'antd';
import React, { useState } from 'react';

import { useAppDispatch, useAppSelector } from '../../app/hooks';
import { useAppDispatch, useAppSelector } from 'src/app/hooks';
import styles from './Counter.module.scss';
import { decrement, increment, incrementAsync, incrementByAmount, incrementIfOdd, selectCount } from './counterSlice';

Expand Down
Loading

0 comments on commit b7cc1eb

Please sign in to comment.