@google-psat/report 0.10.1 → 0.10.2-1
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/dist/dashboard/components/siteMapReport/urlsWithIssues.js +9 -0
- package/dist/dashboard/components/urlsWithIssues/index.js +67 -0
- package/dist-types/dashboard/components/siteMapReport/urlsWithIssues.d.ts +9 -0
- package/dist-types/dashboard/components/urlsWithIssues/index.d.ts +6 -0
- package/package.json +2 -2
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Internal dependencies.
|
|
4
|
+
*/
|
|
5
|
+
import ErroredOutUrls from '../urlsWithIssues';
|
|
6
|
+
const URLSWithIssues = ({ erroredOutUrls }) => {
|
|
7
|
+
return _jsx(ErroredOutUrls, { erroredOutUrls: erroredOutUrls });
|
|
8
|
+
};
|
|
9
|
+
export default URLSWithIssues;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2023 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* External dependencies
|
|
19
|
+
*/
|
|
20
|
+
import { useMemo, useState } from 'react';
|
|
21
|
+
import { Resizable } from 're-resizable';
|
|
22
|
+
import { noop } from '@google-psat/common';
|
|
23
|
+
import { I18n } from '@google-psat/i18n';
|
|
24
|
+
import { Table, TableProvider, } from '@google-psat/design-system';
|
|
25
|
+
const ErroredOutUrls = ({ erroredOutUrls }) => {
|
|
26
|
+
const [selectedRow, setSelectedRow] = useState();
|
|
27
|
+
const tableColumns = useMemo(() => [
|
|
28
|
+
{
|
|
29
|
+
header: 'URL',
|
|
30
|
+
accessorKey: 'url',
|
|
31
|
+
cell: (info) => info,
|
|
32
|
+
enableHiding: false,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
header: 'Error Description',
|
|
36
|
+
accessorKey: 'errorMessage',
|
|
37
|
+
cell: (info) => info,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
header: 'Error Code',
|
|
41
|
+
accessorKey: 'errorCode',
|
|
42
|
+
cell: (info) => (_jsx("span", { className: "w-full flex justify-center", children: info })),
|
|
43
|
+
},
|
|
44
|
+
], []);
|
|
45
|
+
const filters = useMemo(() => ({}), []);
|
|
46
|
+
const searchKeys = useMemo(() => ['url'], []);
|
|
47
|
+
const tablePersistentSettingsKey = useMemo(() => {
|
|
48
|
+
return 'urlsWithIssues';
|
|
49
|
+
}, []);
|
|
50
|
+
return (_jsxs("div", { className: "w-full h-full text-outer-space-crayola border-x border-american-silver dark:border-quartz flex flex-col", children: [_jsx(Resizable, { defaultSize: {
|
|
51
|
+
width: '100%',
|
|
52
|
+
height: '80%',
|
|
53
|
+
}, minHeight: "6%", maxHeight: "95%", enable: {
|
|
54
|
+
top: false,
|
|
55
|
+
right: false,
|
|
56
|
+
bottom: true,
|
|
57
|
+
left: false,
|
|
58
|
+
}, className: "h-full flex", children: _jsx(TableProvider, { data: erroredOutUrls, tableColumns: tableColumns, tableFilterData: filters, tableSearchKeys: searchKeys, tablePersistentSettingsKey: tablePersistentSettingsKey, onRowClick: (row) => {
|
|
59
|
+
setSelectedRow(row);
|
|
60
|
+
}, onRowContextMenu: noop, getRowObjectKey: (row) => {
|
|
61
|
+
return row.originalData.url;
|
|
62
|
+
}, children: _jsx(Table, { hideFiltering: true, selectedKey: selectedRow?.url }) }) }), _jsx("div", { className: "flex-1 border border-gray-300 dark:border-quartz shadow h-full min-w-[10rem]", children: selectedRow ? (_jsxs("div", { className: "text-xs py-1 px-1.5", children: [selectedRow.url && (_jsxs(_Fragment, { children: [_jsx("p", { className: "font-bold text-granite-gray dark:text-manatee mb-1 text-semibold flex items-center", children: _jsx("span", { children: "Error Message" }) }), _jsx("p", { className: "mb-4 break-words text-outer-space-crayola dark:text-bright-gray", children: selectedRow.errorMessage })] })), _jsxs(_Fragment, { children: [_jsx("p", { className: "font-bold text-granite-gray dark:text-manatee mb-1", children: "Error code" }), _jsx("p", { className: "mb-4 text-outer-space-crayola dark:text-bright-gray", children: selectedRow?.errorCode || I18n.getMessage('noDescription') })] }), selectedRow?.stackTrace && (_jsxs(_Fragment, { children: [_jsx("p", { className: "font-bold text-granite-gray dark:text-manatee mb-1", children: "Stack trace" }), _jsx("p", { className: "text-outer-space-crayola dark:text-bright-gray", children: _jsx("pre", { children: _jsx("code", { dangerouslySetInnerHTML: {
|
|
63
|
+
__html: selectedRow?.stackTrace ||
|
|
64
|
+
I18n.getMessage('noDescription'),
|
|
65
|
+
} }) }) })] }))] })) : (_jsx("div", { className: "h-full p-8 flex items-center", children: _jsx("p", { className: "text-lg w-full font-bold text-granite-gray dark:text-manatee text-center", children: I18n.getMessage('selectRowToPreview') }) })) })] }));
|
|
66
|
+
};
|
|
67
|
+
export default ErroredOutUrls;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies.
|
|
3
|
+
*/
|
|
4
|
+
import type { ErroredOutUrlsData } from '@google-psat/common';
|
|
5
|
+
interface URLSWithIssuesProps {
|
|
6
|
+
erroredOutUrls: ErroredOutUrlsData[];
|
|
7
|
+
}
|
|
8
|
+
declare const URLSWithIssues: ({ erroredOutUrls }: URLSWithIssuesProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default URLSWithIssues;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ErroredOutUrlsData } from '@google-psat/common';
|
|
2
|
+
interface ErroredOutUrlsProps {
|
|
3
|
+
erroredOutUrls: ErroredOutUrlsData[];
|
|
4
|
+
}
|
|
5
|
+
declare const ErroredOutUrls: ({ erroredOutUrls }: ErroredOutUrlsProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default ErroredOutUrls;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@google-psat/report",
|
|
3
|
-
"version": "0.10.1",
|
|
3
|
+
"version": "0.10.2-1",
|
|
4
4
|
"description": "Static HTML analysis report",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist-types/index.d.ts",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.15",
|
|
46
46
|
"@types/file-saver": "^2.0.5",
|
|
47
47
|
"babel-loader": "^9.1.3",
|
|
48
|
-
"webpack": "^5.
|
|
48
|
+
"webpack": "^5.94.0",
|
|
49
49
|
"webpack-cli": "^5.1.4",
|
|
50
50
|
"webpack-dev-server": "^4.15.1",
|
|
51
51
|
"webpackbar": "^5.0.2"
|