mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Enforce some naming conventions (#4813)
This commit is contained in:
1 parent
dc6615f98f
commit
0b32775d40
197 files changed
+630
-634
No files matched your search
@@ -15,9 +15,9 @@ import { EventEmitter } from "events";
|
||||
import { navigate } from "../../navigation";
|
||||
import { catalogCategoryRegistry } from "../../api/catalog-category-registry";
|
||||
|
||||
export type CatalogAddButtonProps = {
|
||||
export interface CatalogAddButtonProps {
|
||||
category: CatalogCategory;
|
||||
};
|
||||
}
|
||||
|
||||
type CategoryId = string;
|
||||
|
||||
|
||||
@@ -16,14 +16,14 @@ import { cssNames } from "../../utils";
|
||||
import { Avatar } from "../avatar";
|
||||
import { getLabelBadges } from "./helpers";
|
||||
|
||||
interface Props<T extends CatalogEntity> {
|
||||
export interface CatalogEntityDetailsProps<T extends CatalogEntity> {
|
||||
entity: T;
|
||||
hideDetails(): void;
|
||||
onRun: () => void;
|
||||
}
|
||||
|
||||
@observer
|
||||
export class CatalogEntityDetails<T extends CatalogEntity> extends Component<Props<T>> {
|
||||
export class CatalogEntityDetails<T extends CatalogEntity> extends Component<CatalogEntityDetailsProps<T>> {
|
||||
categoryIcon(category: CatalogCategory) {
|
||||
if (Icon.isSvg(category.metadata.icon)) {
|
||||
return <Icon svg={category.metadata.icon} smallest />;
|
||||
|
||||
@@ -15,10 +15,10 @@ import { cssNames } from "../../utils";
|
||||
import type { CatalogCategory } from "../../api/catalog-entity";
|
||||
import { observer } from "mobx-react";
|
||||
|
||||
type Props = {
|
||||
export interface CatalogMenuProps {
|
||||
activeItem: string;
|
||||
onItemClick: (id: string) => void;
|
||||
};
|
||||
}
|
||||
|
||||
function getCategories() {
|
||||
return catalogCategoryRegistry.filteredItems;
|
||||
@@ -42,7 +42,7 @@ function Item(props: TreeItemProps) {
|
||||
);
|
||||
}
|
||||
|
||||
export const CatalogMenu = observer((props: Props) => {
|
||||
export const CatalogMenu = observer((props: CatalogMenuProps) => {
|
||||
return (
|
||||
// Overwrite Material UI styles with injectFirst https://material-ui.com/guides/interoperability/#controlling-priority-4
|
||||
<StylesProvider injectFirst>
|
||||
|
||||
@@ -37,7 +37,7 @@ import type { RegisteredCustomCategoryViewDecl } from "./custom-views.injectable
|
||||
import customCategoryViewsInjectable from "./custom-views.injectable";
|
||||
import type { CustomCategoryViewComponents } from "./custom-views";
|
||||
|
||||
interface Props extends RouteComponentProps<CatalogViewRouteParam> {}
|
||||
export interface CatalogProps extends RouteComponentProps<CatalogViewRouteParam> {}
|
||||
|
||||
interface Dependencies {
|
||||
catalogPreviousActiveTabStorage: { set: (value: string ) => void };
|
||||
@@ -47,11 +47,11 @@ interface Dependencies {
|
||||
}
|
||||
|
||||
@observer
|
||||
class NonInjectedCatalog extends React.Component<Props & Dependencies> {
|
||||
class NonInjectedCatalog extends React.Component<CatalogProps & Dependencies> {
|
||||
@observable private contextMenu: CatalogEntityContextMenuContext;
|
||||
@observable activeTab?: string;
|
||||
|
||||
constructor(props: Props & Dependencies) {
|
||||
constructor(props: CatalogProps & Dependencies) {
|
||||
super(props);
|
||||
makeObservable(this);
|
||||
}
|
||||
@@ -305,7 +305,7 @@ class NonInjectedCatalog extends React.Component<Props & Dependencies> {
|
||||
}
|
||||
}
|
||||
|
||||
export const Catalog = withInjectables<Dependencies, Props>( NonInjectedCatalog, {
|
||||
export const Catalog = withInjectables<Dependencies, CatalogProps>( NonInjectedCatalog, {
|
||||
getProps: (di, props) => ({
|
||||
catalogEntityStore: di.inject(catalogEntityStoreInjectable),
|
||||
catalogPreviousActiveTabStorage: di.inject(catalogPreviousActiveTabStorageInjectable),
|
||||
|
||||
Reference in new issue
Block a user