Skip to content

Commit

Permalink
fix: build warnings to prepare for release
Browse files Browse the repository at this point in the history
  • Loading branch information
bodom0015 committed Feb 24, 2023
1 parent e00852a commit 246a1e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/views/my-catalog/AddEditSpec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const AddEditSpecPage = (props: any) => {
const {specKey} = useParams<{ specKey?: string; }>();

// Server data
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
const [stacks, setStacks] = useState<Array<V1.Stack>>([]);
const [specs, setSpecs] = useState<Array<V1.Service>>([]);
const [spec, setSpec] = useState<V1.Service>({
Expand Down Expand Up @@ -113,7 +114,7 @@ const AddEditSpecPage = (props: any) => {
}
}).catch(reason => handleError('Failed to fetch specs: ', reason));
V1.UserAppService.listUserapps().then(stacks => setStacks(stacks)).catch(reason => handleError('Failed to fetch stacks: ', reason));
}, [env]);
}, [env, specKey]);

/** Basic Info tab functions */
const handleFieldChange = (event: any, field: string) => {
Expand Down
4 changes: 4 additions & 0 deletions src/views/my-catalog/MyCatalog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const MyCatalogPage = (props: any) => {
const user = useSelector((state: any) => state.auth.user);

// Server data
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
const [stacks, setStacks] = useState<Array<V1.Stack>>([]);
const [specs, setSpecs] = useState<Array<V1.Service>>([]);

Expand Down Expand Up @@ -103,11 +104,13 @@ const MyCatalogPage = (props: any) => {
setRedirect('/my-catalog/' + spec.key);
}

/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
const importSpec = async (jsonStr: string) => {
if (!jsonStr) { return; }

try {
const spec = JSON.parse(jsonStr);
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
const imported = await V1.AppSpecService.createService(spec);
} catch (e) {
console.log('Failed to parse JSON: ', e);
Expand All @@ -118,6 +121,7 @@ const MyCatalogPage = (props: any) => {

const exportSpec = (spec?: V1.Service) => {
if (!spec || !spec.id) { return; }
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
const jsonStr = JSON.stringify(spec);

// TODO: show modal?
Expand Down

0 comments on commit 246a1e9

Please sign in to comment.