-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
complete integration of storeknox inventory listing page and availabl…
…e inventory details API
- Loading branch information
Elliot Yibaebi
committed
Jan 8, 2025
1 parent
d1ff39b
commit d9032a1
Showing
189 changed files
with
6,764 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import CommonDRFAdapter from './commondrf'; | ||
|
||
export default class SkAddToInventoryAdapter extends CommonDRFAdapter { | ||
_buildURL() { | ||
const baseurl = `${this.namespace_v2}/sk_app`; | ||
|
||
return this.buildURLFromBase(baseurl); | ||
} | ||
} | ||
|
||
declare module 'ember-data/types/registries/adapter' { | ||
export default interface AdapterRegistry { | ||
'sk-add-to-inventory': SkAddToInventoryAdapter; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import commondrf from './commondrf'; | ||
|
||
export type SkAppVersionQuery = { | ||
skAppId?: string | number; | ||
is_latest?: boolean; | ||
}; | ||
|
||
export default class SkAppVersionAdapter extends commondrf { | ||
_buildURL(_: string, id: string | number) { | ||
const baseurl = `${this.namespace_v2}/sk_app_version`; | ||
|
||
if (id) { | ||
return this.buildURLFromBase(`${baseurl}/${encodeURIComponent(id)}`); | ||
} | ||
|
||
return this.buildURLFromBase(baseurl); | ||
} | ||
|
||
_buildNestedURL(_: string | number, skAppId: string | number) { | ||
const baseURL = `${this.namespace_v2}/sk_app/${skAppId}/sk_app_version`; | ||
|
||
return this.buildURLFromBase(baseURL); | ||
} | ||
|
||
urlForQuery<K extends string | number>( | ||
query: SkAppVersionQuery, | ||
modelName: K | ||
) { | ||
if (query.skAppId) { | ||
const skAppId = query.skAppId; | ||
|
||
delete query.skAppId; | ||
|
||
return this._buildNestedURL(modelName, skAppId); | ||
} | ||
|
||
return super.urlForQuery(query, modelName); | ||
} | ||
} | ||
|
||
declare module 'ember-data/types/registries/adapter' { | ||
export default interface AdapterRegistry { | ||
'sk-app-version': SkAppVersionAdapter; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import CommonDRFAdapter from './commondrf'; | ||
|
||
export default class SkInventoryAppAdapter extends CommonDRFAdapter { | ||
_buildURL(_: string | number, id?: string | number) { | ||
const baseURL = `${this.namespace_v2}/sk_app_detail`; | ||
|
||
if (id) { | ||
return this.buildURLFromBase(`${baseURL}/${encodeURIComponent(id)}`); | ||
} | ||
|
||
return this.buildURLFromBase(baseURL); | ||
} | ||
} | ||
|
||
declare module 'ember-data/types/registries/adapter' { | ||
export default interface AdapterRegistry { | ||
'sk-inventory-app': SkInventoryAppAdapter; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import CommonDRFAdapter from './commondrf'; | ||
|
||
export default class UnknownAnalysisStatus extends CommonDRFAdapter { | ||
urlForQueryRecord() { | ||
const baseurl = `${this.namespace_v2}/sk_app/check_approval_status`; | ||
|
||
return this.buildURLFromBase(baseurl); | ||
} | ||
} | ||
|
||
declare module 'ember-data/types/registries/adapter' { | ||
export default interface AdapterRegistry { | ||
'sk-inventory-approval-status': UnknownAnalysisStatus; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import CommonDRFAdapter from './commondrf'; | ||
import type SkOrganizationModel from 'irene/models/sk-organization'; | ||
|
||
export default class SkOrganizationAdapter extends CommonDRFAdapter { | ||
_buildURL(_: string, id: string | number) { | ||
const baseurl = `${this.namespace_v2}/sk_organization`; | ||
|
||
if (id) { | ||
return this.buildURLFromBase(`${baseurl}/${encodeURIComponent(id)}`); | ||
} | ||
|
||
return this.buildURLFromBase(baseurl); | ||
} | ||
|
||
async toggleAddToInventoryByDefault( | ||
modelName: string, | ||
id: string | number, | ||
addToInventoryByDefault: boolean | ||
) { | ||
const url = this._buildURL(modelName, id); | ||
|
||
const data = { | ||
add_appknox_project_to_inventory_by_default: addToInventoryByDefault, | ||
}; | ||
|
||
const response = await this.ajax(url, 'PATCH', { data }); | ||
const normalized = this.store.normalize('sk-organization', response); | ||
|
||
return this.store.push(normalized) as SkOrganizationModel; | ||
} | ||
} | ||
|
||
declare module 'ember-data/types/registries/adapter' { | ||
export default interface AdapterRegistry { | ||
'sk-organization': SkOrganizationAdapter; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<svg | ||
width='33' | ||
height='32' | ||
viewBox='0 0 33 32' | ||
fill='none' | ||
xmlns='http://www.w3.org/2000/svg' | ||
> | ||
<circle cx='16.6699' cy='16' r='15.5' fill='#FFEDEC' stroke='#FF3A44' /> | ||
<path | ||
d='M15.5759 12.5762L13.0031 20.4287H10.5056L7.94357 12.5762H10.3283L11.3972 16.5562C11.4366 16.7065 11.4813 16.8999 11.5315 17.1362C11.5852 17.369 11.6335 17.6017 11.6765 17.8345C11.723 18.0672 11.7517 18.257 11.7624 18.4038C11.7767 18.257 11.8036 18.069 11.843 17.8398C11.8824 17.6107 11.9253 17.3815 11.9719 17.1523C12.022 16.9196 12.0686 16.728 12.1115 16.5776L13.2019 12.5762H15.5759ZM15.1786 18.3179V16.6421H18.2133V18.3179H15.1786ZM21.3824 12.5762C22.3779 12.5762 23.1227 12.7928 23.6168 13.2261C24.1145 13.6593 24.3634 14.2752 24.3634 15.0737C24.3634 15.4318 24.3115 15.7756 24.2076 16.105C24.1074 16.4344 23.9409 16.728 23.7081 16.9858C23.4789 17.2437 23.1728 17.4478 22.7897 17.5981C22.4101 17.7485 21.941 17.8237 21.3824 17.8237H20.7862V20.4287H18.6647V12.5762H21.3824ZM21.3341 14.2896H20.7862V16.0942H21.2052C21.3878 16.0942 21.5579 16.0638 21.7154 16.0029C21.873 15.9385 21.9983 15.8364 22.0914 15.6968C22.1881 15.5535 22.2364 15.3638 22.2364 15.1274C22.2364 14.8804 22.163 14.6799 22.0162 14.5259C21.8694 14.3683 21.642 14.2896 21.3341 14.2896Z' | ||
fill='#FF4D3F' | ||
/> | ||
</svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<svg | ||
width='61' | ||
height='34' | ||
viewBox='0 0 61 34' | ||
fill='none' | ||
xmlns='http://www.w3.org/2000/svg' | ||
> | ||
<circle | ||
cx='17' | ||
cy='17' | ||
r='16.4688' | ||
fill='#FFEDEC' | ||
stroke='#FF3A44' | ||
stroke-width='1.0625' | ||
/> | ||
<path | ||
d='M15.8383 12.7993L13.1048 21.1426H10.4511L7.72898 12.7993H10.2628L11.3984 17.028C11.4403 17.1878 11.4879 17.3932 11.5411 17.6443C11.5982 17.8916 11.6495 18.1389 11.6952 18.3862C11.7447 18.6335 11.7751 18.8351 11.7865 18.9911C11.8017 18.8351 11.8303 18.6354 11.8721 18.3919C11.914 18.1484 11.9596 17.9049 12.0091 17.6614C12.0623 17.4141 12.1118 17.2106 12.1575 17.0508L13.3159 12.7993H15.8383ZM15.4162 18.8998V17.1193H18.6406V18.8998H15.4162ZM22.0078 12.7993C23.0654 12.7993 23.8568 13.0294 24.3818 13.4898C24.9106 13.9501 25.175 14.6045 25.175 15.4529C25.175 15.8334 25.1199 16.1986 25.0095 16.5486C24.903 16.8986 24.7261 17.2106 24.4788 17.4845C24.2353 17.7585 23.91 17.9753 23.5029 18.1351C23.0997 18.2949 22.6013 18.3748 22.0078 18.3748H21.3743V21.1426H19.1201V12.7993H22.0078ZM21.9564 14.6197H21.3743V16.5372H21.8194C22.0135 16.5372 22.1942 16.5049 22.3616 16.4402C22.529 16.3717 22.6621 16.2633 22.7611 16.1149C22.8638 15.9627 22.9151 15.7611 22.9151 15.51C22.9151 15.2475 22.8372 15.0344 22.6812 14.8708C22.5252 14.7034 22.2836 14.6197 21.9564 14.6197Z' | ||
fill='#FF4D3F' | ||
/> | ||
<circle | ||
cx='44' | ||
cy='17' | ||
r='16.5' | ||
fill='#F5F5F5' | ||
stroke='#7B7B7B' | ||
stroke-dasharray='3.19 3.19' | ||
/> | ||
<path | ||
d='M44.5007 13.9583C44.1111 13.9583 43.7776 13.8196 43.5001 13.5422C43.2227 13.2648 43.084 12.9312 43.084 12.5417C43.084 12.1521 43.2227 11.8186 43.5001 11.5411C43.7776 11.2637 44.1111 11.125 44.5007 11.125C44.8902 11.125 45.2237 11.2637 45.5012 11.5411C45.7786 11.8186 45.9173 12.1521 45.9173 12.5417C45.9173 12.9312 45.7786 13.2648 45.5012 13.5422C45.2237 13.8196 44.8902 13.9583 44.5007 13.9583ZM44.5007 23.875C44.2055 23.875 43.9546 23.7717 43.748 23.5651C43.5414 23.3585 43.4382 23.1076 43.4382 22.8125V16.4375C43.4382 16.1424 43.5414 15.8915 43.748 15.6849C43.9546 15.4783 44.2055 15.375 44.5007 15.375C44.7958 15.375 45.0467 15.4783 45.2533 15.6849C45.4599 15.8915 45.5632 16.1424 45.5632 16.4375V22.8125C45.5632 23.1076 45.4599 23.3585 45.2533 23.5651C45.0467 23.7717 44.7958 23.875 44.5007 23.875Z' | ||
fill='#7B7B7B' | ||
/> | ||
</svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
viewBox='0 0 34 34' | ||
fill='none' | ||
xmlns='http://www.w3.org/2000/svg' | ||
...attributes | ||
> | ||
<circle | ||
cx='17' | ||
|
Oops, something went wrong.