Skip to content

Commit

Permalink
refactor(entities): remove config.requestHeaders [KM-43] (#1302)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Now `config.requestHeaders` is removed. Use `config.axiosRequestConfig` instead.
  • Loading branch information
Leopoldthecoder committed Apr 2, 2024
1 parent 8de453e commit 144c9d8
Show file tree
Hide file tree
Showing 82 changed files with 165 additions and 255 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ A config card component for CA certificates.
- default: `undefined`
- Base URL for API requests.

- `requestHeaders`:
- type: `RawAxiosRequestHeaders | AxiosHeaders`
- `axiosRequestConfig`:
- type: `AxiosRequestConfig`
- required: `false`
- default: `undefined`
- Additional headers to send with all Axios requests.
- An optional configuration object for the underlying Axios request.

- `workspace`:
- type: `string`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ A form component for CA Certificates.
- default: `undefined`
- Base URL for API requests.

- `requestHeaders`:
- type: `RawAxiosRequestHeaders | AxiosHeaders`
- `axiosRequestConfig`:
- type: `AxiosRequestConfig`
- required: `false`
- default: `undefined`
- Additional headers to send with all Axios requests.
- An optional configuration object for the underlying Axios request.

- `cancelRoute`:
- type: `RouteLocationRaw`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ A table component for ca-certificates.
- default: `undefined`
- Base URL for API requests.

- `requestHeaders`:
- type: `RawAxiosRequestHeaders | AxiosHeaders`
- `axiosRequestConfig`:
- type: `AxiosRequestConfig`
- required: `false`
- default: `undefined`
- Additional headers to send with all Axios requests.
- An optional configuration object for the underlying Axios request.

- `createRoute`:
- type: `RouteLocationRaw`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ A form component for Certificate.
- default: `undefined`
- Base URL for API requests.

- `requestHeaders`:
- type: `RawAxiosRequestHeaders | AxiosHeaders`
- `axiosRequestConfig`:
- type: `AxiosRequestConfig`
- required: `false`
- default: `undefined`
- Additional headers to send with all Axios requests.
- An optional configuration object for the underlying Axios request.

- `workspace`:
- type: `string`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ A form component for Certificates.
- default: `undefined`
- Base URL for API requests.

- `requestHeaders`:
- type: `RawAxiosRequestHeaders | AxiosHeaders`
- `axiosRequestConfig`:
- type: `AxiosRequestConfig`
- required: `false`
- default: `undefined`
- Additional headers to send with all Axios requests.
- An optional configuration object for the underlying Axios request.

- `cancelRoute`:
- type: `RouteLocationRaw`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ A table component for certificates.
- default: `undefined`
- Base URL for API requests.

- `requestHeaders`:
- type: `RawAxiosRequestHeaders | AxiosHeaders`
- `axiosRequestConfig`:
- type: `AxiosRequestConfig`
- required: `false`
- default: `undefined`
- Additional headers to send with all Axios requests.
- An optional configuration object for the underlying Axios request.

- `createRoute`:
- type: `RouteLocationRaw`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ const router = useRouter()
const { i18n: { t } } = composables.useI18n()
const { getMessageFromError } = useErrors()
const { axiosInstance } = useAxios({
headers: props.config?.requestHeaders,
})
const { axiosInstance } = useAxios(props.config?.axiosRequestConfig)
const fetchUrl = computed<string>(() => endpoints.form[props.config.app].edit)
const formType = computed((): EntityBaseFormType => props.certificateId ? EntityBaseFormType.Edit : EntityBaseFormType.Create)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,7 @@ const props = defineProps({
const { i18n: { t, formatUnixTimeStamp }, i18nT } = composables.useI18n()
const router = useRouter()

const { axiosInstance } = useAxios({
headers: props.config?.requestHeaders,
})
const { axiosInstance } = useAxios(props.config?.axiosRequestConfig)
const fetcherCacheKey = ref<number>(1)

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,7 @@ const router = useRouter()
const { i18nT, i18n: { t } } = composables.useI18n()
const { getMessageFromError } = useErrors()
const { axiosInstance } = useAxios({
headers: props.config?.requestHeaders,
})
const { axiosInstance } = useAxios(props.config?.axiosRequestConfig)
const fetchUrl = computed<string>(() => endpoints.form[props.config.app].edit)
const formType = computed((): EntityBaseFormType => props.certificateId ? EntityBaseFormType.Edit : EntityBaseFormType.Create)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,7 @@ const props = defineProps({
const { i18n: { t, formatUnixTimeStamp }, i18nT } = composables.useI18n()
const router = useRouter()

const { axiosInstance } = useAxios({
headers: props.config?.requestHeaders,
})
const { axiosInstance } = useAxios(props.config?.axiosRequestConfig)
const fetcherCacheKey = ref<number>(1)

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ A table component for consumer credentials.
- default: `undefined`
- Base URL for API requests.

- `requestHeaders`:
- type: `RawAxiosRequestHeaders | AxiosHeaders`
- `axiosRequestConfig`:
- type: `AxiosRequestConfig`
- required: `false`
- default: `undefined`
- Additional headers to send with all Axios requests.
- An optional configuration object for the underlying Axios request.

- `createRoute`:
- type: `RouteLocationRaw`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,7 @@ const props = defineProps({

const { i18n: { t, formatUnixTimeStamp } } = composables.useI18n()

const { axiosInstance } = useAxios({
headers: props.config.requestHeaders,
})
const { axiosInstance } = useAxios(props.config?.axiosRequestConfig)
const fetcherCacheKey = ref<number>(1)

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ A config card component for consumer groups.
- default: `undefined`
- Base URL for API requests.

- `requestHeaders`:
- type: `RawAxiosRequestHeaders | AxiosHeaders`
- `axiosRequestConfig`:
- type: `AxiosRequestConfig`
- required: `false`
- default: `undefined`
- Additional headers to send with all Axios requests.
- An optional configuration object for the underlying Axios request.

- `workspace`:
- type: `string`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ A form component to create/edit Consumer Group.
- required: `true`
- default: `undefined`
- Base URL for API requests.
- `requestHeaders`:
- type: `RawAxiosRequestHeaders | AxiosHeaders`
- `axiosRequestConfig`:
- type: `AxiosRequestConfig`
- required: `false`
- default: `undefined`
- Additional headers to send with all Axios requests.
- An optional configuration object for the underlying Axios request.
- `cancelRoute`:
- type: `RouteLocationRaw`
- required: `true`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ A table component for consumer groups.
- default: `undefined`
- Base URL for API requests.

- `requestHeaders`:
- type: `RawAxiosRequestHeaders | AxiosHeaders`
- `axiosRequestConfig`:
- type: `AxiosRequestConfig`
- required: `false`
- default: `undefined`
- Additional headers to send with all Axios requests.
- An optional configuration object for the underlying Axios request.

- `createRoute`:
- type: `RouteLocationRaw`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@ const emit = defineEmits<{
(e: 'error', msg: string): void
}>()
const { axiosInstance } = useAxios({
headers: props.config?.requestHeaders,
})
const { axiosInstance } = useAxios(props.config?.axiosRequestConfig)
/**
* ------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,7 @@ const {
searchKeys: ['username', 'custom_id', 'id'],
})
const { axiosInstance } = useAxios({
headers: props.config?.requestHeaders,
})
const { axiosInstance } = useAxios(props.config?.axiosRequestConfig)
const { getMessageFromError } = useErrors()
const validators = useValidators()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,7 @@ const props = defineProps({
const { i18nT, i18n: { t } } = composables.useI18n()
const router = useRouter()

const { axiosInstance } = useAxios({
headers: props.config?.requestHeaders,
})
const { axiosInstance } = useAxios(props.config?.axiosRequestConfig)
const fetcherCacheKey = ref<number>(1)
const isConsumerPage = computed<boolean>(() => !!props.config.consumerId)
const preferencesStorageKey = computed<string>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ A form component for consumer.
- default: `undefined`
- Base URL for API requests.

- `requestHeaders`:
- type: `RawAxiosRequestHeaders | AxiosHeaders`
- `axiosRequestConfig`:
- type: `AxiosRequestConfig`
- required: `false`
- default: `undefined`
- Additional headers to send with all Axios requests.
- An optional configuration object for the underlying Axios request.

- `workspace`:
- type: `string`
Expand Down
6 changes: 3 additions & 3 deletions packages/entities/entities-consumers/docs/consumer-form.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ A form component to create/edit Consumer.
- required: `true`
- default: `undefined`
- Base URL for API requests.
- `requestHeaders`:
- type: `RawAxiosRequestHeaders | AxiosHeaders`
- `axiosRequestConfig`:
- type: `AxiosRequestConfig`
- required: `false`
- default: `undefined`
- Additional headers to send with all Axios requests.
- An optional configuration object for the underlying Axios request.
- `cancelRoute`:
- type: `RouteLocationRaw`
- required: `true`
Expand Down
6 changes: 3 additions & 3 deletions packages/entities/entities-consumers/docs/consumer-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ A table component for consumers.
- default: `undefined`
- Base URL for API requests.

- `requestHeaders`:
- type: `RawAxiosRequestHeaders | AxiosHeaders`
- `axiosRequestConfig`:
- type: `AxiosRequestConfig`
- required: `false`
- default: `undefined`
- Additional headers to send with all Axios requests.
- An optional configuration object for the underlying Axios request.

- `createRoute`:
- type: `RouteLocationRaw`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@ const emit = defineEmits<{
(e: 'error', msg: string): void
}>()
const { axiosInstance } = useAxios({
headers: props.config?.requestHeaders,
})
const { axiosInstance } = useAxios(props.config?.axiosRequestConfig)
/**
* ------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,7 @@ const emit = defineEmits<{
const { i18nT, i18n: { t } } = composables.useI18n()
const router = useRouter()
const { axiosInstance } = useAxios({
headers: props.config?.requestHeaders,
})
const { axiosInstance } = useAxios(props.config?.axiosRequestConfig)
const { getMessageFromError } = useErrors()
const uuid = uuidv4()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,7 @@ const props = defineProps({
const { i18nT, i18n: { t } } = composables.useI18n()
const router = useRouter()
const { axiosInstance } = useAxios({
headers: props.config?.requestHeaders,
})
const { axiosInstance } = useAxios(props.config?.axiosRequestConfig)
const fetcherCacheKey = ref<number>(1)
const isConsumerGroupPage = computed<boolean>(() => !!props.config.consumerGroupId)
const preferencesStorageKey = computed<string>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ A config card component for gateway services.
- default: `undefined`
- Base URL for API requests.

- `requestHeaders`:
- type: `RawAxiosRequestHeaders | AxiosHeaders`
- `axiosRequestConfig`:
- type: `AxiosRequestConfig`
- required: `false`
- default: `undefined`
- Additional headers to send with all Axios requests.
- An optional configuration object for the underlying Axios request.

- `workspace`:
- type: `string`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ A form component for gateway services.
- default: `undefined`
- Base URL for API requests.

- `requestHeaders`:
- type: `RawAxiosRequestHeaders | AxiosHeaders`
- `axiosRequestConfig`:
- type: `AxiosRequestConfig`
- required: `false`
- default: `undefined`
- Additional headers to send with all Axios requests.
- An optional configuration object for the underlying Axios request.

- `cancelRoute`:
- type: `RouteLocationRaw`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ A table component for gateway services.
- default: `undefined`
- Base URL for API requests.

- `requestHeaders`:
- type: `RawAxiosRequestHeaders | AxiosHeaders`
- `axiosRequestConfig`:
- type: `AxiosRequestConfig`
- required: `false`
- default: `undefined`
- Additional headers to send with all Axios requests.
- An optional configuration object for the underlying Axios request.

- `createRoute`:
- type: `RouteLocationRaw`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,7 @@ const isCollapsed = ref(true)
const router = useRouter()
const { i18nT, i18n: { t } } = composables.useI18n()
const { getMessageFromError } = useErrors()
const { axiosInstance } = useAxios({
headers: props.config?.requestHeaders,
})
const { axiosInstance } = useAxios(props.config?.axiosRequestConfig)
const validators = useValidators()
const fetchUrl = computed<string>(() => endpoints.form[props.config.app].edit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,7 @@ const props = defineProps({
const { i18n: { t } } = composables.useI18n()
const router = useRouter()
const { axiosInstance } = useAxios({
headers: props.config?.requestHeaders,
})
const { axiosInstance } = useAxios(props.config?.axiosRequestConfig)
const fetchCacheKey = ref<number>(1)
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ A config card component for Key Sets.
- default: `undefined`
- Base URL for API requests.

- `requestHeaders`:
- type: `RawAxiosRequestHeaders | AxiosHeaders`
- `axiosRequestConfig`:
- type: `AxiosRequestConfig`
- required: `false`
- default: `undefined`
- Additional headers to send with all Axios requests.
- An optional configuration object for the underlying Axios request.

- `workspace`:
- type: `string`
Expand Down
Loading

0 comments on commit 144c9d8

Please sign in to comment.