426 comments found.
Hi, I need to add this to the start npm command to run HTTPS:
“start”: “export HTTPS=true&&SSL_CRT_FILE=cert.pem&&SSL_KEY_FILE=key.pem react-scripts start”,
But it seems not to be working, also in dandelion there is no “react-scripts start”, so how can I add this?
Hi,
For ssl please try in “start” script"start": "cross-env NODE_ENV=development HTTPS=true&&SSL_CRT_FILE=cert.pem&&SSL_KEY_FILE=key.pem node server",
This template uses express js for server, if the method above doesn’t works, please try by add the ssl config with express server or webpacke
Express:
- File: server/index.js or middlewares/addDevMiddlewares.js
- Ref: https://adamtheautomator.com/https-nodejs/
Webpack
- File: internals/webpack/webpack.dev.babel.js
- Ref https://gist.github.com/Grawl/bd0096b49276934c807b4a74088b081c
Regards.
Hi, I bought this Template of Admin dashboard for my Next.js Project which is also using your template of Lexiron. I copied the whole App, internals, Assets folders into my project. Then I copied the content of App.js file into the index.js of the Admin folder in my pages directory of the Next.js. For the last 20 hours, I am working on localhost/admin but it is having some issue of global css. I renamed each code of import line which contained dan-.... After changing all the files, I still get this error: ./node_modules/react-calendar/dist/Calendar.css Global CSS cannot be imported from within node_modules. Read more: https://nextjs.org/docs/messages/css-npm Location: node_modules\react-calendar\dist\entry.js
I don’t know what to do? I have used many methods and a lot of time but with not success yet…
Hi eisaghani,
For the error, that mean you have to import react-calendar without mention node_modules/ folder. So make your import like this:
import 'react-calendar/dist/Calendar.css';
Same like in this documentation https://www.npmjs.com/package/react-calendar
Regards.
But it mentions the folder to be node_modules? Do i need to edit that?
This does not work
Please try to remove all about the react-calendar and unsupported packages. Sometimes not all plugins works with next.js together.
I tried this method too but then it showed same thing with react-clock and so on..
When I created Luxiren, I copied one by one the components and the plugins, not all at once. It should make debuging and error tracing easier. Or you can keep the Dandelion default structure without next.js, because the admin dashboard is more suitable with SPA structure rather than SSR.
how to convert this project to PWA
Here’s the reference for PWA https://blog.logrocket.com/building-pwa-react/
And here’s for Service Worker config in Dandelion https://ilhammeidi.github.io/dandelion-docs/#offline
How can I persist redux store between pages? Persist module is apparently not working.
Hi, you can put the reducer modules in app/redux/configureStore.js in whitelist like this whitelist: ['module1', 'module2'] And only the registered reducers like in app/redux/reducers.js can be whitelisted.
How can I run the “npm start” command to run the localhost with HTTPS?
To run a React.js application with HTTPS in local development, you have a couple of options. One common approach is to use a tool like “mkcert” to generate local SSL certificates, and then configure your development server to use these certificates for HTTPS. Another option is to use a tool like “ngrok” to create a secure tunnel to your local development server.
Here’s the reference to run with https in local:
- https://flaviocopes.com/react-how-to-configure-https-localhost/
- https://create-react-app.dev/docs/using-https-in-development/
- https://www.mariokandut.com/how-to-setup-https-ssl-in-localhost-react/
we are using creative layout for home page. on logout from landing page, the menus on home page on left side is not getting visible, but on mouse over, it is visible and banner gets moved to left side
!open ? classes.drawerPaperClose : ''
<Drawer
variant="permanent"
classes={{
paper: cx(classes.drawer, classes.drawerPaper),
}}
Hi ilhammeidi, I have an issue on Redux Form Editable Cell, when I submit a new data then click edit action on the new data row, the form doesn’t load the selected row data. Do you have any solution for this issue?
Hi,
Coba di debug di reducernya file: curdTbFrmReducer.js
case `${branch}/${EDIT_ROW_FORM}`: {
const index = draft.dataTable.findIndex(item => item.id === action.item.id);
if (index !== -1) {
editingIndex = state.dataTable.indexOf(action.item);
draft.formValues = action.item;
draft.editingId = action.item.id;
draft.showFrm = true;
}
break;
}
Bisa dilihat masalahnya dengan console.log(action.item) nanti kelihatan apakah ada error atau struktur data yang salah.
Salam.
Saya sudah melakukan sesuai yang disarankan, tetapi setelah ditelusuri reducernya jalan 2 kali dan saat di console.log(action.item.id) menghasilkan dua id yang berbeda pada saat jalan yang pertama dan kedua. apakah ada saran?
Coba di cek pas klik edit button paramater itemnya seperti apa, harusnya sama dengan yg dikirim ke reducer. Kalau action.itemnya tidak kosong harusnya form statenya di reducer ke isi.
Atau bisa di test di hardcode state si formnya di rerucer untuk ngetes apa masalahnya berasal dari datanya atau initial redux-formnya.
baik mas, sebelumnya saya sudah mencoba saran dari mas, dan setelah saya telusuri kembali dari template dandelion pro itu sendiri juga mengalami bug yang sama seperti yang saya alami yaitu setelah saya berhasil menambah item lalu klik edit, data dalam formnya kosong/data tersebut tidak ter-load. Mungkin boleh di cek kembali mas, terima kasih.
Ok nanti saya cek, thank you.
case `${branch}/${EDIT_ROW_FORM}`: {
editingIndex = draft.dataTable.findIndex((obj) => obj.id === action.item.id);
draft.formValues = action.item;
draft.editingId = action.item.id;
draft.showFrm = true;
break;
}
sama di initialState ganti formValues nya jadi null
const initialState = {
dataTable: [],
dataInit: [
{
id: '0',
text: '',
email: '',
radio: '',
selection: '',
onof: false,
checkbox: false,
textarea: '',
edited: true,
}
],
formValues: null, // yg ini
editingId: '',
showFrm: false,
notifMsg: '',
};
Hi, my eslint is showing wrong line numbers, maybe it is related to babel parser, do you know any solution for this?
Hi, Sometimes the error line number not too far from it should be. The issues with line numbers can be resolved by restart the server.
we customized crudtable form table and reducers to our table, we were not able to show /close/ reset the dialog on edit. draft.showform= true in not working in our reducers.
For editing, how to load the row data into form
<CrudTableForm openForm={false} />
For editing in reducers: crudTbFrmReducer.js load data
case `${branch}/${EDIT_ROW_FORM}`: {
const index = draft.dataTable.findIndex(item => item.id === action.item.id);
if (index !== -1) {
editingIndex = state.dataTable.indexOf(action.item);
draft.formValues = action.item;
draft.editingId = action.item.id;
draft.showFrm = true;
}
break;
}
components: EditableCellFrmDemo.js
<CrudTableForm editRow={(payload) => editRow(editAction(payload, branch))} />
After login , the redux store data is lost. what to do to retain the state data
In configureStore.js add ‘login’ reducer in whitelist
const persistConfig = { key: ‘dandelion’, storage, whitelist: [‘ui’, ‘login’] };
I want to install latest dandelion version with latest react version and mui version and which should be supporting node 18. Can you please guide me how to install and upgrade this package in my currently developed application ??
—
- Codemod for tss styling https://mui.com/material-ui/migration/migrating-from-jss/#2-use-tss-react—
- Basic cofiguration for react 18 and MUI-theme (same for both dandelion-pro and starter) https://github.com/ilhammeidi/dandelion-starter/commit/898a032b576c2dbe537c0c45e2e24eadc9cae911#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519—
- webpack config for Node 18 https://github.com/ilhammeidi/dandelion-starter/commit/70f98250a672fcda53a4e35ff2831b432a372d74Sorry wrong link from prev message
- Here’s the codemod for MUI 5 https://mui.com/material-ui/migration/migration-v4/#run-codemods—
- Codemod for tss styling https://mui.com/material-ui/migration/migrating-from-jss/#2-use-tss-react—
- Basic cofiguration for react 18 and MUI-theme (same for both dandelion-pro and starter) https://github.com/ilhammeidi/dandelion-starter/commit/898a032b576c2dbe537c0c45e2e24eadc9cae911#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519—
- webpack config for Node 18 https://github.com/ilhammeidi/dandelion-starter/commit/70f98250a672fcda53a4e35ff2831b432a372d74My website hosted on Bluehost is not longer working after (I believe) the recent Dandelion update. I’m not computer savvy myself, but Bluehost says this:
“Its the scripts associated with the theme dandelion causing issues.
The error log is: thrown in /home1/abefagen/public_html/abefagenson/wp-content/themes/dandelion/functions/options/options.php on line 26
That particuilar options.php script is causing issues with the site related to the theme”
I purchased your theme about 10 years ago. I’d be happy to purchase again or pay for an upgrade if that is necessary to receive support. Are you able to help me? Please let me know how to proceed.
Hi, it’s maybe a mistake. This is Dandelion Pro react templaten and released in 2018. I think thats another dandelion template.
in crudDatatable form, how to connect exernal API and reducer on submit
To connect an external API and reducer on submit, you can follow these general steps:
Create an action that will trigger the API call when the submit button is clicked. This action will typically dispatch a request action to indicate that the API call is starting, then make the API call using a library such as axios, and dispatch a success or failure action based on the response from the API.
Create a reducer to handle the state changes resulting from the API call. This reducer will typically update the state to reflect the current status of the API call, such as whether it is loading, has succeeded, or has failed.
Connect the submit button to dispatch the action when it is clicked. This can typically be done using a mapDispatchToProps function in your component.
// actions.js
import axios from 'axios';
export const submitForm = (formData) => {
return (dispatch) => {
dispatch({ type: 'SUBMIT_FORM_REQUEST' });
axios.post('https://example.com/api/form', formData)
.then(response => {
dispatch({ type: 'SUBMIT_FORM_SUCCESS', payload: response.data });
})
.catch(error => {
dispatch({ type: 'SUBMIT_FORM_FAILURE', error });
});
}
}
// reducer.js
const initialState = {
isLoading: false,
hasError: false,
data: null
};
const formReducer = (state = initialState, action) => {
switch (action.type) {
case 'SUBMIT_FORM_REQUEST':
return { ...state, isLoading: true, hasError: false };
case 'SUBMIT_FORM_SUCCESS':
return { ...state, isLoading: false, data: action.payload };
case 'SUBMIT_FORM_FAILURE':
return { ...state, isLoading: false, hasError: true };
default:
return state;
}
}
// MyFormComponent.js
import { connect } from 'react-redux';
import { submitForm } from './actions';
const MyFormComponent = ({ submitForm }) => {
const handleSubmit = (event) => {
event.preventDefault();
const formData = new FormData(event.target);
submitForm(formData);
}
return (
<form onSubmit={handleSubmit}>
{/* form fields */}
<button type="submit">Submit</button>
</form>
);
}
const mapDispatchToProps = {
submitForm
};
export default connect(null, mapDispatchToProps)(MyFormComponent);
In this example, the submitForm action triggers an API call to submit the form data. The formReducer handles the state changes resulting from the API call, such as setting the isLoading flag to true while the API call is in progress. Finally, the MyFormComponent connects the submit button to dispatch the submitForm action when it is clicked, using the mapDispatchToProps function to bind the action creator to the component’s props.
we tried to connect API using Saga , without branch reducer we are able to use crudtable
but while tried to use Branch reducer as follows
crudTbFrmDemo: branchReducer(crudTableForm, ‘crudTbFrmDemo’),
*we get following error *
Error: takeEvery$1 requires a pattern or channel at check (io-40341e1a.js:33:1) at validateTakeEffect (redux-saga-effects.esm.js:382:8) at takeEvery$1 (redux-saga-effects.esm.js:388:1) at sagaFortopic (sagaFortopic.js:47:20) at sagaFortopic.next (<anonymous>) at next (redux-saga-core.esm.js:1180:29) at proc (redux-saga-core.esm.js:1131:3) at eval (redux-saga-core.esm.js:608:17) at immediately (redux-saga-core.esm.js:79:12) at runForkEffect (redux-saga-core.esm.js:607:3)
Branch reducer use for create multiple reducer with same components, so the actions will like product1/fetch_data and product2/fetch_data. So please make sure to call the correct actions.
please share a sample saga code to connect with your crudTbFrmDemo reducer for calling API
I only know a little bit about saga. More less like this:
import { call, put, takeEvery } from 'redux-saga/effects';
import { fetchAllDataSuccess, fetchAllDataError } from '../actions/crudTbFrmActions';
import { FETCH_DATA } from '../constants/crudTbFrmConstants';
import { api } from 'yourApiPath';
function* fetchAllDataTable1() {
try {
const response = yield call(api.fetchAllData);
yield put(fetchAllDataSuccess(response.data, 'branchTable1'));
} catch (error) {
yield put(fetchAllDataError(error.message, 'branchTable1'));
}
}
function* fetchAllDataTable2() {
try {
const response = yield call(api.fetchAllData);
yield put(fetchAllDataSuccess(response.data, 'branchTable2'));
} catch (error) {
yield put(fetchAllDataError(error.message, 'branchTable2'));
}
}
function* allDataSaga() {
yield takeEvery(FETCH_DATA, fetchAllDataTable1);
yield takeEvery(FETCH_DATA, fetchAllDataTable2);
}
export default allDataSaga;
how to set pagination in CrudTableForm
Hi,
For mui5 you can check this https://mui.com/material-ui/react-table/#custom-pagination-options
For mui4 https://v4.mui.com/components/tables/#custom-pagination-options
Hi, what is the latest webpack version supported?
I am having this error: \node_modules\happypack\lib\WebpackUtils.js:126 var isWebpack2 = resolve.length === 4; ^ TypeError: Cannot read properties of undefined (reading ‘length’)
Hi,
Yes it uses webpack v5. I’ve update it yesterday by replaced happypack with babel loader. Here’s the file diff https://github.com/ilhammeidi/dandelion-starter/commit/70f98250a672fcda53a4e35ff2831b432a372d74
Regards
When this project will support new npm/https without using the ” add NODE_OPTIONS=—openssl-legacy-provider” fix
I will update on end of this month
Hello we are trying to run a basic one page dandelion-pro where we can remove every component that we dont need in order to have a clean custom website. Do you have a minimal template where we can do this? (Less code better)
Hi,
You can use starter-project in starter-project/ folder.
Regards.
I have both V2.4 and V2.5 installed in my system. While v2.5 is running in node v18, v2.4 is not running in node v18. Any solution?
Please check in the package.json then changed start and build scripts in package.json
And add NODE_OPTIONS=--openssl-legacy-provider
"start": "cross-env NODE_ENV=development NODE_OPTIONS=--openssl-legacy-provider node server",
And add to build script as well.
Here’s the docs for troubleshooting related node 18 issue and installation for older version of packages https://ilhammeidi.github.io/dandelion-docs/#shoot
Regards.
I have cloned the starter project from your github (https://github.com/ilhammeidi/dandelion-starter), installed all the packages and tried to run it with npm start. But it’s showing error.
✖ 9110 problems (9110 errors, 0 warnings) 9110 errors and 0 warnings potentially fixable with the `—fix` option.
this is what I get after “npm start” . I have node V18 installed in my system and npm version is 9.4.1
Please try to disable the eslint, you can in the docs
We want to renew the support. May I know what is included and what is not included in the support. Can I get technical help from you. As I told you in my previous questions that I am facing issue with the build folder. O want to run it in my server. If I renew the support will you help me to deploy?
Hi,
Here’s the template support detail https://themeforest.net/page/item_support_policy
As support terms above, for hosting and server are excluded from the service
Hosting, server environment, or software Authors are not required to support issues about your web hosting or server environment, or issues with the software you’ve got installed on your machine to use the item. Please check your ISP/web hosting provider or other software documentation that you’re trying to use to help solve your issues.
But I open for discuss and consult about your deployment without extending the support. I also replied you question before.
Regards.