From 3c36fdd9a19b78c1b894df8668b99e7f69128d0e Mon Sep 17 00:00:00 2001 From: olli Date: Wed, 12 Nov 2025 16:14:18 +0100 Subject: [PATCH] feat: Add Document and GitRepository entities with repositories and services - Created Document entity with properties for file management, including filename, originalFilename, mimeType, size, uploadedAt, uploadedBy, relatedEntity, relatedEntityId, and description. - Implemented DocumentRepository for querying documents by related entity and user. - Added GitRepository entity with properties for managing Git repositories, including URL, localPath, branch, provider, accessToken, project, lastSync, name, description, createdAt, and updatedAt. - Implemented GitRepositoryRepository for querying repositories by project. - Developed GitHubService for interacting with GitHub API, including methods for fetching commits, contributions, branches, and repository info. - Developed GitService for local Git repository interactions, including methods for fetching commits, contributions, branches, and repository info. - Developed GiteaService for interacting with Gitea API, including methods for fetching commits, contributions, branches, repository info, and testing connection. --- .env | 12 +- assets/app.js | 6 + assets/images/logo.svg | 4 + assets/images/osdata.svg | 1 + assets/images/osdata_clear.svg | 50 ++ assets/js/components/DocumentUpload.vue | 379 +++++++++ assets/js/components/GitCommitList.vue | 142 ++++ assets/js/components/GitContributionChart.vue | 291 +++++++ assets/js/layout/AppFooter.vue | 6 + assets/js/views/ProjectManagement.vue | 786 ++++++++++++++++-- config/services.yaml | 10 + docs/GIT_INTEGRATION.md | 228 +++++ migrations/Version20251111153432.php | 33 + migrations/Version20251112141740.php | 33 + migrations/Version20251112142215.php | 33 + package-lock.json | 19 + package.json | 1 + public/.htaccess | 19 + src/Controller/DocumentController.php | 159 ++++ src/Controller/GitRepositoryController.php | 409 +++++++++ src/Controller/PermissionController.php | 2 +- src/Entity/Document.php | 196 +++++ src/Entity/GitRepository.php | 229 +++++ src/Entity/Project.php | 37 + src/Entity/User.php | 6 +- src/EventListener/MailerLoggerListener.php | 4 +- src/Repository/DocumentRepository.php | 46 + src/Repository/GitRepositoryRepository.php | 31 + src/Service/GitHubService.php | 190 +++++ src/Service/GitService.php | 227 +++++ src/Service/GiteaService.php | 246 ++++++ webpack.config.js | 7 + 32 files changed, 3745 insertions(+), 97 deletions(-) create mode 100644 assets/images/logo.svg create mode 100644 assets/images/osdata.svg create mode 100644 assets/images/osdata_clear.svg create mode 100644 assets/js/components/DocumentUpload.vue create mode 100644 assets/js/components/GitCommitList.vue create mode 100644 assets/js/components/GitContributionChart.vue create mode 100644 docs/GIT_INTEGRATION.md create mode 100644 migrations/Version20251111153432.php create mode 100644 migrations/Version20251112141740.php create mode 100644 migrations/Version20251112142215.php create mode 100644 public/.htaccess create mode 100644 src/Controller/DocumentController.php create mode 100644 src/Controller/GitRepositoryController.php create mode 100644 src/Entity/Document.php create mode 100644 src/Entity/GitRepository.php create mode 100644 src/Repository/DocumentRepository.php create mode 100644 src/Repository/GitRepositoryRepository.php create mode 100644 src/Service/GitHubService.php create mode 100644 src/Service/GitService.php create mode 100644 src/Service/GiteaService.php diff --git a/.env b/.env index 96449f3..0c07879 100644 --- a/.env +++ b/.env @@ -17,13 +17,13 @@ ###> symfony/framework-bundle ### APP_ENV=dev APP_SECRET=83df005f029c92c8e01026218f588371 -APP_URL=http://localhost:8000 +APP_URL=https://mycrm.test ###< symfony/framework-bundle ### ###> symfony/routing ### # Configure how to generate URLs in non-HTTP contexts, such as CLI commands. # See https://symfony.com/doc/current/routing.html#generating-urls-in-commands -DEFAULT_URI=http://localhost +DEFAULT_URI=https://mycrm.test ###< symfony/routing ### ###> doctrine/doctrine-bundle ### @@ -58,8 +58,8 @@ CORS_ALLOW_ORIGIN='^https?://(localhost|127\.0\.0\.1)(:[0-9]+)?$' ###> knpuniversity/oauth2-client-bundle ### # Pocket-ID OIDC Configuration # Get your credentials from your Pocket-ID instance -OAUTH_POCKET_ID_URL=https://your-pocket-id-instance.com -OAUTH_POCKET_ID_CLIENT_ID=your-client-id -OAUTH_POCKET_ID_CLIENT_SECRET=your-client-secret -OAUTH_POCKET_ID_REDIRECT_URI=http://localhost:8000/connect/pocketid/check +OAUTH_POCKET_ID_URL=https://id.osdata-home.de +OAUTH_POCKET_ID_CLIENT_ID=2e698201-8a79-4598-9b7d-81b57289c340 +OAUTH_POCKET_ID_CLIENT_SECRET= +OAUTH_POCKET_ID_REDIRECT_URI=https://mycrm.test/dashboard ###< knpuniversity/oauth2-client-bundle ### diff --git a/assets/app.js b/assets/app.js index 5073754..da9fa7b 100644 --- a/assets/app.js +++ b/assets/app.js @@ -23,6 +23,9 @@ import router from './js/router'; import App from './js/App.vue'; import { useAuthStore } from './js/stores/auth'; +// Global Components +import DocumentUpload from './js/components/DocumentUpload.vue'; + // PrimeVue Components (lazy import as needed in components) import 'primeicons/primeicons.css'; @@ -169,6 +172,9 @@ app.directive('tooltip', Tooltip); app.directive('styleclass', StyleClass); app.component('Toast', Toast); +// Register global components +app.component('DocumentUpload', DocumentUpload); + app.mount('#app'); // Apply saved theme colors after mount diff --git a/assets/images/logo.svg b/assets/images/logo.svg new file mode 100644 index 0000000..311c435 --- /dev/null +++ b/assets/images/logo.svg @@ -0,0 +1,4 @@ + + + myCRM + diff --git a/assets/images/osdata.svg b/assets/images/osdata.svg new file mode 100644 index 0000000..e8516ec --- /dev/null +++ b/assets/images/osdata.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/images/osdata_clear.svg b/assets/images/osdata_clear.svg new file mode 100644 index 0000000..aae9d19 --- /dev/null +++ b/assets/images/osdata_clear.svg @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/js/components/DocumentUpload.vue b/assets/js/components/DocumentUpload.vue new file mode 100644 index 0000000..2f32c22 --- /dev/null +++ b/assets/js/components/DocumentUpload.vue @@ -0,0 +1,379 @@ +