microsoft / microsoft/simplechat

Convert def get_retention_label(value) into api call and update backend and javascript

Open
#625 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
152
Forks
116
Avg merge
7h 7m
Merged PRs (30d)
122

Description

def get_retention_label(value):
if value == 'none' or value is None:
return 'No automatic deletion'
try:
days = int(value)
if days == 1:
return '1 day'
elif days == 21:
return '21 days (3 weeks)'
elif days == 90:
return '90 days (3 months)'
elif days == 180:
return '180 days (6 months)'
elif days == 365:
return '365 days (1 year)'
elif days == 730:
return '730 days (2 years)'
else:
return f'{days} days'
except (ValueError, TypeError):
return 'No automatic deletion'

return jsonify({
'success': True,
'workspace_type': workspace_type,
'default_conversation_days': default_conversation,
'default_document_days': default_document,
'default_conversation_label': get_retention_label(default_conversation),
'default_document_label': get_retention_label(default_document)
})

Contributor guide

Open the contributing guide

Research direction

Start at the get_retention_label function and the jsonify response shown in the issue, then trace the JavaScript consumer of these retention values. Confirm how the label should be exposed through the API and update both backend and JavaScript usage; done means the labels come from the API consistently in both layers.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, python
Domain
api, backend, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.