Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
721abae
feat!: Update trusted-service schema
SilviaZeta May 24, 2022
1421c4f
feat!: Multi-image selection in trusted-services
SilviaZeta May 24, 2022
a4a372f
Merge remote-tracking branch 'origin/staging' into issue656
SilviaZeta Jun 7, 2022
2199479
Merge branch 'staging' into issue656
SilviaZeta Jun 7, 2022
90e18f7
feat: Add Zoo
SilviaZeta Jun 27, 2022
e924ef2
fix: Remove spacing
SilviaZeta Jun 28, 2022
27701cd
refactor: Remove unnecessary MuiCard
SilviaZeta Jun 28, 2022
2b6c2cd
fix: Lint
SilviaZeta Jun 29, 2022
3b0fd85
refactor: Move plugin methods from ManageWrapper to services/plugins/
SilviaZeta Jun 29, 2022
8a6290a
feat: Pass ZooDialog to CurateWrapper
SilviaZeta Jun 29, 2022
8d925ed
refactor: Rename ZooCard as PluginsZooCard
SilviaZeta Jun 29, 2022
9121f93
feat: Add 'description' and 'author' to Plugin interface
SilviaZeta Jun 29, 2022
9d4e6c9
chore: Rename method
SilviaZeta Jul 5, 2022
8a25973
feat: Replace 'author' with 'origin' in db Plugin model
SilviaZeta Jul 6, 2022
beafca0
fix: Lint
SilviaZeta Jul 6, 2022
dd43939
fix: Type
SilviaZeta Jul 6, 2022
8ff9654
fix: ZooDialog doesn't re-render when plugins change
SilviaZeta Jul 6, 2022
075a4b8
fix: Set origin_id manually (temp fix)
SilviaZeta Jul 7, 2022
1ed3732
refactor: Import interfaces from @gliff-ai/manage
SilviaZeta Jul 7, 2022
2158202
fix: Lint
SilviaZeta Jul 7, 2022
e9d3fe2
feat: Make plugins sharable
SilviaZeta Jul 7, 2022
27aac37
feat: Add keys to the body of the /run/ request
SilviaZeta Jul 7, 2022
1f4c59c
Merge remote-tracking branch 'origin/issue656' into addZoo
SilviaZeta Jul 8, 2022
276cea0
Merge remote-tracking branch 'origin/issue656' into addZoo (part2)
SilviaZeta Jul 8, 2022
8dc6d6e
feat: Specify variant of base64 encoding
SilviaZeta Jul 8, 2022
c4ec629
feat: Add to the zoo only public plugins
SilviaZeta Jul 8, 2022
a04067f
chore: tidy up
SilviaZeta Jul 8, 2022
a1c3f8f
chore: Tidy up
SilviaZeta Jul 11, 2022
329efcd
fix: Search and show only public plugins
SilviaZeta Jul 11, 2022
b8c0b8b
fix: Lint
SilviaZeta Jul 12, 2022
111f3ba
refactor: useZooData hook
SilviaZeta Jul 12, 2022
7b788dd
fix: Decode publicKey if base64-encoded
SilviaZeta Jul 15, 2022
1977ceb
refactor: Plugins
SilviaZeta Jul 15, 2022
ff69e0e
chore: Tidy up
SilviaZeta Jul 15, 2022
3314d07
feat: Activate shared plugins
SilviaZeta Jul 15, 2022
b9ccc5f
fix: getInitials fails when name has a whitespace at any end of the s…
SilviaZeta Jul 19, 2022
f2978c6
fix: Do no include public_key in body of POST request
SilviaZeta Jul 22, 2022
af8b0ed
fix: bug introduced by merge conflict
SilviaZeta Jul 25, 2022
0dee4ce
feat: Only owners and members can access the ZOO
SilviaZeta Jul 26, 2022
aedde50
fix: Encrypt usernames passed in POST request
SilviaZeta Jul 27, 2022
1b8ff06
Merge remote-tracking branch 'origin/staging' into addZoo
SilviaZeta Jul 29, 2022
3649fa0
fix: Replace Dialog with Dialogue
SilviaZeta Jul 29, 2022
f25c8ed
refactor: Use new Button component
SilviaZeta Jul 29, 2022
c8558fb
build: Upgrade @gliff-ai/style to 16.3.1
SilviaZeta Jul 29, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@gliff-ai/curate": "^7.6.2",
"@gliff-ai/etebase": "^0.44.0",
"@gliff-ai/manage": "^8.0.0",
"@gliff-ai/style": "^16.2.1",
"@gliff-ai/style": "^16.3.1",
"@gliff-ai/upload": "^1.3.0",
"@material-ui/types": "^5.1.0",
"@mui/icons-material": "^5.8.4",
Expand Down
8 changes: 3 additions & 5 deletions src/components/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import {
Typography,
} from "@gliff-ai/style";
import { imgSrc } from "@/imgSrc";

import { useAuth } from "@/hooks/use-auth";
import { getInitialsFromFullname } from "@/helpers";
import { ProductsNavbar, ProductNavbarData } from "@/components";

const documentButton = {
Expand Down Expand Up @@ -147,10 +147,8 @@ export const NavBar = (props: Props): ReactElement | null => {

useEffect(() => {
if (!auth?.userProfile?.name) return;
const initials = auth?.userProfile?.name
.split(" ")
.map((l) => l[0].toUpperCase())
.join("");

const initials = getInitialsFromFullname(auth?.userProfile?.name);
setUserInitials(initials);
}, [auth]);

Expand Down
1 change: 1 addition & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ export {

export { GliffCard } from "./GliffCard";
export { CookieConsent } from "./CookieConsent";
export { ZooDialog } from "./zoo/ZooDialog";
export { ProductsNavbar } from "./ProductsNavbar";
export type { ProductNavbarData } from "./ProductsNavbar";
147 changes: 147 additions & 0 deletions src/components/zoo/PluginsZooCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
import { ReactElement, useMemo } from "react";
import { Plugin } from "@gliff-ai/manage";
import { Divider, icons, MuiCard, Box, theme, Button } from "@gliff-ai/style";
import { DialogActions } from "@mui/material";
import SVG from "react-inlinesvg";

const InconText = ({
icon,
text,
marginLeft = null,
}: {
icon: string;
text: string;
marginLeft?: string | null;
}) => (
<div>
<SVG
src={icon}
style={{
width: "25px",
height: "25px",
marginRight: "12px",
fontSize: "16px",
marginBottom: "-5px",
marginLeft: `${marginLeft || 0}`,
}}
/>
{text}
</div>
);

InconText.defaultProps = { marginLeft: null };

interface Props {
data: Plugin;
isOpen: boolean;
openCard: () => void;
closeCard: () => void;
activatePlugin: (plugin: Plugin) => Promise<unknown>;
}

export const PluginsZooCard = ({
data,
isOpen,
openCard,
closeCard,
activatePlugin,
}: Props): ReactElement => {
const scale = useMemo((): number => Number(isOpen) + 1, [isOpen]);

return (
<MuiCard
sx={{
display: "flex",
flexDirection: "column",
width: isOpen ? "870px" : "400px",
height: isOpen ? "650px" : "auto",
padding: isOpen ? "20px" : "10px",
}}
>
<div
style={{
display: "flex",
alignItems: "end",
marginBottom: scale * 10,
}}
>
<Box
style={{
width: scale * 60,
height: scale * 60,
borderRadius: "9px",
backgroundColor: theme.palette.primary.main,
}}
/>
<div style={{ marginLeft: "10px" }}>
<h3 style={{ lineHeight: "1px" }}>Plugin: {data.name}</h3>
<span style={{ lineHeight: 0, color: theme.palette.text.secondary }}>
{data?.author}
</span>
</div>
</div>
{!isOpen && (
<Box
sx={{
marginBottom: "20px",
overflow: "hidden",
display: "-webkit-box",
"-webkit-box-orient": "vertical",
"-webkit-line-clamp": "4",
height: "80px",
}}
>
{data.description}
</Box>
)}
<MuiCard
variant="outlined"
sx={{
display: "flex",
flexDirection: "row",
justifyContent: isOpen ? "start" : "center",
alignItems: "center",
backgroundColor: "transparent",
border: `solid 2px ${theme.palette.grey[300]}`,
padding: "10px",
}}
>
<InconText
icon={icons.security}
text={data.type === "Javascript" ? "Aluminuium" : "Titanium"}
/>
<InconText
icon={icons.build}
text={data.type === "Javascript" ? "Front-end" : "Back-end"}
marginLeft="15px"
/>
<InconText
icon={icons.projectsPage}
text={data.type}
marginLeft="15px"
/>
</MuiCard>
{isOpen && (
<Box sx={{ marginTop: "20px", height: "100%" }}>{data.description}</Box>
)}
<Divider sx={{ width: "110%", margin: "10px 0 10px -5%" }} />
<DialogActions
sx={{ justifyContent: "space-between", padding: 0, marginBottom: 0 }}
>
<Button
color="secondary"
variant="outlined"
onClick={isOpen ? closeCard : openCard}
text={isOpen ? "Go Back" : "See More"}
/>
<Button
text="Activate"
color="primary"
onClick={() => {
void activatePlugin(data);
}}
/>
</DialogActions>
</MuiCard>
);
};
Loading