vypnute drag&drop pre mobilne zaradenia,
pridane AGENTS.md
This commit is contained in:
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
/backend/vendor
|
||||
/build
|
||||
/dist
|
||||
27
AGENTS.md
Normal file
27
AGENTS.md
Normal file
@ -0,0 +1,27 @@
|
||||
# Repository Guidelines
|
||||
|
||||
## Project Structure & Module Organization
|
||||
|
||||
The application has a PHP/SQLite backend and a Vue 3 frontend. Backend code lives in `backend/src/`; database models are under `backend/src/Models/`, configuration is in `backend/config/`, and `backend/public/API.php` is the HTTP entry point. Frontend pages, reusable components, and shared assets live in `frontend/src/views/`, `frontend/src/components/`, and `frontend/src/assets/`. Static files belong in `frontend/public/`. Development documentation is kept in `doc/`. Runtime SQLite databases and uploaded files are under `data/`; treat them as application state, not fixtures.
|
||||
|
||||
## Build, Test, and Development Commands
|
||||
|
||||
- `cd backend && composer install` installs PHP dependencies and configures PSR-4 autoloading.
|
||||
- `cd frontend && npm ci` installs the locked frontend dependency set.
|
||||
- `cd frontend && npm run dev` starts the Vite development server.
|
||||
- `dev.bat` starts PHP's local server at `http://localhost:8080` from the repository root.
|
||||
- `cd frontend && npm run build` creates the production frontend and generated `.htaccess`.
|
||||
- `build.bat` builds both layers, recreates `dist/`, and packages a versioned ZIP in `build/` on Windows.
|
||||
- `php backend/tests/testDB.php 1` runs one numbered backend smoke check.
|
||||
|
||||
## Coding Style & Naming Conventions
|
||||
|
||||
Follow the surrounding code: use tabs for indentation in PHP, JavaScript, and Vue files; use double quotes in JavaScript and trailing commas in multiline structures. Name Vue components and PHP classes in PascalCase (`ReportBox.vue`, `Attachments.php`), JavaScript functions in camelCase, and database fields in snake_case (`report_status`). Keep PHP classes in the `TPsoft\BugreportBackend` namespace and paths aligned with Composer PSR-4 autoloading. No formatter or linter is configured, so keep diffs focused and match local style.
|
||||
|
||||
## Testing Guidelines
|
||||
|
||||
The repository currently uses a numbered PHP smoke-test script rather than a test framework or coverage gate. Run relevant cases from `backend/tests/testDB.php` and exercise changed UI flows with the Vite server. Cases 6-8 update, insert, or delete database records; use a disposable copy of `data/database.db`. For new automated tests, place backend tests in `backend/tests/` and use descriptive `*Test.php` names.
|
||||
|
||||
## Commit & Pull Request Guidelines
|
||||
|
||||
Recent commits use short, lowercase Slovak or English summaries such as `pridany build skript` and `fixed sanitizeFilename`. Keep each commit scoped to one change and use an imperative, concrete subject; use `release X.Y.Z` only for releases. Pull requests should explain behavior and verification, link the relevant issue, call out database or configuration changes, and include screenshots for visible UI changes. Do not commit secrets, local credentials, generated `frontend/dist/`, or production database contents.
|
||||
@ -7,6 +7,7 @@
|
||||
<draggable
|
||||
v-model="itemsUncategorized"
|
||||
item-key="report_id"
|
||||
:disabled="isDragDisabled"
|
||||
:group="{ name: 'itemsUncategorized', pull: true, put: true }"
|
||||
@change="onDragChange"
|
||||
@start="onDragStart"
|
||||
@ -36,6 +37,7 @@
|
||||
<draggable
|
||||
v-model="itemsWaiting"
|
||||
item-key="report_id"
|
||||
:disabled="isDragDisabled"
|
||||
:group="{ name: 'itemsWaiting', pull: true, put: true }"
|
||||
@change="onDragChange"
|
||||
@start="onDragStart"
|
||||
@ -65,6 +67,7 @@
|
||||
<draggable
|
||||
v-model="itemsInProgress"
|
||||
item-key="report_id"
|
||||
:disabled="isDragDisabled"
|
||||
:group="{ name: 'itemsInProgress', pull: true, put: true }"
|
||||
@change="onDragChange"
|
||||
@start="onDragStart"
|
||||
@ -94,6 +97,7 @@
|
||||
<draggable
|
||||
v-model="itemsBlocked"
|
||||
item-key="report_id"
|
||||
:disabled="isDragDisabled"
|
||||
:group="{ name: 'itemsBlocked', pull: true, put: true }"
|
||||
@change="onDragChange"
|
||||
@start="onDragStart"
|
||||
@ -152,6 +156,8 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
isDragDisabled: false,
|
||||
dragMediaQuery: null,
|
||||
itemsUncategorized: [],
|
||||
itemsWaiting: [],
|
||||
itemsInProgress: [],
|
||||
@ -159,6 +165,9 @@ export default {
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
updateDragState(event) {
|
||||
this.isDragDisabled = event.matches;
|
||||
},
|
||||
loadData(use_loader = true) {
|
||||
if (use_loader) this.loading = true;
|
||||
backend.getAllGrouped(Array(0, 1, 2, 3)).then((response) => {
|
||||
@ -232,6 +241,9 @@ export default {
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.dragMediaQuery = window.matchMedia("(max-width: 768px), (any-pointer: coarse)");
|
||||
this.updateDragState(this.dragMediaQuery);
|
||||
this.dragMediaQuery.addEventListener("change", this.updateDragState);
|
||||
this.loadData();
|
||||
events.on("reports-changed", () => {
|
||||
console.log("Dashoboard reports-changed");
|
||||
@ -239,6 +251,7 @@ export default {
|
||||
});
|
||||
},
|
||||
unmounted() {
|
||||
this.dragMediaQuery.removeEventListener("change", this.updateDragState);
|
||||
events.off("reports-changed");
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user