Skip to content

Commit

Permalink
complete storeknox discovery pages testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Elliot Yibaebi committed Dec 26, 2024
1 parent 0ab70f2 commit 8e5c6f3
Show file tree
Hide file tree
Showing 27 changed files with 1,394 additions and 43 deletions.
1 change: 1 addition & 0 deletions app/components/ak-svg/storeknox-playstore-logo.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
viewBox='0 0 20 20'
fill='none'
xmlns='http://www.w3.org/2000/svg'
...attributes
>
<path
d='M3.28277 14.2383C2.41746 14.2387 1.71434 13.5347 1.71418 12.6695L1.71387 7.86653C1.71355 7.00216 2.41652 6.29825 3.28074 6.2981C3.7009 6.29778 4.09434 6.46075 4.3909 6.757C4.68746 7.05325 4.85059 7.44732 4.8509 7.86622L4.85043 12.6693C4.85152 13.0879 4.68887 13.4817 4.39246 13.7778C4.09684 14.0747 3.7023 14.2381 3.28277 14.2383ZM3.28152 6.7195C2.64824 6.71919 2.13496 7.23372 2.1348 7.86653L2.13559 12.669C2.13574 13.304 2.64996 13.8165 3.28262 13.8172C3.91652 13.8164 4.42996 13.3039 4.42934 12.6692V7.86591C4.42902 7.23325 3.91512 6.71919 3.28152 6.7195Z'
Expand Down
1 change: 1 addition & 0 deletions app/components/ak-svg/storeknox-search-apps.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
viewBox='0 0 282 232'
fill='none'
xmlns='http://www.w3.org/2000/svg'
...attributes
>
<g filter='url(#filter0_d_1285_11312)'>
<path
Expand Down
2 changes: 2 additions & 0 deletions app/components/storeknox/discover/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@direction='column'
@spacing='0.5'
local-class='header-storeknox-discover-page'
data-test-storeknoxDiscover-header-infoTexts
>
<AkTypography @variant='subtitle1'>
{{t 'storeknox.discoverHeader'}}
Expand All @@ -23,6 +24,7 @@
@currentWhen={{item.activeRoutes}}
@hasBadge={{item.hasBadge}}
@badgeCount={{item.badgeCount}}
data-test-storeknox-discovery-tabs='{{item.id}}-tab'
>
{{item.label}}
</Akt.tabItem>
Expand Down
18 changes: 5 additions & 13 deletions app/components/storeknox/discover/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,11 @@ export default class StoreknoxDiscoverComponent extends Component {
route: 'authenticated.storeknox.discover.result',
label: this.intl.t('storeknox.discoveryResults'),
},
this.me.org?.is_admin
? {
id: 'pending-review',
route: 'authenticated.storeknox.discover.review',
label: this.intl.t('storeknox.pendingReview'),
hasBadge: true,
badgeCount: this.skPendingReview.totalCount,
}
: {
id: 'requested-apps',
route: 'authenticated.storeknox.discover.requested',
label: this.intl.t('storeknox.requestedApps'),
},
!this.me.org?.is_admin && {
id: 'requested-apps',
route: 'authenticated.storeknox.discover.requested',
label: this.intl.t('storeknox.requestedApps'),
},
].filter(Boolean);
}

Expand Down
24 changes: 20 additions & 4 deletions app/components/storeknox/discover/requested-apps/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,29 @@
@direction='column'
@alignItems='center'
local-class='empty-container'
data-test-storeknoxDiscover-requestedAppsTable-tableEmpty
>
<AkSvg::ProjectListEmpty />
<AkSvg::ProjectListEmpty
data-test-storeknoxDiscover-requestedAppsTable-tableEmptyIllustration
/>

<AkTypography @variant='h5' @gutterBottom={{true}} local-class='header'>
<AkTypography
@variant='h5'
@gutterBottom={{true}}
local-class='header'
data-test-storeknoxDiscover-requestedAppsTable-tableEmptyHeaderText
>
{{t 'storeknox.noRequestedAppsFound'}}
</AkTypography>

<AkTypography local-class='body-text'>
<AkTypography
local-class='body-text'
data-test-storeknoxDiscover-requestedAppsTable-tableEmptyHeaderDescription
>
{{t 'storeknox.noRequestedAppsFoundDescription' htmlSafe=true}}
</AkTypography>
</AkStack>

{{else}}
<AkPaginationProvider
@results={{this.requestedAppsData}}
Expand Down Expand Up @@ -41,7 +53,11 @@
</h.row>
</tb.head>
<tb.body @rows={{pgc.currentPageResults}} as |b|>
<b.row as |r|>
<b.row
data-test-storeknoxDiscover-requestedAppsTable-row
data-test-storeknoxDiscover-requestedAppsTable-rowId='{{b.rowValue.id}}'
as |r|
>
<r.cell>
{{#let (component r.columnValue.cellComponent) as |Component|}}
<Component
Expand Down
2 changes: 1 addition & 1 deletion app/components/storeknox/discover/requested-apps/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default class StoreknoxDiscoverRequestedAppsComponent extends Component<S
}

try {
this.skRequestedAppData = (await this.store.query('skRequestedApp', {
this.skRequestedAppData = (await this.store.query('sk-requested-app', {
limit,
offset,
})) as SkRequestedAppResponse;
Expand Down
27 changes: 22 additions & 5 deletions app/components/storeknox/discover/requested-apps/status/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,29 @@
@label={{t 'storeknox.waitingForApproval'}}
@variant='semi-filled'
@color='success'
data-test-storeknoxDiscover-requestedAppsTable-row-waitingForApprovalChip
>
<:icon>
<AkIcon @iconName='schedule-send' />
<AkIcon
@iconName='schedule-send'
data-test-storeknoxDiscover-requestedAppsTable-row-waitingForApprovalChipIcon
/>
</:icon>
</AkChip>
{{else}}
<AkStack @justifyContent='center' @direction='column'>
<AkStack
@justifyContent='center'
@direction='column'
data-test-storeknoxDiscover-requestedAppsTable-row-approvalOrRejectedInfoContainer
>
<AkTypography @color={{this.statusDetails.color}}>
{{this.statusDetails.text}}
</AkTypography>

<AkStack @alignItems='center' @spacing='0.5'>
<AkTypography>
<AkTypography
data-test-storeknoxDiscover-requestedAppsTable-row-approvalOrRejectedUserInfo
>
{{t 'by'}}
{{this.statusDetails.by}}
</AkTypography>
Expand All @@ -25,14 +35,21 @@
<AkStack @spacing='0.5' @alignItems='center'>
<AkIcon @iconName='check-circle' @size='small' />

<AkTypography @color='inherit'>
<AkTypography
@color='inherit'
data-test-storeknoxDiscover-requestedAppsTable-row-approvalOrRejectedDate
>
{{this.statusDetails.date}}
</AkTypography>
</AkStack>
</:tooltipContent>

<:default>
<AkIcon @iconName='info' local-class='info-icon' />
<AkIcon
@iconName='info'
local-class='info-icon'
data-test-storeknoxDiscover-requestedAppsTable-row-approvalOrRejectedDateTooltipIcon
/>
</:default>
</AkTooltip>
</AkStack>
Expand Down
12 changes: 9 additions & 3 deletions app/components/storeknox/discover/results/empty/index.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<AkStack @direction='column' @alignItems='center' local-class='empty-container'>

<AkSvg::StoreknoxSearchApps />
<AkStack
@direction='column'
@alignItems='center'
local-class='empty-container'
data-test-storeknoxDiscover-resultsEmptyContainer
>
<AkSvg::StoreknoxSearchApps
data-test-storeknoxDiscover-resultsEmptyIllustration
/>

<AkTypography @variant='h5' @gutterBottom={{true}} local-class='header'>
{{t 'storeknox.searchForApps'}}
Expand Down
54 changes: 44 additions & 10 deletions app/components/storeknox/discover/results/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,48 @@
<AkTextField
@placeholder={{t 'storeknox.searchQuery'}}
@value={{this.searchQuery}}
data-test-storeknoxDiscover-results-searchQueryInput
>
<:rightAdornment>
{{#if this.searchQuery}}
<AkIconButton @size='small' {{on 'click' this.clearSearch}}>
<AkIconButton
@size='small'
{{on 'click' this.clearSearch}}
data-test-storeknoxDiscover-results-searchClearIcon
>
<AkIcon @iconName='close' />
</AkIconButton>
{{else}}
<AkIcon @iconName='search' @color='textSecondary' />
<AkIcon
@iconName='search'
@color='textSecondary'
data-test-storeknoxDiscover-results-searchIcon
/>
{{/if}}
</:rightAdornment>
</AkTextField>
</div>

<AkButton @type='submit' @disabled={{not this.searchQuery}}>
<AkButton
@type='submit'
@disabled={{not this.searchQuery}}
data-test-storeknoxDiscover-results-searchTrigger
>
{{t 'storeknox.discoverHeader'}}
</AkButton>
</AkStack>
</form>

<AkStack @alignItems='center' local-class='disclaimer-section'>
<AkStack
@alignItems='center'
local-class='disclaimer-section'
data-test-storeknoxDiscover-results-disclaimerInfoSection
>
<AkStack local-class='warning-icon' class='p-1'>
<AkIcon @iconName='warning' />
<AkIcon
@iconName='warning'
data-test-storeknoxDiscover-results-disclaimerInfoWarningIcon
/>
</AkStack>

<AkTypography @fontWeight='medium' class='ml-2'>
Expand All @@ -42,6 +62,7 @@
@typographyFontWeight='bold'
class='ml-1'
{{on 'click' this.viewMore}}
data-test-storeknoxDiscover-results-viewMoreDisclaimerInfo
>
{{t 'viewMore'}}
</AkButton>
Expand All @@ -68,9 +89,15 @@
class='pr-1'
as |ab|
>
<AkStack @alignItems='center'>
<AkStack
@alignItems='center'
data-test-storeknoxDiscover-results-disclaimerModalHeaderContainer
>
<AkStack local-class='warning-icon' class='p-1'>
<AkIcon @iconName='warning' />
<AkIcon
@iconName='warning'
data-test-storeknoxDiscover-results-disclaimerModalWarningIcon
/>
</AkStack>

<AkTypography
Expand All @@ -87,19 +114,26 @@
class={{ab.classes.defaultIconBtn}}
{{on 'click' this.closeDisclaimerModal}}
@size='small'
data-test-storeknoxDiscover-results-disclaimerModalCloseBtn
>
<AkIcon @iconName='close' />
<AkIcon
@iconName='close'
data-test-storeknoxDiscover-results-disclaimerModalCloseBtnIcon
/>
</AkIconButton>
</AkAppbar>

<AkStack @direction='column' @alignItems='center' class='p-3'>
<AkTypography @variant='h5'>
<AkTypography
@variant='h5'
data-test-storeknoxDiscover-results-disclaimerModalHeaderText
>
{{t 'storeknox.disclaimerHeader'}}
</AkTypography>

<AkDivider @color='dark' class='my-2' />

<AkTypography>
<AkTypography data-test-storeknoxDiscover-results-disclaimerModalBodyText>
{{t 'storeknox.disclaimerBody' htmlSafe=true}}
</AkTypography>
</AkStack>
Expand Down
23 changes: 19 additions & 4 deletions app/components/storeknox/discover/results/table/action/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
</AkStack>
{{else}}
{{#if this.requested}}
<AkTooltip @placement='bottom' @arrow={{true}} @color='light'>
<AkTooltip
@placement='bottom'
@arrow={{true}}
@color='light'
data-test-storeknoxDiscover-resultsTable-addedOrRequestedTooltip
>
<:tooltipContent>
<div local-class='tooltip-content'>
<AkTypography @color='inherit'>
Expand All @@ -24,18 +29,28 @@
@iconName={{this.iconValue.iconName}}
@size='small'
local-class='{{this.iconValue.className}}'
data-test-storeknoxDiscover-resultsTable-addedOrRequestedIcon
/>
</:default>
</AkTooltip>
{{else}}
{{#if this.buttonLoading}}
<AkLoader @size={{16}} />
{{else}}
<AkIconButton {{on 'click' this.handleAddToInventory}}>
<AkIconButton
{{on 'click' this.handleAddToInventory}}
data-test-storeknoxDiscover-resultsTable-addOrSendAddAppReqButton
>
{{#if this.isAdmin}}
<AkIcon @iconName='add-box' />
<AkIcon
@iconName='add-box'
data-test-storeknoxDiscover-resultsTable-addIcon
/>
{{else}}
<AkIcon @iconName='send' />
<AkIcon
@iconName='send'
data-test-storeknoxDiscover-resultsTable-SendAddAppReqIcon
/>
{{/if}}
</AkIconButton>
{{/if}}
Expand Down
7 changes: 6 additions & 1 deletion app/components/storeknox/discover/results/table/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@justifyContent='space-between'
@alignItems='center'
local-class='result-header'
data-test-storeknoxDiscover-resultsTable-header
>
<AkStack @alignItems='center' local-class='close-search-text'>
<AkTypography @variant='h5' @fontWeight='regular'>
Expand Down Expand Up @@ -80,7 +81,11 @@
</tb.head>

<tb.body @rows={{pgc.currentPageResults}} as |b|>
<b.row as |r|>
<b.row
data-test-storeknoxDiscover-resultsTable-row
data-test-storeknoxDiscover-resultsTable-rowId='{{b.rowValue.docUlid}}'
as |r|
>
<r.cell>
{{#let (component r.columnValue.cellComponent) as |Component|}}
<Component
Expand Down
6 changes: 4 additions & 2 deletions app/components/storeknox/table-columns/store/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
</AkStack>
{{else}}
{{#if @data.isIos}}
<AkSvg::AppstoreLogo />
<AkSvg::AppstoreLogo data-test-storeknoxTableColumns-store-iosIcon />
{{/if}}

{{#if @data.isAndroid}}
<AkSvg::StoreknoxPlaystoreLogo />
<AkSvg::StoreknoxPlaystoreLogo
data-test-storeknoxTableColumns-store-playStoreIcon
/>
{{/if}}
{{/if}}
4 changes: 4 additions & 0 deletions app/models/sk-app-metadata.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import Model, { attr } from '@ember-data/model';
import Inflector from 'ember-inflector';

const inflector = Inflector.inflector;
inflector.irregular('sk-app-metadata', 'sk-app-metadata');

export interface Region {
id: number;
Expand Down
3 changes: 3 additions & 0 deletions app/models/sk-discovery-result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ export default class SkDiscoverySearchResultModel extends Model {
@attr('string')
declare description: string;

@attr('string')
declare devEmail: string;

@attr('string')
declare devName: string;

Expand Down
Loading

0 comments on commit 8e5c6f3

Please sign in to comment.