Skip to content

Commit

Permalink
Merge pull request #1099 from aziontech/dev
Browse files Browse the repository at this point in the history
[NO-ISSUE] fix: remove wrong text in form fields records
UXE-2904 fix: change import from github page breadcumb hyperlink
UXE-2812 fix: adjust radio inputs with unexpected behavior
[NO-ISSUE] fix: adjust help center articles not showing for some routes
UXE-2817 fix: Creating Allowed Rule through Tuning is creating with wrong rule
[NO-ISSUE] fix: remove typo in release notes
UXE-2539 fix: remove typo from release notes menu
UXE-2879 fix: adjust breakpoint signup and additional data
UXE-2537 fix: displaying the list of entries in idns records
UXE-2539 refactor: remove changelogs from help center and add release notes
UXE-2578 refactor: hide frame preview for lua functions
UXE-2806 fix: added a default value for ttl field in edge dns records field
UXE-2432 fix: remove tag event on the edge firewall
[NO-ISSUE] fix: send user to home view even on request error (additional data screen)
UXE-2774 fix: reset page state if page is cached by browser
UXE-1760 fix: add minimum value to input
[NO-ISSUE] feat: add azion samples link to fork at GitHub form
[NO-ISSUE] fix: default value of tls version on change the delivery protocol
[NO-ISSUE] refactor: removed static name of import github template card
[NO-ISSUE] feat: added root directory env to template engine and added some regex
  • Loading branch information
vinigfer authored May 2, 2024
2 parents c313863 + 1f9dc27 commit 480ee77
Show file tree
Hide file tree
Showing 33 changed files with 197 additions and 98 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "azion-platform-kit",
"version": "1.14.3",
"version": "1.15.0",
"private": true,
"type": "module",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion src/router/routes/import-github-routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const importGithubRoutes = {
breadCrumbs: [
{
label: 'Import from GitHub',
to: '/import-github'
to: '/github/azion/import-from-github'
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const adapt = (httpResponse) => {
id: record.record_id,
name: record.entry,
type: record.record_type,
value: record.answers_list.join(','),
value: record.answers_list,
ttl: record.ttl,
policy: record.policy,
weight: record.weight,
Expand Down
4 changes: 0 additions & 4 deletions src/services/vulcan-services/list-vulcan-presets-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ export const listVulcanPresetsService = () => {
label: 'React',
value: 'react'
},
{
label: 'Vite',
value: 'vite'
},
{
label: 'Vue',
value: 'vue'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const adapt = (httpResponse) => {
hitCount: event.hit_count,
topIps: event.top_10_ips.map((ip) => ip.ip),
id: index,
ruleId: event.rule_id,
ruleId: parseInt(event.rule_id),
ipCount: event.ip_count,
matchZone: event.match_zone,
pathCount: event.path_count,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const adapt = (httpResponse) => {
hitCount: event.hit_count,
topIps: event.top_10_ips[0][1],
id: event.rule_id,
ruleId: event.rule_id,
ruleIdDescription: `${event.rule_id} - ${event.rule_description}`,
ipCount: event.ip_count,
matchZone: event.match_zone,
Expand Down
6 changes: 4 additions & 2 deletions src/templates/create-form-block/form-horizontal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
<div class="flex flex-col gap-2 flex-1 w-full md:min-w-[20rem]">
<div class="text-color text-xl font-medium">{{ props.title }}</div>
<div
class="text-color-secondary text-sm font-normal"
class="text-color-secondary text-sm font-normal flex flex-col gap-2"
style="white-space: pre-line"
>
{{ props.description }}
<slot name="description">
{{ props.description }}
</slot>
</div>
</div>
<!-- inputs -->
Expand Down
2 changes: 1 addition & 1 deletion src/templates/create-modal-block/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@
<span
class="h-10 pb-4 text-sm font-normal text-color-secondary mt-1.5 line-clamp-2"
>
Import an existing static project to deploy it on Azion's edge.
Import an existing project to deploy it on Azion's edge.
</span>
</div>
</div>
Expand Down
7 changes: 4 additions & 3 deletions src/templates/help-center-block/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@
},
{ label: 'API', link: 'https://api.azion.com', isLinkExternal: true },
{
label: 'Changelog',
link: 'https://www.azion.com/en/documentation/products/changelog',
label: 'Release notes',
link: 'https://www.azion.com/en/documentation/products/release-notes/',
isLinkExternal: true
},
{
Expand Down Expand Up @@ -304,7 +304,8 @@
}
const getCurrentPath = () => {
return route.path
const match = route.path.match(/(.*\/)(edit|solution)/)
return match ? `${match[1]}${match[2]}` : route.path
}
const parseFilename = (filename) => {
Expand Down
3 changes: 0 additions & 3 deletions src/templates/sign-in-block/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@
import Divider from 'primevue/divider'
import * as yup from 'yup'
import { useToast } from 'primevue/usetoast'
import { useLoadingStore } from '@/stores/loading'
/**@type {import('@/plugins/analytics/AnalyticsTrackerAdapter').AnalyticsTrackerAdapter} */
const tracker = inject('tracker')
Expand Down Expand Up @@ -205,7 +204,6 @@
const route = useRoute()
const toast = useToast()
const loadingStore = useLoadingStore()
const verifyErrorsOnUrl = () => {
const { error_description: errorMessage } = route.query
Expand All @@ -221,7 +219,6 @@
}
onMounted(() => {
loadingStore.finishLoading()
verifyErrorsOnUrl()
})
Expand Down
21 changes: 9 additions & 12 deletions src/templates/signup-block/additional-data-form-block.vue
Original file line number Diff line number Diff line change
Expand Up @@ -379,40 +379,37 @@
loading.value = true
try {
const usersPayload = fullName.value
const accountPayload = role.value
const additionalDataPayload = {
...values,
id: userId
}
const usersPayload = fullName.value
const accountPayload = role.value
const updatedAccount = await props.updateAccountInfoService(accountPayload)
accountStore.setAccountData({ jobRole: updatedAccount.jobRole })
const patchName = props.patchFullnameService(usersPayload)
const postAddData = props.postAdditionalDataService({
payload: additionalDataPayload,
options: additionalDataInfo.value
})
await patchName
await postAddData
const updatedAccount = await props.updateAccountInfoService(accountPayload)
accountStore.setAccountData({ jobRole: updatedAccount.jobRole })
tracker.signUp.submittedAdditionalData(values).track()
router.push({
name: 'home',
query: onboardingSession.value ? { onboardingSession: 'true' } : {}
})
} catch (err) {
const errors = JSON.parse(err)
toast.add({ life: 5000, severity: 'error', detail: errors.errorMessage, summary: 'Error' })
tracker.signUp.failedSubmitAdditionalData(errors).track()
} finally {
router.push({
name: 'home',
query: onboardingSession.value ? { onboardingSession: 'true' } : {}
})
loading.value = false
}
}
Expand Down
16 changes: 15 additions & 1 deletion src/templates/social-idps-block/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import PrimeButton from 'primevue/button'
import Skeleton from 'primevue/skeleton'
import { useToast } from 'primevue/usetoast'
import { computed, onMounted, ref, inject } from 'vue'
import { computed, onMounted, ref, inject, onUnmounted } from 'vue'
defineOptions({ name: 'social-idps-block' })
const emit = defineEmits(['showSocialIdps'])
Expand All @@ -56,6 +56,7 @@
const showSkeleton = computed(() => idps.value.length === 0)
onMounted(() => {
window.addEventListener('pageshow', resetLoadingState)
loadSocialIdps()
})
Expand Down Expand Up @@ -102,4 +103,17 @@
window.location.href = idp.loginUrl
tracker.signUp.userClickedSignedUp({ method: idp.slug }).track()
}
/*
When user goes to social login page and then goes back, the login page is cached in the browser.
https://web.dev/articles/bfcache
*/
const resetLoadingState = () => {
loadingStore.finishLoading()
submittedIdp.value = null
}
onUnmounted(() => {
window.removeEventListener('pageshow', resetLoadingState)
})
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,25 @@ import { describe, expect, it, vi } from 'vitest'
const fixtures = {
dnsRecordMock: {
edgeDNSID: 123987902,
selectedRecordType: { _value: 'dns-record-value' },
selectedRecordType: 'dns-record-value',
name: 'Az-dns-name',
value: 'dns-answer-record-value',
ttl: '8000',
description: 'dns record description',
selectedPolicy: { _value: 'weighted' },
selectedPolicy: 'weighted',
weight: 0.9
}
},
anameDnsRecordTypeMock: {
edgeDNSID: 123987902,
selectedRecordType: 'aname',
name: 'Aname-dns-name',
value: 'aname-record-type',
ttl: 20,
description: 'dns aname record description',
selectedPolicy: 'weighted',
weight: 0.9
},
ttlDefaultValue: 20
}

const makeSut = () => {
Expand Down Expand Up @@ -52,6 +63,26 @@ describe('EdgeDnsRecordsServices', () => {
}
})
})
it('should create a aname record type with default value', async () => {
const requestSpy = vi.spyOn(AxiosHttpClientAdapter, 'request').mockResolvedValueOnce({
statusCode: 201,
body: {
results: {
id: 1
}
}
})
const { sut } = makeSut()
await sut(fixtures.anameDnsRecordTypeMock)

expect(requestSpy).toHaveBeenCalledWith(
expect.objectContaining({
body: expect.objectContaining({
ttl: fixtures.ttlDefaultValue
})
})
)
})

it('should return a feedback message on successfully created', async () => {
vi.spyOn(AxiosHttpClientAdapter, 'request').mockResolvedValueOnce({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ describe('EdgeDnsRecordsServices', () => {
id: fixtures.dnsRecordMock.record_id,
name: fixtures.dnsRecordMock.entry,
type: fixtures.dnsRecordMock.record_type,
value: `${fixtures.dnsRecordMock.answers_list.at(
0
)},${fixtures.dnsRecordMock.answers_list.at(1)}`,
value: fixtures.dnsRecordMock.answers_list,
ttl: fixtures.dnsRecordMock.ttl,
policy: fixtures.dnsRecordMock.policy,
weight: fixtures.dnsRecordMock.weight,
Expand All @@ -82,7 +80,7 @@ describe('EdgeDnsRecordsServices', () => {
id: fixtures.dnsRecordMissingDataMock.record_id,
name: fixtures.dnsRecordMissingDataMock.entry,
type: fixtures.dnsRecordMissingDataMock.record_type,
value: '',
value: [],
ttl: fixtures.dnsRecordMissingDataMock.ttl,
policy: fixtures.dnsRecordMissingDataMock.policy,
description: '-'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('VulcanServices', () => {
const presets = sut.listVulcanPresetsService()

expect(presets).toBeInstanceOf(Array)
expect(presets).toHaveLength(7)
expect(presets).toHaveLength(6)
})

it('each preset should have the correctly properties', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ describe('WafRulesService', () => {
{
hitCount: fixtures.wafRulesMock.hit_count,
topIps: '100.100.10',
ruleId: fixtures.wafRulesMock.rule_id,
id: fixtures.wafRulesMock.rule_id,
ruleIdDescription: `${fixtures.wafRulesMock.rule_id} - ${fixtures.wafRulesMock.rule_description}`,
ipCount: fixtures.wafRulesMock.ip_count,
Expand Down
2 changes: 1 addition & 1 deletion src/views/CreateNew/DeployView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
}"
class="md:ml-auto w-full"
label="Back"
icon="pi pi-sync"
icon="pi pi-chevron-left"
iconPos="left"
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
const setDeliveryProtocol = (protocol, enableHttp3) => {
deliveryProtocol.value = protocol
http3.value = enableHttp3
if (deliveryProtocol.value === 'http') minimumTlsVersion.value = {}
if (deliveryProtocol.value === 'http') minimumTlsVersion.value = ''
setDefaultHttpAndHttpsPort(enableHttp3)
}
Expand Down
6 changes: 5 additions & 1 deletion src/views/EdgeApplications/TabsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@
return edgeApplication.value?.edgeFunctions
})
const showL2CachingEnabled = computed(() => {
return edgeApplication.value?.l2Caching
})
const updatedApplication = (application) => {
edgeApplication.value = { ...application }
verifyTab(edgeApplication.value)
Expand Down Expand Up @@ -248,7 +252,7 @@
:edgeApplicationId="edgeApplicationId"
:isEnableApplicationAccelerator="isEnableApplicationAccelerator"
v-bind="props.cacheSettingsServices"
:showTieredCache="edgeApplication.l2Caching"
:showTieredCache="showL2CachingEnabled"
/>
</TabPanel>
<TabPanel
Expand Down
6 changes: 4 additions & 2 deletions src/views/EdgeApplicationsCacheSettings/Drawer/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@
})
const minimumAcceptableValue = computed(() =>
props.isEnableApplicationAccelerator ? CDN_MAXIMUM_TTL_MIN_VALUE : CDN_MAXIMUM_TTL_MAX_VALUE
props.isEnableApplicationAccelerator || props.showTieredCache
? CDN_MAXIMUM_TTL_MIN_VALUE
: CDN_MAXIMUM_TTL_MAX_VALUE
)
const minimumAcceptableValueWhenIsHonor = ref(minimumAcceptableValue.value)
const l2CachingEnabled = ref()
Expand Down Expand Up @@ -250,7 +252,7 @@
<FormFieldsEdgeApplicationCacheSettings
:isEnableApplicationAccelerator="isEnableApplicationAccelerator"
:showTieredCache="props.showTieredCache"
@l2-caching-enabled="setNewValue"
@l2-caching-enabled="setNewMinimumValue"
/>
</template>
</EditDrawerBlock>
Expand Down
Loading

0 comments on commit 480ee77

Please sign in to comment.