Skip to content

Commit

Permalink
refactor: removed unnecessary github fields from config handler
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelJacobStephen committed Apr 18, 2024
1 parent 689cbab commit a392c1a
Show file tree
Hide file tree
Showing 3 changed files with 14,755 additions and 12,050 deletions.
19 changes: 19 additions & 0 deletions packages/hoppscotch-sh-admin/src/components.d.ts
Expand Up @@ -14,6 +14,25 @@ declare module '@vue/runtime-core' {
AppSidebar: typeof import('./components/app/Sidebar.vue')['default']
AppToast: typeof import('./components/app/Toast.vue')['default']
DashboardMetricsCard: typeof import('./components/dashboard/MetricsCard.vue')['default']
HoppButtonPrimary: typeof import('@hoppscotch/ui')['HoppButtonPrimary']
HoppButtonSecondary: typeof import('@hoppscotch/ui')['HoppButtonSecondary']
HoppSmartAnchor: typeof import('@hoppscotch/ui')['HoppSmartAnchor']
HoppSmartAutoComplete: typeof import('@hoppscotch/ui')['HoppSmartAutoComplete']
HoppSmartConfirmModal: typeof import('@hoppscotch/ui')['HoppSmartConfirmModal']
HoppSmartInput: typeof import('@hoppscotch/ui')['HoppSmartInput']
HoppSmartItem: typeof import('@hoppscotch/ui')['HoppSmartItem']
HoppSmartLink: typeof import('@hoppscotch/ui')['HoppSmartLink']
HoppSmartModal: typeof import('@hoppscotch/ui')['HoppSmartModal']
HoppSmartPicture: typeof import('@hoppscotch/ui')['HoppSmartPicture']
HoppSmartSpinner: typeof import('@hoppscotch/ui')['HoppSmartSpinner']
HoppSmartTab: typeof import('@hoppscotch/ui')['HoppSmartTab']
HoppSmartTable: typeof import('@hoppscotch/ui')['HoppSmartTable']
HoppSmartTabs: typeof import('@hoppscotch/ui')['HoppSmartTabs']
HoppSmartToggle: typeof import('@hoppscotch/ui')['HoppSmartToggle']
IconLucideArrowLeft: typeof import('~icons/lucide/arrow-left')['default']
IconLucideChevronDown: typeof import('~icons/lucide/chevron-down')['default']
IconLucideInbox: typeof import('~icons/lucide/inbox')['default']
IconLucideSearch: typeof import('~icons/lucide/search')['default']
SettingsAuthProvider: typeof import('./components/settings/AuthProvider.vue')['default']
SettingsConfigurations: typeof import('./components/settings/Configurations.vue')['default']
SettingsDataSharing: typeof import('./components/settings/DataSharing.vue')['default']
Expand Down
12 changes: 3 additions & 9 deletions packages/hoppscotch-sh-admin/src/composables/useConfigHandler.ts
Expand Up @@ -15,12 +15,12 @@ import {
} from '~/helpers/backend/graphql';
import {
ALL_CONFIGS,
ServerConfigs,
Config,
GITHUB_CONFIGS,
GOOGLE_CONFIGS,
Config,
MAIL_CONFIGS,
MICROSOFT_CONFIGS,
ServerConfigs,
UpdatedConfigs,
} from '~/helpers/configs';
import { useToast } from './toast';
Expand Down Expand Up @@ -173,16 +173,10 @@ export function useConfigHandler(updatedConfigs?: ServerConfigs) {
updatedConfigs.providers.microsoft.fields
);

const githubFields = Object.fromEntries(
Object.entries(updatedConfigs.providers.github.fields ?? {}).filter(
([key]) => GITHUB_CONFIGS.some((x) => x.key === key)
)
);

pushOrFilterConfigs(
GITHUB_CONFIGS,
updatedConfigs.providers.github.enabled,
githubFields
updatedConfigs.providers.github.fields
);

pushOrFilterConfigs(
Expand Down

0 comments on commit a392c1a

Please sign in to comment.