Improve auto-approve menu design and remove unnecessary options (#7180)
This commit is contained in:
1 parent
1cfff0a45f
commit
9b1dc5bd92
56 files changed
+322
-739
No files matched your search
@@ -19,10 +19,7 @@ export async function updateAutoApprovalSettings(controller: Controller, request
|
||||
const settings = {
|
||||
...currentSettings,
|
||||
...(request.version !== undefined && { version: request.version }),
|
||||
...(request.enabled !== undefined && { enabled: request.enabled }),
|
||||
...(request.maxRequests !== undefined && { maxRequests: request.maxRequests }),
|
||||
...(request.enableNotifications !== undefined && { enableNotifications: request.enableNotifications }),
|
||||
...(request.favorites && request.favorites.length > 0 && { favorites: request.favorites }),
|
||||
actions: {
|
||||
...currentSettings.actions,
|
||||
...(request.actions
|
||||
@@ -31,16 +28,6 @@ export async function updateAutoApprovalSettings(controller: Controller, request
|
||||
},
|
||||
}
|
||||
|
||||
if (controller.task) {
|
||||
const maxRequestsChanged =
|
||||
controller.stateManager.getGlobalSettingsKey("autoApprovalSettings").maxRequests !== settings.maxRequests
|
||||
|
||||
// Reset counter if max requests limit changed
|
||||
if (maxRequestsChanged) {
|
||||
controller.task.resetConsecutiveAutoApprovedRequestsCount()
|
||||
}
|
||||
}
|
||||
|
||||
controller.stateManager.setGlobalState("autoApprovalSettings", settings)
|
||||
|
||||
await controller.postStateToWebview()
|
||||
|
||||
@@ -87,13 +87,9 @@ export async function updateSettingsCli(controller: Controller, request: UpdateS
|
||||
const mergedSettings = {
|
||||
...currentAutoApprovalSettings,
|
||||
...(autoApprovalSettings.version !== undefined && { version: autoApprovalSettings.version }),
|
||||
...(autoApprovalSettings.enabled !== undefined && { enabled: autoApprovalSettings.enabled }),
|
||||
...(autoApprovalSettings.maxRequests !== undefined && { maxRequests: autoApprovalSettings.maxRequests }),
|
||||
...(autoApprovalSettings.enableNotifications !== undefined && {
|
||||
enableNotifications: autoApprovalSettings.enableNotifications,
|
||||
}),
|
||||
...(autoApprovalSettings.favorites &&
|
||||
autoApprovalSettings.favorites.length > 0 && { favorites: autoApprovalSettings.favorites }),
|
||||
actions: {
|
||||
...currentAutoApprovalSettings.actions,
|
||||
...(autoApprovalSettings.actions
|
||||
|
||||
@@ -76,13 +76,9 @@ export async function updateTaskSettings(controller: Controller, request: Update
|
||||
const mergedSettings = {
|
||||
...currentAutoApprovalSettings,
|
||||
...(autoApprovalSettings.version !== undefined && { version: autoApprovalSettings.version }),
|
||||
...(autoApprovalSettings.enabled !== undefined && { enabled: autoApprovalSettings.enabled }),
|
||||
...(autoApprovalSettings.maxRequests !== undefined && { maxRequests: autoApprovalSettings.maxRequests }),
|
||||
...(autoApprovalSettings.enableNotifications !== undefined && {
|
||||
enableNotifications: autoApprovalSettings.enableNotifications,
|
||||
}),
|
||||
...(autoApprovalSettings.favorites &&
|
||||
autoApprovalSettings.favorites.length > 0 && { favorites: autoApprovalSettings.favorites }),
|
||||
actions: {
|
||||
...currentAutoApprovalSettings.actions,
|
||||
...(autoApprovalSettings.actions
|
||||
|
||||
@@ -43,13 +43,9 @@ export async function newTask(controller: Controller, request: NewTaskRequest):
|
||||
return {
|
||||
...globalSettings,
|
||||
...(incomingSettings.version !== undefined && { version: incomingSettings.version }),
|
||||
...(incomingSettings.enabled !== undefined && { enabled: incomingSettings.enabled }),
|
||||
...(incomingSettings.maxRequests !== undefined && { maxRequests: incomingSettings.maxRequests }),
|
||||
...(incomingSettings.enableNotifications !== undefined && {
|
||||
enableNotifications: incomingSettings.enableNotifications,
|
||||
}),
|
||||
...(incomingSettings.favorites &&
|
||||
incomingSettings.favorites.length > 0 && { favorites: incomingSettings.favorites }),
|
||||
actions: {
|
||||
...globalSettings.actions,
|
||||
...(incomingSettings.actions
|
||||
|
||||
Reference in new issue
Block a user