mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	models: Add external_account in custom profile field types.
				
					
				
			Add new custom profile field type, External account. External account field links user's social media profile with account. e.g. GitHub, Twitter, etc. Fixes part of #12302
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							3368589df2
						
					
				
				
					commit
					d7ee2aced1
				
			@@ -104,6 +104,7 @@ function get_custom_profile_field_data(user, field, field_types, dateFormat) {
 | 
			
		||||
    profile_field.name = field.name;
 | 
			
		||||
    profile_field.is_user_field = false;
 | 
			
		||||
    profile_field.is_link = field_type === field_types.URL.id;
 | 
			
		||||
    profile_field.is_external_account = field_type === field_types.EXTERNAL_ACCOUNT.id;
 | 
			
		||||
    profile_field.type = field_type;
 | 
			
		||||
 | 
			
		||||
    switch (field_type) {
 | 
			
		||||
@@ -124,6 +125,11 @@ function get_custom_profile_field_data(user, field, field_types, dateFormat) {
 | 
			
		||||
        profile_field.value = field_value.value;
 | 
			
		||||
        profile_field.rendered_value = field_value.rendered_value;
 | 
			
		||||
        break;
 | 
			
		||||
    case field_types.EXTERNAL_ACCOUNT.id:
 | 
			
		||||
        profile_field.value = field_value.value;
 | 
			
		||||
        profile_field.field_data = JSON.parse(field.field_data);
 | 
			
		||||
        profile_field.link = settings_profile_fields.get_external_account_link(profile_field);
 | 
			
		||||
        break;
 | 
			
		||||
    default:
 | 
			
		||||
        profile_field.value = field_value.value;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user