mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 05:23:35 +00:00 
			
		
		
		
	widgets: Prevent edits to widgets.
As of now, editing a widget doesn't update the rendered content. It's important to ensure that existing votes or options added later on don't get deleted when rendered. This seems more complex than it's worth. For now, we just prevent edits to widgets. This commit makes the UI clearer that editing widgets isn't allowed. See also: https://github.com/zulip/zulip/issues/14229 https://github.com/zulip/zulip/issues/14799 Fixes #17156
This commit is contained in:
		@@ -68,6 +68,10 @@ run_test("get_editability", () => {
 | 
			
		||||
    // is true, we can edit the topic if there is one.
 | 
			
		||||
    message.type = "stream";
 | 
			
		||||
    assert.equal(get_editability(message, 45), editability_types.TOPIC_ONLY);
 | 
			
		||||
    // Right now, we prevent users from editing widgets.
 | 
			
		||||
    message.submessages = ["/poll"];
 | 
			
		||||
    assert.equal(get_editability(message, 45), editability_types.TOPIC_ONLY);
 | 
			
		||||
    delete message.submessages;
 | 
			
		||||
    message.type = "private";
 | 
			
		||||
    assert.equal(get_editability(message, 45), editability_types.NO_LONGER);
 | 
			
		||||
    // If we don't pass a second argument, treat it as 0
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user