Skip to content

Commit

Permalink
renaming folder and components to Workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
hugocostadev committed Oct 17, 2023
1 parent 59b63bf commit 769e341
Show file tree
Hide file tree
Showing 22 changed files with 12 additions and 15 deletions.
4 changes: 2 additions & 2 deletions apps/meteor/client/views/admin/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,12 @@ registerAdminRoute('/sounds/:context?/:id?', {
/** @deprecated in favor of `/workspace` route, this is a fallback to work in Mobile app, should be removed in the next major */
registerAdminRoute('/info', {
name: 'info',
component: lazy(() => import('./workspaceStatus/WorkspaceStatusRoute')),
component: lazy(() => import('./workspace/WorkspaceRoute')),
});

registerAdminRoute('/workspace', {
name: 'workspace',
component: lazy(() => import('./workspaceStatus/WorkspaceStatusRoute')),
component: lazy(() => import('./workspace/WorkspaceRoute')),
});

registerAdminRoute('/import', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const VersionCard = ({ serverInfo }: VersionCardProps): ReactElement => {

const formatDate = useFormatDate();

const { data: licenseData, isLoading } = useLicense();
const { data: licenseData, isLoading, refetch: refetchLicense } = useLicense();
const { data: regStatus } = useRegistrationStatus();

const [actionItems, setActionItems] = useState<VersionActionItem[]>([]);
Expand Down Expand Up @@ -201,7 +201,7 @@ const VersionCard = ({ serverInfo }: VersionCardProps): ReactElement => {
<CardColSection>{actionItems && <VersionCardActionItemList actionItems={actionItems} />}</CardColSection>
</CardCol>
</CardBody>
<CardFooter>{actionButton && <VersionCardActionButton actionButton={actionButton} />}</CardFooter>
<CardFooter>{actionButton && <VersionCardActionButton actionButton={actionButton} refetch={refetchLicense} />}</CardFooter>
</>
) : (
<VersionCardSkeleton />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ import RegisterWorkspaceModal from '../../../cloud/modals/RegisterWorkspaceModal

type VersionCardActionButtonProps = {
actionButton: VersionActionButton;
refetch: () => void;
};

export type VersionActionButton = {
path: string;
label: ReactElement;
};

const VersionCardActionButton = ({ actionButton }: VersionCardActionButtonProps): ReactElement => {
const VersionCardActionButton = ({ actionButton, refetch }: VersionCardActionButtonProps): ReactElement => {
const router = useRouter();
const setModal = useSetModal();

Expand Down Expand Up @@ -47,8 +48,4 @@ const VersionCardActionButton = ({ actionButton }: VersionCardActionButtonProps)
);
};

const refetch = (): void => {
window.location.reload();
};

export default memo(VersionCardActionButton);
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type WorkspaceStatusPageProps = {
onClickDownloadInfo: () => void;
};

const WorkspaceStatusPage = ({
const WorkspacePage = ({
canViewStatistics,
serverInfo,
statistics,
Expand Down Expand Up @@ -99,4 +99,4 @@ const WorkspaceStatusPage = ({
);
};

export default memo(WorkspaceStatusPage);
export default memo(WorkspacePage);
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import PageSkeleton from '../../../components/PageSkeleton';
import { useWorkspaceInfo } from '../../../hooks/useWorkspaceInfo';
import { downloadJsonAs } from '../../../lib/download';
import NotAuthorizedPage from '../../notAuthorized/NotAuthorizedPage';
import WorkspaceStatusPage from './WorkspaceStatusPage';
import WorkspacePage from './WorkspacePage';

const WorkspaceStatusRoute = (): ReactElement => {
const WorkspaceRoute = (): ReactElement => {
const t = useTranslation();
const canViewStatistics = usePermission('view-statistics');

Expand Down Expand Up @@ -57,7 +57,7 @@ const WorkspaceStatusRoute = (): ReactElement => {
}

return (
<WorkspaceStatusPage
<WorkspacePage
canViewStatistics={canViewStatistics}
serverInfo={serverInfo}
statistics={statistics}
Expand All @@ -68,4 +68,4 @@ const WorkspaceStatusRoute = (): ReactElement => {
);
};

export default memo(WorkspaceStatusRoute);
export default memo(WorkspaceRoute);

0 comments on commit 769e341

Please sign in to comment.