diff --git a/src/modules/apps/AppSingle.tsx b/src/modules/apps/AppSingle.tsx index d3cb8e5c364dcfa9bed6029b79c7849994ec77ab..92b84f5e488d5aa4a5db6c08c5b683927964d0d8 100644 --- a/src/modules/apps/AppSingle.tsx +++ b/src/modules/apps/AppSingle.tsx @@ -1,3 +1,13 @@ +/** + * This page shows information about a single application. It contains several + * configuration options (that are not implemented in the back-end yet) such as: + * + * 1. Toggling auto-updates + * 2. Advanced configuration by overwriting helm values + * 3. Deleting the application + * + * This page is only available for Admin users. + */ import React, { useEffect, useState } from 'react'; import { useNavigate, useParams } from 'react-router-dom'; import { useForm, useWatch } from 'react-hook-form'; diff --git a/src/modules/apps/Apps.tsx b/src/modules/apps/Apps.tsx index d6e7f5073a6ac437643a94455c20827a8e11ce5a..761a5df56553df13b977ba2a195109f232622e6b 100644 --- a/src/modules/apps/Apps.tsx +++ b/src/modules/apps/Apps.tsx @@ -1,6 +1,11 @@ /* eslint-disable react-hooks/exhaustive-deps */ +/** + * This page shows all the applications and their status in a table. + * + * This page is only available for Admin users. + */ import React, { useState, useCallback, useMemo, useEffect } from 'react'; -import { useNavigate } from 'react-router'; +// import { useNavigate } from 'react-router'; import { SearchIcon } from '@heroicons/react/solid'; import { showToast, ToastType } from 'src/common/util/show-toast'; import _, { debounce } from 'lodash'; @@ -12,7 +17,7 @@ import { getConstForStatus } from './consts'; export const Apps: React.FC = () => { const [search, setSearch] = useState(''); const [installModalOpen, setInstallModalOpen] = useState(false); - const [appSlug, setAppSlug] = useState(null); + const [appSlug] = useState(null); const { apps, appTableLoading, loadApps } = useApps(); const handleSearch = useCallback((event: any) => { @@ -92,6 +97,9 @@ export const Apps: React.FC = () => { // let buttonFuntion = () => navigate(`/apps/${slug}`); // if (appStatus === AppStatusEnum.NotInstalled) { // buttonFuntion = () => { + // // To make this work, change the `useState` call on top of this + // // file to this: + // // const [appSlug, setAppSlug] = useState(null); // setAppSlug(slug); // setInstallModalOpen(true); // }; diff --git a/src/modules/dashboard/Dashboard.tsx b/src/modules/dashboard/Dashboard.tsx index 794eeb98daea2b824c8f2a35d7fd0f0235eadbe7..0e052febff1a2bf7a8217059b0bdadadd654ccc9 100644 --- a/src/modules/dashboard/Dashboard.tsx +++ b/src/modules/dashboard/Dashboard.tsx @@ -1,4 +1,10 @@ /* eslint-disable react-hooks/exhaustive-deps */ +/** + * Page that shows only installed applications, and links to them. + * + * "Utilities" is a special section that links to the Stackspin documentation, + * and that shows the "Monitoring" application if it is installed. + */ import React, { useEffect } from 'react'; import { useApps } from 'src/services/apps'; import { AppStatusEnum } from 'src/services/apps/types'; diff --git a/src/modules/login/Login.tsx b/src/modules/login/Login.tsx index 22f2a043686428ee9025c97fc2e80f81950b84ee..87be39e1acb6307d70ead6e9432a07b50c48d5d6 100644 --- a/src/modules/login/Login.tsx +++ b/src/modules/login/Login.tsx @@ -1,3 +1,6 @@ +/** + * Login page that starts the OAuth2 authentication flow. + */ import React from 'react'; import clsx from 'clsx'; import { LockClosedIcon } from '@heroicons/react/solid'; diff --git a/src/modules/users/Users.tsx b/src/modules/users/Users.tsx index 41cfafbf3444a685267465d88df1dd9938bee7dc..5d45dd526be0e7668e3d241c1bafb72e3b7108be 100644 --- a/src/modules/users/Users.tsx +++ b/src/modules/users/Users.tsx @@ -1,4 +1,9 @@ /* eslint-disable react-hooks/exhaustive-deps */ +/** + * This page shows a table of all users. It is only available for Admin users. + * + * Admin users can add one or more users, or edit a user. + */ import React, { useState, useCallback, useEffect, useMemo } from 'react'; import { SearchIcon, PlusIcon, ViewGridAddIcon } from '@heroicons/react/solid'; import { CogIcon, TrashIcon } from '@heroicons/react/outline';