Commit Graph

32 Commits

Author SHA1 Message Date
b3d039bbe3 docs: Add admin bar to release notes v1.9.0
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 20:23:09 +01:00
118c604579 docs: Add AI user creation to release notes v1.9.0
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 20:02:53 +01:00
809e573ff7 feat: AI-assisted user creation with Gemini integration
- Add POST /api/admin/users/ai-parse endpoint for text/image parsing
- Add POST /api/admin/users/bulk-create for batch user creation
- Add "Dodaj z AI" button with purple gradient in admin users panel
- Add 3-step modal flow (Input → Review → Results)
- Support text paste from any source (email, Excel, CRM, Slack)
- Support screenshot upload and clipboard paste (Ctrl+V / Cmd+V)
- AI extracts emails, names, matches companies, detects admin roles
- Display generated passwords with copy functionality

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 20:01:30 +01:00
69460b05fe docs: Aktualizacja release notes v1.9.0
- Dodawanie użytkowników w panelu admina
- Wyświetlanie przypisanych firm
- Poprawki nazw użytkowników

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 19:04:13 +01:00
c1d033a9e2 feat: Panel użytkowników - dodawanie użytkowników i wyświetlanie firm
- Dodano endpoint POST /admin/users/add z generowaniem hasła
- Naprawiono wyświetlanie przypisanych firm (relationship Company)
- Dodano przycisk "Dodaj użytkownika" z modalem
- Naprawiono obcinanie nazw użytkowników w tabeli
- UI: modal z formularzem, wyświetlanie wygenerowanego hasła

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 18:31:50 +01:00
7455151c02 feat: Add admin user management panel with improved UI
- Add /admin/users panel for managing users (toggle admin, toggle verified, assign company, reset password, delete)
- Add link to admin menu in base.html
- Replace native confirm()/alert() with styled modals and toast notifications
- Add confirmation modal for password reset with warning icon
- Add styled reset URL modal with copy functionality
- Add danger-styled confirmation modal for user deletion

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 17:27:23 +01:00
5af216c5e0 security: Fix critical vulnerabilities from security audit
- Remove sensitive tokens from logs (show only 8-char preview)
- Enforce SECRET_KEY minimum 32 characters (no default value)
- Reduce login rate limit from 100/hour to 5/hour
- Remove exposed PageSpeed API key from CLAUDE.md

BREAKING: Application requires SECRET_KEY >= 32 chars in .env

Author: Maciej Pienczyn z wykorzystaniem AI i Claude Opus
2026-01-09 15:50:40 +01:00
39a91b709a feat: Add release notes page with version history
- Add /release-notes route with changelog from v1.0.0 to v1.9.0
- Document all major features added since platform launch

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 14:32:33 +01:00
41f7b1d01f feat: Add GBP Audit and Social Audit admin dashboards
- Add /admin/gbp-audit panel with completeness stats, field coverage, company table
- Add /admin/social-audit panel with platform coverage, top followers, company table
- Update admin menu with new dashboard links

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 14:14:56 +01:00
c65f1605b1 fix: IT Audit fixes and improvements
- Add api_it_audit_export endpoint for CSV export
- Fix url_for references (company_detail -> company_detail_by_slug)
- Fix form action (save_it_audit -> it_audit_save)
- Add "Audyt IT" button to company profile contact bar

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 13:19:53 +01:00
b405fdd810 auto-claude: subtask-7-3 - Handle edge cases for IT audit
Edge cases handled:
1. Partial submission:
   - Added is_partial flag to save response
   - Dynamic success message based on completeness score
   - Completeness threshold messages (< 30%, 30-70%, > 70%)

2. Company without audit:
   - Fixed template to show "Brak audytu" for companies without audit
   - Added "Utwórz audyt" button (+ icon) for companies without audit
   - Fixed data structure mismatch between route and template

3. Multiple audit history:
   - Added get_company_audit_history() convenience function
   - Added has_company_audit() helper function
   - Added /api/it-audit/history/<company_id> API endpoint
   - Returns history_count in save response

Other fixes:
- Fixed stats variable naming in admin_it_audit route
- Fixed collaboration_matches data structure for template
- Fixed url_for to use slug instead of company_id
- Fixed match_type filter (shared_licensing not shared_m365_licensing)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 09:30:50 +01:00
6a38f31ebb auto-claude: subtask-6-5 - Add /audit/it/<slug> route for user-facing IT audi
Add user-facing IT audit dashboard route following the pattern of existing
SEO and GBP audit dashboards:
- Route: /audit/it/<slug>
- Access control: admin can view any company, members only their own
- Returns latest IT audit data with scores, technology flags, and recommendations
- Renders it_audit.html template

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 09:15:47 +01:00
36272307fb auto-claude: subtask-6-4 - Add /api/it-audit/matches/<company_id> endpoint fo
Add API endpoint for getting IT audit collaboration matches for a company.
- Admin-only access (matches are not visible to regular users per spec)
- Returns all matches where company is either party A or B
- Includes partner company info, match type/score/reason, status
- Follows existing API patterns (login_required, try/finally, jsonify)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 09:12:59 +01:00
b6a3411e43 auto-claude: subtask-6-3 - Add /it-audit/save POST route for saving form data
Implemented POST endpoint at /it-audit/save that:
- Accepts JSON or form data with IT audit fields
- Validates company access (admin for any, users for their own)
- Parses boolean, array, and string fields with proper type handling
- Uses ITAuditService to save audit with scoring calculation
- Returns JSON with audit scores and redirect URL
- Includes rate limiting (30 per hour)
- Handles errors with rollback and logging

Added helper function _parse_it_audit_form_data() to properly parse:
- Boolean fields (checkboxes)
- Array fields (multi-select)
- String fields
- JSON fields (zabbix_integration)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 09:11:24 +01:00
10ae221c26 auto-claude: subtask-6-2 - Add /it-audit/form GET route for displaying the form
Add Flask route for IT audit form display:
- GET /it-audit/form with optional company_id query parameter
- Access control: admin can access any company, users only their own
- Defaults to current user's company if no company_id provided
- Pre-fills form with existing audit data if available
- Renders it_audit_form.html template

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 09:09:00 +01:00
7370ce78fa auto-claude: subtask-6-1 - Add /admin/it-audit route for admin dashboard
Implemented the IT audit admin dashboard route at /admin/it-audit that:
- Checks for admin authentication (is_admin flag)
- Queries all active companies with their latest IT audit data
- Calculates statistics (audit count, avg scores, maturity distribution)
- Provides technology adoption stats (Azure AD, M365, PBS, Zabbix, EDR, DR)
- Queries collaboration flags from IT audits
- Retrieves and organizes collaboration matches by type
- Renders admin/it_audit_dashboard.html template

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 09:07:07 +01:00
deed279521 fix(social-audit): Use SocialMediaAuditor for comprehensive audit
- Import and use SocialMediaAuditor from scripts/social_media_audit.py
- Audit now scans website HTML for social media links
- Discovers profiles via Brave Search API (if configured)
- Fetches Google Business Profile data via Google Places API
- Saves discovered profiles to database

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 05:12:25 +01:00
cadf91b481 feat(social-audit): Add ability to run Social Media audit
- Add "Uruchom audyt" button to social_audit.html
- Create POST /api/social/audit endpoint to verify profile URLs
- Add loading overlay and modal for audit progress/results
- Audit verifies each social media URL and updates check_status

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 05:07:58 +01:00
505800381e feat(social-audit): Add Social Media audit dashboard
- Create /audit/social/<slug> route with platform presence analysis
- Create social_audit.html template with 6 platforms (FB, IG, LinkedIn, YT, X, TikTok)
- Add purple "Audyt Social" button on company profile next to GBP and SEO audits
- Show score based on platforms count, profile details and recommendations

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 05:03:57 +01:00
c7b57100ad fix(seo-audit): Use correct attribute website_url instead of url
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 04:54:51 +01:00
3da1501872 feat(seo-audit): Add dedicated SEO audit page for individual companies
- Create /audit/seo/<slug> route with access control (admin or company owner)
- Create seo_audit.html template with score visualization
- Add green "Audyt SEO" button next to GBP audit button on company profile
- Match styling and UX patterns from GBP audit feature

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 04:53:21 +01:00
6758e208d4 GBP Audit: fetch Google data + detailed progress overlay
- Add fetch_google_business_data() to fetch fresh data from Google Places API
- Progress overlay shows all 10 data fields with actual values:
  * Place search, Rating, Reviews, Photos, Hours, Phone, Website, Status
- 5-second delay after completion for user to read results
- Fix opening hours display (show formatted weekday_text)
- Fix reviews scoring (integer-based: 3 base + 1/review + 1 bonus)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 04:19:44 +01:00
8fa23bc77e auto-claude: subtask-3-3 - Add GBP audit route accessible to logged-in users
Add user-facing GBP audit dashboard route at /audit/gbp/<company_slug>:
- Requires login (@login_required)
- Admin users can view audit for any company
- Regular users can only view audit for their own company
- Passes can_audit flag to template for run audit button visibility
- Gracefully handles missing audit data (template shows "no audit" state)
- Logs audit dashboard views for monitoring

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 19:17:32 +01:00
a892626ebc auto-claude: subtask-3-1 - Create API endpoint for running GBP audit on a company
Added GBP (Google Business Profile) audit API endpoints:
- GET /api/gbp/audit/health - Health check for GBP audit service
- GET /api/gbp/audit - Fetch latest audit results by company_id or slug
- GET /api/gbp/audit/<slug> - Fetch audit results by slug path
- POST /api/gbp/audit - Run GBP audit for a company

Features:
- Health endpoint returns service status and version
- GET endpoints return completeness score, field status, and recommendations
- POST endpoint runs audit and saves results (configurable)
- Access control: members can audit own company, admins can audit any
- Rate limited to 20 requests per hour

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 19:11:26 +01:00
8705a5b015 Fix: Admin SEO dashboard - use Category.name instead of relationship
Problem: /admin/seo zwracał błąd 500 z AttributeError: category
Przyczyna: Company.category jest relacją SQLAlchemy (obiektem), nie stringiem.
Rozwiązanie: Użycie Category.name.label('category_name') z właściwym JOIN.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 14:00:56 +01:00
d5e6365d1e auto-claude: Merge auto-claude/005-badanie-jakosci-seo-stron-intrentowych-kazdego-z-c 2026-01-08 12:36:09 +01:00
6e4e7c2240 Sync: Current production state
- Added CompanyRecommendation system
- Made company pages public (removed @login_required)
- CSS refactor: inline styles instead of external fluent CSS
- Added release notes page
- Added admin recommendations panel
- Company logos (webp format)
- Docker compose configuration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 12:26:22 +01:00
44f009f027 auto-claude: 6.2 - Add admin route to app.py that renders SEO dashboard
Added /admin/seo route with:
- Admin-only access with @login_required and is_admin check
- Fetches all active companies with SEO analysis data using outerjoin
- Calculates statistics: good_count (90-100), medium_count (50-89),
  poor_count (0-49), not_audited_count, avg_score
- Gets unique categories for filter dropdown
- Passes companies, stats, categories, and now to template
- Uses CompanyRow class for Jinja2 attribute access

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 08:14:43 +01:00
53cd95873e auto-claude: 5.2 - Add POST /api/seo/audit endpoint (admin-only)
Added POST /api/seo/audit endpoint to trigger SEO audits for companies:
- Admin-only access with current_user.is_admin check
- Rate limited to 10 requests per hour per user
- Accepts company_id or slug in JSON body
- Runs full SEO audit (PageSpeed, on-page, technical)
- Saves results to database and returns audit data
- Comprehensive error handling and logging
- Uses existing _build_seo_audit_response helper for response format

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 08:07:00 +01:00
db28aa6419 auto-claude: 5.1 - Add GET /api/seo/audit endpoint for SEO results
Added two API endpoints for retrieving SEO audit data:
- GET /api/seo/audit?company_id=X or ?slug=Y
- GET /api/seo/audit/<slug>

Features:
- Returns pagespeed scores (SEO, performance, accessibility, best practices)
- Returns on-page metrics (meta tags, headings, images, links, structured data)
- Returns technical SEO checks (SSL, sitemap, robots.txt, mobile-friendly)
- Returns Core Web Vitals (LCP, FID, CLS)
- Automatically generates issues list from audit data
- Handles companies without SEO audit gracefully

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 08:03:49 +01:00
6d589407be Sync local repo with production state
- Add MembershipFee and MembershipFeeConfig models
- Add /health endpoint for monitoring
- Add Microsoft Fluent Design CSS
- Update templates with new CSS structure
- Add Announcement model
- Update .gitignore to exclude analysis files

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 22:23:28 +01:00
02fc67bf40 Initial commit 2026-01-01 14:01:49 +01:00