From f3d8b4474302a00fd923581046b0f5828a4c5976 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 12 Apr 2022 20:55:34 +0200 Subject: copyright headers --- packages/anastasis-webui/preact.config.js | 30 +++++++++++----------- .../src/components/menu/NavigationBar.tsx | 8 ++++++ .../src/hooks/use-anastasis-reducer.ts | 26 ++----------------- 3 files changed, 25 insertions(+), 39 deletions(-) (limited to 'packages/anastasis-webui') diff --git a/packages/anastasis-webui/preact.config.js b/packages/anastasis-webui/preact.config.js index 8d6da1911..f9a8d6cba 100644 --- a/packages/anastasis-webui/preact.config.js +++ b/packages/anastasis-webui/preact.config.js @@ -15,31 +15,31 @@ */ /** -* -* @author Sebastian Javier Marchano (sebasjm) -*/ + * + * @author Sebastian Javier Marchano (sebasjm) + */ -import { DefinePlugin } from 'webpack'; +import { DefinePlugin } from "webpack"; -import pack from './package.json'; -import * as cp from 'child_process'; +import pack from "./package.json"; +import * as cp from "child_process"; -const commitHash = cp.execSync('git rev-parse --short HEAD').toString(); +const commitHash = cp.execSync("git rev-parse --short HEAD").toString(); export default { webpack(config, env, helpers) { // add __VERSION__ to be use in the html config.plugins.push( new DefinePlugin({ - 'process.env.__VERSION__': JSON.stringify(env.isProd ? pack.version : `dev-${commitHash}`), + "process.env.__VERSION__": JSON.stringify( + env.isProd ? pack.version : `dev-${commitHash}`, + ), }), ); - const crittersWrapper = helpers.getPluginsByName(config, 'Critters') + const crittersWrapper = helpers.getPluginsByName(config, "Critters"); if (crittersWrapper && crittersWrapper.length > 0) { - const [{ index }] = crittersWrapper - config.plugins.splice(index, 1) + const [{ index }] = crittersWrapper; + config.plugins.splice(index, 1); } - - } -} - + }, +}; diff --git a/packages/anastasis-webui/src/components/menu/NavigationBar.tsx b/packages/anastasis-webui/src/components/menu/NavigationBar.tsx index bc6d923d7..650ebd991 100644 --- a/packages/anastasis-webui/src/components/menu/NavigationBar.tsx +++ b/packages/anastasis-webui/src/components/menu/NavigationBar.tsx @@ -51,6 +51,14 @@ export function NavigationBar({ onMobileMenu, title }: Props): VNode { > Report a bug + + Settings + {/* { const res = await discoverPolicies(this.currentReducerState!, undefined); - const aggregatedPolicies: AggregatedPolicyMetaInfo[] = []; - const polHashToIndex: Record = {}; - for (const pol of res.policies) { - const oldIndex = polHashToIndex[pol.policy_hash]; - if (oldIndex != null) { - aggregatedPolicies[oldIndex].providers.push({ - provider_url: pol.provider_url, - version: pol.version, - }); - } else { - aggregatedPolicies.push({ - attribute_mask: pol.attribute_mask, - policy_hash: pol.policy_hash, - providers: [ - { - provider_url: pol.provider_url, - version: pol.version, - }, - ], - secret_name: pol.secret_name, - }); - polHashToIndex[pol.policy_hash] = aggregatedPolicies.length - 1; - } - } + const aggregatedPolicies = mergeDiscoveryAggregate(res.policies, []); setAnastasisState({ ...anastasisState, discoveryState: { -- cgit v1.2.3