Compare commits
No commits in common. "ai-dev" and "master" have entirely different histories.
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,8 +1,3 @@
|
|||||||
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
@ -20,8 +20,6 @@ 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,
|
||||||
@ -49,8 +47,6 @@ 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,
|
||||||
@ -87,10 +83,6 @@ 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 });
|
||||||
@ -271,20 +263,6 @@ 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,
|
||||||
|
|||||||
@ -1,47 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@ -1,49 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@ -34,14 +34,6 @@ 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,
|
||||||
|
|||||||
@ -33,6 +33,14 @@ 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 = [
|
||||||
@ -48,10 +56,6 @@ 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',
|
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -66,10 +70,6 @@ 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,10 +84,20 @@ 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',
|
||||||
|
|
||||||
industry: 'Alfred Wegener',
|
last_name: 'Brown',
|
||||||
|
|
||||||
|
email: 'bob.brown@example.com',
|
||||||
|
|
||||||
|
phone_number: '5566778899',
|
||||||
|
|
||||||
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
|
notes: 'Looking for opportunities in marketing.',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -121,6 +131,16 @@ 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 = [
|
||||||
@ -153,6 +173,16 @@ 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() {
|
||||||
@ -188,6 +218,17 @@ 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() {
|
||||||
@ -223,6 +264,17 @@ 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"
|
||||||
@ -260,6 +312,17 @@ 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() {
|
||||||
@ -295,6 +358,17 @@ 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() {
|
||||||
@ -330,6 +404,17 @@ 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() {
|
||||||
@ -365,6 +450,17 @@ 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() {
|
||||||
@ -400,6 +496,17 @@ 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 = {
|
||||||
|
|||||||
@ -35,12 +35,6 @@ router.use(checkCrudPermissions('contacts'));
|
|||||||
* notes:
|
* notes:
|
||||||
* type: string
|
* type: string
|
||||||
* default: notes
|
* default: notes
|
||||||
* company:
|
|
||||||
* type: string
|
|
||||||
* default: company
|
|
||||||
* industry:
|
|
||||||
* type: string
|
|
||||||
* default: industry
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -329,8 +323,6 @@ router.get(
|
|||||||
'email',
|
'email',
|
||||||
'phone_number',
|
'phone_number',
|
||||||
'notes',
|
'notes',
|
||||||
'company',
|
|
||||||
'industry',
|
|
||||||
];
|
];
|
||||||
const opts = { fields };
|
const opts = { fields };
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -43,21 +43,7 @@ module.exports = class SearchService {
|
|||||||
const tableColumns = {
|
const tableColumns = {
|
||||||
users: ['firstName', 'lastName', 'phoneNumber', 'email'],
|
users: ['firstName', 'lastName', 'phoneNumber', 'email'],
|
||||||
|
|
||||||
contacts: [
|
contacts: ['first_name', 'last_name', 'email', 'phone_number', 'notes'],
|
||||||
'first_name',
|
|
||||||
|
|
||||||
'last_name',
|
|
||||||
|
|
||||||
'email',
|
|
||||||
|
|
||||||
'phone_number',
|
|
||||||
|
|
||||||
'notes',
|
|
||||||
|
|
||||||
'company',
|
|
||||||
|
|
||||||
'industry',
|
|
||||||
],
|
|
||||||
|
|
||||||
follow_ups: ['status'],
|
follow_ups: ['status'],
|
||||||
|
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
{}
|
|
||||||
@ -133,28 +133,6 @@ 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>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@ -84,16 +84,6 @@ 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}
|
||||||
|
|||||||
@ -14,7 +14,7 @@ import {
|
|||||||
import { useAppDispatch, useAppSelector } from '../../stores/hooks';
|
import { useAppDispatch, useAppSelector } from '../../stores/hooks';
|
||||||
import { useRouter } from 'next/router';
|
import { useRouter } from 'next/router';
|
||||||
import { Field, Form, Formik } from 'formik';
|
import { Field, Form, Formik } from 'formik';
|
||||||
import { DataGrid, GridColDef, GridToolbar } from '@mui/x-data-grid';
|
import { DataGrid, GridColDef } from '@mui/x-data-grid';
|
||||||
import { loadColumns } from './configureContactsCols';
|
import { loadColumns } from './configureContactsCols';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import dataFormatter from '../../helpers/dataFormatter';
|
import dataFormatter from '../../helpers/dataFormatter';
|
||||||
@ -216,9 +216,6 @@ const TableSampleContacts = ({
|
|||||||
className={'datagrid--table'}
|
className={'datagrid--table'}
|
||||||
getRowClassName={() => `datagrid--row`}
|
getRowClassName={() => `datagrid--row`}
|
||||||
rows={contacts ?? []}
|
rows={contacts ?? []}
|
||||||
|
|
||||||
components={{ Toolbar: GridToolbar }}
|
|
||||||
onRowClick={(params) => router.push(`/contacts/contacts-view/?id=${params.id}`)}
|
|
||||||
columns={columns}
|
columns={columns}
|
||||||
initialState={{
|
initialState={{
|
||||||
pagination: {
|
pagination: {
|
||||||
|
|||||||
@ -39,16 +39,29 @@ export const loadColumns = async (
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
field: 'name',
|
field: 'first_name',
|
||||||
headerName: 'Name',
|
headerName: 'FirstName',
|
||||||
flex: 1,
|
flex: 1,
|
||||||
minWidth: 120,
|
minWidth: 120,
|
||||||
filterable: false,
|
filterable: false,
|
||||||
headerClassName: 'datagrid--header',
|
headerClassName: 'datagrid--header',
|
||||||
cellClassName: 'datagrid--cell',
|
cellClassName: 'datagrid--cell',
|
||||||
valueGetter: (params: GridValueGetterParams) =>
|
|
||||||
`${params.row.first_name || ''} ${params.row.last_name || ''}`,
|
editable: hasUpdatePermission,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'last_name',
|
||||||
|
headerName: 'LastName',
|
||||||
|
flex: 1,
|
||||||
|
minWidth: 120,
|
||||||
|
filterable: false,
|
||||||
|
headerClassName: 'datagrid--header',
|
||||||
|
cellClassName: 'datagrid--cell',
|
||||||
|
|
||||||
|
editable: hasUpdatePermission,
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
field: 'email',
|
field: 'email',
|
||||||
headerName: 'Email',
|
headerName: 'Email',
|
||||||
@ -57,8 +70,10 @@ export const loadColumns = async (
|
|||||||
filterable: false,
|
filterable: false,
|
||||||
headerClassName: 'datagrid--header',
|
headerClassName: 'datagrid--header',
|
||||||
cellClassName: 'datagrid--cell',
|
cellClassName: 'datagrid--cell',
|
||||||
|
|
||||||
editable: hasUpdatePermission,
|
editable: hasUpdatePermission,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
field: 'phone_number',
|
field: 'phone_number',
|
||||||
headerName: 'PhoneNumber',
|
headerName: 'PhoneNumber',
|
||||||
@ -67,9 +82,30 @@ export const loadColumns = async (
|
|||||||
filterable: false,
|
filterable: false,
|
||||||
headerClassName: 'datagrid--header',
|
headerClassName: 'datagrid--header',
|
||||||
cellClassName: 'datagrid--cell',
|
cellClassName: 'datagrid--cell',
|
||||||
|
|
||||||
editable: hasUpdatePermission,
|
editable: hasUpdatePermission,
|
||||||
renderCell: (params) => dataFormatter.phoneFormatter(params.value),
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'job_seeker',
|
||||||
|
headerName: 'JobSeeker',
|
||||||
|
flex: 1,
|
||||||
|
minWidth: 120,
|
||||||
|
filterable: false,
|
||||||
|
headerClassName: 'datagrid--header',
|
||||||
|
cellClassName: 'datagrid--cell',
|
||||||
|
|
||||||
|
editable: hasUpdatePermission,
|
||||||
|
|
||||||
|
sortable: false,
|
||||||
|
type: 'singleSelect',
|
||||||
|
getOptionValue: (value: any) => value?.id,
|
||||||
|
getOptionLabel: (value: any) => value?.label,
|
||||||
|
valueOptions: await callOptionsApi('users'),
|
||||||
|
valueGetter: (params: GridValueGetterParams) =>
|
||||||
|
params?.value?.id ?? params?.value,
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
field: 'notes',
|
field: 'notes',
|
||||||
headerName: 'Notes',
|
headerName: 'Notes',
|
||||||
@ -78,8 +114,10 @@ export const loadColumns = async (
|
|||||||
filterable: false,
|
filterable: false,
|
||||||
headerClassName: 'datagrid--header',
|
headerClassName: 'datagrid--header',
|
||||||
cellClassName: 'datagrid--cell',
|
cellClassName: 'datagrid--cell',
|
||||||
|
|
||||||
editable: hasUpdatePermission,
|
editable: hasUpdatePermission,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
field: 'actions',
|
field: 'actions',
|
||||||
type: 'actions',
|
type: 'actions',
|
||||||
|
|||||||
@ -1,105 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import BaseIcon from '../BaseIcon';
|
|
||||||
import { mdiEye, mdiTrashCan, mdiPencilOutline } from '@mdi/js';
|
|
||||||
import axios from 'axios';
|
|
||||||
import {
|
|
||||||
GridActionsCellItem,
|
|
||||||
GridRowParams,
|
|
||||||
GridValueGetterParams,
|
|
||||||
} from '@mui/x-data-grid';
|
|
||||||
import ImageField from '../ImageField';
|
|
||||||
import { saveFile } from '../../helpers/fileSaver';
|
|
||||||
import dataFormatter from '../../helpers/dataFormatter';
|
|
||||||
import DataGridMultiSelect from '../DataGridMultiSelect';
|
|
||||||
import ListActionsPopover from '../ListActionsPopover';
|
|
||||||
|
|
||||||
import { hasPermission } from '../../helpers/userPermissions';
|
|
||||||
|
|
||||||
type Params = (id: string) => void;
|
|
||||||
|
|
||||||
export const loadColumns = async (
|
|
||||||
onDelete: Params,
|
|
||||||
entityName: string,
|
|
||||||
|
|
||||||
user,
|
|
||||||
) => {
|
|
||||||
async function callOptionsApi(entityName: string) {
|
|
||||||
if (!hasPermission(user, 'READ_' + entityName.toUpperCase())) return [];
|
|
||||||
|
|
||||||
try {
|
|
||||||
const data = await axios(`/${entityName}/autocomplete?limit=100`);
|
|
||||||
return data.data;
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error);
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const hasUpdatePermission = hasPermission(user, 'UPDATE_CONTACTS');
|
|
||||||
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
field: 'name',
|
|
||||||
headerName: 'Name',
|
|
||||||
flex: 1,
|
|
||||||
minWidth: 120,
|
|
||||||
filterable: false,
|
|
||||||
headerClassName: 'datagrid--header',
|
|
||||||
cellClassName: 'datagrid--cell',
|
|
||||||
valueGetter: (params: GridValueGetterParams) =>
|
|
||||||
`${params.row.first_name || ''} ${params.row.last_name || ''}`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'email',
|
|
||||||
headerName: 'Email',
|
|
||||||
flex: 1,
|
|
||||||
minWidth: 120,
|
|
||||||
filterable: false,
|
|
||||||
headerClassName: 'datagrid--header',
|
|
||||||
cellClassName: 'datagrid--cell',
|
|
||||||
editable: hasUpdatePermission,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'phone_number',
|
|
||||||
headerName: 'Phone Number',
|
|
||||||
flex: 1,
|
|
||||||
minWidth: 120,
|
|
||||||
filterable: false,
|
|
||||||
headerClassName: 'datagrid--header',
|
|
||||||
cellClassName: 'datagrid--cell',
|
|
||||||
editable: hasUpdatePermission,
|
|
||||||
renderCell: (params) => dataFormatter.phoneFormatter(params.value),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'notes',
|
|
||||||
headerName: 'Notes',
|
|
||||||
flex: 1,
|
|
||||||
minWidth: 120,
|
|
||||||
filterable: false,
|
|
||||||
headerClassName: 'datagrid--header',
|
|
||||||
cellClassName: 'datagrid--cell',
|
|
||||||
editable: hasUpdatePermission,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'actions',
|
|
||||||
type: 'actions',
|
|
||||||
minWidth: 30,
|
|
||||||
headerClassName: 'datagrid--header',
|
|
||||||
cellClassName: 'datagrid--cell',
|
|
||||||
getActions: (params: GridRowParams) => {
|
|
||||||
return [
|
|
||||||
<div key={params?.row?.id}>
|
|
||||||
<ListActionsPopover
|
|
||||||
onDelete={onDelete}
|
|
||||||
itemId={params?.row?.id}
|
|
||||||
pathEdit={`/contacts/contacts-edit/?id=${params?.row?.id}`}
|
|
||||||
pathView={`/contacts/contacts-view/?id=${params?.row?.id}`}
|
|
||||||
hasUpdatePermission={hasUpdatePermission}
|
|
||||||
/>
|
|
||||||
</div>,
|
|
||||||
];
|
|
||||||
},
|
|
||||||
},
|
|
||||||
];
|
|
||||||
};
|
|
||||||
@ -19,7 +19,7 @@ export default function WebSiteFooter({ projectName }: WebSiteFooterProps) {
|
|||||||
|
|
||||||
const style = FooterStyle.WITH_PAGES;
|
const style = FooterStyle.WITH_PAGES;
|
||||||
|
|
||||||
const design = FooterDesigns.DEFAULT_DESIGN;
|
const design = FooterDesigns.DESIGN_DIVERSITY;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
|||||||
@ -27,99 +27,6 @@ export default {
|
|||||||
booleanFormatter(val) {
|
booleanFormatter(val) {
|
||||||
return val ? 'Yes' : 'No';
|
return val ? 'Yes' : 'No';
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* Format phone number to +X (XXX) XXX-XXXX
|
|
||||||
*/
|
|
||||||
phoneFormatter(val) {
|
|
||||||
if (!val) return '';
|
|
||||||
const digits = val.replace(/\D/g, '');
|
|
||||||
let country = '';
|
|
||||||
let number = '';
|
|
||||||
if (digits.length === 11) {
|
|
||||||
country = digits.charAt(0);
|
|
||||||
number = digits.slice(1);
|
|
||||||
} else if (digits.length === 10) {
|
|
||||||
country = '1';
|
|
||||||
number = digits;
|
|
||||||
} else {
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
const area = number.slice(0, 3);
|
|
||||||
const prefix = number.slice(3, 6);
|
|
||||||
const line = number.slice(6);
|
|
||||||
return `+${country} (${area}) ${prefix}-${line}`;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Format phone number to +X (XXX) XXX-XXXX
|
|
||||||
*/
|
|
||||||
phoneFormatter(val) {
|
|
||||||
if (!val) return '';
|
|
||||||
const digits = val.replace(/\D/g, '');
|
|
||||||
let country = '';
|
|
||||||
let number = '';
|
|
||||||
if (digits.length === 11) {
|
|
||||||
country = digits.charAt(0);
|
|
||||||
number = digits.slice(1);
|
|
||||||
} else if (digits.length === 10) {
|
|
||||||
country = '1';
|
|
||||||
number = digits;
|
|
||||||
} else {
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
const area = number.slice(0, 3);
|
|
||||||
const prefix = number.slice(3, 6);
|
|
||||||
const line = number.slice(6);
|
|
||||||
return `+${country} (${area}) ${prefix}-${line}`;
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Format phone number to +X (XXX) XXX-XXXX
|
|
||||||
*/
|
|
||||||
phoneFormatter(val) {
|
|
||||||
if (!val) return '';
|
|
||||||
const digits = val.replace(/\D/g, '');
|
|
||||||
let country = '';
|
|
||||||
let number = '';
|
|
||||||
if (digits.length === 11) {
|
|
||||||
country = digits.charAt(0);
|
|
||||||
number = digits.slice(1);
|
|
||||||
} else if (digits.length === 10) {
|
|
||||||
country = '1';
|
|
||||||
number = digits;
|
|
||||||
} else {
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
const area = number.slice(0, 3);
|
|
||||||
const prefix = number.slice(3, 6);
|
|
||||||
const line = number.slice(6);
|
|
||||||
return `+${country} (${area}) ${prefix}-${line}`;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Format phone number to +X (XXX) XXX-XXXX
|
|
||||||
*/
|
|
||||||
phoneFormatter(val) {
|
|
||||||
if (!val) return '';
|
|
||||||
const digits = val.replace(/\D/g, '');
|
|
||||||
let country = '';
|
|
||||||
let number = '';
|
|
||||||
if (digits.length === 11) {
|
|
||||||
country = digits.charAt(0);
|
|
||||||
number = digits.slice(1);
|
|
||||||
} else if (digits.length === 10) {
|
|
||||||
country = '1';
|
|
||||||
number = digits;
|
|
||||||
} else {
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
const area = number.slice(0, 3);
|
|
||||||
const prefix = number.slice(3, 6);
|
|
||||||
const line = number.slice(6);
|
|
||||||
return `+${country} (${area}) ${prefix}-${line}`;
|
|
||||||
},
|
|
||||||
dataGridEditFormatter(obj) {
|
dataGridEditFormatter(obj) {
|
||||||
return _.transform(obj, (result, value, key) => {
|
return _.transform(obj, (result, value, key) => {
|
||||||
if (_.isArray(value)) {
|
if (_.isArray(value)) {
|
||||||
|
|||||||
@ -1,234 +0,0 @@
|
|||||||
import dayjs from 'dayjs';
|
|
||||||
import _ from 'lodash';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
filesFormatter(arr) {
|
|
||||||
if (!arr || !arr.length) return [];
|
|
||||||
return arr.map((item) => item);
|
|
||||||
},
|
|
||||||
imageFormatter(arr) {
|
|
||||||
if (!arr || !arr.length) return [];
|
|
||||||
return arr.map((item) => ({
|
|
||||||
publicUrl: item.publicUrl || '',
|
|
||||||
}));
|
|
||||||
},
|
|
||||||
oneImageFormatter(arr) {
|
|
||||||
if (!arr || !arr.length) return '';
|
|
||||||
return arr[0].publicUrl || '';
|
|
||||||
},
|
|
||||||
dateFormatter(date) {
|
|
||||||
if (!date) return '';
|
|
||||||
return dayjs(date).format('YYYY-MM-DD');
|
|
||||||
},
|
|
||||||
dateTimeFormatter(date) {
|
|
||||||
if (!date) return '';
|
|
||||||
return dayjs(date).format('YYYY-MM-DD HH:mm');
|
|
||||||
},
|
|
||||||
booleanFormatter(val) {
|
|
||||||
return val ? 'Yes' : 'No';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Format phone number to +X (XXX) XXX-XXXX
|
|
||||||
*/
|
|
||||||
phoneFormatter(val) {
|
|
||||||
if (!val) return '';
|
|
||||||
const digits = val.replace(/\D/g, '');
|
|
||||||
let country = '';
|
|
||||||
let number = '';
|
|
||||||
if (digits.length === 11) {
|
|
||||||
country = digits.charAt(0);
|
|
||||||
number = digits.slice(1);
|
|
||||||
} else if (digits.length === 10) {
|
|
||||||
country = '1';
|
|
||||||
number = digits;
|
|
||||||
} else {
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
const area = number.slice(0, 3);
|
|
||||||
const prefix = number.slice(3, 6);
|
|
||||||
const line = number.slice(6);
|
|
||||||
return `+${country} (${area}) ${prefix}-${line}`;
|
|
||||||
},
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Format phone number to +X (XXX) XXX-XXXX
|
|
||||||
*/
|
|
||||||
phoneFormatter(val) {
|
|
||||||
if (!val) return '';
|
|
||||||
const digits = val.replace(/\D/g, '');
|
|
||||||
let country = '';
|
|
||||||
let number = '';
|
|
||||||
if (digits.length === 11) {
|
|
||||||
country = digits.charAt(0);
|
|
||||||
number = digits.slice(1);
|
|
||||||
} else if (digits.length === 10) {
|
|
||||||
country = '1';
|
|
||||||
number = digits;
|
|
||||||
} else {
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
const area = number.slice(0, 3);
|
|
||||||
const prefix = number.slice(3, 6);
|
|
||||||
const line = number.slice(6);
|
|
||||||
return `+${country} (${area}) ${prefix}-${line}`;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Format phone number to +X (XXX) XXX-XXXX
|
|
||||||
*/
|
|
||||||
phoneFormatter(val) {
|
|
||||||
if (!val) return '';
|
|
||||||
const digits = val.replace(/\D/g, '');
|
|
||||||
let country = '';
|
|
||||||
let number = '';
|
|
||||||
if (digits.length === 11) {
|
|
||||||
country = digits.charAt(0);
|
|
||||||
number = digits.slice(1);
|
|
||||||
} else if (digits.length === 10) {
|
|
||||||
country = '1';
|
|
||||||
number = digits;
|
|
||||||
} else {
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
const area = number.slice(0, 3);
|
|
||||||
const prefix = number.slice(3, 6);
|
|
||||||
const line = number.slice(6);
|
|
||||||
return `+${country} (${area}) ${prefix}-${line}`;
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Format phone number to +X (XXX) XXX-XXXX
|
|
||||||
*/
|
|
||||||
phoneFormatter(val) {
|
|
||||||
if (!val) return '';
|
|
||||||
const digits = val.replace(/\D/g, '');
|
|
||||||
let country = '';
|
|
||||||
let number = '';
|
|
||||||
if (digits.length === 11) {
|
|
||||||
country = digits.charAt(0);
|
|
||||||
number = digits.slice(1);
|
|
||||||
} else if (digits.length === 10) {
|
|
||||||
country = '1';
|
|
||||||
number = digits;
|
|
||||||
} else {
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
const area = number.slice(0, 3);
|
|
||||||
const prefix = number.slice(3, 6);
|
|
||||||
const line = number.slice(6);
|
|
||||||
return `+${country} (${area}) ${prefix}-${line}`;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Format phone number to +X (XXX) XXX-XXXX
|
|
||||||
*/
|
|
||||||
phoneFormatter(val) {
|
|
||||||
if (!val) return '';
|
|
||||||
const digits = val.replace(/\D/g, '');
|
|
||||||
let country = '';
|
|
||||||
let number = '';
|
|
||||||
if (digits.length === 11) {
|
|
||||||
country = digits.charAt(0);
|
|
||||||
number = digits.slice(1);
|
|
||||||
} else if (digits.length === 10) {
|
|
||||||
country = '1';
|
|
||||||
number = digits;
|
|
||||||
} else {
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
const area = number.slice(0, 3);
|
|
||||||
const prefix = number.slice(3, 6);
|
|
||||||
const line = number.slice(6);
|
|
||||||
return `+${country} (${area}) ${prefix}-${line}`;
|
|
||||||
},
|
|
||||||
dataGridEditFormatter(obj) {
|
|
||||||
return _.transform(obj, (result, value, key) => {
|
|
||||||
if (_.isArray(value)) {
|
|
||||||
result[key] = _.map(value, 'id');
|
|
||||||
} else if (_.isObject(value)) {
|
|
||||||
result[key] = value.id;
|
|
||||||
} else {
|
|
||||||
result[key] = value;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
usersManyListFormatter(val) {
|
|
||||||
if (!val || !val.length) return [];
|
|
||||||
return val.map((item) => item.firstName);
|
|
||||||
},
|
|
||||||
usersOneListFormatter(val) {
|
|
||||||
if (!val) return '';
|
|
||||||
return val.firstName;
|
|
||||||
},
|
|
||||||
usersManyListFormatterEdit(val) {
|
|
||||||
if (!val || !val.length) return [];
|
|
||||||
return val.map((item) => {
|
|
||||||
return { id: item.id, label: item.firstName };
|
|
||||||
});
|
|
||||||
},
|
|
||||||
usersOneListFormatterEdit(val) {
|
|
||||||
if (!val) return '';
|
|
||||||
return { label: val.firstName, id: val.id };
|
|
||||||
},
|
|
||||||
|
|
||||||
contactsManyListFormatter(val) {
|
|
||||||
if (!val || !val.length) return [];
|
|
||||||
return val.map((item) => item.first_name);
|
|
||||||
},
|
|
||||||
contactsOneListFormatter(val) {
|
|
||||||
if (!val) return '';
|
|
||||||
return val.first_name;
|
|
||||||
},
|
|
||||||
contactsManyListFormatterEdit(val) {
|
|
||||||
if (!val || !val.length) return [];
|
|
||||||
return val.map((item) => {
|
|
||||||
return { id: item.id, label: item.first_name };
|
|
||||||
});
|
|
||||||
},
|
|
||||||
contactsOneListFormatterEdit(val) {
|
|
||||||
if (!val) return '';
|
|
||||||
return { label: val.first_name, id: val.id };
|
|
||||||
},
|
|
||||||
|
|
||||||
rolesManyListFormatter(val) {
|
|
||||||
if (!val || !val.length) return [];
|
|
||||||
return val.map((item) => item.name);
|
|
||||||
},
|
|
||||||
rolesOneListFormatter(val) {
|
|
||||||
if (!val) return '';
|
|
||||||
return val.name;
|
|
||||||
},
|
|
||||||
rolesManyListFormatterEdit(val) {
|
|
||||||
if (!val || !val.length) return [];
|
|
||||||
return val.map((item) => {
|
|
||||||
return { id: item.id, label: item.name };
|
|
||||||
});
|
|
||||||
},
|
|
||||||
rolesOneListFormatterEdit(val) {
|
|
||||||
if (!val) return '';
|
|
||||||
return { label: val.name, id: val.id };
|
|
||||||
},
|
|
||||||
|
|
||||||
permissionsManyListFormatter(val) {
|
|
||||||
if (!val || !val.length) return [];
|
|
||||||
return val.map((item) => item.name);
|
|
||||||
},
|
|
||||||
permissionsOneListFormatter(val) {
|
|
||||||
if (!val) return '';
|
|
||||||
return val.name;
|
|
||||||
},
|
|
||||||
permissionsManyListFormatterEdit(val) {
|
|
||||||
if (!val || !val.length) return [];
|
|
||||||
return val.map((item) => {
|
|
||||||
return { id: item.id, label: item.name };
|
|
||||||
});
|
|
||||||
},
|
|
||||||
permissionsOneListFormatterEdit(val) {
|
|
||||||
if (!val) return '';
|
|
||||||
return { label: val.name, id: val.id };
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@ -19,6 +19,14 @@ const menuAside: MenuAsideItem[] = [
|
|||||||
: icon.mdiTable ?? icon.mdiTable,
|
: icon.mdiTable ?? icon.mdiTable,
|
||||||
permissions: 'READ_CALLS',
|
permissions: 'READ_CALLS',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
href: '/users/users-list',
|
||||||
|
label: 'Users',
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
// @ts-ignore
|
||||||
|
icon: icon.mdiAccountGroup ?? icon.mdiTable,
|
||||||
|
permissions: 'READ_USERS',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
href: '/contacts/contacts-list',
|
href: '/contacts/contacts-list',
|
||||||
label: 'Contacts',
|
label: 'Contacts',
|
||||||
|
|||||||
@ -47,10 +47,6 @@ const EditContacts = () => {
|
|||||||
job_seeker: null,
|
job_seeker: null,
|
||||||
|
|
||||||
notes: '',
|
notes: '',
|
||||||
|
|
||||||
company: '',
|
|
||||||
|
|
||||||
industry: '',
|
|
||||||
};
|
};
|
||||||
const [initialValues, setInitialValues] = useState(initVals);
|
const [initialValues, setInitialValues] = useState(initVals);
|
||||||
|
|
||||||
@ -138,14 +134,6 @@ 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' />
|
||||||
|
|||||||
@ -47,10 +47,6 @@ const EditContactsPage = () => {
|
|||||||
job_seeker: null,
|
job_seeker: null,
|
||||||
|
|
||||||
notes: '',
|
notes: '',
|
||||||
|
|
||||||
company: '',
|
|
||||||
|
|
||||||
industry: '',
|
|
||||||
};
|
};
|
||||||
const [initialValues, setInitialValues] = useState(initVals);
|
const [initialValues, setInitialValues] = useState(initVals);
|
||||||
|
|
||||||
@ -136,14 +132,6 @@ 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' />
|
||||||
|
|||||||
@ -34,8 +34,6 @@ 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' },
|
||||||
]);
|
]);
|
||||||
|
|||||||
@ -44,10 +44,6 @@ const initialValues = {
|
|||||||
job_seeker: '',
|
job_seeker: '',
|
||||||
|
|
||||||
notes: '',
|
notes: '',
|
||||||
|
|
||||||
company: '',
|
|
||||||
|
|
||||||
industry: '',
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const ContactsNew = () => {
|
const ContactsNew = () => {
|
||||||
@ -111,14 +107,6 @@ 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' />
|
||||||
|
|||||||
@ -34,8 +34,6 @@ 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' },
|
||||||
]);
|
]);
|
||||||
|
|||||||
@ -54,10 +54,30 @@ const ContactsView = () => {
|
|||||||
/>
|
/>
|
||||||
</SectionTitleLineWithButton>
|
</SectionTitleLineWithButton>
|
||||||
<CardBox>
|
<CardBox>
|
||||||
<div className='mb-6'>
|
<div className={'mb-4'}>
|
||||||
<h1 className='text-2xl font-bold'>{contacts?.first_name} {contacts?.last_name}</h1>
|
<p className={'block font-bold mb-2'}>FirstName</p>
|
||||||
<p className='text-sm text-gray-500'>{contacts?.email}</p>
|
<p>{contacts?.first_name}</p>
|
||||||
<p className='text-sm text-gray-500'>{contacts?.phone_number}</p>
|
</div>
|
||||||
|
|
||||||
|
<div className={'mb-4'}>
|
||||||
|
<p className={'block font-bold mb-2'}>LastName</p>
|
||||||
|
<p>{contacts?.last_name}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className={'mb-4'}>
|
||||||
|
<p className={'block font-bold mb-2'}>Email</p>
|
||||||
|
<p>{contacts?.email}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className={'mb-4'}>
|
||||||
|
<p className={'block font-bold mb-2'}>PhoneNumber</p>
|
||||||
|
<p>{contacts?.phone_number}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className={'mb-4'}>
|
||||||
|
<p className={'block font-bold mb-2'}>JobSeeker</p>
|
||||||
|
|
||||||
|
<p>{contacts?.job_seeker?.firstName ?? 'No data'}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={'mb-4'}>
|
<div className={'mb-4'}>
|
||||||
@ -69,16 +89,6 @@ 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
|
||||||
|
|||||||
@ -194,10 +194,6 @@ 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>
|
||||||
@ -219,10 +215,6 @@ 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>
|
||||||
|
|||||||
@ -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={0}
|
withBg={1}
|
||||||
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.`}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user