![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@veeqo/custom-views
Advanced tools
Implement Views from veeqo-components library
Using npm:
npm install @veeqo/components
npm install @veeqo/custom-views
Using yarn:
yarn add @veeqo/components
yarn add @veeqo/custom-views
fixedViews
arrayIt's fixed views so the user can't delete them
Example of fixed views:
const fixedViews = [
{
id: 'default1',
key: 'default1',
label: 'First default',
type: 'fixed',
},
{
id: 'default1',
key: 'default2',
label: 'Second default',
type: 'fixed',
},
];
Also, you can provide some additional info:
duplicatable
. This prop control is Duplicate item visible in options. By default it's true
filters
. This prop can be any type you want, this is what you will get at some points when you need to change the saved filtersExample of fixed view with those props:
{
id: 'default',
key: 'default',
label: 'Not duplicatable default',
type: 'fixed',
duplicatable: false,
filters: {
metric: 'units_sold',
groupBy: 'by_variants',
},
},
apiHandlers
objectExample of apiHandlers
:
const apiHandlers = {
fetch: (customViewModelType) => new Promise((resolve) => (
fetchViews(customViewModelType)
.then((result) => resolve({ data: result })))),
post: (view) => new Promise((resolve) => (
saveView(view, store.dispatch)
.then(((result) => {
resolve({
data: {
id: result.body.data.id,
},
});
}))
)),
patch: (view) => {
saveView(view);
setFiltersToView(view.key, view.attributes.filters);
},
delete: (viewId) => deleteView(viewId),
};
This object should have 4 functions:
fetch
. Used when the store started initialization. Should be a Promise
. Arguments:customViewModelType
, string. Name of your page, for example: inventory
or sales
persist
. Used when view saved and its type was draft
so you need to send this new view to server. Should be a Promise
and resolve with id
that you will get from the server. Arguments:view
, object. View with all attributes. Example:{
type: 'custom_view',
key: 'l6PJGo-UKXeGJNFBFzCde',
user: {
userId: 'XOBDXR15v0mkOoNaYp24K',
},
attributes: {
title: 'Some Draft Tab',
type: 'sales',
filters: {
metric: 'units_sold',
groupBy: 'by_variants',
},
editable: true,
shared: true,
},
}
patch
. Same as persist, but view already has saved
type so you don't need to return Promise and resolve id
, but you still should send changed view to server. Arguments are the same as in persist
delete
. Used when saved
view deleted. Arguments:This factory will create a store and pass the first data to it. Here you should use variables that you create in step 3 and step 4
Example:
const CustomViewsContextProvider = CustomViewsProviderFactory({
customViewModelType: getLocation(),
apiHandlers,
fixedViews,
});
Example:
ReactDOM.render(
<Provider store={store}>
<CustomViewsContextProvider>
<App />
</CustomViewsContextProvider>
</Provider>,
root,
);
Example:
import React from 'react';
import { CustomViews } from '@veeqo/custom-views';
const CustomViewsComponent = (props) => (
<CustomViews {...props} />
);
export default CustomViewsComponent;
Those props you should get from user XHR, until you don't, pass null
. You can't change those values inside store after initialization
Name | Type | Description |
---|---|---|
customViewPositions | string[] | null | Initialization doesn't start until you don't pass an array |
defaultViewId | string | null | Initialization doesn't start until you don't pass a string |
Name | Type | Description | Example |
---|---|---|---|
filters | any | This prop can be any type you want, this is what you will get at some points when you need to change the saved filters | |
includedFilters | { label: string, text: string }[] | Used to show filter values in edit/save dropdown | [{ label: 'filter name', text: 'filter values' }] |
hasUnsavedChanges | boolean | Used to understand should we should show unsaved changes pill. You need just to check the equality of your current filters and filters inside the current view |
Name | Type | Description | Example |
---|---|---|---|
user | any | Adds user info to view attributes | |
isLoading | boolean | ||
pageName | string | Adds page name to success notifications | 'sales' |
currentView | string | You should pass view key. Used to the manual set current view | |
isSortingDropdownEnabled | boolean |
You should use those handlers to keep your store actual
Name | Type | Description |
---|---|---|
handleChangeActiveView | (key: string) => void | |
handleDiscardUnsavedChanges | () => void | |
handleCreateDraftView | (key: string) => void | Used when draft view created from plus button in controls |
handleCreateDraftViewWithCurrentFilters | (key: string) => void | Used when draft view created from unsaved changes pill |
handleDuplicateView | (key: string, newViewKey: string) => void | |
handleCustomViewPositionsChange | (viewPositions: string[]) => void | |
handleDefaultViewChange | (id: string) => void | |
handleSaveView | (key: string, filters: any) => void | Used when draft view saved |
handleSaveToCurrentView | (key: string, filters: any) => void |
FAQs
veeqo custom views
The npm package @veeqo/custom-views receives a total of 3 weekly downloads. As such, @veeqo/custom-views popularity was classified as not popular.
We found that @veeqo/custom-views demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.