Skip to content

Commit

Permalink
[refactor] Remove isLoaded, story with ali
Browse files Browse the repository at this point in the history
  • Loading branch information
amivanoff committed Dec 20, 2021
1 parent 9959eb5 commit 0e21dff
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 26 deletions.
4 changes: 2 additions & 2 deletions src/BaseTable/hooks/useBaseTableData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export const useTableData = ({ viewKindElement: baseViewKindElement, viewDescr,
);

const handleEndReached = useCallback(() => {
if (!coll.isLoading && !coll.isLoaded) {
coll.loadMoreData();
if (!coll.isLoading) {
coll.loadMore();
}
}, [coll]);

Expand Down
5 changes: 3 additions & 2 deletions src/table/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ export * from './basetable/TableSettingMenu';
export * from './BaseTableControl';
export * from './TableCell';

export const tableRenderers: RendererRegistryEntry[] = [
// deprecated for removal
/*export const tableRenderers: RendererRegistryEntry[] = [
{
tester: tableArrayControlTester,
renderer: BaseTableArrayControlWithStore,
},
];
];*/
64 changes: 42 additions & 22 deletions stories/TableRemoteMktp.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,28 @@ const viewKinds = [
'@type': 'aldkg:CollConst',
entConstrs: [
{
'@id': 'mktp:ProductCard_Coll_Shape0',
'@id': 'mktp:ProductCard_Coll_Ent',
'@type': 'aldkg:EntConstr',
schema: 'hs:ProductCardShape',
schema: 'als:ProductCardShape',
conditions: {
'@id': 'mktp:ProductCards_in_Category_Coll_Ent_Cond',
amountValueMoving30: {
relation: 'between-incl-both',
value: [20000, 60000],
},
},
variables: {
'@id': 'mktp:ProductCards_in_Category_Coll_Ent_Var',
imageUrl: null,
name: null,
amountValueMoving30: null,
commentsCount: null,
},
service: mktpSchemaRepoIri,
},
],
//orderBy: [{ expression: variable('identifier0'), descending: false }],
limit: 10,
limit: 100,
},
],
elements: [
Expand All @@ -103,10 +117,11 @@ const viewKinds = [
order: [
'imageUrl',
'name',
'amountValueMoving30',
'commentsCount',
'price',
'saleValue',
/*'saleValue',
'categoryPopularity',
'commentsCount',
'starsValue',
'questionsCount',
'lastMonthSalesAmount',
Expand All @@ -130,41 +145,51 @@ const viewKinds = [
'firstParsedAt',
'lastMonthParsedAt',
'parsedAt',
'prevParsedAt',
'prevParsedAt',*/
],
imageUrl: {
width: 60,
width: 100,
formatter: 'image',
editable: false,
},
identifier: {
formatter: 'link',
//dataToFormatter: { link: 'identifier' },
sortable: true,
editable: false,
},
name: {
width: 340,
formatter: 'link',
dataToFormatter: { link: '@id' },
sortable: true,
editable: false,
},
country: {
price: {
width: 60,
sortable: true,
editable: false,
},
brand: {
amountValueMoving30: {
width: 100,
sortable: true,
editable: false,
},
commentsCount: {
width: 100,
sortable: true,
editable: false,
},
/*identifier: {
formatter: 'link',
//dataToFormatter: { link: 'identifier' },
sortable: true,
editable: false,
},
price: {
country: {
width: 60,
sortable: true,
editable: false,
},
brand: {
formatter: 'link',
sortable: true,
editable: false,
},
saleValue: {
width: 60,
sortable: true,
Expand All @@ -179,11 +204,6 @@ const viewKinds = [
width: 100,
editable: false,
},
commentsCount: {
width: 100,
sortable: true,
editable: false,
},
starsValue: {
width: 100,
sortable: true,
Expand Down Expand Up @@ -271,7 +291,7 @@ const viewKinds = [
},
prevParsedAt: {
editable: false,
},
},*/
},
},
],
Expand Down

0 comments on commit 0e21dff

Please sign in to comment.