ocket8888 commented on code in PR #7927:
URL: https://github.com/apache/trafficcontrol/pull/7927#discussion_r1471607082
##########
infrastructure/cdn-in-a-box/optional/grafana/trafficcontrol-scenes/src/img/logo.svg:
##########
Review Comment:
Can you make this a symbolic link to `misc/logos/ATC-SVG.svg`? Or will that
not work?
##########
infrastructure/cdn-in-a-box/optional/grafana/trafficcontrol-scenes/src/constants.ts:
##########
@@ -17,36 +17,36 @@
* under the License.
*/
-import pluginJson from './plugin.json';
+import pluginJson from "./plugin.json";
export const PLUGIN_BASE_URL = `/a/${pluginJson.id}`;
-export enum ROUTES {
- CacheGroup = 'cache-group',
- DeliveryService = 'delivery-service',
- Server = 'server',
-}
+export const ROUTES = {
Review Comment:
Feel free to use enums if you want
##########
infrastructure/cdn-in-a-box/optional/grafana/trafficcontrol-scenes/.eslintrc.json:
##########
@@ -238,7 +238,8 @@
"selector": "variable",
"format": [
"camelCase",
- "UPPER_CASE"
+ "UPPER_CASE",
+ "PascalCase"
Review Comment:
indentation here is 7 tab characters while on the preceding line it's 14
spaces (7 groups of 2 spaces, presumably). Indentation within a single file
should be consistent (and ideally use one tab per indentation level).
##########
infrastructure/cdn-in-a-box/optional/grafana/trafficcontrol-scenes/src/utils/utils.plugin.ts:
##########
@@ -17,20 +17,14 @@
* under the License.
*/
-import React, { useContext } from 'react';
-import { AppRootProps } from '@grafana/data';
+import { AppRootProps } from "@grafana/data";
+import React from "react";
// This is used to be able to retrieve the root plugin props anywhere inside
the app.
export const PluginPropsContext = React.createContext<AppRootProps |
null>(null);
-export const usePluginProps = () => {
- const pluginProps = useContext(PluginPropsContext);
-
- return pluginProps;
-};
-
-export const usePluginMeta = () => {
- const pluginProps = usePluginProps();
-
- return pluginProps?.meta;
-};
+// export const usePluginProps = () => {
+// const pluginProps = useContext(PluginPropsContext);
+//
+// return pluginProps;
+// };
Review Comment:
Did you mean to comment this out? If it's not relevant, should it be removed?
##########
infrastructure/cdn-in-a-box/optional/grafana/trafficcontrol-scenes/webpack/webpack.config.ts:
##########
@@ -11,23 +11,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-/*
- * ⚠️⚠️⚠️ THIS FILE WAS SCAFFOLDED BY `@grafana/create-plugin`. DO NOT EDIT
THIS FILE DIRECTLY. ⚠️⚠️⚠️
- *
- * In order to extend the configuration follow the steps in
- *
https://grafana.com/developers/plugin-tools/create-a-plugin/extend-a-plugin/extend-configurations#extend-the-webpack-config
- */
+/* eslint-disable */
Review Comment:
You should probably disable a specific rule (with a comment explaining why)
and not the entire linter.
##########
infrastructure/cdn-in-a-box/optional/grafana/trafficcontrol-scenes/src/components/App/App.tsx:
##########
@@ -17,17 +17,28 @@
* under the License.
*/
-import React from 'react';
-import { AppRootProps } from '@grafana/data';
-import { PluginPropsContext } from '../../utils/utils.plugin';
-import { Routes } from '../Routes';
+import { AppRootProps } from "@grafana/data";
+import React, { ReactElement } from "react";
+import { Routes } from "src/components/Routes";
+import { PluginPropsContext } from "src/utils/utils.plugin";
+
+/**
+ * Renders the component by providing the PluginPropsContext to its children.
+ *
+ * @returns {ReactElement} The rendered component.
Review Comment:
Classes don't need `@returns` annotations.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]