Skip to content

Commit

Permalink
chores(ui): codegen ui
Browse files Browse the repository at this point in the history
Signed-off-by: ashutosh16 <[email protected]>
  • Loading branch information
ashutosh16 committed Nov 8, 2024
1 parent 5a94f8b commit 8073998
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
19 changes: 14 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ endif

GIT_TAG:=$(if $(GIT_TAG),$(GIT_TAG),$(shell if [ -z "`git status --porcelain`" ]; then git describe --exact-match --tags HEAD 2>/dev/null; fi))


# setting the appropriate environment variables before running make.
# docker image publishing options
IMAGE_NAMESPACE?=argoproj-labs
IMAGE_NAME=${IMAGE_NAMESPACE}/argocd-ephemeral-access
IMAGE_NAME?=${IMAGE_NAMESPACE}/argocd-ephemeral-access
EPHEMERAL_BACKEND_NAMESPACE?=default
EPHEMERAL_CONTROLLER_PORT?=8889
EPHEMERAL_METRICS_ADDR?=:9999
EPHEMERAL_BACKEND_DEFAULT_ACCESS_DURATION?=1m

ifneq (${GIT_TAG},)
IMAGE_TAG=${GIT_TAG}
Expand Down Expand Up @@ -259,10 +263,15 @@ generate-mocks: mockery ## Generate the mocks for the project as configured in .
clean-ui:
find ${UI_DIR} -type f -name extension.tar -delete

PHONY: codegen-download-openapi
codegen-download-openapi: run-backend
.PHONY: codegen-download-openapi run-backend

codegen-download-openapi:
@echo "Starting the backend server"
goreman start backend &
sleep 5
@echo "Downloading OpenAPI spec from dev server"
yarn --cwd ${UI_DIR} api:download
yarn --cwd ${UI_DIR} api:download
killall goreman || true

.PHONY: codegen-ui
codegen-ui: ## Generate the UI API files.
Expand Down
2 changes: 1 addition & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"scripts": {
"start": "webpack --config ./webpack.config.js --watch",
"build": "webpack --config ./webpack.config.js && tar -C dist -cvf extension.tar resources",
"api:download": "curl http://localhost:8888/api/openapi.yaml -o ./src/gen/schema.yaml",
"api:download": "curl http://localhost:8888/openapi.yaml -o ./src/gen/schema.yaml",
"api:generate": "orval"
},
"eslintConfig": {
Expand Down
8 changes: 4 additions & 4 deletions ui/src/ephemeral-access.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { getUserInfo } from './config/client';
import { Application, UserInfo } from './models/type';
import { EnableEphemeralAccess } from './utils/utils';



export const RequestAccessBtn = () => {
return (
<div qe-id='ext-access'>
Expand All @@ -31,12 +29,14 @@ export const RequestAccessBtnFlyout = ({ application }: RequestAccessBtnFlyoutPr
if (!application) return;

const fetchUserInfo = async () => {
const info = await getUserInfo(application);
const info = await getUserInfo(application);
setUserInfo(info);
};

fetchUserInfo();
}, [application]);

return <>{userInfo && <EphemeralAccessDetails application={application} userInfo={userInfo} />}</>;
return (
<>{userInfo && <EphemeralAccessDetails application={application} userInfo={userInfo} />}</>
);
};

0 comments on commit 8073998

Please sign in to comment.