Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh APS Token #982

Merged
merged 16 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion exporter/SynthesisFusionAddin/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,5 @@ site-packages
# env files
**/.env

proto/proto_out
proto/proto_out
.aps_auth
2 changes: 2 additions & 0 deletions fission/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VITE_SYNTHESIS_SERVER_PATH=/
# VITE_SYNTHESIS_SERVER_PATH=https://synthesis.autodesk.com/
17 changes: 10 additions & 7 deletions fission/src/Synthesis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,23 @@
import { AddRobotsModal, AddFieldsModal, SpawningModal } from "@/modals/spawning/SpawningModals.tsx"
import ImportMirabufModal from "@/modals/mirabuf/ImportMirabufModal.tsx"
import ImportLocalMirabufModal from "@/modals/mirabuf/ImportLocalMirabufModal.tsx"
import APS, { ENDPOINT_SYNTHESIS_CHALLENGE } from "./aps/APS.ts"

Check warning on line 57 in fission/src/Synthesis.tsx

View workflow job for this annotation

GitHub Actions / ESLint Format Validation

'ENDPOINT_SYNTHESIS_CHALLENGE' is defined but never used. Allowed unused vars must match /^_/u

Check warning on line 57 in fission/src/Synthesis.tsx

View workflow job for this annotation

GitHub Actions / ESLint Format Validation

'ENDPOINT_SYNTHESIS_CHALLENGE' is defined but never used. Allowed unused vars must match /^_/u
import ResetAllInputsModal from "./ui/modals/configuring/ResetAllInputsModal.tsx"
import Skybox from './ui/components/Skybox.tsx';

const DEFAULT_MIRA_PATH = "/api/mira/Robots/Team 2471 (2018)_v7.mira"

function Synthesis() {
const urlParams = new URLSearchParams(document.location.search)
if (urlParams.has("code")) {
const has_code = urlParams.has("code")
if (has_code) {
const code = urlParams.get("code")
window.opener?.setAuthCode(code)
window.close()
if (code) {
APS.convertAuthToken(code).then(() => {
document.location.search = ""
})
}
}

const { openModal, closeModal, getActiveModalElement } = useModalManager(initialModals)
const { openPanel, closePanel, closeAllPanels, getActivePanelElements } = usePanelManager(initialPanels)
const { showTooltip } = useTooltipManager()
Expand All @@ -81,17 +85,16 @@
const modalElement = getActiveModalElement()

useEffect(() => {
if (has_code) return

World.InitWorld()

let mira_path = DEFAULT_MIRA_PATH

const urlParams = new URLSearchParams(document.location.search)

if (urlParams.has("mira")) {
mira_path = `test_mira/${urlParams.get("mira")!}`
console.debug(`Selected Mirabuf File: ${mira_path}`)
}
console.log(urlParams)

const setup = async () => {
const info = await MirabufCachingService.CacheRemote(mira_path, MiraType.ROBOT)
Expand Down Expand Up @@ -132,7 +135,7 @@
World.DestroyWorld()
// World.SceneRenderer.RemoveAllSceneObjects();
}
}, [])

Check warning on line 138 in fission/src/Synthesis.tsx

View workflow job for this annotation

GitHub Actions / ESLint Format Validation

React Hook useEffect has missing dependencies: 'has_code' and 'urlParams'. Either include them or remove the dependency array

Check warning on line 138 in fission/src/Synthesis.tsx

View workflow job for this annotation

GitHub Actions / ESLint Format Validation

React Hook useEffect has missing dependencies: 'has_code' and 'urlParams'. Either include them or remove the dependency array

return (
<AnimatePresence>
Expand Down
6 changes: 0 additions & 6 deletions fission/src/Window.d.ts

This file was deleted.

Loading
Loading