- Created ROADMAP.md outlining current features, critical missing features, implementation phases, and technology recommendations. - Added immediate next steps for development focus. fix: Enhance test data creation scripts for diverse project scenarios - Implemented create-diverse-test-data.js to generate varied test projects with different statuses and locations. - Updated create-additional-test-data.js for better project creation consistency. refactor: Improve project view page with additional navigation and map features - Added link to view all projects on the map from the project view page. - Enhanced project location display with status indicators. feat: Implement project map page with status filtering - Added status filters for project markers on the map. - Integrated color-coded markers based on project status. fix: Update LeafletMap and ProjectMap components for better marker handling - Created colored marker icons for different project statuses. - Enhanced ProjectMap to display project status and coordinates more effectively. test: Add mobile view test HTML for responsive map testing - Created test-mobile.html to test the map's responsive behavior on mobile devices.
89 lines
2.1 KiB
JavaScript
89 lines
2.1 KiB
JavaScript
import db from "../src/lib/db.js";
|
|
|
|
// Create projects with different statuses and locations around Poland
|
|
const testProjects = [
|
|
{
|
|
name: "Gdansk Port Project",
|
|
address: "Port of Gdansk, Gdansk",
|
|
city: "Gdansk",
|
|
coordinates: "54.3520,18.6466",
|
|
status: "registered",
|
|
type: "design",
|
|
},
|
|
{
|
|
name: "Wroclaw Shopping Center",
|
|
address: "Market Square, Wroclaw",
|
|
city: "Wroclaw",
|
|
coordinates: "51.1079,17.0385",
|
|
status: "in_progress_design",
|
|
type: "design+construction",
|
|
},
|
|
{
|
|
name: "Poznan Office Complex",
|
|
address: "Old Town, Poznan",
|
|
city: "Poznan",
|
|
coordinates: "52.4064,16.9252",
|
|
status: "in_progress_construction",
|
|
type: "construction",
|
|
},
|
|
{
|
|
name: "Lodz Residential Development",
|
|
address: "City Center, Lodz",
|
|
city: "Lodz",
|
|
coordinates: "51.7592,19.4600",
|
|
status: "fulfilled",
|
|
type: "design+construction",
|
|
},
|
|
{
|
|
name: "Katowice Industrial Park",
|
|
address: "Silesia Region, Katowice",
|
|
city: "Katowice",
|
|
coordinates: "50.2649,19.0238",
|
|
status: "in_progress_design",
|
|
type: "design",
|
|
},
|
|
{
|
|
name: "Lublin University Campus",
|
|
address: "University District, Lublin",
|
|
city: "Lublin",
|
|
coordinates: "51.2465,22.5684",
|
|
status: "fulfilled",
|
|
type: "construction",
|
|
},
|
|
];
|
|
|
|
let projectCounter = 3; // Starting from 3 since we already have projects 1 and 2
|
|
|
|
testProjects.forEach((project) => {
|
|
try {
|
|
const result = db
|
|
.prepare(
|
|
`
|
|
INSERT INTO projects (
|
|
contract_id, project_name, project_number, address, city, coordinates,
|
|
project_type, project_status
|
|
) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
`
|
|
)
|
|
.run(
|
|
2, // Use the test contract
|
|
project.name,
|
|
`${projectCounter}/TEST/2025`,
|
|
project.address,
|
|
project.city,
|
|
project.coordinates,
|
|
project.type,
|
|
project.status
|
|
);
|
|
|
|
console.log(
|
|
`Created project: ${project.name} (ID: ${result.lastInsertRowid}) - Status: ${project.status}`
|
|
);
|
|
projectCounter++;
|
|
} catch (error) {
|
|
console.error(`Error creating project ${project.name}:`, error.message);
|
|
}
|
|
});
|
|
|
|
console.log("Diverse test projects created successfully!");
|