Saleor - Trying to modify the dashboard (add 'Job Title' to 'Customer' / 'Account')

北城余情 提交于 2021-01-29 11:10:33

问题


I'm new here :) I'm trying to build an eCommerce site using Saleor as the framework, I'm having trouble understanding the framework with the intention to modify the admin dashboard and database.

To start simple and practice, I'm trying to add a 'Job Title' field to customers, and want this to be editable on the dashboard.

Currently, I've performed a django migration and the new field is liked up to the database - I modified /saleor/saleor/account/modles.py

class User(PermissionsMixin, AbstractBaseUser):
    ...
    job_title = models.CharField(max_length=256, blank=True)

PostgreSQL also works fine

SELECT * FROM account_user;

SQL Output

Where I'm completely stuck is actually getting this field to work with the dashboard/ appear.

I've gone through editing the files where 'First Name' field appears, as the django /templates/ file seems to reference a 'form' I can only assume is run by ReactJS (which I'm not as familiar with as Python).

The files I've modified (and effectively copied what existed for 'First Name') are:

added jobTitle: formData.jobTitle, to line 111 on static/dashboard-next/customers/views/CustomerDetails.tsx
added block from line 128 on static/customers/components/CustomerDetails/CustomerDetails.tsx
added block from line 24 and 61 on static/customers/components/CustomerDetailsPage/CustomerDetailsPage.tsx

I'd really appreciate if someone can help point me in the right direction of how saleor / django / reactjs goes from website -> actual html :)

Thanks!

来源:https://stackoverflow.com/questions/57237286/saleor-trying-to-modify-the-dashboard-add-job-title-to-customer-accoun

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!