Skip to content

Commit

Permalink
Merge pull request #7 from ljreaux/main
Browse files Browse the repository at this point in the history
added apple certificate
  • Loading branch information
ljreaux authored Oct 3, 2024
2 parents 7ef0f38 + 88003db commit 8e01c6a
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 98 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ jobs:
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}

- name: upload assets
uses: crabnebula-dev/cloud-release@v0
Expand Down
13 changes: 3 additions & 10 deletions src-tauri/capabilities/desktop.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
{
"identifier": "desktop-capability",
"platforms": [
"macOS",
"windows",
"linux"
],
"permissions": [
"global-shortcut:default",
"updater:default"
]
}
"platforms": ["macOS", "windows", "linux"],
"permissions": ["global-shortcut:default", "updater:default"]
}
6 changes: 5 additions & 1 deletion src-tauri/capabilities/migrated.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@
"dialog:default",
"sql:default",
"sql:allow-load",
"sql:allow-execute"
"sql:allow-execute",
"updater:allow-download",
"updater:allow-check",
"updater:allow-download",
"updater:allow-download-and-install"
]
}
2 changes: 1 addition & 1 deletion src-tauri/gen/schemas/capabilities.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"desktop-capability":{"identifier":"desktop-capability","description":"","local":true,"permissions":["global-shortcut:default","updater:default"],"platforms":["macOS","windows","linux"]},"migrated":{"identifier":"migrated","description":"permissions that were migrated from v1","local":true,"windows":["main"],"permissions":["core:default","fs:allow-read-file","fs:allow-write-file","fs:allow-read-dir","fs:allow-copy-file","fs:allow-mkdir","fs:allow-remove","fs:allow-remove","fs:allow-rename","fs:allow-exists","fs:allow-write-text-file","fs:allow-read-text-file",{"identifier":"fs:scope","allow":["**"]},"core:window:allow-create","core:window:allow-center","core:window:allow-request-user-attention","core:window:allow-set-resizable","core:window:allow-set-maximizable","core:window:allow-set-minimizable","core:window:allow-set-closable","core:window:allow-set-title","core:window:allow-maximize","core:window:allow-unmaximize","core:window:allow-minimize","core:window:allow-unminimize","core:window:allow-show","core:window:allow-hide","core:window:allow-close","core:window:allow-set-decorations","core:window:allow-set-always-on-top","core:window:allow-set-content-protected","core:window:allow-set-size","core:window:allow-set-min-size","core:window:allow-set-max-size","core:window:allow-set-position","core:window:allow-set-fullscreen","core:window:allow-set-focus","core:window:allow-set-icon","core:window:allow-set-skip-taskbar","core:window:allow-set-cursor-grab","core:window:allow-set-cursor-visible","core:window:allow-set-cursor-icon","core:window:allow-set-cursor-position","core:window:allow-set-ignore-cursor-events","core:window:allow-start-dragging","core:webview:allow-print","shell:allow-execute","shell:allow-open","dialog:allow-open","dialog:allow-save","dialog:allow-message","dialog:allow-ask","dialog:allow-confirm","http:default","notification:default","global-shortcut:allow-is-registered","global-shortcut:allow-register","global-shortcut:allow-register-all","global-shortcut:allow-unregister","global-shortcut:allow-unregister-all","os:allow-platform","os:allow-version","os:allow-os-type","os:allow-family","os:allow-arch","os:allow-exe-extension","os:allow-locale","os:allow-hostname","process:default","process:allow-restart","process:allow-exit","clipboard-manager:allow-read-text","clipboard-manager:allow-write-text","core:app:allow-app-show","core:app:allow-app-hide","clipboard-manager:default","fs:default","http:default","notification:default","dialog:default","sql:default","sql:allow-load","sql:allow-execute"]}}
{"desktop-capability":{"identifier":"desktop-capability","description":"","local":true,"permissions":["global-shortcut:default","updater:default"],"platforms":["macOS","windows","linux"]},"migrated":{"identifier":"migrated","description":"permissions that were migrated from v1","local":true,"windows":["main"],"permissions":["core:default","fs:allow-read-file","fs:allow-write-file","fs:allow-read-dir","fs:allow-copy-file","fs:allow-mkdir","fs:allow-remove","fs:allow-remove","fs:allow-rename","fs:allow-exists","fs:allow-write-text-file","fs:allow-read-text-file",{"identifier":"fs:scope","allow":["**"]},"core:window:allow-create","core:window:allow-center","core:window:allow-request-user-attention","core:window:allow-set-resizable","core:window:allow-set-maximizable","core:window:allow-set-minimizable","core:window:allow-set-closable","core:window:allow-set-title","core:window:allow-maximize","core:window:allow-unmaximize","core:window:allow-minimize","core:window:allow-unminimize","core:window:allow-show","core:window:allow-hide","core:window:allow-close","core:window:allow-set-decorations","core:window:allow-set-always-on-top","core:window:allow-set-content-protected","core:window:allow-set-size","core:window:allow-set-min-size","core:window:allow-set-max-size","core:window:allow-set-position","core:window:allow-set-fullscreen","core:window:allow-set-focus","core:window:allow-set-icon","core:window:allow-set-skip-taskbar","core:window:allow-set-cursor-grab","core:window:allow-set-cursor-visible","core:window:allow-set-cursor-icon","core:window:allow-set-cursor-position","core:window:allow-set-ignore-cursor-events","core:window:allow-start-dragging","core:webview:allow-print","shell:allow-execute","shell:allow-open","dialog:allow-open","dialog:allow-save","dialog:allow-message","dialog:allow-ask","dialog:allow-confirm","http:default","notification:default","global-shortcut:allow-is-registered","global-shortcut:allow-register","global-shortcut:allow-register-all","global-shortcut:allow-unregister","global-shortcut:allow-unregister-all","os:allow-platform","os:allow-version","os:allow-os-type","os:allow-family","os:allow-arch","os:allow-exe-extension","os:allow-locale","os:allow-hostname","process:default","process:allow-restart","process:allow-exit","clipboard-manager:allow-read-text","clipboard-manager:allow-write-text","core:app:allow-app-show","core:app:allow-app-hide","clipboard-manager:default","fs:default","http:default","notification:default","dialog:default","sql:default","sql:allow-load","sql:allow-execute","updater:allow-download","updater:allow-check","updater:allow-download","updater:allow-download-and-install"]}}
16 changes: 8 additions & 8 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import YeastTable from "./components/YeastDataTable/Table";
import Juice from "./components/Juice/Juice";
import ManualEntry from "./components/PillData/ManualEntry";
import { checkForAppUpdates } from "./updater";
// import { onOpenUrl } from "@tauri-apps/plugin-deep-link";

export interface Additive {
name: string;
Expand Down Expand Up @@ -80,16 +79,17 @@ function App() {
const [filePath, setFilePath] = useState<string | null>(null);
useEffect(() => {
const root = document.querySelector("#root");
const unlisten = listen("tauri://file-drop", (event) => {
if (event.payload) {
const [filePath] = event.payload as string[];
const unlisten = listen("tauri://drag-drop", (event) => {
const { payload }: { payload: any } = event;
if (payload) {
const [filePath] = payload.paths as string[];
if (root) {
root.classList.remove("blur");
}

if (filePath.endsWith(".mead")) {
setFilePath(filePath);
navigate("/");
navigate("/local");
} else alert("Please select a valid .mead file");
}
});
Expand All @@ -100,7 +100,7 @@ function App() {
}, []);
useEffect(() => {
const root = document.querySelector("#root");
const unlisten = listen("tauri://file-drop-hover", () => {
const unlisten = listen("tauri://drag-enter", () => {
if (root) {
root.classList.add("blur");
}
Expand Down Expand Up @@ -188,7 +188,7 @@ function App() {
<main className="flex items-center justify-center w-full min-h-[100vh] bg-secondary">
<Routes>
<Route
path="/home"
path="/"
element={
<Home
recipeData={recipeData}
Expand Down Expand Up @@ -236,7 +236,7 @@ function App() {
/>
<Route path="/juice" element={<Juice />} />
<Route
path="/"
path="/local"
element={
<LocalRecipe
ingredientsList={ingredientsList}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Account/LocalRecipes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ function LocalRecipes({
: "";
setFilePath(file_path);

const goToPdf = "/?pdf=true" + hydroPath;
const goToHydro = `/?hydro=true` + hydroPath;
const goToPdf = "/local/?pdf=true" + hydroPath;
const goToHydro = `/local/?hydro=true` + hydroPath;

if (pdf) navigate(goToPdf);
else if (hydro) navigate(goToHydro);
Expand Down
136 changes: 60 additions & 76 deletions src/components/Recipes/LocalRecipe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,22 +233,6 @@ export default function LocalRecipe({
}, [recipeData, ingredientsList, data, yeasts, nuteInfo]);

const { next, back, goTo, step, currentStepIndex, steps } = useMultiStepForm([
<>
<Button
onClick={() => fileDialog()}
variant={"secondary"}
className="my-4"
>
{t("desktop.open")}
</Button>
{t("accountPage.or")}
<Link
to={"/home"}
className="flex items-center justify-center gap-4 px-8 py-2 my-4 text-lg border border-solid rounded-lg bg-background text-foreground hover:bg-foreground hover:border-background hover:text-background sm:gap-8 group"
>
{t("desktop.goTo")}
</Link>
</>,
<RecipeBuilder
{...recipeData}
setRecipeData={setRecipeData}
Expand Down Expand Up @@ -335,13 +319,17 @@ export default function LocalRecipe({
<>
{!token ? (
<>
<Link
to={"/login"}
className="flex items-center justify-center gap-4 px-8 py-2 my-4 text-lg border border-solid rounded-lg bg-background text-foreground hover:bg-foreground hover:border-background hover:text-background sm:gap-8 group"
>
{t("recipeForm.login")}
</Link>
{t("accountPage.or")}
{!showLocalForm && (
<>
<Link
to={"/login"}
className="flex items-center justify-center gap-4 px-8 py-2 my-4 text-lg border border-solid rounded-lg bg-background text-foreground hover:bg-foreground hover:border-background hover:text-background sm:gap-8 group"
>
{t("recipeForm.login")}
</Link>
{t("accountPage.or")}
</>
)}
{filePath && (
<>
{showLocalForm && (
Expand All @@ -354,8 +342,9 @@ export default function LocalRecipe({
<Button
variant={"secondary"}
onClick={() => setShowLocalForm(!showLocalForm)}
className=" md:w-1/4 md:max-w-56"
>
{t("updateLocalChanges")}
{showLocalForm ? t("meadtoolsOnline") : t("updateLocalChanges")}
</Button>
</>
)}
Expand Down Expand Up @@ -423,7 +412,6 @@ export default function LocalRecipe({
setNuteInfo(nuteInfo);
setPrimaryNotes(cocatNotes(primaryNotes));
setSecondaryNotes(cocatNotes(secondaryNotes));
goTo(1);
} catch (error) {
console.error("Error opening file dialog:", error);
} finally {
Expand Down Expand Up @@ -461,59 +449,55 @@ export default function LocalRecipe({
};

return (
<div className="flex flex-col items-center justify-center w-full mt-12 mb-12">
<div className="flex flex-col items-center justify-center w-full my-12">
{loading ? <Loading /> : step}

{currentStepIndex !== 0 && (
<>
<div className="flex items-center justify-center w-1/4">
{currentStepIndex > 0 && (
<Button
variant={"secondary"}
onClick={back}
className="flex-1 w-full"
>
{t("buttonLabels.back")}
</Button>
)}
{currentStepIndex < steps.length - 1 && (
<Button
variant={"secondary"}
className="flex-1 w-full"
onClick={() => {
setData((prev) => ({
...prev,
yanContribution,
}));
next();
}}
>
{t("buttonLabels.next")}
</Button>
)}
</div>
<div className="md:w-1/4 md:max-w-56 flex items-center justify-between mb-[3rem]">
<ResetButton
setRecipeData={setRecipeData}
setData={setData}
recipeData={recipeData}
setPrimaryNotes={setPrimaryNotes}
setSecondaryNotes={setSecondaryNotes}
/>
{currentStepIndex !== steps.length - 3 && (
<Button
variant={"secondary"}
className="flex-1"
onClick={() => goTo(steps.length - 3)}
>
<div className="flex items-center justify-center w-full h-full text-2xl">
<MdPictureAsPdf />
</div>
</Button>
)}
</div>
</>
)}
<div className="flex items-center justify-center md:w-1/4 md:max-w-56 ">
{currentStepIndex > 0 && (
<Button
variant={"secondary"}
onClick={back}
className="flex-1 w-full"
>
{t("buttonLabels.back")}
</Button>
)}
{currentStepIndex < steps.length - 1 && (
<Button
variant={"secondary"}
className="flex-1 w-full"
onClick={() => {
setData((prev) => ({
...prev,
yanContribution,
}));
next();
}}
>
{t("buttonLabels.next")}
</Button>
)}
</div>
<div className="md:w-1/4 md:max-w-56 flex items-center justify-between mb-[3rem]">
<ResetButton
setRecipeData={setRecipeData}
setData={setData}
recipeData={recipeData}
setPrimaryNotes={setPrimaryNotes}
setSecondaryNotes={setSecondaryNotes}
/>
{currentStepIndex !== steps.length - 3 && (
<Button
variant={"secondary"}
className="flex-1"
onClick={() => goTo(steps.length - 3)}
>
<div className="flex items-center justify-center w-full h-full text-2xl">
<MdPictureAsPdf />
</div>
</Button>
)}
</div>
</div>
);
}

0 comments on commit 8e01c6a

Please sign in to comment.