# Issue: Git Repository Management UI (SZ-43)
rk@tigase.net opened 2 weeks ago

Description

This issue adds the full user-interface for Git Repository Management in the Sztab frontend.
The backend GitRepo REST API already exists; this task focuses entirely on UI screens, API wiring, and consistent visual grammar.

Scope

1. Git Repositories List Page

  • New page under /repos.
  • Table listing:
    • Repository name
    • URL
    • Description
    • Associated project (if any)
  • Include the git-repo icon (icon-gitrepo.svg) in the header.
  • Follow the new UI grammar (italic Sztab banner, spacing, typography).
  • Pagination support (20 items/page).

2. Create Repository Modal

  • Fields:
    • name (required, size-limited)
    • url (required)
    • description (optional)
    • project selector (dropdown)
  • Client-side validation.
  • Uniform modal styling consistent with User and Project modals.

3. Delete Repository Modal

  • Confirmation dialog displaying repo name.
  • Disable delete button for repos that have active branches or PRs (placeholder guard only; backend check to be added later).

4. Repository Details Placeholder Page

  • Clicking a repo row opens a WIP page.
  • Placeholder for future features:
    • commits
    • branches
    • issues linked via commit messages
    • pull requests

5. API Integration

  • Implement UI wiring for:
    • GET /api/repos
    • POST /api/repos
    • DELETE /api/repos/{id}
  • Update api.ts with typed functions.
  • Centralized error handling + toast notifications.

6. Sidebar Integration

  • Add “Git Repos” to sidebar navigation.
  • Use correct icon sizing and label tracking.

7. Visual Grammar Consistency

  • Apply Sztab visual grammar standards:
    • Italicized Sztab brand
    • Consistent spacing and typography
    • Tooltip conventions
    • Unified button styles

Non-Goals (Future Issues)

  • Git-Linker Go service integration
  • Commit → Issue auto-linking logic
  • Branch browsing
  • Repository access control
  • Server-side repository validation

Deliverables

  • frontend/src/pages/GitReposPage.tsx
  • frontend/src/components/gitrepo/CreateGitRepoModal.tsx
  • frontend/src/components/gitrepo/DeleteGitRepoModal.tsx
  • Updated frontend/src/api/api.ts
  • Sidebar entry update
  • Minimal UI tests

Estimated Time

6–8 hours

  • rk@tigase.net commented 2 weeks ago

    Worklog: Git Repository Management UI

    Total Time

    7h 10m

    Detailed Log

    1. Initial Design + Page Structure — 1h 00m

    • Reviewed backend GitRepo API.
    • Sketched UI layout matching existing Sztab visual grammar.
    • Defined list table columns and pagination model.
    • Planned modal structure for create/delete workflows.

    2. Implement GitReposPage.tsx (List View) — 1h 40m

    • Created new page scaffold under pages/.
    • Added table layout, rows, pagination control.
    • Wired up API call to getRepos(page,size,sortOrder).
    • Added loading and empty-state handling.
    • Integrated git-repo icon into header.
    • Confirmed consistent typography and spacing.

    3. Create Repository Modal — 1h 15m

    • Implemented form fields (name, URL, description, project).
    • Added validation (required fields, size limits).
    • Added role-based behaviors (future-proofed).
    • Wired POST request to backend.
    • Added success/error toast notifications.

    4. Delete Repository Modal — 45m

    • Implemented confirm dialog.
    • Added placeholder guard for "protected" repos.
    • Wired DELETE API call.
    • Confirmed update of list page after deletion.

    5. Routing + Sidebar Integration — 30m

    • Added new entry "Git Repositories" to sidebar.
    • Added icon and hover behaviors.
    • Ensured active route highlighting works.

    6. Visual Grammar Pass — 30m

    • Updated header layout: spacing, icon alignment, font style.
    • Added tooltip support consistent with User Management screen.
    • Updated button colors and hover states.

    7. API.ts Enhancements — 20m

    • Added typed functions:
      • getRepos(...)
      • createRepo(...)
      • deleteRepo(id)
    • Confirmed response type compatibility with backend DTO.

    8. Testing + Fixes — 30m

    • Manual testing with local backend.
    • Validated create/delete flows.
    • Fixed pagination edge cases.
    • Documented follow-up tasks in comments.

    9. Final Review + Commit Prep — 20m

    • Cleaned imports, removed debug logs.
    • Confirmed vite build and Docker frontend build succeed.
    • Prepared branch for PR.

    Notes

    • Repo details page is intentionally WIP; will be implemented in future issue.
    • Git-Linker backend service integration postponed by design.
  • rk@tigase.net changed state to 'In Progress' 2 weeks ago
    Previous Value Current Value
    Open
    In Progress
  • rk@tigase.net commented 2 weeks ago

    Feature branch: feature/SZ-43-Git-Repository-Management-UI

  • rk@tigase.net referenced from other issue 2 weeks ago
  • rk@tigase.net commented 2 weeks ago

    Worklog — SZ-43: Git Repository Management (UI + Backend)

    Hours: 3.8h
    Branch: feature/SZ-43-Git-Repository-Management-UI

    Summary

    Completed end-to-end Git repository management for Sztab.
    This includes backend DTO adjustments, controller/service updates, validation alignment, test updates, and a working UI for listing, creating, and deleting Git repositories.

    Backend Work

    • Relocated CreateGitRepoRequest into backend/src/main/java/com/sztab/dto/gitrepo/.
    • Updated GitRepoController, GitRepoService, and GitRepoServiceImpl to support creation, listing with project counts, and deletion.
    • Ensured description and URL fields enforce @Size(max = 255) and name enforces @Size(max = 100) with @NotBlank.
    • Aligned GitRepoDto with the frontend requirements (name, description, url, createdAt, projectCount).
    • Updated repository queries to handle project count.
    • Updated GitRepoControllerTest and GitRepoRegressionTest to match final DTO structure and validation behavior.

    Frontend Work

    • Implemented GitReposPage:
      • Paging support.
      • Project count column.
      • Delete button disabled when related projects exist.
      • Copy-URL button added.
    • Implemented CreateGitRepoModal for adding new repositories.
    • Updated api.ts with GitRepo CRUD methods.
    • Fixed profile and password page alignment (centered content within max-width container).
    • Ensured validation errors (400 responses) surface correctly via toast messages.

    Integration and Build

    • Verified backend and frontend interaction via docker-compose up --build.
    • Manually tested:
      • Creating repos with short and long descriptions.
      • Copy URL to clipboard.
      • Delete behavior with and without related projects.
      • UI reload reflecting database state.
    • Confirmed that long description > 255 chars returns 400 and UI displays toast.

    Status

    Feature completed and ready.
    Branch pushed and PR available.
    Tag: gitrepomgmt-done.

  • rk@tigase.net commented 2 weeks ago

    All work for SZ-43 is now complete. Git repository management (backend + UI) is fully implemented, including creation, paging, project counts, safe deletion behavior, and validation handling. UI aligned with existing patterns, and all regression/unit tests are passing. Code has been pushed to the feature branch and a PR is available for review. Tag gitrepomgmt-done has been recorded. Closing this issue.

    Tag:

    % git tag -a gitrepomgmt-done -m "Git repository management UI + backend complete"
    git push --tags
    Enumerating objects: 1, done.
    Counting objects: 100% (1/1), done.
    Writing objects: 100% (1/1), 194 bytes | 194.00 KiB/s, done.
    Total 1 (delta 0), reused 0 (delta 0), pack-reused 0
    To https://tigase.dev/sztab.git
     * [new tag]         gitrepomgmt-done -> gitrepomgmt-done
    % 
    
    
  • rk@tigase.net changed state to 'Closed' 2 weeks ago
    Previous Value Current Value
    In Progress
    Closed
  • rk@tigase.net referenced from other issue 2 weeks ago
issue 1 of 1
Type
New Feature
Priority
Normal
Assignee
Version
1.0
Sprints
n/a
Customer
n/a
Issue Votes (0)
Watchers (3)
Reference
SZ-43
Please wait...
Page is in error, reload to recover