Compare commits

..

No commits in common. "be20ea89f62227dc44ef355e0a0b622fac63a11b" and "b9289338b9ce8ce5c107fb763a85a46fd6b58eae" have entirely different histories.

24 changed files with 495 additions and 423 deletions

File diff suppressed because one or more lines are too long

View File

@ -16,9 +16,6 @@ module.exports = class OrganizationsDBApi {
id: data.id || undefined,
name: data.name || null,
logo_url: data.logo_url || null,
primary_color: data.primary_color || null,
secondary_color: data.secondary_color || null,
importHash: data.importHash || null,
createdById: currentUser.id,
updatedById: currentUser.id,
@ -38,9 +35,6 @@ module.exports = class OrganizationsDBApi {
id: item.id || undefined,
name: item.name || null,
logo_url: item.logo_url || null,
primary_color: item.primary_color || null,
secondary_color: item.secondary_color || null,
importHash: item.importHash || null,
createdById: currentUser.id,
updatedById: currentUser.id,
@ -72,14 +66,6 @@ module.exports = class OrganizationsDBApi {
if (data.name !== undefined) updatePayload.name = data.name;
if (data.logo_url !== undefined) updatePayload.logo_url = data.logo_url;
if (data.primary_color !== undefined)
updatePayload.primary_color = data.primary_color;
if (data.secondary_color !== undefined)
updatePayload.secondary_color = data.secondary_color;
updatePayload.updatedById = currentUser.id;
await organizations.update(updatePayload, { transaction });
@ -218,35 +204,6 @@ module.exports = class OrganizationsDBApi {
};
}
if (filter.logo_url) {
where = {
...where,
[Op.and]: Utils.ilike('organizations', 'logo_url', filter.logo_url),
};
}
if (filter.primary_color) {
where = {
...where,
[Op.and]: Utils.ilike(
'organizations',
'primary_color',
filter.primary_color,
),
};
}
if (filter.secondary_color) {
where = {
...where,
[Op.and]: Utils.ilike(
'organizations',
'secondary_color',
filter.secondary_color,
),
};
}
if (filter.active !== undefined) {
where = {
...where,

View File

@ -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(
'organizations',
'logo_url',
{
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('organizations', 'logo_url', {
transaction,
});
await transaction.commit();
} catch (err) {
await transaction.rollback();
throw err;
}
},
};

View File

@ -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(
'organizations',
'primary_color',
{
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('organizations', 'primary_color', {
transaction,
});
await transaction.commit();
} catch (err) {
await transaction.rollback();
throw err;
}
},
};

View File

@ -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(
'organizations',
'secondary_color',
{
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('organizations', 'secondary_color', {
transaction,
});
await transaction.commit();
} catch (err) {
await transaction.rollback();
throw err;
}
},
};

View File

@ -18,18 +18,6 @@ module.exports = function (sequelize, DataTypes) {
type: DataTypes.TEXT,
},
logo_url: {
type: DataTypes.TEXT,
},
primary_color: {
type: DataTypes.TEXT,
},
secondary_color: {
type: DataTypes.TEXT,
},
importHash: {
type: DataTypes.STRING(255),
allowNull: true,

View File

@ -47,7 +47,35 @@ const ActionsData = [
due_date: new Date('2023-10-15T00:00:00Z'),
status: 'Vencida',
status: 'EnProgreso',
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
},
{
description: 'Contain and clean chemical spill',
due_date: new Date('2023-10-18T00:00:00Z'),
status: 'Pendiente',
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
},
{
description: 'Inspect and repair electrical wiring',
due_date: new Date('2023-10-20T00:00:00Z'),
status: 'Completada',
// type code here for "relation_one" field
@ -81,6 +109,22 @@ const BranchesData = [
// type code here for "relation_one" field
},
{
name: 'Puerto Williams',
location: 'Chile',
// type code here for "relation_one" field
},
{
name: 'Bodega Central',
location: 'Chile',
// type code here for "relation_one" field
},
];
const ChecklistsData = [
@ -114,11 +158,31 @@ const ChecklistsData = [
// type code here for "relation_one" field
},
{
title: 'Quarterly Emergency Drill',
description: 'Conduct emergency drills for all staff',
// type code here for "files" field
// type code here for "relation_one" field
},
{
title: 'Annual Safety Audit',
description: 'Comprehensive safety audit of all facilities',
// type code here for "files" field
// type code here for "relation_one" field
},
];
const EventsData = [
{
event_type: 'ObservacióndeSeguridad',
event_type: 'Cuasi-incidente',
description: 'Worker slipped on wet floor',
@ -126,7 +190,7 @@ const EventsData = [
status: 'Abierto',
risk_level: 'Alto',
risk_level: 'Bajo',
// type code here for "images" field
@ -138,7 +202,7 @@ const EventsData = [
},
{
event_type: 'Incidente',
event_type: 'ObservacióndeSeguridad',
description: 'Forklift nearly hit a worker',
@ -158,13 +222,33 @@ const EventsData = [
},
{
event_type: 'Incidente',
event_type: 'Cuasi-incidente',
description: 'Safety goggles not worn',
event_date: new Date('2023-10-03T09:15:00Z'),
status: 'EnInvestigación',
status: 'Cerrado',
risk_level: 'Medio',
// type code here for "images" field
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
},
{
event_type: 'ObservacióndeSeguridad',
description: 'Chemical spill in storage area',
event_date: new Date('2023-10-04T14:45:00Z'),
status: 'Cerrado',
risk_level: 'Bajo',
@ -176,6 +260,26 @@ const EventsData = [
// type code here for "relation_one" field
},
{
event_type: 'Incidente',
description: 'Loose electrical wiring found',
event_date: new Date('2023-10-05T16:20:00Z'),
status: 'Abierto',
risk_level: 'Alto',
// type code here for "images" field
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
},
];
const InspectionsData = [
@ -226,37 +330,59 @@ const InspectionsData = [
// type code here for "relation_one" field
},
{
// type code here for "relation_one" field
// type code here for "relation_one" field
completion_date: new Date('2023-10-09T14:00:00Z'),
// type code here for "relation_one" field
// type code here for "files" field
score: 100,
// type code here for "relation_one" field
},
{
// type code here for "relation_one" field
// type code here for "relation_one" field
completion_date: new Date('2023-10-10T15:00:00Z'),
// type code here for "relation_one" field
// type code here for "files" field
score: 100,
// type code here for "relation_one" field
},
];
const OrganizationsData = [
{
name: 'William Herschel',
logo_url: 'Paul Ehrlich',
primary_color: 'Comte de Buffon',
secondary_color: 'Antoine Laurent Lavoisier',
name: 'Hans Bethe',
},
{
name: 'Murray Gell-Mann',
logo_url: 'Frederick Sanger',
primary_color: 'Isaac Newton',
secondary_color: 'Francis Crick',
name: 'Frederick Gowland Hopkins',
},
{
name: 'William Bayliss',
name: 'George Gaylord Simpson',
},
logo_url: 'Isaac Newton',
{
name: 'Arthur Eddington',
},
primary_color: 'Francis Crick',
secondary_color: 'Anton van Leeuwenhoek',
{
name: 'John von Neumann',
},
];
@ -295,6 +421,28 @@ async function associateUserWithOrganization() {
if (User2?.setOrganization) {
await User2.setOrganization(relatedOrganization2);
}
const relatedOrganization3 = await Organizations.findOne({
offset: Math.floor(Math.random() * (await Organizations.count())),
});
const User3 = await Users.findOne({
order: [['id', 'ASC']],
offset: 3,
});
if (User3?.setOrganization) {
await User3.setOrganization(relatedOrganization3);
}
const relatedOrganization4 = await Organizations.findOne({
offset: Math.floor(Math.random() * (await Organizations.count())),
});
const User4 = await Users.findOne({
order: [['id', 'ASC']],
offset: 4,
});
if (User4?.setOrganization) {
await User4.setOrganization(relatedOrganization4);
}
}
async function associateActionWithEvent() {
@ -330,6 +478,28 @@ async function associateActionWithEvent() {
if (Action2?.setEvent) {
await Action2.setEvent(relatedEvent2);
}
const relatedEvent3 = await Events.findOne({
offset: Math.floor(Math.random() * (await Events.count())),
});
const Action3 = await Actions.findOne({
order: [['id', 'ASC']],
offset: 3,
});
if (Action3?.setEvent) {
await Action3.setEvent(relatedEvent3);
}
const relatedEvent4 = await Events.findOne({
offset: Math.floor(Math.random() * (await Events.count())),
});
const Action4 = await Actions.findOne({
order: [['id', 'ASC']],
offset: 4,
});
if (Action4?.setEvent) {
await Action4.setEvent(relatedEvent4);
}
}
async function associateActionWithAssigned_to() {
@ -365,6 +535,28 @@ async function associateActionWithAssigned_to() {
if (Action2?.setAssigned_to) {
await Action2.setAssigned_to(relatedAssigned_to2);
}
const relatedAssigned_to3 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const Action3 = await Actions.findOne({
order: [['id', 'ASC']],
offset: 3,
});
if (Action3?.setAssigned_to) {
await Action3.setAssigned_to(relatedAssigned_to3);
}
const relatedAssigned_to4 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const Action4 = await Actions.findOne({
order: [['id', 'ASC']],
offset: 4,
});
if (Action4?.setAssigned_to) {
await Action4.setAssigned_to(relatedAssigned_to4);
}
}
async function associateActionWithOrganization() {
@ -400,6 +592,28 @@ async function associateActionWithOrganization() {
if (Action2?.setOrganization) {
await Action2.setOrganization(relatedOrganization2);
}
const relatedOrganization3 = await Organizations.findOne({
offset: Math.floor(Math.random() * (await Organizations.count())),
});
const Action3 = await Actions.findOne({
order: [['id', 'ASC']],
offset: 3,
});
if (Action3?.setOrganization) {
await Action3.setOrganization(relatedOrganization3);
}
const relatedOrganization4 = await Organizations.findOne({
offset: Math.floor(Math.random() * (await Organizations.count())),
});
const Action4 = await Actions.findOne({
order: [['id', 'ASC']],
offset: 4,
});
if (Action4?.setOrganization) {
await Action4.setOrganization(relatedOrganization4);
}
}
async function associateBranchWithOrganization() {
@ -435,6 +649,28 @@ async function associateBranchWithOrganization() {
if (Branch2?.setOrganization) {
await Branch2.setOrganization(relatedOrganization2);
}
const relatedOrganization3 = await Organizations.findOne({
offset: Math.floor(Math.random() * (await Organizations.count())),
});
const Branch3 = await Branches.findOne({
order: [['id', 'ASC']],
offset: 3,
});
if (Branch3?.setOrganization) {
await Branch3.setOrganization(relatedOrganization3);
}
const relatedOrganization4 = await Organizations.findOne({
offset: Math.floor(Math.random() * (await Organizations.count())),
});
const Branch4 = await Branches.findOne({
order: [['id', 'ASC']],
offset: 4,
});
if (Branch4?.setOrganization) {
await Branch4.setOrganization(relatedOrganization4);
}
}
async function associateChecklistWithOrganization() {
@ -470,6 +706,28 @@ async function associateChecklistWithOrganization() {
if (Checklist2?.setOrganization) {
await Checklist2.setOrganization(relatedOrganization2);
}
const relatedOrganization3 = await Organizations.findOne({
offset: Math.floor(Math.random() * (await Organizations.count())),
});
const Checklist3 = await Checklists.findOne({
order: [['id', 'ASC']],
offset: 3,
});
if (Checklist3?.setOrganization) {
await Checklist3.setOrganization(relatedOrganization3);
}
const relatedOrganization4 = await Organizations.findOne({
offset: Math.floor(Math.random() * (await Organizations.count())),
});
const Checklist4 = await Checklists.findOne({
order: [['id', 'ASC']],
offset: 4,
});
if (Checklist4?.setOrganization) {
await Checklist4.setOrganization(relatedOrganization4);
}
}
async function associateEventWithReported_by() {
@ -505,6 +763,28 @@ async function associateEventWithReported_by() {
if (Event2?.setReported_by) {
await Event2.setReported_by(relatedReported_by2);
}
const relatedReported_by3 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const Event3 = await Events.findOne({
order: [['id', 'ASC']],
offset: 3,
});
if (Event3?.setReported_by) {
await Event3.setReported_by(relatedReported_by3);
}
const relatedReported_by4 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const Event4 = await Events.findOne({
order: [['id', 'ASC']],
offset: 4,
});
if (Event4?.setReported_by) {
await Event4.setReported_by(relatedReported_by4);
}
}
async function associateEventWithBranch() {
@ -540,6 +820,28 @@ async function associateEventWithBranch() {
if (Event2?.setBranch) {
await Event2.setBranch(relatedBranch2);
}
const relatedBranch3 = await Branches.findOne({
offset: Math.floor(Math.random() * (await Branches.count())),
});
const Event3 = await Events.findOne({
order: [['id', 'ASC']],
offset: 3,
});
if (Event3?.setBranch) {
await Event3.setBranch(relatedBranch3);
}
const relatedBranch4 = await Branches.findOne({
offset: Math.floor(Math.random() * (await Branches.count())),
});
const Event4 = await Events.findOne({
order: [['id', 'ASC']],
offset: 4,
});
if (Event4?.setBranch) {
await Event4.setBranch(relatedBranch4);
}
}
async function associateEventWithOrganization() {
@ -575,6 +877,28 @@ async function associateEventWithOrganization() {
if (Event2?.setOrganization) {
await Event2.setOrganization(relatedOrganization2);
}
const relatedOrganization3 = await Organizations.findOne({
offset: Math.floor(Math.random() * (await Organizations.count())),
});
const Event3 = await Events.findOne({
order: [['id', 'ASC']],
offset: 3,
});
if (Event3?.setOrganization) {
await Event3.setOrganization(relatedOrganization3);
}
const relatedOrganization4 = await Organizations.findOne({
offset: Math.floor(Math.random() * (await Organizations.count())),
});
const Event4 = await Events.findOne({
order: [['id', 'ASC']],
offset: 4,
});
if (Event4?.setOrganization) {
await Event4.setOrganization(relatedOrganization4);
}
}
async function associateInspectionWithChecklist() {
@ -610,6 +934,28 @@ async function associateInspectionWithChecklist() {
if (Inspection2?.setChecklist) {
await Inspection2.setChecklist(relatedChecklist2);
}
const relatedChecklist3 = await Checklists.findOne({
offset: Math.floor(Math.random() * (await Checklists.count())),
});
const Inspection3 = await Inspections.findOne({
order: [['id', 'ASC']],
offset: 3,
});
if (Inspection3?.setChecklist) {
await Inspection3.setChecklist(relatedChecklist3);
}
const relatedChecklist4 = await Checklists.findOne({
offset: Math.floor(Math.random() * (await Checklists.count())),
});
const Inspection4 = await Inspections.findOne({
order: [['id', 'ASC']],
offset: 4,
});
if (Inspection4?.setChecklist) {
await Inspection4.setChecklist(relatedChecklist4);
}
}
async function associateInspectionWithInspector() {
@ -645,6 +991,28 @@ async function associateInspectionWithInspector() {
if (Inspection2?.setInspector) {
await Inspection2.setInspector(relatedInspector2);
}
const relatedInspector3 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const Inspection3 = await Inspections.findOne({
order: [['id', 'ASC']],
offset: 3,
});
if (Inspection3?.setInspector) {
await Inspection3.setInspector(relatedInspector3);
}
const relatedInspector4 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const Inspection4 = await Inspections.findOne({
order: [['id', 'ASC']],
offset: 4,
});
if (Inspection4?.setInspector) {
await Inspection4.setInspector(relatedInspector4);
}
}
async function associateInspectionWithBranch() {
@ -680,6 +1048,28 @@ async function associateInspectionWithBranch() {
if (Inspection2?.setBranch) {
await Inspection2.setBranch(relatedBranch2);
}
const relatedBranch3 = await Branches.findOne({
offset: Math.floor(Math.random() * (await Branches.count())),
});
const Inspection3 = await Inspections.findOne({
order: [['id', 'ASC']],
offset: 3,
});
if (Inspection3?.setBranch) {
await Inspection3.setBranch(relatedBranch3);
}
const relatedBranch4 = await Branches.findOne({
offset: Math.floor(Math.random() * (await Branches.count())),
});
const Inspection4 = await Inspections.findOne({
order: [['id', 'ASC']],
offset: 4,
});
if (Inspection4?.setBranch) {
await Inspection4.setBranch(relatedBranch4);
}
}
async function associateInspectionWithOrganization() {
@ -715,6 +1105,28 @@ async function associateInspectionWithOrganization() {
if (Inspection2?.setOrganization) {
await Inspection2.setOrganization(relatedOrganization2);
}
const relatedOrganization3 = await Organizations.findOne({
offset: Math.floor(Math.random() * (await Organizations.count())),
});
const Inspection3 = await Inspections.findOne({
order: [['id', 'ASC']],
offset: 3,
});
if (Inspection3?.setOrganization) {
await Inspection3.setOrganization(relatedOrganization3);
}
const relatedOrganization4 = await Organizations.findOne({
offset: Math.floor(Math.random() * (await Organizations.count())),
});
const Inspection4 = await Inspections.findOne({
order: [['id', 'ASC']],
offset: 4,
});
if (Inspection4?.setOrganization) {
await Inspection4.setOrganization(relatedOrganization4);
}
}
module.exports = {

View File

@ -25,15 +25,6 @@ router.use(checkCrudPermissions('organizations'));
* name:
* type: string
* default: name
* logo_url:
* type: string
* default: logo_url
* primary_color:
* type: string
* default: primary_color
* secondary_color:
* type: string
* default: secondary_color
*/
@ -323,13 +314,7 @@ router.get(
currentUser,
});
if (filetype && filetype === 'csv') {
const fields = [
'id',
'name',
'logo_url',
'primary_color',
'secondary_color',
];
const fields = ['id', 'name'];
const opts = { fields };
try {
const csv = parse(payload.rows, opts);

View File

@ -51,7 +51,7 @@ module.exports = class SearchService {
events: ['description'],
organizations: ['name', 'logo_url', 'primary_color', 'secondary_color'],
organizations: ['name'],
};
const columnsInt = {
inspections: ['score'],

View File

@ -85,39 +85,6 @@ const CardOrganizations = ({
<div className='font-medium line-clamp-4'>{item.name}</div>
</dd>
</div>
<div className='flex justify-between gap-x-4 py-3'>
<dt className=' text-gray-500 dark:text-dark-600'>
Logo url
</dt>
<dd className='flex items-start gap-x-2'>
<div className='font-medium line-clamp-4'>
{item.logo_url}
</div>
</dd>
</div>
<div className='flex justify-between gap-x-4 py-3'>
<dt className=' text-gray-500 dark:text-dark-600'>
Primary color
</dt>
<dd className='flex items-start gap-x-2'>
<div className='font-medium line-clamp-4'>
{item.primary_color}
</div>
</dd>
</div>
<div className='flex justify-between gap-x-4 py-3'>
<dt className=' text-gray-500 dark:text-dark-600'>
Secondary color
</dt>
<dd className='flex items-start gap-x-2'>
<div className='font-medium line-clamp-4'>
{item.secondary_color}
</div>
</dd>
</div>
</dl>
</li>
))}

View File

@ -58,25 +58,6 @@ const ListOrganizations = ({
<p className={'text-xs text-gray-500 '}>Name</p>
<p className={'line-clamp-2'}>{item.name}</p>
</div>
<div className={'flex-1 px-3'}>
<p className={'text-xs text-gray-500 '}>Logo url</p>
<p className={'line-clamp-2'}>{item.logo_url}</p>
</div>
<div className={'flex-1 px-3'}>
<p className={'text-xs text-gray-500 '}>
Primary color
</p>
<p className={'line-clamp-2'}>{item.primary_color}</p>
</div>
<div className={'flex-1 px-3'}>
<p className={'text-xs text-gray-500 '}>
Secondary color
</p>
<p className={'line-clamp-2'}>{item.secondary_color}</p>
</div>
</Link>
<ListActionsPopover
onDelete={onDelete}

View File

@ -50,42 +50,6 @@ export const loadColumns = async (
editable: hasUpdatePermission,
},
{
field: 'logo_url',
headerName: 'Logo url',
flex: 1,
minWidth: 120,
filterable: false,
headerClassName: 'datagrid--header',
cellClassName: 'datagrid--cell',
editable: hasUpdatePermission,
},
{
field: 'primary_color',
headerName: 'Primary color',
flex: 1,
minWidth: 120,
filterable: false,
headerClassName: 'datagrid--header',
cellClassName: 'datagrid--cell',
editable: hasUpdatePermission,
},
{
field: 'secondary_color',
headerName: 'Secondary color',
flex: 1,
minWidth: 120,
filterable: false,
headerClassName: 'datagrid--header',
cellClassName: 'datagrid--cell',
editable: hasUpdatePermission,
},
{
field: 'actions',
type: 'actions',

View File

@ -17,7 +17,7 @@ export default function WebSiteFooter({ projectName }: WebSiteFooterProps) {
const borders = useAppSelector((state) => state.style.borders);
const websiteHeder = useAppSelector((state) => state.style.websiteHeder);
const style = FooterStyle.WITH_PAGES;
const style = FooterStyle.WITH_PROJECT_NAME;
const design = FooterDesigns.DESIGN_DIVERSITY;

View File

@ -19,7 +19,7 @@ export default function WebSiteHeader({ projectName }: WebSiteHeaderProps) {
const style = HeaderStyle.PAGES_RIGHT;
const design = HeaderDesigns.DEFAULT_DESIGN;
const design = HeaderDesigns.DESIGN_DIVERSITY;
return (
<header id='websiteHeader' className='overflow-hidden'>
<div

View File

@ -93,7 +93,7 @@ const menuAside: MenuAsideItem[] = [
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
icon: icon.mdiTable ?? icon.mdiTable,
permissions: 'CREATE_ORGANIZATIONS',
permissions: 'READ_ORGANIZATIONS',
},
{
href: '/profile',

View File

@ -93,7 +93,7 @@ export default function WebSite() {
<FeaturesSection
projectName={'PREVCON'}
image={['Dashboard displaying safety metrics']}
withBg={1}
withBg={0}
features={features_points}
mainText={`Discover ${projectName} Key Features`}
subTitle={`Explore how ${projectName} enhances safety and efficiency with cutting-edge tools and insights.`}

View File

@ -47,9 +47,9 @@ export default function Login() {
notify: notifyState,
} = useAppSelector((state) => state.auth);
const [initialValues, setInitialValues] = React.useState({
email: '',
password: '',
remember: false,
email: 'super_admin@flatlogic.com',
password: 'd4b3e79a',
remember: true,
});
const title = 'PREVCON';
@ -204,6 +204,51 @@ export default function Login() {
</Link>
<div className='flex flex-row text-gray-500 justify-between'>
<div>
<p className='mb-2'>
Use{' '}
<code
className={`cursor-pointer ${textColor} `}
data-password='d4b3e79a'
onClick={(e) => setLogin(e.target)}
>
super_admin@flatlogic.com
</code>
{' / '}
<code className={`${textColor}`}>d4b3e79a</code>
{' / '}
to login as Super Admin
</p>
<p className='mb-2'>
Use{' '}
<code
className={`cursor-pointer ${textColor} `}
data-password='d4b3e79a'
onClick={(e) => setLogin(e.target)}
>
admin@flatlogic.com
</code>
{' / '}
<code className={`${textColor}`}>d4b3e79a</code>
{' / '}
to login as Admin
</p>
<p>
Use{' '}
<code
className={`cursor-pointer ${textColor} `}
data-password='76630ed12cc4'
onClick={(e) => setLogin(e.target)}
>
client@hello.com
</code>
{' / '}
<code className={`${textColor}`}>76630ed12cc4</code>
{' / '}
to login as User
</p>
</div>
<div>
<BaseIcon
className={`${iconsColor}`}

View File

@ -39,12 +39,6 @@ const EditOrganizations = () => {
const dispatch = useAppDispatch();
const initVals = {
name: '',
logo_url: '',
primary_color: '',
secondary_color: '',
};
const [initialValues, setInitialValues] = useState(initVals);
@ -105,18 +99,6 @@ const EditOrganizations = () => {
<Field name='name' placeholder='Name' />
</FormField>
<FormField label='Logo url'>
<Field name='logo_url' placeholder='Logo url' />
</FormField>
<FormField label='Primary color'>
<Field name='primary_color' placeholder='Primary color' />
</FormField>
<FormField label='Secondary color'>
<Field name='secondary_color' placeholder='Secondary color' />
</FormField>
<BaseDivider />
<BaseButtons>
<BaseButton type='submit' color='info' label='Submit' />

View File

@ -39,12 +39,6 @@ const EditOrganizationsPage = () => {
const dispatch = useAppDispatch();
const initVals = {
name: '',
logo_url: '',
primary_color: '',
secondary_color: '',
};
const [initialValues, setInitialValues] = useState(initVals);
@ -103,18 +97,6 @@ const EditOrganizationsPage = () => {
<Field name='name' placeholder='Name' />
</FormField>
<FormField label='Logo url'>
<Field name='logo_url' placeholder='Logo url' />
</FormField>
<FormField label='Primary color'>
<Field name='primary_color' placeholder='Primary color' />
</FormField>
<FormField label='Secondary color'>
<Field name='secondary_color' placeholder='Secondary color' />
</FormField>
<BaseDivider />
<BaseButtons>
<BaseButton type='submit' color='info' label='Submit' />

View File

@ -31,12 +31,7 @@ const OrganizationsTablesPage = () => {
const dispatch = useAppDispatch();
const [filters] = useState([
{ label: 'Name', title: 'name' },
{ label: 'Logo url', title: 'logo_url' },
{ label: 'Primary color', title: 'primary_color' },
{ label: 'Secondary color', title: 'secondary_color' },
]);
const [filters] = useState([{ label: 'Name', title: 'name' }]);
const hasCreatePermission =
currentUser && hasPermission(currentUser, 'CREATE_ORGANIZATIONS');

View File

@ -34,12 +34,6 @@ import moment from 'moment';
const initialValues = {
name: '',
logo_url: '',
primary_color: '',
secondary_color: '',
};
const OrganizationsNew = () => {
@ -73,18 +67,6 @@ const OrganizationsNew = () => {
<Field name='name' placeholder='Name' />
</FormField>
<FormField label='Logo url'>
<Field name='logo_url' placeholder='Logo url' />
</FormField>
<FormField label='Primary color'>
<Field name='primary_color' placeholder='Primary color' />
</FormField>
<FormField label='Secondary color'>
<Field name='secondary_color' placeholder='Secondary color' />
</FormField>
<BaseDivider />
<BaseButtons>
<BaseButton type='submit' color='info' label='Submit' />

View File

@ -31,12 +31,7 @@ const OrganizationsTablesPage = () => {
const dispatch = useAppDispatch();
const [filters] = useState([
{ label: 'Name', title: 'name' },
{ label: 'Logo url', title: 'logo_url' },
{ label: 'Primary color', title: 'primary_color' },
{ label: 'Secondary color', title: 'secondary_color' },
]);
const [filters] = useState([{ label: 'Name', title: 'name' }]);
const hasCreatePermission =
currentUser && hasPermission(currentUser, 'CREATE_ORGANIZATIONS');

View File

@ -63,21 +63,6 @@ const OrganizationsView = () => {
<p>{organizations?.name}</p>
</div>
<div className={'mb-4'}>
<p className={'block font-bold mb-2'}>Logo url</p>
<p>{organizations?.logo_url}</p>
</div>
<div className={'mb-4'}>
<p className={'block font-bold mb-2'}>Primary color</p>
<p>{organizations?.primary_color}</p>
</div>
<div className={'mb-4'}>
<p className={'block font-bold mb-2'}>Secondary color</p>
<p>{organizations?.secondary_color}</p>
</div>
<>
<p className={'block font-bold mb-2'}>Users Organizations</p>
<CardBox

View File

@ -77,7 +77,7 @@ export default function WebSite() {
<FeaturesSection
projectName={'PREVCON'}
image={['Dashboard displaying safety metrics']}
withBg={0}
withBg={1}
features={features_points}
mainText={`Discover ${projectName} Key Features`}
subTitle={`Explore how ${projectName} enhances safety and efficiency with cutting-edge tools and insights.`}