Skip to content

Commit

Permalink
add more types
Browse files Browse the repository at this point in the history
Signed-off-by: Viktor Tsvetkov <[email protected]>
  • Loading branch information
vtsvetkov-splunk committed Jan 9, 2025
1 parent 8eac413 commit fac69fe
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions ui/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@splunk/add-on-ucc-framework",
"description": "Splunk Add-on SDK formerly UCC is a build and code generation framework",
"description": "UCC is a build and code generation framework for building Splunk Add-ons (TAs)",
"repository": {
"type": "git",
"url": "git+https://github.com/splunk/addonfactory-ucc-generator.git",
"directory": "ui"
},
"version": "5.55.0",
"version": "5.56.0",
"license": "Apache-2.0",
"author": "Splunk Inc.",
"homepage": "https://splunk.github.io/addonfactory-ucc-generator",
Expand Down
5 changes: 1 addition & 4 deletions ui/src/components/CustomTab/CustomTab.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import React, { useEffect, useRef, useState } from 'react';
import { _ } from '@splunk/ui-utils/i18n';
import { z } from 'zod';
import { getUnifiedConfigs } from '../../util/util';
import { getBuildDirPath } from '../../util/script';
import { TabSchema } from '../../types/globalConfig/pages';
import { CustomTabConstructor } from './CustomTabBase';

type Tab = z.infer<typeof TabSchema>;
import { Tab } from './CustomTab.types';

interface CustomTabProps {
tab: Tab;
Expand Down
4 changes: 4 additions & 0 deletions ui/src/components/CustomTab/CustomTab.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { z } from 'zod';
import { TabSchema } from '../../types/globalConfig/pages';

export type Tab = z.infer<typeof TabSchema>;
8 changes: 5 additions & 3 deletions ui/src/components/CustomTab/CustomTabBase.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Tab } from './CustomTab.types';

export type CustomTabInstance<T extends typeof CustomTabBase = typeof CustomTabBase> =
InstanceType<T>;

Expand All @@ -6,11 +8,11 @@ export type CustomTabConstructor<T extends typeof CustomTabBase = typeof CustomT
) => CustomTabInstance<T>;

export abstract class CustomTabBase {
protected tab: object;
protected tab: Tab;

protected el: HTMLElement;
protected el: HTMLDivElement;

constructor(tab: object, el: HTMLElement) {
constructor(tab: Tab, el: HTMLDivElement) {
this.tab = tab;
this.el = el;
}
Expand Down

0 comments on commit fac69fe

Please sign in to comment.