From 6f6406ea0370ef2c74272fb42133570cf7651484 Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Mon, 28 Feb 2022 03:20:58 +0100 Subject: [PATCH] DEV: Fix random typos (#16066) --- .../javascripts/discourse/app/lib/discourse-location.js | 2 +- app/assets/javascripts/discourse/app/lib/plugin-api.js | 2 +- .../discourse/app/lib/register-topic-footer-dropdown.js | 2 +- .../javascripts/discourse/app/lib/reports-loader.js | 2 +- app/assets/javascripts/discourse/app/lib/user-presence.js | 2 +- .../javascripts/discourse/app/models/post-stream.js | 4 ++-- .../discourse/app/models/topic-tracking-state.js | 2 +- app/assets/javascripts/discourse/app/models/user.js | 4 ++-- .../discourse/app/services/media-optimization-worker.js | 4 ++-- app/assets/javascripts/discourse/app/widgets/hooks.js | 2 +- .../discourse/tests/acceptance/mobile-pan-test.js | 2 +- app/models/do_not_disturb_timing.rb | 4 ++-- app/models/topic_user.rb | 4 ++-- app/services/inline_uploads.rb | 8 ++++---- lib/presence_channel.rb | 4 ++-- .../discourse-presence/spec/integration/presence_spec.rb | 2 +- script/import_scripts/google_groups.rb | 6 +++--- spec/requests/api/uploads_spec.rb | 2 +- 18 files changed, 29 insertions(+), 29 deletions(-) diff --git a/app/assets/javascripts/discourse/app/lib/discourse-location.js b/app/assets/javascripts/discourse/app/lib/discourse-location.js index f026de6b919..fdbe91410a4 100644 --- a/app/assets/javascripts/discourse/app/lib/discourse-location.js +++ b/app/assets/javascripts/discourse/app/lib/discourse-location.js @@ -113,7 +113,7 @@ const DiscourseLocation = EmberObject.extend({ Get the current `history.state` Polyfill checks for native browser support and falls back to retrieving - from a private _historyState constiable + from a private _historyState variable @method getState */ diff --git a/app/assets/javascripts/discourse/app/lib/plugin-api.js b/app/assets/javascripts/discourse/app/lib/plugin-api.js index ed0ed57cc2e..22c95c38126 100644 --- a/app/assets/javascripts/discourse/app/lib/plugin-api.js +++ b/app/assets/javascripts/discourse/app/lib/plugin-api.js @@ -831,7 +831,7 @@ class PluginApi { } /** - * Register a desktop notificaiton handler + * Register a desktop notification handler * * ```javascript * api.registerDesktopNotificationHandler((data, siteSettings, user) => { diff --git a/app/assets/javascripts/discourse/app/lib/register-topic-footer-dropdown.js b/app/assets/javascripts/discourse/app/lib/register-topic-footer-dropdown.js index a68920da44c..56cb2fd01b9 100644 --- a/app/assets/javascripts/discourse/app/lib/register-topic-footer-dropdown.js +++ b/app/assets/javascripts/discourse/app/lib/register-topic-footer-dropdown.js @@ -40,7 +40,7 @@ export function registerTopicFooterDropdown(dropdown) { priority: 0, // an object used to display the state of the dropdown - // when no value is currectnly set, eg: { id: 1, name: "foo" } + // when no value is currently set, eg: { id: 1, name: "foo" } noneItem: null, }; diff --git a/app/assets/javascripts/discourse/app/lib/reports-loader.js b/app/assets/javascripts/discourse/app/lib/reports-loader.js index afd0b132ee6..fb774b323df 100644 --- a/app/assets/javascripts/discourse/app/lib/reports-loader.js +++ b/app/assets/javascripts/discourse/app/lib/reports-loader.js @@ -19,7 +19,7 @@ const DEBOUNCING_DELAY = 50; export default { enqueue(type, params, callback) { - // makes sures the queue is not filling indefinitely + // makes sure the queue is not filling indefinitely if (_queue.length >= MAX_QUEUE_SIZE) { const removedJobs = _queue.splice(0, 1)[0]; removedJobs.forEach((job) => { diff --git a/app/assets/javascripts/discourse/app/lib/user-presence.js b/app/assets/javascripts/discourse/app/lib/user-presence.js index 7fe1af6c6c7..fd062298378 100644 --- a/app/assets/javascripts/discourse/app/lib/user-presence.js +++ b/app/assets/javascripts/discourse/app/lib/user-presence.js @@ -15,7 +15,7 @@ let testPresence = true; // Check whether the document is currently visible, and the user is actively using the site // Will return false if the browser went into the background more than `browserHiddenTime` milliseconds ago -// Will also return false if there has been no user activty for more than `userUnseenTime` milliseconds +// Will also return false if there has been no user activity for more than `userUnseenTime` milliseconds // Otherwise, will return true export default function userPresent({ browserHiddenTime = DEFAULT_BROWSER_HIDDEN_MS, diff --git a/app/assets/javascripts/discourse/app/models/post-stream.js b/app/assets/javascripts/discourse/app/models/post-stream.js index d2d90649d4a..92d05871e4a 100644 --- a/app/assets/javascripts/discourse/app/models/post-stream.js +++ b/app/assets/javascripts/discourse/app/models/post-stream.js @@ -680,8 +680,8 @@ export default RestModel.extend({ }); }, - /* mainly for backwards compatability with plugins, used in quick messages plugin - * TODO: remove July 2021 + /* mainly for backwards compatibility with plugins, used in quick messages plugin + * TODO: remove July 2022 * */ triggerNewPostInStream(postId, opts) { deprecated( diff --git a/app/assets/javascripts/discourse/app/models/topic-tracking-state.js b/app/assets/javascripts/discourse/app/models/topic-tracking-state.js index bbb9b058ef6..685750b52ef 100644 --- a/app/assets/javascripts/discourse/app/models/topic-tracking-state.js +++ b/app/assets/javascripts/discourse/app/models/topic-tracking-state.js @@ -506,7 +506,7 @@ const TopicTrackingState = EmberObject.extend({ }, /** - * Calls the provided callback for each of the currenty tracked topics + * Calls the provided callback for each of the currently tracked topics * we have in state. * * @method forEachTracked diff --git a/app/assets/javascripts/discourse/app/models/user.js b/app/assets/javascripts/discourse/app/models/user.js index 4f9cca7a4d5..1e773db6489 100644 --- a/app/assets/javascripts/discourse/app/models/user.js +++ b/app/assets/javascripts/discourse/app/models/user.js @@ -759,8 +759,8 @@ const User = RestModel.extend({ }, @discourseComputed("watched_first_post_category_ids") - watchedFirstPostCategories(wachedFirstPostCategoryIds) { - return Category.findByIds(wachedFirstPostCategoryIds); + watchedFirstPostCategories(watchedFirstPostCategoryIds) { + return Category.findByIds(watchedFirstPostCategoryIds); }, @discourseComputed("can_delete_account") diff --git a/app/assets/javascripts/discourse/app/services/media-optimization-worker.js b/app/assets/javascripts/discourse/app/services/media-optimization-worker.js index 3699ffb5ae0..d60f5c5af4a 100644 --- a/app/assets/javascripts/discourse/app/services/media-optimization-worker.js +++ b/app/assets/javascripts/discourse/app/services/media-optimization-worker.js @@ -44,7 +44,7 @@ export default class MediaOptimizationWorkerService extends Service { ) { return Promise.resolve(); } - await this.ensureAvailiableWorker(); + await this.ensureAvailableWorker(); return new Promise(async (resolve) => { this.logIfDebug(`Transforming ${file.name}`); @@ -88,7 +88,7 @@ export default class MediaOptimizationWorkerService extends Service { }); } - async ensureAvailiableWorker() { + async ensureAvailableWorker() { if (this.worker && this.workerInstalled) { return Promise.resolve(); } diff --git a/app/assets/javascripts/discourse/app/widgets/hooks.js b/app/assets/javascripts/discourse/app/widgets/hooks.js index 17c34d1519f..a95de1c1817 100644 --- a/app/assets/javascripts/discourse/app/widgets/hooks.js +++ b/app/assets/javascripts/discourse/app/widgets/hooks.js @@ -43,7 +43,7 @@ function buildHook(attributeName, setAttr) { } // For the majority of events, we register a single listener on the ``, and then -// notify the relavent widget (if any) when the event fires (see setupDocumentCallback() below) +// notify the relevant widget (if any) when the event fires (see setupDocumentCallback() below) export const WidgetClickHook = buildHook(CLICK_ATTRIBUTE_NAME); export const WidgetDoubleClickHook = buildHook(DOUBLE_CLICK_ATTRIBUTE_NAME); export const WidgetClickOutsideHook = buildHook( diff --git a/app/assets/javascripts/discourse/tests/acceptance/mobile-pan-test.js b/app/assets/javascripts/discourse/tests/acceptance/mobile-pan-test.js index cbde5320dc6..8ef7a1b70d5 100644 --- a/app/assets/javascripts/discourse/tests/acceptance/mobile-pan-test.js +++ b/app/assets/javascripts/discourse/tests/acceptance/mobile-pan-test.js @@ -73,7 +73,7 @@ async function triggerSwipeEnd({ x, y, touchTarget }) { }); } -// new Touch() isn't availiable in Firefox, so this is skipped there +// new Touch() isn't available in Firefox, so this is skipped there acceptance("Mobile - menu swipes", function (needs) { needs.mobileView(); needs.user(); diff --git a/app/models/do_not_disturb_timing.rb b/app/models/do_not_disturb_timing.rb index a9a4d2c51f1..62d7d65cbda 100644 --- a/app/models/do_not_disturb_timing.rb +++ b/app/models/do_not_disturb_timing.rb @@ -3,9 +3,9 @@ class DoNotDisturbTiming < ActiveRecord::Base belongs_to :user - validate :ends_at_greater_thans_starts_at + validate :ends_at_greater_than_starts_at - def ends_at_greater_thans_starts_at + def ends_at_greater_than_starts_at if starts_at > ends_at errors.add(:ends_at, :invalid) end diff --git a/app/models/topic_user.rb b/app/models/topic_user.rb index 4f6b7853dde..638fa4f891c 100644 --- a/app/models/topic_user.rb +++ b/app/models/topic_user.rb @@ -405,8 +405,8 @@ class TopicUser < ActiveRecord::Base # The parameters can be used to shrink the scope, and make it faster. # user_id, post_id and topic_id can optionally be arrays of ids. # - # Providing post_id will automatically scope to the relavent user_id and topic_id. - # A provided `topic_id` value will always take presedence, which is + # Providing post_id will automatically scope to the relevant user_id and topic_id. + # A provided `topic_id` value will always take precedence, which is # useful when a post has been moved between topics. def self.update_post_action_cache( user_id: nil, diff --git a/app/services/inline_uploads.rb b/app/services/inline_uploads.rb index 26907d47c87..598fdc9e360 100644 --- a/app/services/inline_uploads.rb +++ b/app/services/inline_uploads.rb @@ -17,7 +17,7 @@ class InlineUploads end cooked_fragment = Nokogiri::HTML5::fragment(PrettyText.cook(markdown, disable_emojis: true)) - link_occurences = [] + link_occurrences = [] cooked_fragment.traverse do |node| if node.name == "img" @@ -29,9 +29,9 @@ class InlineUploads if seen_link = matched_uploads(node).first if (actual_link = (node.attributes["href"]&.value || node.attributes["src"]&.value)) - link_occurences << { link: actual_link, is_valid: true } + link_occurrences << { link: actual_link, is_valid: true } elsif node.name != "p" - link_occurences << { link: seen_link, is_valid: false } + link_occurrences << { link: seen_link, is_valid: false } end end end @@ -104,7 +104,7 @@ class InlineUploads .sort { |a, b| a[3] <=> b[3] } .each do |match, link, replace_with, _index| - node_info = link_occurences.shift + node_info = link_occurrences.shift next unless node_info&.dig(:is_valid) if link.include?(node_info[:link]) diff --git a/lib/presence_channel.rb b/lib/presence_channel.rb index 82c9db540b6..83d6cd066ee 100644 --- a/lib/presence_channel.rb +++ b/lib/presence_channel.rb @@ -220,7 +220,7 @@ class PresenceChannel end # Designed to be run periodically. Checks the channel list for channels with expired members, - # and runs auto_leave for each eligable channel + # and runs auto_leave for each eligible channel def self.auto_leave_all channels_with_expiring_members = PresenceChannel.redis.zrangebyscore(redis_key_channel_list, '-inf', Time.zone.now.to_i) channels_with_expiring_members.each do |name| @@ -357,7 +357,7 @@ class PresenceChannel # are published in the same sequence that the PresenceChannel lua script are run. # # The present/leave/auto_leave lua scripts will automatically acquire this mutex - # if needed. If their return value indicates a change has occured, the mutex + # if needed. If their return value indicates a change has occurred, the mutex # should be released via #release_mutex after the messagebus message has been sent # # If they need a change, and the mutex is not available, they will raise an error diff --git a/plugins/discourse-presence/spec/integration/presence_spec.rb b/plugins/discourse-presence/spec/integration/presence_spec.rb index a59c43b8377..a6d441e6a63 100644 --- a/plugins/discourse-presence/spec/integration/presence_spec.rb +++ b/plugins/discourse-presence/spec/integration/presence_spec.rb @@ -98,7 +98,7 @@ describe "discourse-presence" do expect(c.config.allowed_user_ids).to eq(nil) end - it 'handles permissions for private messsages' do + it 'handles permissions for private messages' do c = PresenceChannel.new("/discourse-presence/reply/#{private_message.id}") expect(c.config.public).to eq(false) expect(c.config.allowed_group_ids).to contain_exactly(group.id, Group::AUTO_GROUPS[:staff]) diff --git a/script/import_scripts/google_groups.rb b/script/import_scripts/google_groups.rb index ab7bb303895..212702fc77d 100755 --- a/script/import_scripts/google_groups.rb +++ b/script/import_scripts/google_groups.rb @@ -123,7 +123,7 @@ def crawl_topic(url) puts "Scraping #{url}" get(url) - messsages_crawled = false + messages_crawled = false extract(".subject a[href*='#{@groupname}']") do |a| [ @@ -131,10 +131,10 @@ def crawl_topic(url) a["title"].empty? ] end.each do |msg_url, might_be_deleted| - messsages_crawled |= crawl_message(msg_url, might_be_deleted) + messages_crawled |= crawl_message(msg_url, might_be_deleted) end - @skipped_topic_count = skippable && messsages_crawled ? 0 : @skipped_topic_count + 1 + @skipped_topic_count = skippable && messages_crawled ? 0 : @skipped_topic_count + 1 @scraped_topic_urls << url rescue puts "Failed to scrape topic at #{url}".red diff --git a/spec/requests/api/uploads_spec.rb b/spec/requests/api/uploads_spec.rb index 540d350598a..61e13ac002f 100644 --- a/spec/requests/api/uploads_spec.rb +++ b/spec/requests/api/uploads_spec.rb @@ -202,7 +202,7 @@ describe 'uploads' do consumes 'application/json' description <<~HEREDOC Multipart uploads are uploaded in chunks or parts to individual presigned - URLs, similar to the one genreated by /generate-presigned-put. The part + URLs, similar to the one generated by /generate-presigned-put. The part numbers provided must be between 1 and 10000. The total number of parts will depend on the chunk size in bytes that you intend to use to upload each chunk. For example a 12MB file may have 2 5MB chunks and a final