Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync dev to freezing #1954

Merged
merged 4 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions azion/production/azion.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@
"origin-id": 154233,
"origin-key": "8c16e835-20af-41d5-a688-cac8e6aefa94",
"name": "origin-console-feedback"
},
{
"origin-id": 162902,
"origin-key": "8b4c7f0a-6496-4a4d-8369-b39809903069",
"name": "maintaince-origin"
}
],
"rules-engine": {
Expand Down Expand Up @@ -163,11 +158,6 @@
"name": "Route API Identity Providers",
"phase": "request"
},
{
"id": 316429,
"name": "maintaince page",
"phase": "request"
},
{
"id": 318350,
"name": "Route GraphQL Accounting Queries to Manager Origin",
Expand Down
23 changes: 22 additions & 1 deletion cypress/e2mock/edge-application/list-edge-applications.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,25 @@ describe('Edge Application List Spec', { tags: ['@dev2'] }, () => {
.its('response.body')
.should('have.property', 'count', 100)
})
})

it('should paginate correctly list', function () {
cy.intercept('GET', '/api/v4/edge_application/*', (req) => {
if (req.url.includes('page_size=10')) {
req.reply({
fixture: '/edge-application/edge-applications-paginated.json'
})
}
}).as('paginatedEdgeApplicationsListApi')

cy.get(selectors.list.rowsPerPage.dropdown).click()
cy.get(selectors.list.rowsPerPage.option('10')).click()
cy.get(selectors.list.pageNumber.option('5')).click()
cy.wait('@paginatedEdgeApplicationsListApi')
cy.get(selectors.list.pageNumber.option('6')).should('be.visible')
cy.get(selectors.list.pageNumber.option('5')).should('have.class', 'p-highlight')

cy.get(selectors.list.searchInput).type('foo 1{enter}')
cy.get(selectors.list.pageNumber.option('1')).should('be.visible')
cy.get(selectors.list.pageNumber.option('1')).should('have.class', 'p-highlight')
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"count": 100,
"results": [
{
"id": 1727808946,
"name": "foo 1",
"last_editor": "foobar@azion.com",
"last_modified": "2024-10-01T18:45:58.915153Z"
},
{
"id": 1727808947,
"name": "foo 2",
"last_editor": "foobar@azion.com",
"last_modified": "2024-10-02T18:45:58.915153Z"
},
{
"id": 1727808948,
"name": "foo 3",
"last_editor": "foobar@azion.com",
"last_modified": "2024-10-03T18:45:58.915153Z"
},
{
"id": 1727808949,
"name": "foo 4",
"last_editor": "foobar@azion.com",
"last_modified": "2024-10-04T18:45:58.915153Z"
},
{
"id": 1727808950,
"name": "foo 5",
"last_editor": "foobar@azion.com",
"last_modified": "2024-10-05T18:45:58.915153Z"
},
{
"id": 1727808951,
"name": "foo 6",
"last_editor": "foobar@azion.com",
"last_modified": "2024-10-06T18:45:58.915153Z"
},
{
"id": 1727808952,
"name": "foo 7",
"last_editor": "foobar@azion.com",
"last_modified": "2024-10-07T18:45:58.915153Z"
},
{
"id": 1727808953,
"name": "foo 8",
"last_editor": "foobar@azion.com",
"last_modified": "2024-10-08T18:45:58.915153Z"
},
{
"id": 1727808954,
"name": "foo 9",
"last_editor": "foobar@azion.com",
"last_modified": "2024-10-09T18:45:58.915153Z"
},
{
"id": 1727808955,
"name": "foo 10",
"last_editor": "foobar@azion.com",
"last_modified": "2024-10-10T18:45:58.915153Z"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ export default {
dropdown: '.p-paginator-rpp-options',
option: (size) => `li.p-dropdown-item[aria-label="${size}"]`
},
pageNumber: {
option: (page) => `button.p-paginator-page[aria-label="${page}"]`
},
orderingHeader: {
firstColumn: ':nth-child(1) > .p-column-header-content > [data-pc-section="sort"] > .p-icon'
}
Expand Down
5 changes: 4 additions & 1 deletion src/layout/app-sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@
}"
>
<template #container>
<component :is="activeComponent.component" />
<component
:is="activeComponent.component"
class="h-full"
/>
</template>
</Sidebar>
</template>
22 changes: 13 additions & 9 deletions src/layout/components/navbar/button-copilot.vue
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
<template>
<PrimeButton
v-if="showButton"
:label="currentLabel"
@click="toggleSidebarComponent('copilot')"
class="special-button text-white border-header bg-header hover:bg-header-button-hover"
:pt="{
root: { class: 'max-md:w-[2rem] max-md:h-[2rem] justify-content-center' },
label: { class: 'max-md:hidden' },
icon: { class: 'max-md:m-0 text-white' }
label: { class: 'max-md:hidden' }
}"
:class="buttonClasses"
icon="ai ai-ask-azion"
size="small"
outlined
class="special-button"
v-tooltip.bottom="{ value: 'Azion Copilot', showDelay: 200 }"
>
<div class="special-button-content">
<i class="ai ai-ask-azion"> </i>
{{ currentLabel }}
<div
class="special-button-content shadow !shadow-[#ffffff50] w-8 md:w-auto justify-center md:justify-start"
:class="aiChatIsOpen"
>
<i class="ai ai-ask-azion"></i>{{ currentLabel }}
</div>
</PrimeButton>
</template>
Expand Down Expand Up @@ -46,6 +44,12 @@
return route.name !== 'copilot'
})

const aiChatIsOpen = computed(() => {
return isSidebarActive.value && activeComponentKey.value === 'copilot'
? 'bg-header/40'
: 'bg-header/80 hover:bg-[#00000025]'
})

const buttonClasses = computed(() => {
return isSidebarActive.value && activeComponentKey.value === 'copilot'
? 'bg-header-button-enabled'
Expand Down
6 changes: 3 additions & 3 deletions src/modules/azion-ai-chat/assets/markdown.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.markdown {
max-width: unset;
font-size: 16px;
color: #333;
color: var(--text-color);
}

.markdown pre {
Expand All @@ -19,11 +19,11 @@
line-height: 1.5em;
}

*::-webkit-scrollbar {
.markdown *::-webkit-scrollbar {
width: 8px;
}

*::-webkit-scrollbar-thumb {
.markdown *::-webkit-scrollbar-thumb {
background-color: #7a7a7a;
border-radius: 4px;
}
Expand Down
2 changes: 1 addition & 1 deletion src/modules/azion-ai-chat/layout/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
>
<Welcome />

<div class="w-[548px] justify-center items-start gap-3 inline-flex">
<div class="justify-center items-start gap-3 inline-flex">
<Suggestions />
</div>

Expand Down
25 changes: 14 additions & 11 deletions src/modules/azion-ai-chat/layout/view.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
<template>
<div class="min-h-[calc(100vh-15.5rem)] max-h-[calc(100vh-15.5rem)] pb-8 px-8 h-full">
<div class="flex flex-col border h-full rounded-md surface-border p-3">
<div
class="sticky w-full flex justify-end px-3 top-0 surface-section"
v-if="getStartConversation"
>
<PrimeButton
icon="pi pi-eraser"
outlined
label="New chat"
class="surface-border"
aria-label="New chat"
v-tooltip.bottom="'New chat'"
@click="clearChat"
/>
</div>
<div
class="overflow-hidden overflow-y-auto h-full custom-scroll"
ref="chatContainer"
Expand All @@ -14,17 +28,6 @@
</template>
<template v-else>
<div class="h-full px-3">
<div class="sticky w-full flex justify-end px-3 top-0 surface-section">
<PrimeButton
icon="pi pi-eraser"
outlined
label="New chat"
class="surface-border"
aria-label="New chat"
v-tooltip.bottom="'New chat'"
@click="clearChat"
/>
</div>
<ChatMessages class="pb-6" />
</div>
</template>
Expand Down
4 changes: 2 additions & 2 deletions src/modules/azion-ai-chat/services/make-url.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const makeBaseUrl = () => {
const { VITE_ENVIRONMENT, MODE } = import.meta.env
const environmentPrefix =
VITE_ENVIRONMENT === 'production' || MODE === 'production' ? '' : 'stage-'
const environment = VITE_ENVIRONMENT || MODE
const environmentPrefix = environment === 'production' ? '' : 'stage-'
return `https://${environmentPrefix}ai.azion.com/copilot/chat/completions`
}
5 changes: 3 additions & 2 deletions src/router/hooks/guards/accountGuard.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ export async function accountGuard({ to, accountStore, tracker, loadContractServ
accountInfo.user_id = userInfo.results.id
accountInfo.colorTheme = accountStore.theme
accountInfo.jobRole = accountJobRole.jobRole
accountInfo.isDeveloperSupportPlan = true

if (accountInfo.client_id) {
const { isDeveloperSupportPlan, yourServicePlan } = await loadContractServicePlan({
clientId: accountInfo.client_id
})
accountStore.isDeveloperSupportPlan = isDeveloperSupportPlan
accountStore.yourServicePlan = yourServicePlan
accountInfo.isDeveloperSupportPlan = isDeveloperSupportPlan
accountInfo.yourServicePlan = yourServicePlan
}

accountStore.setAccountData(accountInfo)
Expand Down
4 changes: 2 additions & 2 deletions src/router/routes/edge-application-routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ export const edgeApplicationRoutes = {
editErrorResponsesService: ErrorResponsesService.editErrorResponsesService
},
rulesEngineServices: {
listRulesEngineService: RulesEngineServiceV4.listRulesEngineService,
listRulesEngineService: RulesEngineServiceV4.listRulesEngineServiceAll,
deleteRulesEngineService: RulesEngineService.deleteRulesEngineService,
editRulesEngineService: RulesEngineService.editRulesEngineService,
createRulesEngineService: RulesEngineService.createRulesEngineService,
loadRulesEngineService: RulesEngineService.loadRulesEngineService,
reorderRulesEngine: RulesEngineService.reorderRulesEngine,
reorderRulesEngine: RulesEngineServiceV4.reorderRulesEngine,
documentationService: Helpers.documentationCatalog.edgeApplicationRulesEngine,
listOriginsService: OriginsService.listOriginsService,
listCacheSettingsService: CacheSettingsServices.listCacheSettingsService,
Expand Down
3 changes: 1 addition & 2 deletions src/router/routes/edge-firewall-routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ export const edgeFirewallRoutes = {
listFunctionsService: EdgeFirewallFunctionsServices.listFunctionsService,
listWafRulesService: WafRulesServices.listWafRulesService,
documentationService: Helpers.documentationCatalog.edgeFirewallRulesEngine,
reorderEdgeFirewallRulesEngine:
EdgeFirewallRulesEngineServicesV4.reorderEdgeFirewallRulesEngine
reorderRulesEngine: EdgeFirewallRulesEngineServicesV4.reorderRulesEngine
}
},
meta: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ import { deleteRulesEngineService } from './delete-rules-engine-service'
import { editRulesEngineService } from './edit-rules-engine-service'
import { createRulesEngineService } from './create-rules-engine-service'
import { loadRulesEngineService } from './load-rules-engine-service'
import { reorderRulesEngine } from './reorder-rules-engine-service'

export {
listRulesEngineService,
createRulesEngineService,
editRulesEngineService,
loadRulesEngineService,
deleteRulesEngineService,
reorderRulesEngine
deleteRulesEngineService
}

This file was deleted.

14 changes: 3 additions & 11 deletions src/services/edge-application-rules-engine-services/v4/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
import { listRulesEngineService } from './list-rules-engine-service'

/**
* @typedef {Object} ExportedServicesType - The type of the exported services
* @property {typeof listRulesEngineService} listRulesEngineService - The listRulesEngineService reference
*/

/**
* @type {ExportedServicesType}
*/
export { listRulesEngineService }
import { listRulesEngineServiceAll } from './list-rules-engine-all-service'
import { reorderRulesEngine } from './reorder-rules-engine-service'
export { listRulesEngineServiceAll, reorderRulesEngine }
Loading
Loading