ydb-embedded-ui 1.1.0 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/components/AsideNavigation/AsideHeader.tsx +2 -1
- package/dist/components/FullNodeViewer/FullNodeViewer.js +1 -1
- package/dist/containers/Authentication/Authentication.tsx +1 -1
- package/dist/containers/Node/Node.tsx +2 -15
- package/dist/containers/Node/NodeStructure/NodeStructure.scss +3 -0
- package/dist/containers/Node/NodeStructure/NodeStructure.tsx +14 -12
- package/dist/containers/Node/NodeStructure/Pdisk.tsx +4 -4
- package/dist/containers/Node/NodeStructure/Vdisk.tsx +4 -4
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.tsx +1 -1
- package/package.json +6 -2
    
        package/CHANGELOG.md
    CHANGED
    
    | @@ -1,5 +1,27 @@ | |
| 1 1 | 
             
            # Changelog
         | 
| 2 2 |  | 
| 3 | 
            +
            ### [1.1.3](https://www.github.com/ydb-platform/ydb-embedded-ui/compare/v1.1.2...v1.1.3) (2022-04-20)
         | 
| 4 | 
            +
             | 
| 5 | 
            +
             | 
| 6 | 
            +
            ### Bug Fixes
         | 
| 7 | 
            +
             | 
| 8 | 
            +
            * should prepare internal link correctly ([3da36e2](https://www.github.com/ydb-platform/ydb-embedded-ui/commit/3da36e22f6adbce6a1b14ac1afb0fb4aa46bb75f))
         | 
| 9 | 
            +
             | 
| 10 | 
            +
            ### [1.1.2](https://www.github.com/ydb-platform/ydb-embedded-ui/compare/v1.1.1...v1.1.2) (2022-04-19)
         | 
| 11 | 
            +
             | 
| 12 | 
            +
             | 
| 13 | 
            +
            ### Bug Fixes
         | 
| 14 | 
            +
             | 
| 15 | 
            +
            * **ObjectSummary:** should correctly parse table creation time ([c9887dd](https://www.github.com/ydb-platform/ydb-embedded-ui/commit/c9887dd162720667dcbe3b4834b3b0ba5a9f3f6e))
         | 
| 16 | 
            +
             | 
| 17 | 
            +
            ### [1.1.1](https://www.github.com/ydb-platform/ydb-embedded-ui/compare/v1.1.0...v1.1.1) (2022-04-19)
         | 
| 18 | 
            +
             | 
| 19 | 
            +
             | 
| 20 | 
            +
            ### Bug Fixes
         | 
| 21 | 
            +
             | 
| 22 | 
            +
            * add typecheck + fix type errors ([e6d9086](https://www.github.com/ydb-platform/ydb-embedded-ui/commit/e6d9086c46702a611f848c992377d18826ca2e23))
         | 
| 23 | 
            +
            * **Node:** scroll to selected vdisk should not apply to undefined container ([7236a43](https://www.github.com/ydb-platform/ydb-embedded-ui/commit/7236a43655b935777abb5b8df228ae011ceb6bed))
         | 
| 24 | 
            +
             | 
| 3 25 | 
             
            ## [1.1.0](https://www.github.com/ydb-platform/ydb-embedded-ui/compare/v1.0.4...v1.1.0) (2022-04-15)
         | 
| 4 26 |  | 
| 5 27 |  | 
| @@ -20,7 +20,7 @@ import { | |
| 20 20 | 
             
                FooterItemIconView,
         | 
| 21 21 | 
             
            } from './constants';
         | 
| 22 22 | 
             
            import i18n from './i18n';
         | 
| 23 | 
            -
             | 
| 23 | 
            +
             | 
| 24 24 | 
             
            import {getLocalData, setLocalData} from './helpers';
         | 
| 25 25 | 
             
            import {SetSlotsContext, SlotsProvider} from './AsideHeaderFooterSlot/SlotsContext';
         | 
| 26 26 | 
             
            import {SlotName} from './AsideHeaderFooterSlot/AsideHeaderFooterSlot';
         | 
| @@ -28,6 +28,7 @@ import {SlotName} from './AsideHeaderFooterSlot/AsideHeaderFooterSlot'; | |
| 28 28 | 
             
            import controlMenuButton from '../../assets/icons/control-menu-button.svg';
         | 
| 29 29 |  | 
| 30 30 | 
             
            import './AsideHeader.scss';
         | 
| 31 | 
            +
            import {Lang} from '../../utils/i18n';
         | 
| 31 32 |  | 
| 32 33 | 
             
            const b = block('nv-aside-header');
         | 
| 33 34 |  | 
| @@ -32,7 +32,7 @@ class FullNodeViewer extends React.Component { | |
| 32 32 | 
             
                render() {
         | 
| 33 33 | 
             
                    const {node, className, additionalNodesInfo={}} = this.props;
         | 
| 34 34 | 
             
                    const nodeHref = additionalNodesInfo.getNodeRef
         | 
| 35 | 
            -
                        ? additionalNodesInfo.getNodeRef(node)
         | 
| 35 | 
            +
                        ? additionalNodesInfo.getNodeRef(node) + 'internal'
         | 
| 36 36 | 
             
                        : undefined;
         | 
| 37 37 |  | 
| 38 38 | 
             
                    const commonInfo = [
         | 
| @@ -43,7 +43,7 @@ function Authentication({authenticate, error}: any) { | |
| 43 43 | 
             
                    authenticate(login, pass);
         | 
| 44 44 | 
             
                };
         | 
| 45 45 |  | 
| 46 | 
            -
                const onEnterClick = (e: KeyboardEvent<HTMLInputElement>) => {
         | 
| 46 | 
            +
                const onEnterClick = (e: KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => {
         | 
| 47 47 | 
             
                    if (e.keyCode === 13) {
         | 
| 48 48 | 
             
                        onLoginClick();
         | 
| 49 49 | 
             
                    }
         | 
| @@ -39,7 +39,6 @@ interface NodeProps { | |
| 39 39 |  | 
| 40 40 | 
             
            function Node(props: NodeProps) {
         | 
| 41 41 | 
             
                const dispatch = useDispatch();
         | 
| 42 | 
            -
                const repaint = React.useState({})[1];
         | 
| 43 42 |  | 
| 44 43 | 
             
                const wasLoaded = useSelector((state: any) => state.node.wasLoaded);
         | 
| 45 44 | 
             
                const loading = useSelector((state: any) => state.node.loading);
         | 
| @@ -72,8 +71,6 @@ function Node(props: NodeProps) { | |
| 72 71 | 
             
                    return {activeTabVerified, nodeTabs};
         | 
| 73 72 | 
             
                }, [activeTab, node]);
         | 
| 74 73 |  | 
| 75 | 
            -
                const nodeContainerRef = React.useRef<HTMLDivElement | null>(null);
         | 
| 76 | 
            -
             | 
| 77 74 | 
             
                React.useEffect(() => {
         | 
| 78 75 | 
             
                    const fetchData = () => dispatch(getNodeInfo(nodeId));
         | 
| 79 76 | 
             
                    fetchData();
         | 
| @@ -148,7 +145,6 @@ function Node(props: NodeProps) { | |
| 148 145 | 
             
                                    className={b('node-page-wrapper')}
         | 
| 149 146 | 
             
                                    nodeId={nodeId}
         | 
| 150 147 | 
             
                                    additionalNodesInfo={additionalNodesInfo}
         | 
| 151 | 
            -
                                    scrollContainer={nodeContainerRef.current}
         | 
| 152 148 | 
             
                                />
         | 
| 153 149 | 
             
                            );
         | 
| 154 150 | 
             
                        }
         | 
| @@ -157,13 +153,6 @@ function Node(props: NodeProps) { | |
| 157 153 | 
             
                    }
         | 
| 158 154 | 
             
                };
         | 
| 159 155 |  | 
| 160 | 
            -
                const onRefChange = (ref: HTMLDivElement) => {
         | 
| 161 | 
            -
                    if (!nodeContainerRef.current) {
         | 
| 162 | 
            -
                        nodeContainerRef.current = ref;
         | 
| 163 | 
            -
                        repaint({});
         | 
| 164 | 
            -
                    }
         | 
| 165 | 
            -
                };
         | 
| 166 | 
            -
             | 
| 167 156 | 
             
                if (loading && !wasLoaded) {
         | 
| 168 157 | 
             
                    return <Loader />;
         | 
| 169 158 | 
             
                } else if (error) {
         | 
| @@ -171,12 +160,10 @@ function Node(props: NodeProps) { | |
| 171 160 | 
             
                } else {
         | 
| 172 161 | 
             
                    if (node) {
         | 
| 173 162 | 
             
                        return (
         | 
| 174 | 
            -
                            <div className={ | 
| 163 | 
            +
                            <div className={b(null, props.className)}>
         | 
| 175 164 | 
             
                                {renderTabs()}
         | 
| 176 165 |  | 
| 177 | 
            -
                                <div className={b('content')} | 
| 178 | 
            -
                                    {renderTabContent()}
         | 
| 179 | 
            -
                                </div>
         | 
| 166 | 
            +
                                <div className={b('content')}>{renderTabContent()}</div>
         | 
| 180 167 | 
             
                            </div>
         | 
| 181 168 | 
             
                        );
         | 
| 182 169 | 
             
                    }
         | 
| @@ -28,7 +28,6 @@ interface NodeStructureProps { | |
| 28 28 | 
             
                nodeId: string;
         | 
| 29 29 | 
             
                className?: string;
         | 
| 30 30 | 
             
                additionalNodesInfo?: any;
         | 
| 31 | 
            -
                scrollContainer: Element | null;
         | 
| 32 31 | 
             
            }
         | 
| 33 32 |  | 
| 34 33 | 
             
            const autofetcher = new AutoFetcher();
         | 
| @@ -40,9 +39,7 @@ function NodeStructure(props: NodeStructureProps) { | |
| 40 39 |  | 
| 41 40 | 
             
                const loadingStructure = useSelector((state: any) => state.node.loadingStructure);
         | 
| 42 41 | 
             
                const wasLoadedStructure = useSelector((state: any) => state.node.wasLoadedStructure);
         | 
| 43 | 
            -
                const nodeData = useSelector(
         | 
| 44 | 
            -
                    (state: any) => state.node?.data?.SystemStateInfo?.[0]
         | 
| 45 | 
            -
                );
         | 
| 42 | 
            +
                const nodeData = useSelector((state: any) => state.node?.data?.SystemStateInfo?.[0]);
         | 
| 46 43 |  | 
| 47 44 | 
             
                const nodeHref = useMemo(() => {
         | 
| 48 45 | 
             
                    return props.additionalNodesInfo?.getNodeRef
         | 
| @@ -55,13 +52,15 @@ function NodeStructure(props: NodeStructureProps) { | |
| 55 52 | 
             
                    true,
         | 
| 56 53 | 
             
                ).query;
         | 
| 57 54 |  | 
| 55 | 
            +
                const scrollContainerRef = useRef<HTMLDivElement>(null);
         | 
| 56 | 
            +
                const scrollContainer = scrollContainerRef.current;
         | 
| 57 | 
            +
             | 
| 58 58 | 
             
                const isReady = useRef(false);
         | 
| 59 59 |  | 
| 60 60 | 
             
                const scrolled = useRef(false);
         | 
| 61 61 |  | 
| 62 62 | 
             
                useEffect(() => {
         | 
| 63 63 | 
             
                    return () => {
         | 
| 64 | 
            -
                        const {scrollContainer} = props;
         | 
| 65 64 | 
             
                        if (scrollContainer) {
         | 
| 66 65 | 
             
                            scrollContainer.scrollTo({
         | 
| 67 66 | 
             
                                behavior: 'smooth',
         | 
| @@ -84,13 +83,12 @@ function NodeStructure(props: NodeStructureProps) { | |
| 84 83 | 
             
                }, [props.nodeId, dispatch]);
         | 
| 85 84 |  | 
| 86 85 | 
             
                useEffect(() => {
         | 
| 87 | 
            -
                    if (!_.isEmpty(nodeStructure) &&  | 
| 86 | 
            +
                    if (!_.isEmpty(nodeStructure) && scrollContainer) {
         | 
| 88 87 | 
             
                        isReady.current = true;
         | 
| 89 88 | 
             
                    }
         | 
| 90 | 
            -
                }, [nodeStructure | 
| 89 | 
            +
                }, [nodeStructure]);
         | 
| 91 90 |  | 
| 92 91 | 
             
                useEffect(() => {
         | 
| 93 | 
            -
                    const {scrollContainer} = props;
         | 
| 94 92 | 
             
                    if (isReady.current && !scrolled.current && scrollContainer) {
         | 
| 95 93 | 
             
                        const element = document.getElementById(
         | 
| 96 94 | 
             
                            generateId({type: 'pdisk', id: pdiskIdFromUrl as string}),
         | 
| @@ -105,7 +103,7 @@ function NodeStructure(props: NodeStructureProps) { | |
| 105 103 | 
             
                            const order = vDisk?.order;
         | 
| 106 104 |  | 
| 107 105 | 
             
                            if (dataTable) {
         | 
| 108 | 
            -
                                scrollToVdisk += (dataTable as HTMLElement).offsetTop + 40 *  | 
| 106 | 
            +
                                scrollToVdisk += (dataTable as HTMLElement).offsetTop + 40 * order;
         | 
| 109 107 | 
             
                            }
         | 
| 110 108 | 
             
                        }
         | 
| 111 109 |  | 
| @@ -113,12 +111,12 @@ function NodeStructure(props: NodeStructureProps) { | |
| 113 111 | 
             
                            scrollContainer.scrollTo({
         | 
| 114 112 | 
             
                                behavior: 'smooth',
         | 
| 115 113 | 
             
                                // should subtract 20 to avoid sticking the element to tabs
         | 
| 116 | 
            -
                                top: scrollToVdisk ? scrollToVdisk : element.offsetTop | 
| 114 | 
            +
                                top: scrollToVdisk ? scrollToVdisk : element.offsetTop,
         | 
| 117 115 | 
             
                            });
         | 
| 118 116 | 
             
                            scrolled.current = true;
         | 
| 119 117 | 
             
                        }
         | 
| 120 118 | 
             
                    }
         | 
| 121 | 
            -
                }, [nodeStructure,  | 
| 119 | 
            +
                }, [nodeStructure, pdiskIdFromUrl, vdiskIdFromUrl]);
         | 
| 122 120 |  | 
| 123 121 | 
             
                const renderStub = () => {
         | 
| 124 122 | 
             
                    return 'There is no information about node structure.';
         | 
| @@ -147,7 +145,11 @@ function NodeStructure(props: NodeStructureProps) { | |
| 147 145 | 
             
                    return renderStructure();
         | 
| 148 146 | 
             
                };
         | 
| 149 147 |  | 
| 150 | 
            -
                return  | 
| 148 | 
            +
                return (
         | 
| 149 | 
            +
                    <div className={b()} ref={scrollContainerRef}>
         | 
| 150 | 
            +
                        <div className={props.className}>{renderContent()}</div>
         | 
| 151 | 
            +
                    </div>
         | 
| 152 | 
            +
                );
         | 
| 151 153 | 
             
            }
         | 
| 152 154 |  | 
| 153 155 | 
             
            export default NodeStructure;
         | 
| @@ -68,11 +68,11 @@ function getColumns({ | |
| 68 68 | 
             
                        header: vDiskTableColumnsNames[VDiskTableColumnsIds.slotId],
         | 
| 69 69 | 
             
                        width: 100,
         | 
| 70 70 | 
             
                        render: ({value, row}) => {
         | 
| 71 | 
            -
                            let vdiskInternalViewerLink | 
| 71 | 
            +
                            let vdiskInternalViewerLink = '';
         | 
| 72 72 |  | 
| 73 73 | 
             
                            if (nodeHref && value !== undefined) {
         | 
| 74 74 | 
             
                                vdiskInternalViewerLink +=
         | 
| 75 | 
            -
                                    nodeHref + ' | 
| 75 | 
            +
                                    nodeHref + 'actors/vdisks/vdisk' + pad9(pDiskId) + '_' + pad9(value);
         | 
| 76 76 | 
             
                            }
         | 
| 77 77 |  | 
| 78 78 | 
             
                            return (
         | 
| @@ -195,10 +195,10 @@ export function PDisk(props: PDiskProps) { | |
| 195 195 | 
             
                        SerialNumber,
         | 
| 196 196 | 
             
                    } = data;
         | 
| 197 197 |  | 
| 198 | 
            -
                    let pDiskInternalViewerLink | 
| 198 | 
            +
                    let pDiskInternalViewerLink = '';
         | 
| 199 199 |  | 
| 200 200 | 
             
                    if (nodeHref) {
         | 
| 201 | 
            -
                        pDiskInternalViewerLink += nodeHref + ' | 
| 201 | 
            +
                        pDiskInternalViewerLink += nodeHref + 'actors/pdisks/pdisk' + pad9(PDiskId);
         | 
| 202 202 | 
             
                    }
         | 
| 203 203 |  | 
| 204 204 | 
             
                    const pdiskInfo: any = [
         | 
| @@ -1,12 +1,12 @@ | |
| 1 1 | 
             
            import React from 'react';
         | 
| 2 2 | 
             
            import cn from 'bem-cn-lite';
         | 
| 3 3 |  | 
| 4 | 
            -
            import ProgressViewer from 'components/ProgressViewer/ProgressViewer';
         | 
| 5 | 
            -
            import {formatStorageValuesToGb, stringifyVdiskId} from 'utils';
         | 
| 6 | 
            -
            import {bytesToGB, bytesToSpeed} from 'utils/utils';
         | 
| 4 | 
            +
            import ProgressViewer from '../../../components/ProgressViewer/ProgressViewer';
         | 
| 5 | 
            +
            import {formatStorageValuesToGb, stringifyVdiskId} from '../../../utils';
         | 
| 6 | 
            +
            import {bytesToGB, bytesToSpeed} from '../../../utils/utils';
         | 
| 7 7 | 
             
            import EntityStatus from '../../../components/EntityStatus/EntityStatus';
         | 
| 8 8 | 
             
            import {valueIsDefined} from './NodeStructure';
         | 
| 9 | 
            -
            import InfoViewer from 'components/InfoViewer/InfoViewer';
         | 
| 9 | 
            +
            import InfoViewer from '../../../components/InfoViewer/InfoViewer';
         | 
| 10 10 |  | 
| 11 11 | 
             
            const b = cn('kv-node-structure');
         | 
| 12 12 |  | 
| @@ -153,7 +153,7 @@ function ObjectSummary(props: ObjectSummaryProps) { | |
| 153 153 | 
             
                };
         | 
| 154 154 |  | 
| 155 155 | 
             
                const renderObjectOverview = () => {
         | 
| 156 | 
            -
                    const startTimeInMilliseconds = currentSchemaData?.CreateStep | 
| 156 | 
            +
                    const startTimeInMilliseconds = Number(currentSchemaData?.CreateStep);
         | 
| 157 157 | 
             
                    let createTime = '';
         | 
| 158 158 | 
             
                    if (startTimeInMilliseconds) {
         | 
| 159 159 | 
             
                        createTime = new Date(startTimeInMilliseconds).toUTCString();
         | 
    
        package/package.json
    CHANGED
    
    | @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            {
         | 
| 2 2 | 
             
              "name": "ydb-embedded-ui",
         | 
| 3 | 
            -
              "version": "1.1. | 
| 3 | 
            +
              "version": "1.1.3",
         | 
| 4 4 | 
             
              "files": [
         | 
| 5 5 | 
             
                "dist"
         | 
| 6 6 | 
             
              ],
         | 
| @@ -52,6 +52,9 @@ | |
| 52 52 | 
             
                "test": "react-app-rewired test",
         | 
| 53 53 | 
             
                "eject": "react-scripts eject",
         | 
| 54 54 | 
             
                "prepublishOnly": "npm run package",
         | 
| 55 | 
            +
                "typecheck": "npm run typecheck:server && npm run typecheck:ui",
         | 
| 56 | 
            +
                "typecheck:server": "tsc -p src/server --noEmit",
         | 
| 57 | 
            +
                "typecheck:ui": "tsc -p src/ui --noEmit",
         | 
| 55 58 | 
             
                "prepare": "husky install"
         | 
| 56 59 | 
             
              },
         | 
| 57 60 | 
             
              "lint-staged": {
         | 
| @@ -78,6 +81,7 @@ | |
| 78 81 | 
             
                "@commitlint/cli": "^15.0.0",
         | 
| 79 82 | 
             
                "@commitlint/config-conventional": "^15.0.0",
         | 
| 80 83 | 
             
                "@types/lodash": "^4.14.178",
         | 
| 84 | 
            +
                "@types/react": "^17.0.44",
         | 
| 81 85 | 
             
                "@types/react-dom": "^17.0.11",
         | 
| 82 86 | 
             
                "@types/react-router": "^5.1.17",
         | 
| 83 87 | 
             
                "@types/react-router-dom": "^5.3.2",
         | 
| @@ -99,6 +103,6 @@ | |
| 99 103 | 
             
                "react-app-rewired": "^2.1.11",
         | 
| 100 104 | 
             
                "react-dom": "^17.0.2",
         | 
| 101 105 | 
             
                "stylelint": "^14.3.0",
         | 
| 102 | 
            -
                "typescript": "^4.5. | 
| 106 | 
            +
                "typescript": "^4.5.5"
         | 
| 103 107 | 
             
              }
         | 
| 104 108 | 
             
            }
         |