-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hide UI elements when using local foreman-advisor-engine
Hide the sync recommendations toggle Remove InsightsHeader
- Loading branch information
1 parent
dc80828
commit 1ffb31d
Showing
21 changed files
with
113 additions
and
112 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
app/controllers/api/v2/rh_cloud/advisor_engine_config_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module Api | ||
module V2 | ||
module RhCloud | ||
class AdvisorEngineConfigController < ::Api::V2::BaseController | ||
include ::Api::Version2 | ||
|
||
api :GET, "/rh_cloud/advisor_engine_config", N_("Show if system is configured to use local Foreman Advisor Engine.") | ||
def show | ||
render json: { | ||
use_local_advisor_engine: ForemanRhCloud.with_local_advisor_engine?, | ||
}, status: :ok | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
webpack/InsightsCloudSync/Components/InsightsHeader/InsightsHeader.scss
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
webpack/InsightsCloudSync/Components/InsightsHeader/index.js
This file was deleted.
Oops, something went wrong.
48 changes: 26 additions & 22 deletions
48
webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettings.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 0 additions & 18 deletions
18
webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/InsightsSettings.test.js
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
...oudSync/Components/InsightsSettings/__tests__/__snapshots__/InsightsSettings.test.js.snap
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
webpack/InsightsCloudSync/Components/__tests__/InsightsHeader.test.js
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
webpack/InsightsCloudSync/Components/__tests__/__snapshots__/InsightsHeader.test.js.snap
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const useAPI = jest.fn(() => ({ | ||
response: {}, | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { useAPI } from 'foremanReact/common/hooks/API/APIHooks'; | ||
import { | ||
ADVISOR_ENGINE_CONFIG_KEY, | ||
ADVISOR_ENGINE_CONFIG_PATH, | ||
} from '../../InsightsCloudSync/Components/InsightsTable/InsightsTableConstants'; | ||
|
||
export const useAdvisorEngineConfig = () => { | ||
const { response: advisorEngineConfig } = useAPI( | ||
'get', | ||
ADVISOR_ENGINE_CONFIG_PATH, | ||
{ | ||
key: ADVISOR_ENGINE_CONFIG_KEY, | ||
} | ||
); | ||
|
||
// eslint-disable-next-line camelcase | ||
const isLocalAdvisorEngine = advisorEngineConfig?.use_local_advisor_engine; | ||
return isLocalAdvisorEngine; | ||
}; |