Skip to content

Commit

Permalink
fix(dev-console): changed lighthouse config page using appId (#1528)
Browse files Browse the repository at this point in the history
  • Loading branch information
akhilmhdh authored Apr 13, 2022
1 parent ddbdaa3 commit 29cff0d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/developer-console-spa/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 packages/developer-console-spa/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "developer-console-spa",
"version": "0.2.11",
"version": "0.2.12",
"homepage": "/console",
"description": "The place where developers can get started with using One Platform for SPA deployments and integrating with One Platform Microservices.",
"author": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@ const ConfigureLighthouse = ( props: any ) => {
} );
const [ isCardExpanded, setIsCardExpanded ] = useState( true );
const [ showConfirmation, setShowConfirmation ] = useState( false );
const { app, loading: appLoading } = useContext( AppContext );
const { lighthouseConfig, setLighthouseConfig, loading: lighthouseConfigLoading } = useLighthouseConfig( app.id );
const { app, loading: appLoading, appId } = useContext( AppContext );
const {
lighthouseConfig,
setLighthouseConfig,
loading: lighthouseConfigLoading,
} = useLighthouseConfig(appId);

const lighthouseDocLink = 'https://github.com/GoogleChrome/lighthouse-ci/blob/main/docs/getting-started.md';
const lighthouseConfigDocLink = 'https://github.com/GoogleChrome/lighthouse-ci/blob/main/docs/configuration.md';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const LinkProjectForm = ( props: LinkProjectProps ) => {
const [ projects, setProjects ] = useState( [] );
const [ isProjectListOpen, setIsProjectListOpen ] = useState( false );
const [ filteredProjects, setFilteredProjects ] = useState( [] );
const { app } = useContext( AppContext );
const { appId } = useContext( AppContext );

const editMode = Boolean( lighthouseConfig?.projectId );

Expand Down Expand Up @@ -83,7 +83,7 @@ const LinkProjectForm = ( props: LinkProjectProps ) => {
};
const onCreateOption = ( newValue: any ) => {
const config = {
appId: app.id,
appId,
projectId: selectedProject.id,
branch: newValue,
createdBy: window.OpAuthHelper.getUserInfo().rhatUUID
Expand Down Expand Up @@ -115,7 +115,7 @@ const LinkProjectForm = ( props: LinkProjectProps ) => {
const linkProject = ( data: LinkProjectFormInput ) => {
setIsPrimaryLoading( true );
const config = {
appId: app.id,
appId: appId,
projectId: selectedProject.id,
branch: data.branch,
createdBy: window.OpAuthHelper.getUserInfo().rhatUUID
Expand Down

0 comments on commit 29cff0d

Please sign in to comment.