summaryrefslogtreecommitdiff
path: root/internal/handlers/settings.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/handlers/settings.go')
-rw-r--r--internal/handlers/settings.go54
1 files changed, 0 insertions, 54 deletions
diff --git a/internal/handlers/settings.go b/internal/handlers/settings.go
index 43fce20..5ba3724 100644
--- a/internal/handlers/settings.go
+++ b/internal/handlers/settings.go
@@ -4,8 +4,6 @@ import (
"encoding/json"
"net/http"
- "github.com/go-chi/chi/v5"
-
"task-dashboard/internal/auth"
"task-dashboard/internal/models"
"task-dashboard/internal/store"
@@ -14,7 +12,6 @@ import (
// HandleSettingsPage renders the settings page
func (h *Handler) HandleSettingsPage(w http.ResponseWriter, r *http.Request) {
configs, _ := h.store.GetSourceConfigs()
- toggles, _ := h.store.GetFeatureToggles()
syncLog, _ := h.store.GetRecentSyncLog(20)
agents, _ := h.store.GetAllAgents()
buckets, _ := BuildBucketSummaries(h.store)
@@ -30,7 +27,6 @@ func (h *Handler) HandleSettingsPage(w http.ResponseWriter, r *http.Request) {
data := struct {
Configs map[string][]models.SourceConfig
Sources []string
- Toggles []models.FeatureToggle
SyncLog []store.SyncLogEntry
Agents []models.Agent
Buckets []models.BucketSummary
@@ -41,7 +37,6 @@ func (h *Handler) HandleSettingsPage(w http.ResponseWriter, r *http.Request) {
}{
Configs: bySource,
Sources: []string{"trello", "gcal", "gtasks"},
- Toggles: toggles,
SyncLog: syncLog,
Agents: agents,
Buckets: buckets,
@@ -163,52 +158,3 @@ func (h *Handler) HandleToggleSourceConfig(w http.ResponseWriter, r *http.Reques
json.NewEncoder(w).Encode(map[string]bool{"enabled": enabled})
}
-// HandleToggleFeature toggles a feature flag
-func (h *Handler) HandleToggleFeature(w http.ResponseWriter, r *http.Request) {
- name, ok := requireFormValue(w, r, "name")
- if !ok {
- return
- }
- enabled := r.FormValue("enabled") == "true"
-
- if err := h.store.SetFeatureEnabled(name, enabled); err != nil {
- JSONError(w, http.StatusInternalServerError, "Failed to update feature", err)
- return
- }
-
- w.Header().Set("Content-Type", "application/json")
- json.NewEncoder(w).Encode(map[string]bool{"enabled": enabled})
-}
-
-// HandleCreateFeature creates a new feature toggle
-func (h *Handler) HandleCreateFeature(w http.ResponseWriter, r *http.Request) {
- name, ok := requireFormValue(w, r, "name")
- if !ok {
- return
- }
- description := r.FormValue("description")
-
- if err := h.store.CreateFeatureToggle(name, description, false); err != nil {
- JSONError(w, http.StatusInternalServerError, "Failed to create feature", err)
- return
- }
-
- // Return updated toggles list
- h.HandleSettingsPage(w, r)
-}
-
-// HandleDeleteFeature removes a feature toggle
-func (h *Handler) HandleDeleteFeature(w http.ResponseWriter, r *http.Request) {
- name := chi.URLParam(r, "name")
- if name == "" {
- JSONError(w, http.StatusBadRequest, "Feature name required", nil)
- return
- }
-
- if err := h.store.DeleteFeatureToggle(name); err != nil {
- JSONError(w, http.StatusInternalServerError, "Failed to delete feature", err)
- return
- }
-
- w.WriteHeader(http.StatusOK)
-}