diff --git a/.eslintrc b/.eslintrc index 7b20950289e68..32ba25020b8a7 100644 --- a/.eslintrc +++ b/.eslintrc @@ -131,6 +131,7 @@ "parentCall" : false, "Promise" : false, "Random" : false, + "ReactiveDict" : false, "ReactiveVar" : false, "Reload" : false, "RocketChat" : true, diff --git a/.meteor/packages b/.meteor/packages index 4e496bd5640a2..0cbb854a2016b 100644 --- a/.meteor/packages +++ b/.meteor/packages @@ -112,6 +112,7 @@ rocketchat:push-notifications rocketchat:reactions rocketchat:apps rocketchat:sandstorm +rocketchat:setup-wizard rocketchat:slackbridge rocketchat:slashcommands-archive rocketchat:slashcommands-asciiarts diff --git a/.meteor/versions b/.meteor/versions index e334e1c489795..d51b6678e4310 100644 --- a/.meteor/versions +++ b/.meteor/versions @@ -202,6 +202,7 @@ rocketchat:push-notifications@0.0.1 rocketchat:reactions@0.0.1 rocketchat:sandstorm@0.0.1 rocketchat:search@0.0.1 +rocketchat:setup-wizard@0.0.1 rocketchat:slackbridge@0.0.1 rocketchat:slashcommands-archive@0.0.1 rocketchat:slashcommands-asciiarts@0.0.1 diff --git a/client/routes/router.js b/client/routes/router.js index c3cb3e5457355..2f0ad84ee1f17 100644 --- a/client/routes/router.js +++ b/client/routes/router.js @@ -149,6 +149,22 @@ FlowRouter.route('/register/:hash', { } }); +FlowRouter.route('/setup-wizard', { + name: 'setup-wizard', + + action() { + BlazeLayout.render('setupWizard'); + } +}); + +FlowRouter.route('/setup-wizard/final', { + name: 'setup-wizard-final', + + action() { + BlazeLayout.render('setupWizardFinal'); + } +}); + FlowRouter.notFound = { action() { BlazeLayout.render('pageNotFound'); diff --git a/client/startup/userSetUtcOffset.js b/client/startup/userSetUtcOffset.js index d41f644fe67fb..14542fede1c22 100644 --- a/client/startup/userSetUtcOffset.js +++ b/client/startup/userSetUtcOffset.js @@ -2,7 +2,7 @@ import moment from 'moment'; Meteor.startup(function() { Tracker.autorun(function() { - const user = Meteor.user(); + const user = RocketChat.models.Users.findOne({_id: Meteor.userId()}, {fields: {statusConnection: 1, utcOffset: 1}}); if (user && user.statusConnection === 'online') { const utcOffset = moment().utcOffset() / 60; if (user.utcOffset !== utcOffset) { diff --git a/packages/rocketchat-assets/server/assets.js b/packages/rocketchat-assets/server/assets.js index 69bce7af9e03e..297efb79ea473 100644 --- a/packages/rocketchat-assets/server/assets.js +++ b/packages/rocketchat-assets/server/assets.js @@ -22,6 +22,10 @@ const assets = { extensions: ['svg', 'png', 'jpg', 'jpeg'], width: undefined, height: undefined + }, + wizard: { + step: 3, + order: 2 } }, favicon_ico: { @@ -296,7 +300,8 @@ function addAssetToSetting(key, value) { fileConstraints: value.constraints, i18nLabel: value.label, asset: key, - public: true + public: true, + wizard: value.wizard }); } diff --git a/packages/rocketchat-i18n/i18n/en.i18n.json b/packages/rocketchat-i18n/i18n/en.i18n.json index 373b452e85f0b..fe6b7d7ab8ea1 100644 --- a/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/packages/rocketchat-i18n/i18n/en.i18n.json @@ -184,7 +184,9 @@ "additional_integrations_Zapier": "Are you looking to integrate other software and applications with Rocket.Chat but you don't have the time to manually do it? Then we suggest using Zapier which we fully support. Read more about it on our documentation. https://rocket.chat/docs/administrator-guides/integrations/zapier/using-zaps/", "additional_integrations_Bots": "If you are looking for how to integrate your own bot, then look no further than our Hubot adapter. https://github.com/RocketChat/hubot-rocketchat", "Administration": "Administration", + "Admin_Info": "Admin Info", "Adult_images_are_not_allowed": "Adult images are not allowed", + "Advocacy": "Advocacy", "After_OAuth2_authentication_users_will_be_redirected_to_this_URL": "After OAuth2 authentication, users will be redirected to this URL", "Agent": "Agent", "Agent_added": "Agent added", @@ -340,6 +342,7 @@ "ban-user_description": "Permission to ban a user from a channel", "Beta_feature_Depends_on_Video_Conference_to_be_enabled": "Beta feature. Depends on Video Conference to be enabled.", "Block_User": "Block User", + "Blockchain": "Blockchain", "Body": "Body", "bold": "bold", "bot_request": "Bot request", @@ -488,12 +491,16 @@ "Collapse_Embedded_Media_By_Default": "Collapse Embedded Media by Default", "Color": "Color", "Contains_Security_Fixes": "Contains Security Fixes", + "Continue": "Continue", "Commands": "Commands", "Comment_to_leave_on_closing_session": "Comment to Leave on Closing Session", "Common_Access": "Common Access", + "Community": "Community", "Compact": "Compact", "Computer": "Computer", "Confirm_password": "Confirm your password", + "Consulting": "Consulting", + "Consumer_Goods": "Consumer Goods", "Content": "Content", "Conversation": "Conversation", "Conversation_closed": "Conversation closed: __comment__.", @@ -504,6 +511,7 @@ "Copy_to_clipboard": "Copy to clipboard", "COPY_TO_CLIPBOARD": "COPY TO CLIPBOARD", "Count": "Count", + "Country": "Country", "Cozy": "Cozy", "Create": "Create", "create-c": "Create Public Channels", @@ -661,6 +669,7 @@ "edited": "edited", "Editing_room": "Editing room", "Editing_user": "Editing user", + "Education": "Education", "Email": "Email", "Email_address_to_send_offline_messages": "Email Address to Send Offline Messages", "Email_already_exists": "Email already exists", @@ -698,6 +707,8 @@ "Enter_name_here": "Enter name here", "Enter_Normal": "Normal mode (send with Enter)", "Enter_to": "Enter to", + "Entertainment": "Entertainment", + "Enterprise": "Enterprise", "Error": "Error", "Error_404": "Error:404", "error-action-not-allowed": "__action__ is not allowed", @@ -840,6 +851,7 @@ "FileUpload_Storage_Type": "Storage Type", "First_Channel_After_Login": "First Channel After Login", "Flags": "Flags", + "Financial_Services": "Financial Services", "Follow_social_profiles": "Follow our social profiles, fork us on github and share your thoughts about the rocket.chat app on our trello board.", "Fonts": "Fonts", "Food_and_Drink": "Food & Drink", @@ -867,6 +879,7 @@ "From": "From", "From_Email": "From Email", "From_email_warning": "Warning: The field From is subject to your mail server settings.", + "Gaming": "Gaming", "General": "General", "github_no_public_email": "You don't have any email as public email in your GitHub account", "Give_a_unique_name_for_the_custom_oauth": "Give a unique name for the custom oauth", @@ -893,6 +906,8 @@ "GoogleVision_Type_Properties": "Properties (Color) Detection", "GoogleVision_Type_SafeSearch": "SafeSearch Detection", "GoogleVision_Type_Similar": "Search Similar Images", + "Go_to_your_workspace": "Go to your workspace", + "Government": "Government", "Group_by_Type": "Group by Type", "Group_favorites": "Group favorites", "Group_mentions_only": "Group mentions only", @@ -900,7 +915,9 @@ "Hash": "Hash", "Header": "Header", "Header_and_Footer": "Header and Footer", + "Healthcare_and_Pharmaceutical": "Healthcare/Pharmaceutical", "Helpers": "Helpers", + "Help_Center": "Help Center", "Hex_Color_Preview": "Hex Color Preview", "Hidden": "Hidden", "Hide_Avatars": "Hide Avatars", @@ -973,6 +990,7 @@ "Importer_Source_File": "Source File Selection", "Incoming_Livechats": "Incoming Livechats", "Incoming_WebHook": "Incoming WebHook", + "Industry": "Industry", "initials_avatar": "Initials Avatar", "inline_code": "inline code", "Install_Extension": "Install Extension", @@ -985,6 +1003,7 @@ "Installed_at": "Installed at", "Instance_Record": "Instance Record", "Instructions_to_your_visitor_fill_the_form_to_send_a_message": "Instructions to your visitor fill the form to send a message", + "Insurance": "Insurance", "Integration_added": "Integration has been added", "Integration_Advanced_Settings": "Advanced Settings", "Integration_disabled": "Integration disabled", @@ -1086,6 +1105,7 @@ "italics": "italics", "Jitsi_Chrome_Extension": "Chrome Extension Id", "Jitsi_Enable_Channels": "Enable in Channels", + "Job_Title": "Job Title", "join": "Join", "join-without-join-code": "Join Without Join Code", "join-without-join-code_description": "Permission to bypass the join code in channels with join code enabled", @@ -1129,6 +1149,7 @@ "Last_login": "Last login", "Last_Message_At": "Last Message At", "Last_seen": "Last seen", + "Launched_successfully": "Launched successfully", "Layout": "Layout", "Layout_Home_Body": "Home Body", "Layout_Home_Title": "Home Title", @@ -1270,6 +1291,7 @@ "Logged_out_of_other_clients_successfully": "Logged out of other clients successfully", "Login": "Login", "Login_with": "Login with %s", + "Logistics": "Logistics", "Logout": "Logout", "Logout_Others": "Logout From Other Logged In Locations", "mail-messages": "Mail Messages", @@ -1303,6 +1325,7 @@ "Manager_removed": "Manager removed", "Managing_assets": "Managing assets", "Managing_integrations": "Managing integrations", + "Manufacturing": "Manufacturing", "MapView_Enabled": "Enable Mapview", "MapView_Enabled_Description": "Enabling mapview will display a location share button on the left of the chat input field.", "MapView_GMapsAPIKey": "Google Static Maps API Key", @@ -1320,6 +1343,7 @@ "Markdown_SupportSchemesForLink": "Markdown Support Schemes for Link", "Markdown_SupportSchemesForLink_Description": "Comma-separated list of allowed schemes", "Max_length_is": "Max length is %s", + "Media": "Media", "Members_List": "Members List", "mention-all": "Mention All", "mention-all_description": "Permission to use the @all mention", @@ -1476,6 +1500,7 @@ "Nobody_available": "Nobody available", "Node_version": "Node Version", "None": "None", + "Nonprofit": "Nonprofit", "Normal": "Normal", "Not_authorized": "Not authorized", "Not_Available": "Not Available", @@ -1538,6 +1563,10 @@ "Oops_page_not_found": "Oops, page not found", "Or_talk_as_anonymous": "Or talk as anonymous", "Order": "Order", + "Organization_Email": "Organization Email", + "Organization_Info": "Organization Info", + "Organization_Name": "Organization Name", + "Organization_Type": "Organization Type", "Original": "Original", "OS_Arch": "OS Arch", "OS_Cpus": "OS CPU Count", @@ -1548,6 +1577,7 @@ "OS_Totalmem": "OS Total Memory", "OS_Type": "OS Type", "OS_Uptime": "OS Uptime", + "Other": "Other", "others": "others", "OTR": "OTR", "OTR_is_only_available_when_both_users_are_online": "OTR is only available when both users are online", @@ -1617,12 +1647,15 @@ "Private_Group": "Private Group", "Private_Groups": "Private Groups", "Private_Groups_list": "List of Private Groups", + "Private_Team": "Private Team", "Profile": "Profile", "Profile_details": "Profile Details", "Profile_picture": "Profile Picture", "Profile_saved_successfully": "Profile saved successfully", "Public": "Public", "Public_Channel": "Public Channel", + "Public_Community": "Public Community", + "Public_Relations": "Public Relations", "Push": "Push", "Push_apn_cert": "APN Cert", "Push_apn_dev_cert": "APN Dev Cert", @@ -1658,6 +1691,7 @@ "Read_only_group": "Read Only Group", "Reason_To_Join": "Reason to Join", "RealName_Change_Disabled": "Your Rocket.Chat administrator has disabled the changing of names", + "Real_Estate": "Real Estate", "Receive_alerts": "Receive alerts", "Receive_Group_Mentions": "Receive @all and @here mentions", "Record": "Record", @@ -1667,11 +1701,13 @@ "Refresh_your_page_after_install_to_enable_screen_sharing": "Refresh your page after install to enable screen sharing", "Regenerate_codes": "Regenerate codes", "Register": "Register a new account", + "Register_Server": "Register Server", "Registration": "Registration", "Registration_Succeeded": "Registration Succeeded", "Registration_via_Admin": "Registration via Admin", "Regular_Expressions": "Regular Expressions", "Release": "Release", + "Religious": "Religious", "Reload": "Reload", "Reload_Pages": "Reload Pages", "Remove": "Remove", @@ -1702,6 +1738,7 @@ "Reset_section_settings": "Reset Section Settings", "Restart": "Restart", "Restart_the_server": "Restart the server", + "Retail": "Retail", "Retry_Count": "Retry Count", "Apps": "Apps", "App_Information": "App Information", @@ -1774,6 +1811,8 @@ "Saving": "Saving", "Scan_QR_code": "Using an authenticator app like Google Authenticator, Authy or Duo, scan the QR code. It will display a 6 digit code which you need to enter below.", "Scan_QR_code_alternative_s": "If you can't scan the QR code, you may enter code manually instead: __code__", + "Setup_Wizard": "Setup Wizard", + "Setup_Wizard_Info": "We’ll guide you through setting up your first admin user, configuring your organisation and registering your server to receive free push notifications and more.", "Scope": "Scope", "Screen_Share": "Screen Share", "Script_Enabled": "Script Enabled", @@ -1820,6 +1859,8 @@ "Sending": "Sending...", "Sent_an_attachment": "Sent an attachment", "Served_By": "Served By", + "Server_Info": "Server Info", + "Server_Type": "Server Type", "Service": "Service", "Service_account_key": "Service account key", "set-moderator": "Set Moderator", @@ -1861,6 +1902,7 @@ "Site_Name": "Site Name", "Site_Url": "Site URL", "Site_Url_Description": "Example: https://chat.domain.com/", + "Size": "Size", "Skip": "Skip", "SlackBridge_error": "SlackBridge got an error while importing your messages at %s: %s", "SlackBridge_finish": "SlackBridge has finished importing the messages at %s. Please reload to view all messages.", @@ -1901,6 +1943,7 @@ "Snippet_Added": "Created on %s", "Snippet_Messages": "Snippet Messages", "Snippeted_a_message": "Created a snippet __snippetLink__", + "Social_Network": "Social Network", "Sorry_page_you_requested_does_not_exists_or_was_deleted": "Sorry, page you requested does not exists or was deleted!", "Sort_by_activity": "Sort by Activity", "Sound": "Sound", @@ -1941,6 +1984,7 @@ "Stats_Total_Rooms": "Total Rooms", "Stats_Total_Users": "Total Users", "Status": "Status", + "Step": "Step", "Stop_Recording": "Stop Recording", "Store_Last_Message": "Store Last Message", "Store_Last_Message_Sent_per_Room": "Store last message sent on each room.", @@ -1965,7 +2009,10 @@ "Take_it": "Take it!", "TargetRoom": "Target Room", "TargetRoom_Description": "The room where messages will be sent which are a result of this event being fired. Only one target room is allowed and it must exist.", + "Telecom": "Telecom", "Team": "Team", + "Technology_Provider": "Technology Provider", + "Technology_Services": "Technology Services", "Test_Connection": "Test Connection", "Test_Desktop_Notifications": "Test Desktop Notifications", "Thank_you_exclamation_mark": "Thank you!", @@ -2059,6 +2106,7 @@ "Tokens_Required_Input_Error": "Invalid typed tokens.", "Tokens_Required_Input_Placeholder": "Tokens asset names", "Topic": "Topic", + "Tourism": "Tourism", "Transcript_Enabled": "Ask Visitor if They Would Like a Transcript After Chat Closed", "Transcript_message": "Message to Show When Asking About Transcript", "Transcript_of_your_livechat_conversation": "Transcript of your livechat conversation.", @@ -2079,9 +2127,12 @@ "Two-factor_authentication_native_mobile_app_warning": "WARNING: Once you enable this, you will not be able to login on the native mobile apps (Rocket.Chat+) using your password until they implement the 2FA.", "Type": "Type", "Type_your_email": "Type your email", + "Type_your_job_title": "Type your job title", "Type_your_message": "Type your message", "Type_your_name": "Type your name", "Type_your_new_password": "Type your new password", + "Type_your_password": "Type your password", + "Type_your_username": "Type your username", "UI_Allow_room_names_with_special_chars": "Allow Special Characters in Room Names", "UI_Click_Direct_Message": "Click to Create Direct Message", "UI_Click_Direct_Message_Description": "Skip opening profile tab, instead go straight to conversation", @@ -2344,5 +2395,247 @@ "your_message": "your message", "your_message_optional": "your message (optional)", "Your_password_is_wrong": "Your password is wrong!", - "Your_push_was_sent_to_s_devices": "Your push was sent to %s devices" -} \ No newline at end of file + "Your_push_was_sent_to_s_devices": "Your push was sent to %s devices", + "Your_server_link": "Your server link", + "Your_workspace_is_ready": "Your workspace is ready to use 🎉", + "Worldwide": "Worldwide", + "Country_Afghanistan": "Afghanistan", + "Country_Albania": "Albania", + "Country_Algeria": "Algeria", + "Country_American_Samoa": "American Samoa", + "Country_Andorra": "Andorra", + "Country_Angola": "Angola", + "Country_Anguilla": "Anguilla", + "Country_Antarctica": "Antarctica", + "Country_Antigua_and_Barbuda": "Antigua and Barbuda", + "Country_Argentina": "Argentina", + "Country_Armenia": "Armenia", + "Country_Aruba": "Aruba", + "Country_Australia": "Australia", + "Country_Austria": "Austria", + "Country_Azerbaijan": "Azerbaijan", + "Country_Bahamas": "Bahamas", + "Country_Bahrain": "Bahrain", + "Country_Bangladesh": "Bangladesh", + "Country_Barbados": "Barbados", + "Country_Belarus": "Belarus", + "Country_Belgium": "Belgium", + "Country_Belize": "Belize", + "Country_Benin": "Benin", + "Country_Bermuda": "Bermuda", + "Country_Bhutan": "Bhutan", + "Country_Bolivia": "Bolivia", + "Country_Bosnia_and_Herzegovina": "Bosnia and Herzegovina", + "Country_Botswana": "Botswana", + "Country_Bouvet_Island": "Bouvet Island", + "Country_Brazil": "Brazil", + "Country_British_Indian_Ocean_Territory": "British Indian Ocean Territory", + "Country_Brunei_Darussalam": "Brunei Darussalam", + "Country_Bulgaria": "Bulgaria", + "Country_Burkina_Faso": "Burkina Faso", + "Country_Burundi": "Burundi", + "Country_Cambodia": "Cambodia", + "Country_Cameroon": "Cameroon", + "Country_Canada": "Canada", + "Country_Cape_Verde": "Cape Verde", + "Country_Cayman_Islands": "Cayman Islands", + "Country_Central_African_Republic": "Central African Republic", + "Country_Chad": "Chad", + "Country_Chile": "Chile", + "Country_China": "China", + "Country_Christmas_Island": "Christmas Island", + "Country_Cocos_Keeling_Islands": "Cocos (Keeling) Islands", + "Country_Colombia": "Colombia", + "Country_Comoros": "Comoros", + "Country_Congo": "Congo", + "Country_Congo_The_Democratic_Republic_of_The": "Congo, The Democratic Republic of The", + "Country_Cook_Islands": "Cook Islands", + "Country_Costa_Rica": "Costa Rica", + "Country_Cote_Divoire": "Cote D'ivoire", + "Country_Croatia": "Croatia", + "Country_Cuba": "Cuba", + "Country_Cyprus": "Cyprus", + "Country_Czech_Republic": "Czech Republic", + "Country_Denmark": "Denmark", + "Country_Djibouti": "Djibouti", + "Country_Dominica": "Dominica", + "Country_Dominican_Republic": "Dominican Republic", + "Country_Ecuador": "Ecuador", + "Country_Egypt": "Egypt", + "Country_El_Salvador": "El Salvador", + "Country_Equatorial_Guinea": "Equatorial Guinea", + "Country_Eritrea": "Eritrea", + "Country_Estonia": "Estonia", + "Country_Ethiopia": "Ethiopia", + "Country_Falkland_Islands_Malvinas": "Falkland Islands (Malvinas)", + "Country_Faroe_Islands": "Faroe Islands", + "Country_Fiji": "Fiji", + "Country_Finland": "Finland", + "Country_France": "France", + "Country_French_Guiana": "French Guiana", + "Country_French_Polynesia": "French Polynesia", + "Country_French_Southern_Territories": "French Southern Territories", + "Country_Gabon": "Gabon", + "Country_Gambia": "Gambia", + "Country_Georgia": "Georgia", + "Country_Germany": "Germany", + "Country_Ghana": "Ghana", + "Country_Gibraltar": "Gibraltar", + "Country_Greece": "Greece", + "Country_Greenland": "Greenland", + "Country_Grenada": "Grenada", + "Country_Guadeloupe": "Guadeloupe", + "Country_Guam": "Guam", + "Country_Guatemala": "Guatemala", + "Country_Guinea": "Guinea", + "Country_Guinea_bissau": "Guinea-bissau", + "Country_Guyana": "Guyana", + "Country_Haiti": "Haiti", + "Country_Heard_Island_and_Mcdonald_Islands": "Heard Island and Mcdonald Islands", + "Country_Holy_See_Vatican_City_State": "Holy See (Vatican City State)", + "Country_Honduras": "Honduras", + "Country_Hong_Kong": "Hong Kong", + "Country_Hungary": "Hungary", + "Country_Iceland": "Iceland", + "Country_India": "India", + "Country_Indonesia": "Indonesia", + "Country_Iran_Islamic_Republic_of": "Iran, Islamic Republic of", + "Country_Iraq": "Iraq", + "Country_Ireland": "Ireland", + "Country_Israel": "Israel", + "Country_Italy": "Italy", + "Country_Jamaica": "Jamaica", + "Country_Japan": "Japan", + "Country_Jordan": "Jordan", + "Country_Kazakhstan": "Kazakhstan", + "Country_Kenya": "Kenya", + "Country_Kiribati": "Kiribati", + "Country_Korea_Democratic_Peoples_Republic_of": "Korea, Democratic People's Republic of", + "Country_Korea_Republic_of": "Korea, Republic of", + "Country_Kuwait": "Kuwait", + "Country_Kyrgyzstan": "Kyrgyzstan", + "Country_Lao_Peoples_Democratic_Republic": "Lao People's Democratic Republic", + "Country_Latvia": "Latvia", + "Country_Lebanon": "Lebanon", + "Country_Lesotho": "Lesotho", + "Country_Liberia": "Liberia", + "Country_Libyan_Arab_Jamahiriya": "Libyan Arab Jamahiriya", + "Country_Liechtenstein": "Liechtenstein", + "Country_Lithuania": "Lithuania", + "Country_Luxembourg": "Luxembourg", + "Country_Macao": "Macao", + "Country_Macedonia_The_Former_Yugoslav_Republic_of": "Macedonia, The Former Yugoslav Republic of", + "Country_Madagascar": "Madagascar", + "Country_Malawi": "Malawi", + "Country_Malaysia": "Malaysia", + "Country_Maldives": "Maldives", + "Country_Mali": "Mali", + "Country_Malta": "Malta", + "Country_Marshall_Islands": "Marshall Islands", + "Country_Martinique": "Martinique", + "Country_Mauritania": "Mauritania", + "Country_Mauritius": "Mauritius", + "Country_Mayotte": "Mayotte", + "Country_Mexico": "Mexico", + "Country_Micronesia_Federated_States_of": "Micronesia, Federated States of", + "Country_Moldova_Republic_of": "Moldova, Republic of", + "Country_Monaco": "Monaco", + "Country_Mongolia": "Mongolia", + "Country_Montserrat": "Montserrat", + "Country_Morocco": "Morocco", + "Country_Mozambique": "Mozambique", + "Country_Myanmar": "Myanmar", + "Country_Namibia": "Namibia", + "Country_Nauru": "Nauru", + "Country_Nepal": "Nepal", + "Country_Netherlands": "Netherlands", + "Country_Netherlands_Antilles": "Netherlands Antilles", + "Country_New_Caledonia": "New Caledonia", + "Country_New_Zealand": "New Zealand", + "Country_Nicaragua": "Nicaragua", + "Country_Niger": "Niger", + "Country_Nigeria": "Nigeria", + "Country_Niue": "Niue", + "Country_Norfolk_Island": "Norfolk Island", + "Country_Northern_Mariana_Islands": "Northern Mariana Islands", + "Country_Norway": "Norway", + "Country_Oman": "Oman", + "Country_Pakistan": "Pakistan", + "Country_Palau": "Palau", + "Country_Palestinian_Territory_Occupied": "Palestinian Territory, Occupied", + "Country_Panama": "Panama", + "Country_Papua_New_Guinea": "Papua New Guinea", + "Country_Paraguay": "Paraguay", + "Country_Peru": "Peru", + "Country_Philippines": "Philippines", + "Country_Pitcairn": "Pitcairn", + "Country_Poland": "Poland", + "Country_Portugal": "Portugal", + "Country_Puerto_Rico": "Puerto Rico", + "Country_Qatar": "Qatar", + "Country_Reunion": "Reunion", + "Country_Romania": "Romania", + "Country_Russian_Federation": "Russian Federation", + "Country_Rwanda": "Rwanda", + "Country_Saint_Helena": "Saint Helena", + "Country_Saint_Kitts_and_Nevis": "Saint Kitts and Nevis", + "Country_Saint_Lucia": "Saint Lucia", + "Country_Saint_Pierre_and_Miquelon": "Saint Pierre and Miquelon", + "Country_Saint_Vincent_and_The_Grenadines": "Saint Vincent and The Grenadines", + "Country_Samoa": "Samoa", + "Country_San_Marino": "San Marino", + "Country_Sao_Tome_and_Principe": "Sao Tome and Principe", + "Country_Saudi_Arabia": "Saudi Arabia", + "Country_Senegal": "Senegal", + "Country_Serbia_and_Montenegro": "Serbia and Montenegro", + "Country_Seychelles": "Seychelles", + "Country_Sierra_Leone": "Sierra Leone", + "Country_Singapore": "Singapore", + "Country_Slovakia": "Slovakia", + "Country_Slovenia": "Slovenia", + "Country_Solomon_Islands": "Solomon Islands", + "Country_Somalia": "Somalia", + "Country_South_Africa": "South Africa", + "Country_South_Georgia_and_The_South_Sandwich_Islands": "South Georgia and The South Sandwich Islands", + "Country_Spain": "Spain", + "Country_Sri_Lanka": "Sri Lanka", + "Country_Sudan": "Sudan", + "Country_Suriname": "Suriname", + "Country_Svalbard_and_Jan_Mayen": "Svalbard and Jan Mayen", + "Country_Swaziland": "Swaziland", + "Country_Sweden": "Sweden", + "Country_Switzerland": "Switzerland", + "Country_Syrian_Arab_Republic": "Syrian Arab Republic", + "Country_Taiwan_Province_of_China": "Taiwan, Province of China", + "Country_Tajikistan": "Tajikistan", + "Country_Tanzania_United_Republic_of": "Tanzania, United Republic of", + "Country_Thailand": "Thailand", + "Country_Timor_leste": "Timor-leste", + "Country_Togo": "Togo", + "Country_Tokelau": "Tokelau", + "Country_Tonga": "Tonga", + "Country_Trinidad_and_Tobago": "Trinidad and Tobago", + "Country_Tunisia": "Tunisia", + "Country_Turkey": "Turkey", + "Country_Turkmenistan": "Turkmenistan", + "Country_Turks_and_Caicos_Islands": "Turks and Caicos Islands", + "Country_Tuvalu": "Tuvalu", + "Country_Uganda": "Uganda", + "Country_Ukraine": "Ukraine", + "Country_United_Arab_Emirates": "United Arab Emirates", + "Country_United_Kingdom": "United Kingdom", + "Country_United_States": "United States", + "Country_United_States_Minor_Outlying_Islands": "United States Minor Outlying Islands", + "Country_Uruguay": "Uruguay", + "Country_Uzbekistan": "Uzbekistan", + "Country_Vanuatu": "Vanuatu", + "Country_Venezuela": "Venezuela", + "Country_Viet_Nam": "Viet Nam", + "Country_Virgin_Islands_British": "Virgin Islands, British", + "Country_Virgin_Islands_US": "Virgin Islands, U.S.", + "Country_Wallis_and_Futuna": "Wallis and Futuna", + "Country_Western_Sahara": "Western Sahara", + "Country_Yemen": "Yemen", + "Country_Zambia": "Zambia", + "Country_Zimbabwe": "Zimbabwe" +} diff --git a/packages/rocketchat-lib/server/models/Settings.js b/packages/rocketchat-lib/server/models/Settings.js index 7da29bee37faf..493eb41511fc1 100644 --- a/packages/rocketchat-lib/server/models/Settings.js +++ b/packages/rocketchat-lib/server/models/Settings.js @@ -92,6 +92,10 @@ class ModelSettings extends RocketChat.models._Base { }); } + findSetupWizardSettings() { + return this.find({ wizard: { '$exists': true, '$ne': null } }); + } + // UPDATE updateValueById(_id, value) { const query = { diff --git a/packages/rocketchat-lib/server/startup/settings.js b/packages/rocketchat-lib/server/startup/settings.js index 5d21ad446de4d..ad5bd54d33390 100644 --- a/packages/rocketchat-lib/server/startup/settings.js +++ b/packages/rocketchat-lib/server/startup/settings.js @@ -628,6 +628,10 @@ RocketChat.settings.addGroup('OAuth', function() { }); RocketChat.settings.addGroup('General', function() { + this.add('Show_Setup_Wizard', true, { + type: 'boolean', + public: true + }); this.add('Site_Url', typeof __meteor_runtime_config__ !== 'undefined' && __meteor_runtime_config__ !== null ? __meteor_runtime_config__.ROOT_URL : null, { type: 'string', i18nDescription: 'Site_Url_Description', @@ -635,11 +639,19 @@ RocketChat.settings.addGroup('General', function() { }); this.add('Site_Name', 'Rocket.Chat', { type: 'string', - 'public': true + 'public': true, + wizard: { + step: 3, + order: 0 + } }); this.add('Language', '', { type: 'language', - 'public': true + 'public': true, + wizard: { + step: 3, + order: 1 + } }); this.add('Allow_Invalid_SelfSigned_Certs', false, { type: 'boolean' @@ -1625,4 +1637,1192 @@ RocketChat.settings.addGroup('Logs', function() { }); }); -RocketChat.settings.init(); +RocketChat.settings.addGroup('Setup_Wizard', function() { + this.section('Organization_Info', function() { + this.add('Organization_Type', '', { + type: 'select', + values: [ + { + key: 'nonprofit', + i18nLabel: 'Nonprofit' + }, + { + key: 'enterprise', + i18nLabel: 'Enterprise' + }, + { + key: 'government', + i18nLabel: 'Government' + }, + { + key: 'community', + i18nLabel: 'Community' + } + ], + public: true, + wizard: { + step: 2, + order: 0 + } + }); + this.add('Organization_Name', '', { + type: 'string', + public: true, + wizard: { + step: 2, + order: 1 + } + }); + this.add('Industry', '', { + type: 'select', + values: [ + { + key: 'advocacy', + i18nLabel: 'Advocacy' + }, + { + key: 'blockchain', + i18nLabel: 'Blockchain' + }, + { + key: 'helpCenter', + i18nLabel: 'Help_Center' + }, + { + key: 'manufacturing', + i18nLabel: 'Manufacturing' + }, + { + key: 'education', + i18nLabel: 'Education' + }, + { + key: 'insurance', + i18nLabel: 'Insurance' + }, + { + key: 'logistics', + i18nLabel: 'Logistics' + }, + { + key: 'consulting', + i18nLabel: 'Consulting' + }, + { + key: 'entertainment', + i18nLabel: 'Entertainment' + }, + { + key: 'publicRelations', + i18nLabel: 'Public_Relations' + }, + { + key: 'religious', + i18nLabel: 'Religious' + }, + { + key: 'gaming', + i18nLabel: 'Gaming' + }, + { + key: 'socialNetwork', + i18nLabel: 'Social_Network' + }, + { + key: 'realEstate', + i18nLabel: 'Real_Estate' + }, + { + key: 'tourism', + i18nLabel: 'Tourism' + }, + { + key: 'telecom', + i18nLabel: 'Telecom' + }, + { + key: 'consumerGoods', + i18nLabel: 'Consumer_Goods' + }, + { + key: 'financialServices', + i18nLabel: 'Financial_Services' + }, + { + key: 'healthcarePharmaceutical', + i18nLabel: 'Healthcare_and_Pharmaceutical' + }, + { + key: 'industry', + i18nLabel: 'Industry' + }, + { + key: 'media', + i18nLabel: 'Media' + }, + { + key: 'retail', + i18nLabel: 'Retail' + }, + { + key: 'technologyServices', + i18nLabel: 'Technology_Services' + }, + { + key: 'technologyProvider', + i18nLabel: 'Technology_Provider' + }, + { + key: 'other', + i18nLabel: 'Other' + } + ], + public: true, + wizard: { + step: 2, + order: 2 + } + }); + this.add('Size', '', { + type: 'select', + values: [ + { + key: '0', + i18nLabel: '1-10 people' + }, + { + key: '1', + i18nLabel: '11-50 people' + }, + { + key: '2', + i18nLabel: '51-100 people' + }, + { + key: '3', + i18nLabel: '101-250 people' + }, + { + key: '4', + i18nLabel: '251-500 people' + }, + { + key: '5', + i18nLabel: '501-1000 people' + }, + { + key: '6', + i18nLabel: '1001-4000 people' + }, + { + key: '7', + i18nLabel: '4000 or more people' + } + ], + public: true, + wizard: { + step: 2, + order: 3 + } + }); + this.add('Country', '', { + type: 'select', + values: [ + { + key: 'worldwide', + i18nLabel: 'Worldwide' + }, + { + key: 'afghanistan', + i18nLabel: 'Country_Afghanistan' + }, + { + key: 'albania', + i18nLabel: 'Country_Albania' + }, + { + key: 'algeria', + i18nLabel: 'Country_Algeria' + }, + { + key: 'americanSamoa', + i18nLabel: 'Country_American_Samoa' + }, + { + key: 'andorra', + i18nLabel: 'Country_Andorra' + }, + { + key: 'angola', + i18nLabel: 'Country_Angola' + }, + { + key: 'anguilla', + i18nLabel: 'Country_Anguilla' + }, + { + key: 'antarctica', + i18nLabel: 'Country_Antarctica' + }, + { + key: 'antiguaAndBarbuda', + i18nLabel: 'Country_Antigua_and_Barbuda' + }, + { + key: 'argentina', + i18nLabel: 'Country_Argentina' + }, + { + key: 'armenia', + i18nLabel: 'Country_Armenia' + }, + { + key: 'aruba', + i18nLabel: 'Country_Aruba' + }, + { + key: 'australia', + i18nLabel: 'Country_Australia' + }, + { + key: 'austria', + i18nLabel: 'Country_Austria' + }, + { + key: 'azerbaijan', + i18nLabel: 'Country_Azerbaijan' + }, + { + key: 'bahamas', + i18nLabel: 'Country_Bahamas' + }, + { + key: 'bahrain', + i18nLabel: 'Country_Bahrain' + }, + { + key: 'bangladesh', + i18nLabel: 'Country_Bangladesh' + }, + { + key: 'barbados', + i18nLabel: 'Country_Barbados' + }, + { + key: 'belarus', + i18nLabel: 'Country_Belarus' + }, + { + key: 'belgium', + i18nLabel: 'Country_Belgium' + }, + { + key: 'belize', + i18nLabel: 'Country_Belize' + }, + { + key: 'benin', + i18nLabel: 'Country_Benin' + }, + { + key: 'bermuda', + i18nLabel: 'Country_Bermuda' + }, + { + key: 'bhutan', + i18nLabel: 'Country_Bhutan' + }, + { + key: 'bolivia', + i18nLabel: 'Country_Bolivia' + }, + { + key: 'bosniaAndHerzegovina', + i18nLabel: 'Country_Bosnia_and_Herzegovina' + }, + { + key: 'botswana', + i18nLabel: 'Country_Botswana' + }, + { + key: 'bouvetIsland', + i18nLabel: 'Country_Bouvet_Island' + }, + { + key: 'brazil', + i18nLabel: 'Country_Brazil' + }, + { + key: 'britishIndianOceanTerritory', + i18nLabel: 'Country_British_Indian_Ocean_Territory' + }, + { + key: 'bruneiDarussalam', + i18nLabel: 'Country_Brunei_Darussalam' + }, + { + key: 'bulgaria', + i18nLabel: 'Country_Bulgaria' + }, + { + key: 'burkinaFaso', + i18nLabel: 'Country_Burkina_Faso' + }, + { + key: 'burundi', + i18nLabel: 'Country_Burundi' + }, + { + key: 'cambodia', + i18nLabel: 'Country_Cambodia' + }, + { + key: 'cameroon', + i18nLabel: 'Country_Cameroon' + }, + { + key: 'canada', + i18nLabel: 'Country_Canada' + }, + { + key: 'capeVerde', + i18nLabel: 'Country_Cape_Verde' + }, + { + key: 'caymanIslands', + i18nLabel: 'Country_Cayman_Islands' + }, + { + key: 'centralAfricanRepublic', + i18nLabel: 'Country_Central_African_Republic' + }, + { + key: 'chad', + i18nLabel: 'Country_Chad' + }, + { + key: 'chile', + i18nLabel: 'Country_Chile' + }, + { + key: 'china', + i18nLabel: 'Country_China' + }, + { + key: 'christmasIsland', + i18nLabel: 'Country_Christmas_Island' + }, + { + key: 'cocosKeelingIslands', + i18nLabel: 'Country_Cocos_Keeling_Islands' + }, + { + key: 'colombia', + i18nLabel: 'Country_Colombia' + }, + { + key: 'comoros', + i18nLabel: 'Country_Comoros' + }, + { + key: 'congo', + i18nLabel: 'Country_Congo' + }, + { + key: 'congoTheDemocraticRepublicOfThe', + i18nLabel: 'Country_Congo_The_Democratic_Republic_of_The' + }, + { + key: 'cookIslands', + i18nLabel: 'Country_Cook_Islands' + }, + { + key: 'costaRica', + i18nLabel: 'Country_Costa_Rica' + }, + { + key: 'coteDivoire', + i18nLabel: 'Country_Cote_Divoire' + }, + { + key: 'croatia', + i18nLabel: 'Country_Croatia' + }, + { + key: 'cuba', + i18nLabel: 'Country_Cuba' + }, + { + key: 'cyprus', + i18nLabel: 'Country_Cyprus' + }, + { + key: 'czechRepublic', + i18nLabel: 'Country_Czech_Republic' + }, + { + key: 'denmark', + i18nLabel: 'Country_Denmark' + }, + { + key: 'djibouti', + i18nLabel: 'Country_Djibouti' + }, + { + key: 'dominica', + i18nLabel: 'Country_Dominica' + }, + { + key: 'dominicanRepublic', + i18nLabel: 'Country_Dominican_Republic' + }, + { + key: 'ecuador', + i18nLabel: 'Country_Ecuador' + }, + { + key: 'egypt', + i18nLabel: 'Country_Egypt' + }, + { + key: 'elSalvador', + i18nLabel: 'Country_El_Salvador' + }, + { + key: 'equatorialGuinea', + i18nLabel: 'Country_Equatorial_Guinea' + }, + { + key: 'eritrea', + i18nLabel: 'Country_Eritrea' + }, + { + key: 'estonia', + i18nLabel: 'Country_Estonia' + }, + { + key: 'ethiopia', + i18nLabel: 'Country_Ethiopia' + }, + { + key: 'falklandIslandsMalvinas', + i18nLabel: 'Country_Falkland_Islands_Malvinas' + }, + { + key: 'faroeIslands', + i18nLabel: 'Country_Faroe_Islands' + }, + { + key: 'fiji', + i18nLabel: 'Country_Fiji' + }, + { + key: 'finland', + i18nLabel: 'Country_Finland' + }, + { + key: 'france', + i18nLabel: 'Country_France' + }, + { + key: 'frenchGuiana', + i18nLabel: 'Country_French_Guiana' + }, + { + key: 'frenchPolynesia', + i18nLabel: 'Country_French_Polynesia' + }, + { + key: 'frenchSouthernTerritories', + i18nLabel: 'Country_French_Southern_Territories' + }, + { + key: 'gabon', + i18nLabel: 'Country_Gabon' + }, + { + key: 'gambia', + i18nLabel: 'Country_Gambia' + }, + { + key: 'georgia', + i18nLabel: 'Country_Georgia' + }, + { + key: 'germany', + i18nLabel: 'Country_Germany' + }, + { + key: 'ghana', + i18nLabel: 'Country_Ghana' + }, + { + key: 'gibraltar', + i18nLabel: 'Country_Gibraltar' + }, + { + key: 'greece', + i18nLabel: 'Country_Greece' + }, + { + key: 'greenland', + i18nLabel: 'Country_Greenland' + }, + { + key: 'grenada', + i18nLabel: 'Country_Grenada' + }, + { + key: 'guadeloupe', + i18nLabel: 'Country_Guadeloupe' + }, + { + key: 'guam', + i18nLabel: 'Country_Guam' + }, + { + key: 'guatemala', + i18nLabel: 'Country_Guatemala' + }, + { + key: 'guinea', + i18nLabel: 'Country_Guinea' + }, + { + key: 'guineaBissau', + i18nLabel: 'Country_Guinea_bissau' + }, + { + key: 'guyana', + i18nLabel: 'Country_Guyana' + }, + { + key: 'haiti', + i18nLabel: 'Country_Haiti' + }, + { + key: 'heardIslandAndMcdonaldIslands', + i18nLabel: 'Country_Heard_Island_and_Mcdonald_Islands' + }, + { + key: 'holySeeVaticanCityState', + i18nLabel: 'Country_Holy_See_Vatican_City_State' + }, + { + key: 'honduras', + i18nLabel: 'Country_Honduras' + }, + { + key: 'hongKong', + i18nLabel: 'Country_Hong_Kong' + }, + { + key: 'hungary', + i18nLabel: 'Country_Hungary' + }, + { + key: 'iceland', + i18nLabel: 'Country_Iceland' + }, + { + key: 'india', + i18nLabel: 'Country_India' + }, + { + key: 'indonesia', + i18nLabel: 'Country_Indonesia' + }, + { + key: 'iranIslamicRepublicOf', + i18nLabel: 'Country_Iran_Islamic_Republic_of' + }, + { + key: 'iraq', + i18nLabel: 'Country_Iraq' + }, + { + key: 'ireland', + i18nLabel: 'Country_Ireland' + }, + { + key: 'israel', + i18nLabel: 'Country_Israel' + }, + { + key: 'italy', + i18nLabel: 'Country_Italy' + }, + { + key: 'jamaica', + i18nLabel: 'Country_Jamaica' + }, + { + key: 'japan', + i18nLabel: 'Country_Japan' + }, + { + key: 'jordan', + i18nLabel: 'Country_Jordan' + }, + { + key: 'kazakhstan', + i18nLabel: 'Country_Kazakhstan' + }, + { + key: 'kenya', + i18nLabel: 'Country_Kenya' + }, + { + key: 'kiribati', + i18nLabel: 'Country_Kiribati' + }, + { + key: 'koreaDemocraticPeoplesRepublicOf', + i18nLabel: 'Country_Korea_Democratic_Peoples_Republic_of' + }, + { + key: 'koreaRepublicOf', + i18nLabel: 'Country_Korea_Republic_of' + }, + { + key: 'kuwait', + i18nLabel: 'Country_Kuwait' + }, + { + key: 'kyrgyzstan', + i18nLabel: 'Country_Kyrgyzstan' + }, + { + key: 'laoPeoplesDemocraticRepublic', + i18nLabel: 'Country_Lao_Peoples_Democratic_Republic' + }, + { + key: 'latvia', + i18nLabel: 'Country_Latvia' + }, + { + key: 'lebanon', + i18nLabel: 'Country_Lebanon' + }, + { + key: 'lesotho', + i18nLabel: 'Country_Lesotho' + }, + { + key: 'liberia', + i18nLabel: 'Country_Liberia' + }, + { + key: 'libyanArabJamahiriya', + i18nLabel: 'Country_Libyan_Arab_Jamahiriya' + }, + { + key: 'liechtenstein', + i18nLabel: 'Country_Liechtenstein' + }, + { + key: 'lithuania', + i18nLabel: 'Country_Lithuania' + }, + { + key: 'luxembourg', + i18nLabel: 'Country_Luxembourg' + }, + { + key: 'macao', + i18nLabel: 'Country_Macao' + }, + { + key: 'macedoniaTheFormerYugoslavRepublicOf', + i18nLabel: 'Country_Macedonia_The_Former_Yugoslav_Republic_of' + }, + { + key: 'madagascar', + i18nLabel: 'Country_Madagascar' + }, + { + key: 'malawi', + i18nLabel: 'Country_Malawi' + }, + { + key: 'malaysia', + i18nLabel: 'Country_Malaysia' + }, + { + key: 'maldives', + i18nLabel: 'Country_Maldives' + }, + { + key: 'mali', + i18nLabel: 'Country_Mali' + }, + { + key: 'malta', + i18nLabel: 'Country_Malta' + }, + { + key: 'marshallIslands', + i18nLabel: 'Country_Marshall_Islands' + }, + { + key: 'martinique', + i18nLabel: 'Country_Martinique' + }, + { + key: 'mauritania', + i18nLabel: 'Country_Mauritania' + }, + { + key: 'mauritius', + i18nLabel: 'Country_Mauritius' + }, + { + key: 'mayotte', + i18nLabel: 'Country_Mayotte' + }, + { + key: 'mexico', + i18nLabel: 'Country_Mexico' + }, + { + key: 'micronesiaFederatedStatesOf', + i18nLabel: 'Country_Micronesia_Federated_States_of' + }, + { + key: 'moldovaRepublicOf', + i18nLabel: 'Country_Moldova_Republic_of' + }, + { + key: 'monaco', + i18nLabel: 'Country_Monaco' + }, + { + key: 'mongolia', + i18nLabel: 'Country_Mongolia' + }, + { + key: 'montserrat', + i18nLabel: 'Country_Montserrat' + }, + { + key: 'morocco', + i18nLabel: 'Country_Morocco' + }, + { + key: 'mozambique', + i18nLabel: 'Country_Mozambique' + }, + { + key: 'myanmar', + i18nLabel: 'Country_Myanmar' + }, + { + key: 'namibia', + i18nLabel: 'Country_Namibia' + }, + { + key: 'nauru', + i18nLabel: 'Country_Nauru' + }, + { + key: 'nepal', + i18nLabel: 'Country_Nepal' + }, + { + key: 'netherlands', + i18nLabel: 'Country_Netherlands' + }, + { + key: 'netherlandsAntilles', + i18nLabel: 'Country_Netherlands_Antilles' + }, + { + key: 'newCaledonia', + i18nLabel: 'Country_New_Caledonia' + }, + { + key: 'newZealand', + i18nLabel: 'Country_New_Zealand' + }, + { + key: 'nicaragua', + i18nLabel: 'Country_Nicaragua' + }, + { + key: 'niger', + i18nLabel: 'Country_Niger' + }, + { + key: 'nigeria', + i18nLabel: 'Country_Nigeria' + }, + { + key: 'niue', + i18nLabel: 'Country_Niue' + }, + { + key: 'norfolkIsland', + i18nLabel: 'Country_Norfolk_Island' + }, + { + key: 'northernMarianaIslands', + i18nLabel: 'Country_Northern_Mariana_Islands' + }, + { + key: 'norway', + i18nLabel: 'Country_Norway' + }, + { + key: 'oman', + i18nLabel: 'Country_Oman' + }, + { + key: 'pakistan', + i18nLabel: 'Country_Pakistan' + }, + { + key: 'palau', + i18nLabel: 'Country_Palau' + }, + { + key: 'palestinianTerritoryOccupied', + i18nLabel: 'Country_Palestinian_Territory_Occupied' + }, + { + key: 'panama', + i18nLabel: 'Country_Panama' + }, + { + key: 'papuaNewGuinea', + i18nLabel: 'Country_Papua_New_Guinea' + }, + { + key: 'paraguay', + i18nLabel: 'Country_Paraguay' + }, + { + key: 'peru', + i18nLabel: 'Country_Peru' + }, + { + key: 'philippines', + i18nLabel: 'Country_Philippines' + }, + { + key: 'pitcairn', + i18nLabel: 'Country_Pitcairn' + }, + { + key: 'poland', + i18nLabel: 'Country_Poland' + }, + { + key: 'portugal', + i18nLabel: 'Country_Portugal' + }, + { + key: 'puertoRico', + i18nLabel: 'Country_Puerto_Rico' + }, + { + key: 'qatar', + i18nLabel: 'Country_Qatar' + }, + { + key: 'reunion', + i18nLabel: 'Country_Reunion' + }, + { + key: 'romania', + i18nLabel: 'Country_Romania' + }, + { + key: 'russianFederation', + i18nLabel: 'Country_Russian_Federation' + }, + { + key: 'rwanda', + i18nLabel: 'Country_Rwanda' + }, + { + key: 'saintHelena', + i18nLabel: 'Country_Saint_Helena' + }, + { + key: 'saintKittsAndNevis', + i18nLabel: 'Country_Saint_Kitts_and_Nevis' + }, + { + key: 'saintLucia', + i18nLabel: 'Country_Saint_Lucia' + }, + { + key: 'saintPierreAndMiquelon', + i18nLabel: 'Country_Saint_Pierre_and_Miquelon' + }, + { + key: 'saintVincentAndTheGrenadines', + i18nLabel: 'Country_Saint_Vincent_and_The_Grenadines' + }, + { + key: 'samoa', + i18nLabel: 'Country_Samoa' + }, + { + key: 'sanMarino', + i18nLabel: 'Country_San_Marino' + }, + { + key: 'saoTomeAndPrincipe', + i18nLabel: 'Country_Sao_Tome_and_Principe' + }, + { + key: 'saudiArabia', + i18nLabel: 'Country_Saudi_Arabia' + }, + { + key: 'senegal', + i18nLabel: 'Country_Senegal' + }, + { + key: 'serbiaAndMontenegro', + i18nLabel: 'Country_Serbia_and_Montenegro' + }, + { + key: 'seychelles', + i18nLabel: 'Country_Seychelles' + }, + { + key: 'sierraLeone', + i18nLabel: 'Country_Sierra_Leone' + }, + { + key: 'singapore', + i18nLabel: 'Country_Singapore' + }, + { + key: 'slovakia', + i18nLabel: 'Country_Slovakia' + }, + { + key: 'slovenia', + i18nLabel: 'Country_Slovenia' + }, + { + key: 'solomonIslands', + i18nLabel: 'Country_Solomon_Islands' + }, + { + key: 'somalia', + i18nLabel: 'Country_Somalia' + }, + { + key: 'southAfrica', + i18nLabel: 'Country_South_Africa' + }, + { + key: 'southGeorgiaAndTheSouthSandwichIslands', + i18nLabel: 'Country_South_Georgia_and_The_South_Sandwich_Islands' + }, + { + key: 'spain', + i18nLabel: 'Country_Spain' + }, + { + key: 'sriLanka', + i18nLabel: 'Country_Sri_Lanka' + }, + { + key: 'sudan', + i18nLabel: 'Country_Sudan' + }, + { + key: 'suriname', + i18nLabel: 'Country_Suriname' + }, + { + key: 'svalbardAndJanMayen', + i18nLabel: 'Country_Svalbard_and_Jan_Mayen' + }, + { + key: 'swaziland', + i18nLabel: 'Country_Swaziland' + }, + { + key: 'sweden', + i18nLabel: 'Country_Sweden' + }, + { + key: 'switzerland', + i18nLabel: 'Country_Switzerland' + }, + { + key: 'syrianArabRepublic', + i18nLabel: 'Country_Syrian_Arab_Republic' + }, + { + key: 'taiwanProvinceOfChina', + i18nLabel: 'Country_Taiwan_Province_of_China' + }, + { + key: 'tajikistan', + i18nLabel: 'Country_Tajikistan' + }, + { + key: 'tanzaniaUnitedRepublicOf', + i18nLabel: 'Country_Tanzania_United_Republic_of' + }, + { + key: 'thailand', + i18nLabel: 'Country_Thailand' + }, + { + key: 'timorLeste', + i18nLabel: 'Country_Timor_leste' + }, + { + key: 'togo', + i18nLabel: 'Country_Togo' + }, + { + key: 'tokelau', + i18nLabel: 'Country_Tokelau' + }, + { + key: 'tonga', + i18nLabel: 'Country_Tonga' + }, + { + key: 'trinidadAndTobago', + i18nLabel: 'Country_Trinidad_and_Tobago' + }, + { + key: 'tunisia', + i18nLabel: 'Country_Tunisia' + }, + { + key: 'turkey', + i18nLabel: 'Country_Turkey' + }, + { + key: 'turkmenistan', + i18nLabel: 'Country_Turkmenistan' + }, + { + key: 'turksAndCaicosIslands', + i18nLabel: 'Country_Turks_and_Caicos_Islands' + }, + { + key: 'tuvalu', + i18nLabel: 'Country_Tuvalu' + }, + { + key: 'uganda', + i18nLabel: 'Country_Uganda' + }, + { + key: 'ukraine', + i18nLabel: 'Country_Ukraine' + }, + { + key: 'unitedArabEmirates', + i18nLabel: 'Country_United_Arab_Emirates' + }, + { + key: 'unitedKingdom', + i18nLabel: 'Country_United_Kingdom' + }, + { + key: 'unitedStates', + i18nLabel: 'Country_United_States' + }, + { + key: 'unitedStatesMinorOutlyingIslands', + i18nLabel: 'Country_United_States_Minor_Outlying_Islands' + }, + { + key: 'uruguay', + i18nLabel: 'Country_Uruguay' + }, + { + key: 'uzbekistan', + i18nLabel: 'Country_Uzbekistan' + }, + { + key: 'vanuatu', + i18nLabel: 'Country_Vanuatu' + }, + { + key: 'venezuela', + i18nLabel: 'Country_Venezuela' + }, + { + key: 'vietNam', + i18nLabel: 'Country_Viet_Nam' + }, + { + key: 'virginIslandsBritish', + i18nLabel: 'Country_Virgin_Islands_British' + }, + { + key: 'virginIslandsUS', + i18nLabel: 'Country_Virgin_Islands_US' + }, + { + key: 'wallisAndFutuna', + i18nLabel: 'Country_Wallis_and_Futuna' + }, + { + key: 'westernSahara', + i18nLabel: 'Country_Western_Sahara' + }, + { + key: 'yemen', + i18nLabel: 'Country_Yemen' + }, + { + key: 'zambia', + i18nLabel: 'Country_Zambia' + }, + { + key: 'zimbabwe', + i18nLabel: 'Country_Zimbabwe' + } + ], + public: true, + wizard: { + step: 2, + order: 4 + } + }); + this.add('Website', '', { + type: 'string', + public: true, + wizard: { + step: 2, + order: 5 + } + }); + this.add('Server_Type', '', { + type: 'select', + values: [ + { + key: 'privateTeam', + i18nLabel: 'Private_Team' + }, + { + key: 'publicCommunity', + i18nLabel: 'Public_Community' + } + ], + public: true, + wizard: { + step: 3, + order: 2 + } + }); + }); +}); + +RocketChat.settings.init(); + diff --git a/packages/rocketchat-setup-wizard/client/setupWizard.html b/packages/rocketchat-setup-wizard/client/setupWizard.html new file mode 100644 index 0000000000000..8a7b710054def --- /dev/null +++ b/packages/rocketchat-setup-wizard/client/setupWizard.html @@ -0,0 +1,192 @@ + + + + + + + + {{_ "Launched_successfully"}} + {{_ "Your_workspace_is_ready"}} + {{_ "Your_server_link"}} + {{siteUrl}} + + {{_ "Go_to_your_workspace"}} + + + + + + + + + + + + {{_ "Setup_Wizard"}} + + + {{_ "Setup_Wizard"}} + {{_ "Setup_Wizard_Info"}} + + {{#unless hasAdmin}}{{headerTitle 1}}{{/unless}} + {{headerTitle 2}}{{#unless hasAdmin}}{{/unless}} + {{headerTitle 3}} + {{#unless hasAdmin}}{{headerTitle 4}}{{/unless}} + + + + + + + + {{_ "Step"}} {{currentStep}} + {{headerTitle}} + + + + + + {{_ "Name"}} + + + {{> icon block="rc-input__icon-sv" icon="user"}} + + + + + + + + {{_ "Username"}} + + + {{> icon block="rc-input__icon-sv" icon="at"}} + + + + + + + + {{_ "Organization_Email"}} + + + {{> icon block="rc-input__icon-sv" icon="mail"}} + + + + + {{#if invalidEmail}} + + + {{> icon block="rc-input__error-icon" icon="warning" classes="rc-input__error-icon-svg"}} + + {{_ "Invalid_email"}} + + {{/if}} + + + + {{_ "Password"}} + + + {{> icon block="rc-input__icon-sv" icon="key"}} + + + + + + + + {{#each getSettings currentStep}} + {{#if $eq type 'select'}} + + + {{_ i18nLabel}} + + + {{#each values}} + {{_ i18nLabel}} + {{/each}} + + {{> icon block="rc-select__arrow" icon="arrow-down" }} + + + + {{/if}} + + {{#if $eq type 'string'}} + + + {{_ i18nLabel}} + + + + + + {{/if}} + + {{#if $eq type 'language'}} + + + {{_ i18nLabel}} + + + {{#each languages}} + {{name}} + {{/each}} + + {{> icon block="rc-select__arrow" icon="arrow-down" }} + + + + {{/if}} + {{/each}} + + + To receive free Rocket.Chat supplied features you need to register your server. + + + + + + Registered Server + + + {{> icon block="setup-wizard-forms__content-register-radio-icon" icon="check"}}Mobile push notifications + {{> icon block="setup-wizard-forms__content-register-radio-icon" icon="check"}}Omnichannel proxy + {{> icon block="setup-wizard-forms__content-register-radio-icon" icon="check"}}Social Network oAuth proxy + {{> icon block="setup-wizard-forms__content-register-radio-icon" icon="check"}}Apps Marketplace + + + + + + + Standalone Server + + + {{> icon block="setup-wizard-forms__content-register-radio-icon" icon="cross"}}Mobile push notifications + {{> icon block="setup-wizard-forms__content-register-radio-icon" icon="cross"}}Omnichannel proxy + {{> icon block="setup-wizard-forms__content-register-radio-icon" icon="cross"}}Social Network oAuth proxy + {{> icon block="setup-wizard-forms__content-register-radio-icon" icon="cross"}}Apps Marketplace + + + + + + + + + + + diff --git a/packages/rocketchat-setup-wizard/client/setupWizard.js b/packages/rocketchat-setup-wizard/client/setupWizard.js new file mode 100644 index 0000000000000..e04a03003f749 --- /dev/null +++ b/packages/rocketchat-setup-wizard/client/setupWizard.js @@ -0,0 +1,272 @@ +import s from 'underscore.string'; + +const setSettingsAndGo = (settings, registerServer = true) => { + const settingsFilter = Object.entries(settings) + .filter(([key]) => !/registration-|registerServer|currentStep/.test(key)) + .map(([_id, value]) => ({_id, value})); + + settingsFilter.push({ + _id: 'Statistics_reporting', + value: registerServer + }); + + RocketChat.settings.batchSet(settingsFilter, function(err) { + if (err) { + return handleError(err); + } + + localStorage.setItem('wizardFinal', true); + FlowRouter.go('setup-wizard-final'); + }); +}; + +Template.setupWizard.onCreated(function() { + if (localStorage.getItem('wizardFinal')) { + FlowRouter.go('setup-wizard-final'); + } + + this.hasAdmin = new ReactiveVar(false); + this.state = new ReactiveDict(); + this.wizardSettings = new ReactiveVar([]); + this.invalidEmail = new ReactiveVar(false); + + const storage = JSON.parse(localStorage.getItem('wizard')); + if (storage) { + Object.entries(storage).forEach(([key, value]) => { + this.state.set(key, value); + }); + } + + Tracker.autorun(() => { + const user = Meteor.user(); + if (user) { + if (!this.hasAdmin.get()) { + if (user.roles && user.roles.includes('admin')) { + this.state.set('currentStep', 2); + this.hasAdmin.set(true); + } else { + this.hasAdmin.set(false); + } + } + + Meteor.call('getWizardSettings', (error, result) => { + if (error) { + return handleError(error); + } + + this.wizardSettings.set(result); + }); + } else { + this.state.set('currentStep', 1); + } + + if (RocketChat.settings.get('Show_Setup_Wizard') === false) { + FlowRouter.go('home'); + } + + const states = this.state.all(); + states['registration-pass'] = ''; + localStorage.setItem('wizard', JSON.stringify(states)); + }); +}); + +Template.setupWizard.onRendered(function() { + $('#initial-page-loading').remove(); +}); + +Template.setupWizard.events({ + 'click .setup-wizard-forms__footer-next'(e, t) { + const currentStep = t.state.get('currentStep'); + const hasAdmin = t.hasAdmin.get(); + + if (!hasAdmin && currentStep === 1) { + const emailValue = t.state.get('registration-email'); + const invalidEmail = !/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]+\b/i.test(emailValue); + t.invalidEmail.set(invalidEmail); + + if (invalidEmail) { + return false; + } + + const state = t.state.all(); + const registration = Object.entries(state).filter(([key]) => /registration-/.test(key)); + const registrationData = Object.assign(...registration.map(d => ({[d[0].replace('registration-', '')]: d[1]}))); + + Meteor.call('registerUser', registrationData, error => { + if (error) { + return handleError(error); + } + + RocketChat.callbacks.run('userRegistered'); + + Meteor.loginWithPassword(s.trim(registrationData.email), registrationData.pass, error => { + if (error && error.error === 'error-invalid-email') { + toastr.success(t('We_have_sent_registration_email')); + return false; + } + + Session.set('forceLogin', false); + + Meteor.call('setUsername', registrationData.username, error => { + if (error) { + return handleError(error); + } + + RocketChat.callbacks.run('usernameSet'); + }); + }); + }); + } + + if (hasAdmin && currentStep === 3) { + setSettingsAndGo(t.state.all()); + return false; + } + + if (currentStep === 4) { + setSettingsAndGo(t.state.all(), JSON.parse(t.state.get('registerServer') || true)); + + return false; + } + + t.state.set('currentStep', currentStep + 1); + }, + 'click .setup-wizard-forms__footer-back'(e, t) { + t.state.set('currentStep', t.state.get('currentStep') - 1); + }, + 'input .js-setting-data'(e, t) { + t.state.set(e.currentTarget.name, e.currentTarget.value); + } +}); + +Template.setupWizard.helpers({ + currentStep() { + return Template.instance().state.get('currentStep'); + }, + itemModifier(step) { + const current = Template.instance().state.get('currentStep'); + + if (current === step) { + return 'setup-wizard-info__steps-item--active'; + } + + if (current > step) { + return 'setup-wizard-info__steps-item--past'; + } + + return ''; + }, + getValue(name) { + return Template.instance().state.get(name); + }, + selectedValue(setting, optionValue) { + return Template.instance().state.get(setting) === optionValue; + }, + isDisabled() { + const user = Meteor.user(); + if (user && user.roles && !user.roles.includes('admin')) { + return 'disabled'; + } + + if (Template.instance().state.get('currentStep') === 1) { + const state = Template.instance().state.all(); + + if (Object.entries(state).filter(([key, value]) => /registration-/.test(key) && !value).length) { + return 'disabled'; + } + } + + return ''; + }, + headerTitle(step) { + if (!step) { + step = Template.instance().state.get('currentStep'); + } + + switch (step) { + case 1: return t('Admin_Info'); + case 2: return t('Organization_Info'); + case 3: return t('Server_Info'); + case 4: return t('Register_Server'); + } + }, + showStep() { + const currentStep = Template.instance().state.get('currentStep'); + if (currentStep === 2 || currentStep === 3) { + return 'setup-wizard-forms__content-step--active'; + } + + return ''; + }, + getSettings(step) { + return Template.instance().wizardSettings.get() + .filter(setting => setting.wizard.step === step) + .sort((a, b) => a.wizard.order - b.wizard.order); + }, + languages() { + const languages = TAPi18n.getLanguages(); + + const result = Object.entries(languages).map(language => { + const obj = language[1]; + obj.key = language[0]; + return obj; + }).sort((a, b) => a.key - b.key); + + result.unshift({ + 'name': 'Default', + 'en': 'Default', + 'key': '' + }); + + return result; + }, + hasAdmin() { + return Template.instance().hasAdmin.get(); + }, + invalidEmail() { + return Template.instance().invalidEmail.get(); + }, + showBackButton() { + if (Template.instance().hasAdmin.get()) { + if (Template.instance().state.get('currentStep') > 2) { + return true; + } + + return false; + } + + if (Template.instance().state.get('currentStep') > 1) { + return true; + } + + return false; + } +}); + +Template.setupWizardFinal.onCreated(function() { + Tracker.autorun(() => { + if (RocketChat.settings.get('Show_Setup_Wizard') === false) { + FlowRouter.go('home'); + } + }); +}); + +Template.setupWizardFinal.onRendered(function() { + $('#initial-page-loading').remove(); +}); + +Template.setupWizardFinal.events({ + 'click .js-finish'() { + RocketChat.settings.set('Show_Setup_Wizard', false, function() { + localStorage.removeItem('wizard'); + localStorage.removeItem('wizardFinal'); + FlowRouter.go('home'); + }); + } +}); + +Template.setupWizardFinal.helpers({ + siteUrl() { + return RocketChat.settings.get('Site_Url'); + } +}); diff --git a/packages/rocketchat-setup-wizard/package.js b/packages/rocketchat-setup-wizard/package.js new file mode 100644 index 0000000000000..b9d07f3caeb3e --- /dev/null +++ b/packages/rocketchat-setup-wizard/package.js @@ -0,0 +1,17 @@ +Package.describe({ + name: 'rocketchat:setup-wizard', + version: '0.0.1', + summary: '', + git: '' +}); + +Package.onUse(function(api) { + api.use('ecmascript'); + api.use('templating', 'client'); + api.use('rocketchat:theme'); + + api.addFiles('client/setupWizard.html', 'client'); + api.addFiles('client/setupWizard.js', 'client'); + + api.addFiles('server/lib/getWizardSettings.js', 'server'); +}); diff --git a/packages/rocketchat-setup-wizard/server/lib/getWizardSettings.js b/packages/rocketchat-setup-wizard/server/lib/getWizardSettings.js new file mode 100644 index 0000000000000..918c3225bd234 --- /dev/null +++ b/packages/rocketchat-setup-wizard/server/lib/getWizardSettings.js @@ -0,0 +1,9 @@ +Meteor.methods({ + getWizardSettings() { + if (RocketChat.authz.hasRole(Meteor.userId(), 'admin') && RocketChat.models && RocketChat.models.Settings) { + return RocketChat.models.Settings.findSetupWizardSettings().fetch(); + } + + throw new Meteor.Error('settings-are-not-ready', 'Settings are not ready'); + } +}); diff --git a/packages/rocketchat-statistics/server/functions/get.js b/packages/rocketchat-statistics/server/functions/get.js index c0e069044a600..226119a71511b 100644 --- a/packages/rocketchat-statistics/server/functions/get.js +++ b/packages/rocketchat-statistics/server/functions/get.js @@ -5,6 +5,44 @@ import os from 'os'; RocketChat.statistics.get = function _getStatistics() { const statistics = {}; + // Setup Wizard + statistics.wizard = {}; + if (RocketChat.models.Settings.findOne('Organization_Type')) { + statistics.wizard.organizationType = RocketChat.models.Settings.findOne('Organization_Type').value; + } + + if (RocketChat.models.Settings.findOne('Organization_Name')) { + statistics.wizard.organizationName = RocketChat.models.Settings.findOne('Organization_Name').value; + } + + if (RocketChat.models.Settings.findOne('Industry')) { + statistics.wizard.industry = RocketChat.models.Settings.findOne('Industry').value; + } + + if (RocketChat.models.Settings.findOne('Size')) { + statistics.wizard.size = RocketChat.models.Settings.findOne('Size').value; + } + + if (RocketChat.models.Settings.findOne('Country')) { + statistics.wizard.country = RocketChat.models.Settings.findOne('Country').value; + } + + if (RocketChat.models.Settings.findOne('Website')) { + statistics.wizard.website = RocketChat.models.Settings.findOne('Website').value; + } + + if (RocketChat.models.Settings.findOne('Site_Name')) { + statistics.wizard.siteName = RocketChat.models.Settings.findOne('Site_Name').value; + } + + if (RocketChat.models.Settings.findOne('Language')) { + statistics.wizard.siteName = RocketChat.models.Settings.findOne('Site_Name').value; + } + + if (RocketChat.models.Settings.findOne('Server_Type')) { + statistics.wizard.serverType = RocketChat.models.Settings.findOne('Server_Type').value; + } + // Version statistics.uniqueId = RocketChat.settings.get('uniqueID'); if (RocketChat.models.Settings.findOne('uniqueID')) { diff --git a/packages/rocketchat-theme/client/imports/components/setup-wizard.css b/packages/rocketchat-theme/client/imports/components/setup-wizard.css new file mode 100644 index 0000000000000..e8a5fd591ca7d --- /dev/null +++ b/packages/rocketchat-theme/client/imports/components/setup-wizard.css @@ -0,0 +1,465 @@ +.setup-wizard { + display: flex; + + width: 100%; + height: 100%; + + background-color: #f7f8fa; + + justify-content: center; + + &-info { + flex: 0 0 350px; + + margin: 55px 65px 0 80px; + + &__header{ + display: flex; + + margin: 0 -0.375rem 3rem; + align-items: center; + + &-logo { + margin: 0 0.375rem; + } + + &-tag { + margin: 0 0.375rem; + + padding: 4px 8px; + + letter-spacing: 0.05rem; + + text-transform: uppercase; + + color: #ffffff; + + border-radius: 50px; + background: #2f343d; + + font-size: 10px; + + line-height: 1rem; + } + } + + &__content { + &-title { + margin-bottom: 1rem; + + letter-spacing: 0.03rem; + + color: #2f343d; + + font-size: 2rem; + + font-weight: 600; + + line-height: 2.6rem; + } + + &-text { + margin-bottom: 3rem; + + color: #9ea2a8; + + font-size: 1rem; + + font-weight: 500; + + line-height: 1.5rem; + } + } + + &__steps { + counter-reset: steps; + + &-item { + position: relative; + + margin: 0 -0.5rem; + + counter-increment: steps; + + color: #d3d5d9; + + font-size: 0.875rem; + font-weight: 500; + + &:not(:last-child) { + margin-bottom: 2rem; + + &::after { + position: absolute; + bottom: -1rem; + left: 1.2rem; + + display: block; + + width: 1px; + height: 1rem; + + content: ""; + + background-color: #d3d5d9; + } + } + + &::before { + display: inline-flex; + + width: 1.5rem; + height: 1.5rem; + margin: 0 0.5rem; + + content: counter(steps); + + color: #d3d5d9; + + border: 1px solid #d3d5d9; + border-radius: 50px; + + font-size: 0.75rem; + align-items: center; + justify-content: center; + } + + &--active { + color: #1d74f5; + + &::before { + color: #1d74f5; + border-color: #1d74f5; + } + } + + &--past { + color: #2f343d; + + &::before { + color: #ffffff; + background-color: #1d74f5; + } + + &::after { + background-color: #1d74f5 !important; + } + + & .setup-wizard-info__steps-item-bonding { + background-color: #1d74f5; + } + } + + &-bonding { + position: absolute; + top: -1rem; + left: 1.2rem; + + display: block; + + width: 1px; + height: 1rem; + + background-color: currentColor; + } + } + } + } + + &-forms { + flex: 1 1 auto; + + &__wrapper { + display: flex; + overflow-y: auto; + + width: calc(100% - 1rem); + height: calc(100% - 2rem); + margin: 1rem 1rem 1rem 0; + + padding: 3rem; + + border-radius: 2px; + background: #ffffff; + box-shadow: 0 2px 4px 0 rgba(0,0,0,0.08); + justify-content: center; + } + + &__box { + display: flex; + flex-direction: column; + + width: 350px; + } + + &__header { + margin-bottom: 2rem; + + &-step { + display: block; + + margin-bottom: 3px; + + letter-spacing: 0.05rem; + + text-transform: uppercase; + + color: #caced1; + + font-size: 0.75rem; + + line-height: 1.125rem; + } + + &-title { + letter-spacing: 0.05rem; + + color: #1f2329; + + font-size: 1.25rem; + font-weight: 500; + + line-height: 1.75rem; + } + } + + &__content { + margin-bottom: 2rem; + + &-step { + display: none; + + &--active { + display: block; + } + } + + &-text { + + margin-bottom: 2rem; + + color: #9ea2a8; + + font-size: 1rem; + font-weight: 500; + + line-height: 1.5rem; + } + + &-register { + display: flex; + flex-direction: column; + + &-option { + + display: block; + + padding: 1.5rem; + + cursor: pointer; + + color: #2f343d; + border: 1px solid #e7ebf2; + + border-radius: 2px; + + font-size: 0.875rem; + + line-height: 1.25rem; + + &:first-child { + margin-bottom: 1rem; + } + } + + &-radio { + position: relative; + + display: flex; + + margin: 0 -0.5rem 1rem; + + &-element { + position: absolute; + z-index: -1; + top: 0; + left: 0; + + width: 0; + height: 0; + + &:checked + .setup-wizard-forms__content-register-radio-fake { + + position: relative; + + border-color: #1d74f5; + + &::before { + position: absolute; + + top: 3px; + left: 3px; + + width: 12px; + height: 12px; + + content: ""; + + border-radius: 50%; + + background-color: #1d74f5; + } + } + } + + &-fake { + display: block; + + width: 20px; + height: 20px; + margin: 0 0.5rem; + + border: 1px solid #cfd8e6; + border-radius: 50px; + } + + &-text { + font-weight: 500; + } + } + + &-item { + + display: flex; + + margin: 0 -0.5rem 0.5rem; + align-items: center; + + &:last-child { + margin-bottom: 0; + } + + & .setup-wizard-forms__content-register-radio-icon { + margin: 0 calc(4px + 0.5rem); + + font-size: 10px; + } + + & .setup-wizard-forms__content-register-radio-icon--check { + color: #1d74f5; + } + } + } + } + + &__footer { + display: flex; + + margin: 0 -0.5rem; + + & .rc-button { + margin: 0 0.5rem; + } + } + } + + &-final { + width: 930px; + padding-top: 5rem; + + &__header { + margin-bottom: 5rem; + } + + &__box { + padding: 5rem 6rem; + + border-radius: 2px; + background: #ffffff; + box-shadow: 0 2px 4px 0 rgba(0,0,0,0.08); + + &-title { + margin-bottom: 3.25rem; + } + } + + &__link { + display: block; + + margin-bottom: 1.5rem; + + letter-spacing: 0; + + color: #1d74f5; + + font-size: 1rem; + + line-height: 1.5rem; + + &-text { + display:block; + + letter-spacing: 0.03rem; + + text-transform:uppercase; + + color: #2f343d; + + font-size: 0.625rem; + line-height: 1rem; + } + } + } + + & .rc-input { + &:not(:last-child) { + margin-bottom: 1.5rem; + } + + &__title { + letter-spacing: 0.03rem; + + text-transform: uppercase; + + color: #9ea2a8; + + font-size: 0.625rem; + + line-height: 1rem; + } + + &__element { + color: #030c1a; + + font-weight: 500; + } + } + + & .rc-select { + &__element { + color: #030c1a; + + font-size: 0.875rem; + + font-weight: 500; + } + } +} + +.rtl { + & .setup-wizard-info { + margin: 55px 80px 0 65px; + } + + & .setup-wizard-forms__wrapper { + margin: 1rem 0 1rem 1rem; + } + + & .setup-wizard-info__steps-item { + &:not(:last-child)::after, + &-bonding { + right: 1.2rem; + left: auto; + } + } +} diff --git a/packages/rocketchat-theme/client/imports/forms/input.css b/packages/rocketchat-theme/client/imports/forms/input.css index ded7b0869ba8a..4e38aabf2ba80 100644 --- a/packages/rocketchat-theme/client/imports/forms/input.css +++ b/packages/rocketchat-theme/client/imports/forms/input.css @@ -187,6 +187,10 @@ display: none; } + &__description { + font-size: 0.875rem; + color: var(--color-gray); + } } select.rc-input { diff --git a/packages/rocketchat-theme/client/imports/forms/select.css b/packages/rocketchat-theme/client/imports/forms/select.css index 4f571c8b1fddf..d1a1a9db56cd6 100644 --- a/packages/rocketchat-theme/client/imports/forms/select.css +++ b/packages/rocketchat-theme/client/imports/forms/select.css @@ -25,28 +25,28 @@ &__arrow { position: absolute; - z-index: -1; margin: 0 -5px; + pointer-events: none; + color: var(--color-gray-light); font-size: 20px; } &__element { + width: 100%; padding: 0.75rem 2rem 0.75rem 1rem; text-transform: capitalize; border: none; - appearance: none; - - width: 100%; - line-height: 1rem !important; + appearance: none; + &::-ms-expand { display: none; } diff --git a/packages/rocketchat-theme/client/main.css b/packages/rocketchat-theme/client/main.css index 7217194f40ce5..4ac78a1175b07 100644 --- a/packages/rocketchat-theme/client/main.css +++ b/packages/rocketchat-theme/client/main.css @@ -25,6 +25,7 @@ @import 'imports/components/sidebar/rooms-list.css'; /* Main */ +@import 'imports/components/setup-wizard.css'; @import 'imports/components/flex-nav.css'; @import 'imports/components/header.css'; @import 'imports/components/memberlist.css'; diff --git a/packages/rocketchat-ui-admin/client/admin.js b/packages/rocketchat-ui-admin/client/admin.js index 5553324ade1c2..13df0142f7268 100644 --- a/packages/rocketchat-ui-admin/client/admin.js +++ b/packages/rocketchat-ui-admin/client/admin.js @@ -84,17 +84,18 @@ Template.admin.helpers({ languages() { const languages = TAPi18n.getLanguages(); - let result = Object.keys(languages).map(key => { - const language = languages[key]; - return _.extend(language, { key }); - }); + const result = Object.entries(languages).map(language => { + const obj = language[1]; + obj.key = language[0]; + return obj; + }).sort((a, b) => a.key - b.key); - result = _.sortBy(result, 'key'); result.unshift({ 'name': 'Default', 'en': 'Default', 'key': '' }); + return result; }, appLanguage(key) { diff --git a/packages/rocketchat-ui-master/client/main.html b/packages/rocketchat-ui-master/client/main.html index 4b9ddfe0b466b..e33014d7148f3 100644 --- a/packages/rocketchat-ui-master/client/main.html +++ b/packages/rocketchat-ui-master/client/main.html @@ -24,43 +24,45 @@ {{#if subsReady}} - {{#unless logged}} - - {{> status}} - - {{#if useIframe}} - {{#if iframeUrl}} - + {{#unless showSetupWizard}} + {{#unless logged}} + + {{> status}} + + {{#if useIframe}} + {{#if iframeUrl}} + + {{/if}} + {{else}} + {{> loginLayout center="loginForm"}} {{/if}} + {{ CustomScriptLoggedOut }} {{else}} - {{> loginLayout center="loginForm"}} - {{/if}} - {{ CustomScriptLoggedOut }} - {{else}} - {{#unless hasUsername}} - {{> username}} - {{else}} - {{#if requirePasswordChange}} - {{> loginLayout center="resetPassword"}} + {{#unless hasUsername}} + {{> username}} {{else}} - {{> videoCall overlay=true}} - - - {{#unless modal}} - {{> sideNav }} - {{/unless}} - - {{> Template.dynamic template=center}} + {{#if requirePasswordChange}} + {{> loginLayout center="resetPassword"}} + {{else}} + {{> videoCall overlay=true}} + + + {{#unless modal}} + {{> sideNav }} + {{/unless}} + + {{> Template.dynamic template=center}} + - - - {{> status}} - - {{> audioNotification }} - {{/if}} + + {{> status}} + + {{> audioNotification }} + {{/if}} + {{/unless}} + {{ CustomScriptLoggedIn }} + {{> photoswipe}} {{/unless}} - {{ CustomScriptLoggedIn }} - {{> photoswipe}} {{/unless}} {{else}} {{> loading}} diff --git a/packages/rocketchat-ui-master/client/main.js b/packages/rocketchat-ui-master/client/main.js index 74a41c42339d0..46a1b600ba73a 100644 --- a/packages/rocketchat-ui-master/client/main.js +++ b/packages/rocketchat-ui-master/client/main.js @@ -170,6 +170,13 @@ Template.main.helpers({ if (RocketChat.Layout.isEmbedded()) { return 'embedded-view'; } + }, + showSetupWizard() { + if (RocketChat.settings.get('Show_Setup_Wizard') === false) { + return false; + } + + return true; } }); @@ -191,6 +198,11 @@ Template.main.onRendered(function() { }); return Tracker.autorun(function() { const user = Meteor.user(); + + if (RocketChat.settings.get('Show_Setup_Wizard')) { + FlowRouter.go('setup-wizard'); + } + if (RocketChat.getUserPreference(user, 'hideUsernames')) { $(document.body).on('mouseleave', 'button.thumb', function() { return RocketChat.tooltip.hide(); diff --git a/public/images/logo/logo-black.svg b/public/images/logo/logo-black.svg new file mode 100644 index 0000000000000..f2433d3d6f19c --- /dev/null +++ b/public/images/logo/logo-black.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/images/setup-wizard-intro.png b/public/images/setup-wizard-intro.png new file mode 100644 index 0000000000000..0ec16ccf7793a Binary files /dev/null and b/public/images/setup-wizard-intro.png differ diff --git a/server/startup/migrations/v117.js b/server/startup/migrations/v117.js new file mode 100644 index 0000000000000..b6ea98760b2d0 --- /dev/null +++ b/server/startup/migrations/v117.js @@ -0,0 +1,15 @@ +RocketChat.Migrations.add({ + version: 117, + up() { + if (RocketChat && + RocketChat.authz && + RocketChat.authz.getUsersInRole('admin').count() && + RocketChat.models && + RocketChat.models.Settings) { + RocketChat.models.Settings.upsert( + { _id: 'Show_Setup_Wizard' }, + { $set: { value: false }} + ); + } + } +}); diff --git a/tests/end-to-end/ui/00-login.js b/tests/end-to-end/ui/00-login.js index a357fda144234..9cda91c531a32 100644 --- a/tests/end-to-end/ui/00-login.js +++ b/tests/end-to-end/ui/00-login.js @@ -1,6 +1,84 @@ /* eslint-env mocha */ import loginPage from '../../pageobjects/login.page'; +import setupWizard from '../../pageobjects/setup-wizard.page'; + +describe('[Setup Wizard]', () => { + before(()=>{ + setupWizard.open(); + setupWizard.organizationType.waitForVisible(15000); + }); + + describe('[Render - Step 1]', () => { + it('it should show organization type', () => { + setupWizard.organizationType.isVisible().should.be.true; + }); + + it('it should show organization name', () => { + setupWizard.organizationName.isVisible().should.be.true; + }); + + it('it should show industry', () => { + setupWizard.industry.isVisible().should.be.true; + }); + + it('it should show size', () => { + setupWizard.size.isVisible().should.be.true; + }); + + it('it should show country', () => { + setupWizard.country.isVisible().should.be.true; + }); + + it('it should show website', () => { + setupWizard.website.isVisible().should.be.true; + }); + + after(() => { + setupWizard.goNext(); + }); + }); + + describe('[Render - Step 2]', () => { + it('it should show site name', () => { + setupWizard.siteName.isVisible().should.be.true; + }); + + it('it should show language', () => { + setupWizard.language.isVisible().should.be.true; + }); + + it('it should server type', () => { + setupWizard.serverType.isVisible().should.be.true; + }); + + after(() => { + setupWizard.goNext(); + }); + }); + + describe('[Render - Final Step]', () => { + it('it should render "Go to your workspace button', () => { + setupWizard.goToWorkspace.waitForVisible(15000); + setupWizard.goToWorkspace.isVisible().should.be.true; + }); + + after(() => { + setupWizard.goToHome(); + }); + }); + + after(() => { + browser.execute(function() { + const user = Meteor.user(); + Meteor.logout(() => { + RocketChat.callbacks.run('afterLogoutCleanUp', user); + Meteor.call('logoutCleanUp', user); + FlowRouter.go('home'); + }); + }); + }); +}); describe('[Login]', () => { before(()=>{ diff --git a/tests/pageobjects/setup-wizard.page.js b/tests/pageobjects/setup-wizard.page.js new file mode 100644 index 0000000000000..c114b3fb18129 --- /dev/null +++ b/tests/pageobjects/setup-wizard.page.js @@ -0,0 +1,36 @@ +import Page from './Page'; +import {adminEmail, adminPassword} from '../data/user'; + + +class SetupWizard extends Page { + get nextButton() { return browser.element('.setup-wizard-forms__footer-next:enabled'); } + get goToWorkspace() { return browser.element('button.js-finish'); } + get organizationType() { return browser.element('select[name="Organization_Type"]'); } + get organizationName() { return browser.element('input[name="Organization_Name"]'); } + get industry() { return browser.element('select[name="Industry"]'); } + get size() { return browser.element('select[name="Size"]'); } + get country() { return browser.element('select[name="Country"]'); } + get website() { return browser.element('input[name="Website"]'); } + get siteName() { return browser.element('input[name="Site_Name"]'); } + get language() { return browser.element('select[name="Language"]'); } + get serverType() { return browser.element('select[name="Server_Type"]'); } + + open() { + super.open('setup-wizard'); + browser.execute(function(email, password) { + Meteor.loginWithPassword(email, password, () => {}); + }, adminEmail, adminPassword); + } + + goNext() { + this.nextButton.waitForVisible(5000); + this.nextButton.click(); + } + + goToHome() { + this.goToWorkspace.waitForVisible(5000); + this.goToWorkspace.click(); + } +} + +module.exports = new SetupWizard();
{{_ "Setup_Wizard_Info"}}
To receive free Rocket.Chat supplied features you need to register your server.