Skip to content

Commit

Permalink
fix(repo): Remove ref to first party if no tomes found (#698)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmp5987 authored Mar 10, 2024
1 parent aaa84f3 commit b2aa17e
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 38 deletions.
6 changes: 3 additions & 3 deletions tavern/internal/www/build/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"files": {
"main.css": "/static/css/main.c8dfb028.css",
"main.js": "/static/js/main.f97381e4.js",
"main.js": "/static/js/main.f72f0877.js",
"react-syntax-highlighter/refractor-core-import.js": "/static/js/react-syntax-highlighter/refractor-core-import.d0cd1e85.chunk.js",
"react-syntax-highlighter_languages_refractor_abap.js": "/static/js/react-syntax-highlighter_languages_refractor_abap.a2bf84e3.chunk.js",
"react-syntax-highlighter_languages_refractor_actionscript.js": "/static/js/react-syntax-highlighter_languages_refractor_actionscript.fff5a604.chunk.js",
Expand Down Expand Up @@ -158,7 +158,7 @@
"static/media/eldrich.png": "/static/media/eldrich.a80c74e8249d2461e174.png",
"index.html": "/index.html",
"main.c8dfb028.css.map": "/static/css/main.c8dfb028.css.map",
"main.f97381e4.js.map": "/static/js/main.f97381e4.js.map",
"main.f72f0877.js.map": "/static/js/main.f72f0877.js.map",
"refractor-core-import.d0cd1e85.chunk.js.map": "/static/js/react-syntax-highlighter/refractor-core-import.d0cd1e85.chunk.js.map",
"react-syntax-highlighter_languages_refractor_abap.a2bf84e3.chunk.js.map": "/static/js/react-syntax-highlighter_languages_refractor_abap.a2bf84e3.chunk.js.map",
"react-syntax-highlighter_languages_refractor_actionscript.fff5a604.chunk.js.map": "/static/js/react-syntax-highlighter_languages_refractor_actionscript.fff5a604.chunk.js.map",
Expand Down Expand Up @@ -315,6 +315,6 @@
},
"entrypoints": [
"static/css/main.c8dfb028.css",
"static/js/main.f97381e4.js"
"static/js/main.f72f0877.js"
]
}
2 changes: 1 addition & 1 deletion tavern/internal/www/build/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"><link rel="manifest" href="/site.webmanifest"><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>Realm - Red Team Engagement Platform</title><script defer="defer" src="/static/js/main.f97381e4.js"></script><link href="/static/css/main.c8dfb028.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"><link rel="manifest" href="/site.webmanifest"><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>Realm - Red Team Engagement Platform</title><script defer="defer" src="/static/js/main.f72f0877.js"></script><link href="/static/css/main.c8dfb028.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions tavern/internal/www/src/components/tavern-base-ui/EmptyState.tsx
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
import React from "react";
import React, { FC } from "react";
import { Ring } from '@uiball/loaders'
import { AdjustmentsHorizontalIcon, ExclamationTriangleIcon, NoSymbolIcon } from "@heroicons/react/24/outline";

export enum EmptyStateType{
error= "Error",
noData="No Data",
noMatches="No Matches",
loading="Loading",
noIcon="No Icon"
export enum EmptyStateType {
error = "Error",
noData = "No Data",
noMatches = "No Matches",
loading = "Loading",
noIcon = "No Icon"
}

type Props ={
type EmptyStateProps = {
label: string,
type: EmptyStateType,
details?: string,
children?: React.ReactNode
}
export const EmptyState = (props: Props) => {
export const EmptyState: FC<EmptyStateProps> = (props) => {
const {
label,
details,
type=EmptyStateType.noData,
label,
details,
type = EmptyStateType.noData,
children
} = props;
function getEmptyStateIcon(type: EmptyStateType){
switch(type){

function getEmptyStateIcon(type: EmptyStateType) {
switch (type) {
case EmptyStateType.error:
return <ExclamationTriangleIcon width={24} />
case EmptyStateType.noMatches:
return <AdjustmentsHorizontalIcon width={24} />
case EmptyStateType.loading:
return (<Ring
size={24}
lineWeight={2}
speed={2}
color="black"
return (<Ring
size={24}
lineWeight={2}
speed={2}
color="black"
/>);
case EmptyStateType.noData:
return <NoSymbolIcon width={24} />
Expand All @@ -53,4 +53,4 @@ export const EmptyState = (props: Props) => {
{children && (<div className="py-2">{children}</div>)}
</div>
)
}
}
16 changes: 8 additions & 8 deletions tavern/internal/www/src/pages/tomes/Tomes.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import React, { useState } from "react"
import { PageWrapper } from "../../components/page-wrapper"
import { PageNavItem } from "../../utils/enums"
import { ReactElement, useState } from "react";
import { PageWrapper } from "../../components/page-wrapper";
import { PageNavItem } from "../../utils/enums";

import { Button } from "@chakra-ui/react";
import { ArrowUpTrayIcon } from "@heroicons/react/24/outline";
import { EmptyState, EmptyStateType } from "../../components/tavern-base-ui/EmptyState";
import ImportRepositoryModal from "./components/ImportRepositoryModal";
import RepositoryTable from "./components/RepositoryTable";
import { useRepositoryView } from "./hooks/useRepositoryView";
import ImportRepositoryModal from "./components/ImportRepositoryModal";
import { EmptyState, EmptyStateType } from "../../components/tavern-base-ui/EmptyState";
import { Button } from "@chakra-ui/react";

export const Tomes = () => {
const [isOpen, setOpen] = useState(false);
export const Tomes = (): ReactElement => {
const [isOpen, setOpen] = useState<boolean>(false);
const { loading, repositories, error } = useRepositoryView();

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const useRepositoryView = () => {
});

useEffect(()=> {
if(!firstParty && firstPartyTome){
if(!firstParty && firstPartyTome && firstPartyTome?.tomes?.length > 0){
const firstPartyRepo =
{node:{
url: "https://github.com/spellshift/realm/tree/main/tavern/tomes",
Expand Down

0 comments on commit b2aa17e

Please sign in to comment.