added industry and company name
This commit is contained in:
Flatlogic Bot 2025-05-23 18:57:58 +00:00
parent 5c73342da6
commit c760eee632
22 changed files with 284 additions and 124 deletions

5
.gitignore vendored
View File

@ -1,3 +1,8 @@
node_modules/ node_modules/
*/node_modules/ */node_modules/
*/build/ */build/
**/node_modules/
**/build/
.DS_Store
.env

File diff suppressed because one or more lines are too long

View File

@ -20,6 +20,8 @@ module.exports = class ContactsDBApi {
email: data.email || null, email: data.email || null,
phone_number: data.phone_number || null, phone_number: data.phone_number || null,
notes: data.notes || null, notes: data.notes || null,
company: data.company || null,
industry: data.industry || null,
importHash: data.importHash || null, importHash: data.importHash || null,
createdById: currentUser.id, createdById: currentUser.id,
updatedById: currentUser.id, updatedById: currentUser.id,
@ -47,6 +49,8 @@ module.exports = class ContactsDBApi {
email: item.email || null, email: item.email || null,
phone_number: item.phone_number || null, phone_number: item.phone_number || null,
notes: item.notes || null, notes: item.notes || null,
company: item.company || null,
industry: item.industry || null,
importHash: item.importHash || null, importHash: item.importHash || null,
createdById: currentUser.id, createdById: currentUser.id,
updatedById: currentUser.id, updatedById: currentUser.id,
@ -83,6 +87,10 @@ module.exports = class ContactsDBApi {
if (data.notes !== undefined) updatePayload.notes = data.notes; if (data.notes !== undefined) updatePayload.notes = data.notes;
if (data.company !== undefined) updatePayload.company = data.company;
if (data.industry !== undefined) updatePayload.industry = data.industry;
updatePayload.updatedById = currentUser.id; updatePayload.updatedById = currentUser.id;
await contacts.update(updatePayload, { transaction }); await contacts.update(updatePayload, { transaction });
@ -263,6 +271,20 @@ module.exports = class ContactsDBApi {
}; };
} }
if (filter.company) {
where = {
...where,
[Op.and]: Utils.ilike('contacts', 'company', filter.company),
};
}
if (filter.industry) {
where = {
...where,
[Op.and]: Utils.ilike('contacts', 'industry', filter.industry),
};
}
if (filter.active !== undefined) { if (filter.active !== undefined) {
where = { where = {
...where, ...where,

View File

@ -0,0 +1,47 @@
module.exports = {
/**
* @param {QueryInterface} queryInterface
* @param {Sequelize} Sequelize
* @returns {Promise<void>}
*/
async up(queryInterface, Sequelize) {
/**
* @type {Transaction}
*/
const transaction = await queryInterface.sequelize.transaction();
try {
await queryInterface.addColumn(
'contacts',
'company',
{
type: Sequelize.DataTypes.TEXT,
},
{ transaction },
);
await transaction.commit();
} catch (err) {
await transaction.rollback();
throw err;
}
},
/**
* @param {QueryInterface} queryInterface
* @param {Sequelize} Sequelize
* @returns {Promise<void>}
*/
async down(queryInterface, Sequelize) {
/**
* @type {Transaction}
*/
const transaction = await queryInterface.sequelize.transaction();
try {
await queryInterface.removeColumn('contacts', 'company', { transaction });
await transaction.commit();
} catch (err) {
await transaction.rollback();
throw err;
}
},
};

View File

@ -0,0 +1,49 @@
module.exports = {
/**
* @param {QueryInterface} queryInterface
* @param {Sequelize} Sequelize
* @returns {Promise<void>}
*/
async up(queryInterface, Sequelize) {
/**
* @type {Transaction}
*/
const transaction = await queryInterface.sequelize.transaction();
try {
await queryInterface.addColumn(
'contacts',
'industry',
{
type: Sequelize.DataTypes.TEXT,
},
{ transaction },
);
await transaction.commit();
} catch (err) {
await transaction.rollback();
throw err;
}
},
/**
* @param {QueryInterface} queryInterface
* @param {Sequelize} Sequelize
* @returns {Promise<void>}
*/
async down(queryInterface, Sequelize) {
/**
* @type {Transaction}
*/
const transaction = await queryInterface.sequelize.transaction();
try {
await queryInterface.removeColumn('contacts', 'industry', {
transaction,
});
await transaction.commit();
} catch (err) {
await transaction.rollback();
throw err;
}
},
};

View File

@ -34,6 +34,14 @@ module.exports = function (sequelize, DataTypes) {
type: DataTypes.TEXT, type: DataTypes.TEXT,
}, },
company: {
type: DataTypes.TEXT,
},
industry: {
type: DataTypes.TEXT,
},
importHash: { importHash: {
type: DataTypes.STRING(255), type: DataTypes.STRING(255),
allowNull: true, allowNull: true,

View File

@ -33,14 +33,6 @@ const CallsData = [
// type code here for "relation_one" field // type code here for "relation_one" field
}, },
{
scheduled_time: new Date('2023-11-04T11:00:00Z'),
// type code here for "relation_one" field
// type code here for "relation_one" field
},
]; ];
const ContactsData = [ const ContactsData = [
@ -56,6 +48,10 @@ const ContactsData = [
// type code here for "relation_one" field // type code here for "relation_one" field
notes: 'Met at the tech conference.', notes: 'Met at the tech conference.',
company: 'Lynn Margulis',
industry: 'Karl Landsteiner',
}, },
{ {
@ -70,6 +66,10 @@ const ContactsData = [
// type code here for "relation_one" field // type code here for "relation_one" field
notes: 'Referred by a mutual friend.', notes: 'Referred by a mutual friend.',
company: 'Paul Ehrlich',
industry: 'William Bayliss',
}, },
{ {
@ -84,20 +84,10 @@ const ContactsData = [
// type code here for "relation_one" field // type code here for "relation_one" field
notes: 'Interested in software development roles.', notes: 'Interested in software development roles.',
},
{ company: 'Louis Victor de Broglie',
first_name: 'Bob',
last_name: 'Brown', industry: 'Alfred Wegener',
email: 'bob.brown@example.com',
phone_number: '5566778899',
// type code here for "relation_one" field
notes: 'Looking for opportunities in marketing.',
}, },
]; ];
@ -131,16 +121,6 @@ const FollowUpsData = [
status: 'Pending', status: 'Pending',
}, },
{
follow_up_date: new Date('2023-11-09T11:00:00Z'),
// type code here for "relation_one" field
// type code here for "relation_one" field
status: 'In Progress',
},
]; ];
const OutreachMessagesData = [ const OutreachMessagesData = [
@ -173,16 +153,6 @@ const OutreachMessagesData = [
// type code here for "relation_one" field // type code here for "relation_one" field
}, },
{
subject: 'Job Opportunity Discussion',
body: 'I came across a job opportunity that might interest you.',
// type code here for "relation_one" field
// type code here for "relation_one" field
},
]; ];
async function associateCallWithContact() { async function associateCallWithContact() {
@ -218,17 +188,6 @@ async function associateCallWithContact() {
if (Call2?.setContact) { if (Call2?.setContact) {
await Call2.setContact(relatedContact2); await Call2.setContact(relatedContact2);
} }
const relatedContact3 = await Contacts.findOne({
offset: Math.floor(Math.random() * (await Contacts.count())),
});
const Call3 = await Calls.findOne({
order: [['id', 'ASC']],
offset: 3,
});
if (Call3?.setContact) {
await Call3.setContact(relatedContact3);
}
} }
async function associateCallWithJob_seeker() { async function associateCallWithJob_seeker() {
@ -264,17 +223,6 @@ async function associateCallWithJob_seeker() {
if (Call2?.setJob_seeker) { if (Call2?.setJob_seeker) {
await Call2.setJob_seeker(relatedJob_seeker2); await Call2.setJob_seeker(relatedJob_seeker2);
} }
const relatedJob_seeker3 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const Call3 = await Calls.findOne({
order: [['id', 'ASC']],
offset: 3,
});
if (Call3?.setJob_seeker) {
await Call3.setJob_seeker(relatedJob_seeker3);
}
} }
// Similar logic for "relation_many" // Similar logic for "relation_many"
@ -312,17 +260,6 @@ async function associateContactWithJob_seeker() {
if (Contact2?.setJob_seeker) { if (Contact2?.setJob_seeker) {
await Contact2.setJob_seeker(relatedJob_seeker2); await Contact2.setJob_seeker(relatedJob_seeker2);
} }
const relatedJob_seeker3 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const Contact3 = await Contacts.findOne({
order: [['id', 'ASC']],
offset: 3,
});
if (Contact3?.setJob_seeker) {
await Contact3.setJob_seeker(relatedJob_seeker3);
}
} }
async function associateFollowUpWithContact() { async function associateFollowUpWithContact() {
@ -358,17 +295,6 @@ async function associateFollowUpWithContact() {
if (FollowUp2?.setContact) { if (FollowUp2?.setContact) {
await FollowUp2.setContact(relatedContact2); await FollowUp2.setContact(relatedContact2);
} }
const relatedContact3 = await Contacts.findOne({
offset: Math.floor(Math.random() * (await Contacts.count())),
});
const FollowUp3 = await FollowUps.findOne({
order: [['id', 'ASC']],
offset: 3,
});
if (FollowUp3?.setContact) {
await FollowUp3.setContact(relatedContact3);
}
} }
async function associateFollowUpWithJob_seeker() { async function associateFollowUpWithJob_seeker() {
@ -404,17 +330,6 @@ async function associateFollowUpWithJob_seeker() {
if (FollowUp2?.setJob_seeker) { if (FollowUp2?.setJob_seeker) {
await FollowUp2.setJob_seeker(relatedJob_seeker2); await FollowUp2.setJob_seeker(relatedJob_seeker2);
} }
const relatedJob_seeker3 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const FollowUp3 = await FollowUps.findOne({
order: [['id', 'ASC']],
offset: 3,
});
if (FollowUp3?.setJob_seeker) {
await FollowUp3.setJob_seeker(relatedJob_seeker3);
}
} }
async function associateOutreachMessageWithContact() { async function associateOutreachMessageWithContact() {
@ -450,17 +365,6 @@ async function associateOutreachMessageWithContact() {
if (OutreachMessage2?.setContact) { if (OutreachMessage2?.setContact) {
await OutreachMessage2.setContact(relatedContact2); await OutreachMessage2.setContact(relatedContact2);
} }
const relatedContact3 = await Contacts.findOne({
offset: Math.floor(Math.random() * (await Contacts.count())),
});
const OutreachMessage3 = await OutreachMessages.findOne({
order: [['id', 'ASC']],
offset: 3,
});
if (OutreachMessage3?.setContact) {
await OutreachMessage3.setContact(relatedContact3);
}
} }
async function associateOutreachMessageWithJob_seeker() { async function associateOutreachMessageWithJob_seeker() {
@ -496,17 +400,6 @@ async function associateOutreachMessageWithJob_seeker() {
if (OutreachMessage2?.setJob_seeker) { if (OutreachMessage2?.setJob_seeker) {
await OutreachMessage2.setJob_seeker(relatedJob_seeker2); await OutreachMessage2.setJob_seeker(relatedJob_seeker2);
} }
const relatedJob_seeker3 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const OutreachMessage3 = await OutreachMessages.findOne({
order: [['id', 'ASC']],
offset: 3,
});
if (OutreachMessage3?.setJob_seeker) {
await OutreachMessage3.setJob_seeker(relatedJob_seeker3);
}
} }
module.exports = { module.exports = {

View File

@ -35,6 +35,12 @@ router.use(checkCrudPermissions('contacts'));
* notes: * notes:
* type: string * type: string
* default: notes * default: notes
* company:
* type: string
* default: company
* industry:
* type: string
* default: industry
*/ */
@ -323,6 +329,8 @@ router.get(
'email', 'email',
'phone_number', 'phone_number',
'notes', 'notes',
'company',
'industry',
]; ];
const opts = { fields }; const opts = { fields };
try { try {

View File

@ -43,7 +43,21 @@ module.exports = class SearchService {
const tableColumns = { const tableColumns = {
users: ['firstName', 'lastName', 'phoneNumber', 'email'], users: ['firstName', 'lastName', 'phoneNumber', 'email'],
contacts: ['first_name', 'last_name', 'email', 'phone_number', 'notes'], contacts: [
'first_name',
'last_name',
'email',
'phone_number',
'notes',
'company',
'industry',
],
follow_ups: ['status'], follow_ups: ['status'],

View File

@ -0,0 +1 @@
{}

View File

@ -133,6 +133,28 @@ const CardContacts = ({
<div className='font-medium line-clamp-4'>{item.notes}</div> <div className='font-medium line-clamp-4'>{item.notes}</div>
</dd> </dd>
</div> </div>
<div className='flex justify-between gap-x-4 py-3'>
<dt className=' text-gray-500 dark:text-dark-600'>
Company
</dt>
<dd className='flex items-start gap-x-2'>
<div className='font-medium line-clamp-4'>
{item.company}
</div>
</dd>
</div>
<div className='flex justify-between gap-x-4 py-3'>
<dt className=' text-gray-500 dark:text-dark-600'>
Industry
</dt>
<dd className='flex items-start gap-x-2'>
<div className='font-medium line-clamp-4'>
{item.industry}
</div>
</dd>
</div>
</dl> </dl>
</li> </li>
))} ))}

View File

@ -84,6 +84,16 @@ const ListContacts = ({
<p className={'text-xs text-gray-500 '}>Notes</p> <p className={'text-xs text-gray-500 '}>Notes</p>
<p className={'line-clamp-2'}>{item.notes}</p> <p className={'line-clamp-2'}>{item.notes}</p>
</div> </div>
<div className={'flex-1 px-3'}>
<p className={'text-xs text-gray-500 '}>Company</p>
<p className={'line-clamp-2'}>{item.company}</p>
</div>
<div className={'flex-1 px-3'}>
<p className={'text-xs text-gray-500 '}>Industry</p>
<p className={'line-clamp-2'}>{item.industry}</p>
</div>
</Link> </Link>
<ListActionsPopover <ListActionsPopover
onDelete={onDelete} onDelete={onDelete}

View File

@ -118,6 +118,30 @@ export const loadColumns = async (
editable: hasUpdatePermission, editable: hasUpdatePermission,
}, },
{
field: 'company',
headerName: 'Company',
flex: 1,
minWidth: 120,
filterable: false,
headerClassName: 'datagrid--header',
cellClassName: 'datagrid--cell',
editable: hasUpdatePermission,
},
{
field: 'industry',
headerName: 'Industry',
flex: 1,
minWidth: 120,
filterable: false,
headerClassName: 'datagrid--header',
cellClassName: 'datagrid--cell',
editable: hasUpdatePermission,
},
{ {
field: 'actions', field: 'actions',
type: 'actions', type: 'actions',

View File

@ -19,7 +19,7 @@ export default function WebSiteFooter({ projectName }: WebSiteFooterProps) {
const style = FooterStyle.WITH_PAGES; const style = FooterStyle.WITH_PAGES;
const design = FooterDesigns.DESIGN_DIVERSITY; const design = FooterDesigns.DEFAULT_DESIGN;
return ( return (
<div <div

View File

@ -47,6 +47,10 @@ const EditContacts = () => {
job_seeker: null, job_seeker: null,
notes: '', notes: '',
company: '',
industry: '',
}; };
const [initialValues, setInitialValues] = useState(initVals); const [initialValues, setInitialValues] = useState(initVals);
@ -134,6 +138,14 @@ const EditContacts = () => {
></Field> ></Field>
</FormField> </FormField>
<FormField label='Company'>
<Field name='company' placeholder='Company' />
</FormField>
<FormField label='Industry'>
<Field name='industry' placeholder='Industry' />
</FormField>
<BaseDivider /> <BaseDivider />
<BaseButtons> <BaseButtons>
<BaseButton type='submit' color='info' label='Submit' /> <BaseButton type='submit' color='info' label='Submit' />

View File

@ -47,6 +47,10 @@ const EditContactsPage = () => {
job_seeker: null, job_seeker: null,
notes: '', notes: '',
company: '',
industry: '',
}; };
const [initialValues, setInitialValues] = useState(initVals); const [initialValues, setInitialValues] = useState(initVals);
@ -132,6 +136,14 @@ const EditContactsPage = () => {
></Field> ></Field>
</FormField> </FormField>
<FormField label='Company'>
<Field name='company' placeholder='Company' />
</FormField>
<FormField label='Industry'>
<Field name='industry' placeholder='Industry' />
</FormField>
<BaseDivider /> <BaseDivider />
<BaseButtons> <BaseButtons>
<BaseButton type='submit' color='info' label='Submit' /> <BaseButton type='submit' color='info' label='Submit' />

View File

@ -34,6 +34,8 @@ const ContactsTablesPage = () => {
{ label: 'Email', title: 'email' }, { label: 'Email', title: 'email' },
{ label: 'PhoneNumber', title: 'phone_number' }, { label: 'PhoneNumber', title: 'phone_number' },
{ label: 'Notes', title: 'notes' }, { label: 'Notes', title: 'notes' },
{ label: 'Company', title: 'company' },
{ label: 'Industry', title: 'industry' },
{ label: 'JobSeeker', title: 'job_seeker' }, { label: 'JobSeeker', title: 'job_seeker' },
]); ]);

View File

@ -44,6 +44,10 @@ const initialValues = {
job_seeker: '', job_seeker: '',
notes: '', notes: '',
company: '',
industry: '',
}; };
const ContactsNew = () => { const ContactsNew = () => {
@ -107,6 +111,14 @@ const ContactsNew = () => {
></Field> ></Field>
</FormField> </FormField>
<FormField label='Company'>
<Field name='company' placeholder='Company' />
</FormField>
<FormField label='Industry'>
<Field name='industry' placeholder='Industry' />
</FormField>
<BaseDivider /> <BaseDivider />
<BaseButtons> <BaseButtons>
<BaseButton type='submit' color='info' label='Submit' /> <BaseButton type='submit' color='info' label='Submit' />

View File

@ -34,6 +34,8 @@ const ContactsTablesPage = () => {
{ label: 'Email', title: 'email' }, { label: 'Email', title: 'email' },
{ label: 'PhoneNumber', title: 'phone_number' }, { label: 'PhoneNumber', title: 'phone_number' },
{ label: 'Notes', title: 'notes' }, { label: 'Notes', title: 'notes' },
{ label: 'Company', title: 'company' },
{ label: 'Industry', title: 'industry' },
{ label: 'JobSeeker', title: 'job_seeker' }, { label: 'JobSeeker', title: 'job_seeker' },
]); ]);

View File

@ -89,6 +89,16 @@ const ContactsView = () => {
)} )}
</div> </div>
<div className={'mb-4'}>
<p className={'block font-bold mb-2'}>Company</p>
<p>{contacts?.company}</p>
</div>
<div className={'mb-4'}>
<p className={'block font-bold mb-2'}>Industry</p>
<p>{contacts?.industry}</p>
</div>
<> <>
<p className={'block font-bold mb-2'}>Calls Contact</p> <p className={'block font-bold mb-2'}>Calls Contact</p>
<CardBox <CardBox

View File

@ -194,6 +194,10 @@ const UsersView = () => {
<th>Email</th> <th>Email</th>
<th>PhoneNumber</th> <th>PhoneNumber</th>
<th>Company</th>
<th>Industry</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -215,6 +219,10 @@ const UsersView = () => {
<td data-label='email'>{item.email}</td> <td data-label='email'>{item.email}</td>
<td data-label='phone_number'>{item.phone_number}</td> <td data-label='phone_number'>{item.phone_number}</td>
<td data-label='company'>{item.company}</td>
<td data-label='industry'>{item.industry}</td>
</tr> </tr>
))} ))}
</tbody> </tbody>

View File

@ -86,7 +86,7 @@ export default function WebSite() {
<FeaturesSection <FeaturesSection
projectName={'never search alone'} projectName={'never search alone'}
image={['Dashboard showcasing job connections']} image={['Dashboard showcasing job connections']}
withBg={1} withBg={0}
features={features_points} features={features_points}
mainText={`Discover Key Features of ${projectName}`} mainText={`Discover Key Features of ${projectName}`}
subTitle={`Unlock the full potential of your job search with ${projectName}. Streamline your process and connect effortlessly.`} subTitle={`Unlock the full potential of your job search with ${projectName}. Streamline your process and connect effortlessly.`}