mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	This restructures organization settings and permissions to be
more accurately grouped and for the permissions page to not be too
long.
CHANGES:
PROFILE:
    (this was split out)
    organization-profile-admin.handlebars:
        form #1:
            name
            description
            (SUBMIT)
        avatar:
            (UPLOAD)
            (DELETE)
SETTINGS:
    organization-settings-admin.handlebars:
        language (mostly untouched)
        message editing:
            time limit/history/retention
        message feed:
            mandatory-topics
            preview images
            preview websites
PERMISSIONS:
    organization-permissions-admin.handlebars
    (mostly stuff was removed)
    Joining:
        restrict domains
        require invite
    User Identity:
        name changes
        email changes
    Streams/Emoji:
        creating streams:
            waiting period (ADDED)
        adding emojis
    (SUBMIT) for whole panel
The profile group (name, description, avatar) were split into a new
page that did not previously exist, and the permissions was stripped
of message settings (message editing, message feed), but keeping the
"waiting period" input and putting it in the "Streams & custom emoji"
section.
Fixes: #5844.
		
	
		
			
				
	
	
		
			82 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			82 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
var admin_sections = (function () {
 | 
						|
 | 
						|
var exports = {};
 | 
						|
 | 
						|
var is_loaded = new Dict(); // section -> bool
 | 
						|
 | 
						|
exports.load_admin_section = function (name) {
 | 
						|
    var section;
 | 
						|
 | 
						|
    switch (name) {
 | 
						|
        case 'organization-profile':
 | 
						|
        case 'organization-settings':
 | 
						|
        case 'organization-permissions':
 | 
						|
        case 'auth-methods':
 | 
						|
            section = 'org';
 | 
						|
            break;
 | 
						|
        case 'emoji-settings':
 | 
						|
            section = 'emoji';
 | 
						|
            break;
 | 
						|
        case 'bot-list-admin':
 | 
						|
        case 'user-list-admin':
 | 
						|
        case 'deactivated-users-admin':
 | 
						|
            section = 'users';
 | 
						|
            break;
 | 
						|
        case 'streams-list-admin':
 | 
						|
        case 'default-streams-list':
 | 
						|
            section = 'streams';
 | 
						|
            break;
 | 
						|
        case 'filter-settings':
 | 
						|
            section = 'filters';
 | 
						|
            break;
 | 
						|
        default:
 | 
						|
            blueslip.error('Unknown admin id ' + name);
 | 
						|
            return;
 | 
						|
    }
 | 
						|
 | 
						|
    if (is_loaded.get(section)) {
 | 
						|
        // We only load sections once (unless somebody calls
 | 
						|
        // reset_sections).
 | 
						|
        return;
 | 
						|
    }
 | 
						|
 | 
						|
    switch (section) {
 | 
						|
        case 'org':
 | 
						|
            settings_org.set_up();
 | 
						|
            break;
 | 
						|
        case 'emoji':
 | 
						|
            settings_emoji.set_up();
 | 
						|
            break;
 | 
						|
        case 'users':
 | 
						|
            settings_users.set_up();
 | 
						|
            break;
 | 
						|
        case 'streams':
 | 
						|
            settings_streams.set_up();
 | 
						|
            break;
 | 
						|
        case 'filters':
 | 
						|
            settings_filters.set_up();
 | 
						|
            break;
 | 
						|
        default:
 | 
						|
            blueslip.error('programming error for section ' + section);
 | 
						|
            return;
 | 
						|
    }
 | 
						|
 | 
						|
    is_loaded.set(section, true);
 | 
						|
};
 | 
						|
 | 
						|
exports.reset_sections = function () {
 | 
						|
    is_loaded.clear();
 | 
						|
    settings_org.reset();
 | 
						|
    settings_emoji.reset();
 | 
						|
    settings_users.reset();
 | 
						|
    settings_streams.reset();
 | 
						|
    settings_filters.reset();
 | 
						|
};
 | 
						|
 | 
						|
return exports;
 | 
						|
}());
 | 
						|
 | 
						|
if (typeof module !== 'undefined') {
 | 
						|
    module.exports = admin_sections;
 | 
						|
}
 |