Skip to content

Commit

Permalink
move to correct directory
Browse files Browse the repository at this point in the history
getters before constructor
  • Loading branch information
notbakaneko committed Aug 4, 2023
1 parent 7f89086 commit 32206c4
Show file tree
Hide file tree
Showing 22 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion resources/js/beatmap-discussions-history/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import BeatmapsetCover from 'components/beatmapset-cover';
import BeatmapsetDiscussionsBundleJson from 'interfaces/beatmapset-discussions-bundle-json';
import { makeObservable, observable } from 'mobx';
import { observer } from 'mobx-react';
import BeatmapsetDiscussionsBundleStore from 'models/beatmapset-discussions-bundle-store';
import * as React from 'react';
import BeatmapsetDiscussionsBundleStore from 'stores/beatmapset-discussions-bundle-store';
import { makeUrl } from 'utils/beatmapset-discussion-helper';
import { trans } from 'utils/lang';

Expand Down
2 changes: 1 addition & 1 deletion resources/js/beatmap-discussions/discussion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

import BeatmapsetDiscussionJson, { BeatmapsetDiscussionJsonForBundle, BeatmapsetDiscussionJsonForShow } from 'interfaces/beatmapset-discussion-json';
import BeatmapsetDiscussionPostJson from 'interfaces/beatmapset-discussion-post-json';
import BeatmapsetDiscussions from 'interfaces/beatmapset-discussions';
import { findLast } from 'lodash';
import { action, computed, makeObservable } from 'mobx';
import { observer } from 'mobx-react';
import BeatmapsetDiscussions from 'models/beatmapset-discussions';
import { deletedUserJson } from 'models/user';
import core from 'osu-core-singleton';
import * as React from 'react';
Expand Down
2 changes: 1 addition & 1 deletion resources/js/beatmap-discussions/discussions-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import BeatmapsetWithDiscussionsJson from 'interfaces/beatmapset-with-discussion
import GameMode from 'interfaces/game-mode';
import { maxBy } from 'lodash';
import { action, computed, makeObservable, observable, toJS } from 'mobx';
import BeatmapsetDiscussionsStore from 'models/beatmapset-discussions-store';
import moment from 'moment';
import core from 'osu-core-singleton';
import BeatmapsetDiscussionsStore from 'stores/beatmapset-discussions-store';
import { findDefault, group, sortWithMode } from 'utils/beatmap-helper';
import { makeUrl, parseUrl } from 'utils/beatmapset-discussion-helper';
import { switchNever } from 'utils/switch-never';
Expand Down
2 changes: 1 addition & 1 deletion resources/js/beatmap-discussions/discussions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

import IconExpand from 'components/icon-expand';
import BeatmapsetDiscussionJson, { BeatmapsetDiscussionJsonForShow } from 'interfaces/beatmapset-discussion-json';
import BeatmapsetDiscussions from 'interfaces/beatmapset-discussions';
import { action, computed, makeObservable, observable } from 'mobx';
import { observer } from 'mobx-react';
import BeatmapsetDiscussions from 'models/beatmapset-discussions';
import * as React from 'react';
import { canModeratePosts } from 'utils/beatmapset-discussion-helper';
import { classWithModifiers } from 'utils/css';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import { EmbedElement } from 'editor';
import BeatmapsetDiscussionJson from 'interfaces/beatmapset-discussion-json';
import BeatmapsetDiscussions from 'interfaces/beatmapset-discussions';
import { Observer } from 'mobx-react';
import BeatmapsetDiscussions from 'models/beatmapset-discussions';
import * as React from 'react';
import { Transforms } from 'slate';
import { RenderElementProps } from 'slate-react';
Expand Down
2 changes: 1 addition & 1 deletion resources/js/beatmap-discussions/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { Spinner } from 'components/spinner';
import { EmbedElement } from 'editor';
import BeatmapExtendedJson from 'interfaces/beatmap-extended-json';
import BeatmapsetDiscussionJson, { BeatmapsetDiscussionJsonForShow } from 'interfaces/beatmapset-discussion-json';
import BeatmapsetDiscussions from 'interfaces/beatmapset-discussions';
import isHotkey from 'is-hotkey';
import { route } from 'laroute';
import { observer } from 'mobx-react';
import BeatmapsetDiscussions from 'models/beatmapset-discussions';
import core from 'osu-core-singleton';
import * as React from 'react';
import { createEditor, Editor as SlateEditor, Element as SlateElement, Node as SlateNode, NodeEntry, Range, Text, Transforms } from 'slate';
Expand Down
2 changes: 1 addition & 1 deletion resources/js/beatmap-discussions/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import StringWithComponent from 'components/string-with-component';
import UserLink from 'components/user-link';
import BeatmapExtendedJson from 'interfaces/beatmap-extended-json';
import BeatmapJson from 'interfaces/beatmap-json';
import BeatmapsetDiscussions from 'interfaces/beatmapset-discussions';
import GameMode, { gameModes } from 'interfaces/game-mode';
import { route } from 'laroute';
import { kebabCase, snakeCase } from 'lodash';
import { action, computed, makeObservable, observable } from 'mobx';
import { observer } from 'mobx-react';
import BeatmapsetDiscussions from 'models/beatmapset-discussions';
import { deletedUserJson } from 'models/user';
import core from 'osu-core-singleton';
import * as React from 'react';
Expand Down
2 changes: 1 addition & 1 deletion resources/js/beatmap-discussions/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import BeatmapsetWithDiscussionsJson from 'interfaces/beatmapset-with-discussion
import { route } from 'laroute';
import { action, makeObservable, observable } from 'mobx';
import { observer } from 'mobx-react';
import BeatmapsetDiscussionsStore from 'models/beatmapset-discussions-store';
import core from 'osu-core-singleton';
import * as React from 'react';
import BeatmapsetDiscussionsStore from 'stores/beatmapset-discussions-store';
import { defaultFilter, parseUrl, stateFromDiscussion } from 'utils/beatmapset-discussion-helper';
import { nextVal } from 'utils/seq';
import { currentUrl } from 'utils/turbolinks';
Expand Down
2 changes: 1 addition & 1 deletion resources/js/beatmap-discussions/new-review.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the GNU Affero General Public License v3.0.
// See the LICENCE file in the repository root for full licence text.

import BeatmapsetDiscussions from 'interfaces/beatmapset-discussions';
import { action, computed, makeObservable, observable } from 'mobx';
import { observer } from 'mobx-react';
import BeatmapsetDiscussions from 'models/beatmapset-discussions';
import core from 'osu-core-singleton';
import * as React from 'react';
import { downloadLimited } from 'utils/beatmapset-helper';
Expand Down
2 changes: 1 addition & 1 deletion resources/js/beatmap-discussions/nominations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Modal from 'components/modal';
import StringWithComponent from 'components/string-with-component';
import TimeWithTooltip from 'components/time-with-tooltip';
import UserLink from 'components/user-link';
import BeatmapsetDiscussions from 'interfaces/beatmapset-discussions';
import BeatmapsetEventJson from 'interfaces/beatmapset-event-json';
import { BeatmapsetNominationsInterface } from 'interfaces/beatmapset-json';
import BeatmapsetWithDiscussionsJson from 'interfaces/beatmapset-with-discussions-json';
Expand All @@ -19,7 +20,6 @@ import UserJson from 'interfaces/user-json';
import { route } from 'laroute';
import { action, makeObservable, observable, runInAction } from 'mobx';
import { observer } from 'mobx-react';
import BeatmapsetDiscussions from 'models/beatmapset-discussions';
import { deletedUser, deletedUserJson } from 'models/user';
import moment from 'moment';
import core from 'osu-core-singleton';
Expand Down
2 changes: 1 addition & 1 deletion resources/js/beatmap-discussions/nominator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

import BigButton from 'components/big-button';
import Modal from 'components/modal';
import BeatmapsetDiscussions from 'interfaces/beatmapset-discussions';
import BeatmapsetEventJson from 'interfaces/beatmapset-event-json';
import BeatmapsetWithDiscussionsJson from 'interfaces/beatmapset-with-discussions-json';
import GameMode from 'interfaces/game-mode';
import { route } from 'laroute';
import { forEachRight, map, uniq } from 'lodash';
import { action, computed, makeObservable, observable, runInAction } from 'mobx';
import { observer } from 'mobx-react';
import BeatmapsetDiscussions from 'models/beatmapset-discussions';
import core from 'osu-core-singleton';
import * as React from 'react';
import { onError } from 'utils/ajax';
Expand Down
2 changes: 1 addition & 1 deletion resources/js/beatmap-discussions/post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import TimeWithTooltip from 'components/time-with-tooltip';
import UserLink from 'components/user-link';
import BeatmapsetDiscussionJson from 'interfaces/beatmapset-discussion-json';
import { BeatmapsetDiscussionMessagePostJson } from 'interfaces/beatmapset-discussion-post-json';
import BeatmapsetDiscussions from 'interfaces/beatmapset-discussions';
import BeatmapsetWithDiscussionsJson from 'interfaces/beatmapset-with-discussions-json';
import UserJson from 'interfaces/user-json';
import { route } from 'laroute';
import { isEqual } from 'lodash';
import { action, autorun, computed, makeObservable, observable, runInAction } from 'mobx';
import { disposeOnUnmount, observer } from 'mobx-react';
import BeatmapsetDiscussions from 'models/beatmapset-discussions';
import { deletedUserJson } from 'models/user';
import core from 'osu-core-singleton';
import * as React from 'react';
Expand Down
2 changes: 1 addition & 1 deletion resources/js/beatmap-discussions/review-post-embed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { discussionTypeIcons } from 'beatmap-discussions/discussion-type';
import { BeatmapIcon } from 'components/beatmap-icon';
import BeatmapsetDiscussionJson from 'interfaces/beatmapset-discussion-json';
import BeatmapsetDiscussions from 'models/beatmapset-discussions';
import BeatmapsetDiscussions from 'interfaces/beatmapset-discussions';
import * as React from 'react';
import { formatTimestamp, makeUrl, startingPost } from 'utils/beatmapset-discussion-helper';
import { classWithModifiers } from 'utils/css';
Expand Down
2 changes: 1 addition & 1 deletion resources/js/beatmap-discussions/review-post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import { PersistedBeatmapDiscussionReview } from 'interfaces/beatmap-discussion-review';
import { BeatmapsetDiscussionMessagePostJson } from 'interfaces/beatmapset-discussion-post-json';
import BeatmapsetDiscussions from 'models/beatmapset-discussions';
import BeatmapsetDiscussions from 'interfaces/beatmapset-discussions';
import * as React from 'react';
import DiscussionMessage from './discussion-message';
import { ReviewPostEmbed } from './review-post-embed';
Expand Down
2 changes: 1 addition & 1 deletion resources/js/beatmap-discussions/user-filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

import mapperGroup from 'beatmap-discussions/mapper-group';
import SelectOptions, { OptionRenderProps } from 'components/select-options';
import BeatmapsetDiscussions from 'interfaces/beatmapset-discussions';
import UserJson from 'interfaces/user-json';
import { action, makeObservable } from 'mobx';
import { observer } from 'mobx-react';
import BeatmapsetDiscussions from 'models/beatmapset-discussions';
import { usernameSortAscending } from 'models/user';
import * as React from 'react';
import { makeUrl, parseUrl } from 'utils/beatmapset-discussion-helper';
Expand Down
2 changes: 1 addition & 1 deletion resources/js/modding-profile/discussions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import { Discussion } from 'beatmap-discussions/discussion';
import BeatmapsetCover from 'components/beatmapset-cover';
import { BeatmapsetDiscussionJsonForBundle } from 'interfaces/beatmapset-discussion-json';
import BeatmapsetDiscussions from 'interfaces/beatmapset-discussions';
import UserJson from 'interfaces/user-json';
import { route } from 'laroute';
import BeatmapsetDiscussions from 'models/beatmapset-discussions';
import React from 'react';
import { makeUrl } from 'utils/beatmapset-discussion-helper';
import { trans } from 'utils/lang';
Expand Down
2 changes: 1 addition & 1 deletion resources/js/modding-profile/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import { first, last, throttle } from 'lodash';
import { action, computed, makeObservable, observable } from 'mobx';
import { observer } from 'mobx-react';
import Kudosu from 'modding-profile/kudosu';
import BeatmapsetDiscussionsBundleForModdingProfileStore from 'models/beatmapset-discussions-for-modding-profile-store';
import core from 'osu-core-singleton';
import Badges from 'profile-page/badges';
import Cover from 'profile-page/cover';
import DetailBar from 'profile-page/detail-bar';
import headerLinks from 'profile-page/header-links';
import * as React from 'react';
import BeatmapsetDiscussionsBundleForModdingProfileStore from 'stores/beatmapset-discussions-for-modding-profile-store';
import { bottomPage } from 'utils/html';
import { nextVal } from 'utils/seq';
import { switchNever } from 'utils/switch-never';
Expand Down
2 changes: 1 addition & 1 deletion resources/js/modding-profile/posts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

import BeatmapsetCover from 'components/beatmapset-cover';
import { BeatmapsetDiscussionMessagePostJson } from 'interfaces/beatmapset-discussion-post-json';
import BeatmapsetDiscussions from 'interfaces/beatmapset-discussions';
import UserJson from 'interfaces/user-json';
import { route } from 'laroute';
import BeatmapsetDiscussions from 'models/beatmapset-discussions';
import { deletedUserJson } from 'models/user';
import * as React from 'react';
import { makeUrl } from 'utils/beatmapset-discussion-helper';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the GNU Affero General Public License v3.0.
// See the LICENCE file in the repository root for full licence text.

import BeatmapsetDiscussions from 'interfaces/beatmapset-discussions';
import BeatmapsetDiscussionsBundleJson from 'interfaces/beatmapset-discussions-bundle-json';
import { computed, makeObservable } from 'mobx';
import { mapBy, mapByWithNulls } from 'utils/map';
import BeatmapsetDiscussions from './beatmapset-discussions';

export default class BeatmapsetDiscussionsBundleStore implements BeatmapsetDiscussions {
constructor(private bundle: BeatmapsetDiscussionsBundleJson) {
makeObservable(this);
}

@computed
get beatmaps() {
return mapBy(this.bundle.beatmaps, 'id');
Expand All @@ -31,4 +27,8 @@ export default class BeatmapsetDiscussionsBundleStore implements BeatmapsetDiscu
get users() {
return mapByWithNulls(this.bundle.users, 'id');
}

constructor(private bundle: BeatmapsetDiscussionsBundleJson) {
makeObservable(this);
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the GNU Affero General Public License v3.0.
// See the LICENCE file in the repository root for full licence text.

import BeatmapsetDiscussions from 'interfaces/beatmapset-discussions';
import { BeatmapsetDiscussionsBundleJsonForModdingProfile } from 'interfaces/beatmapset-discussions-bundle-json';
import { computed, makeObservable } from 'mobx';
import { mapBy, mapByWithNulls } from 'utils/map';
import BeatmapsetDiscussions from './beatmapset-discussions';

export default class BeatmapsetDiscussionsBundleForModdingProfileStore implements BeatmapsetDiscussions {
@computed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the GNU Affero General Public License v3.0.
// See the LICENCE file in the repository root for full licence text.

import BeatmapsetDiscussions from 'interfaces/beatmapset-discussions';
import BeatmapsetExtendedJson from 'interfaces/beatmapset-extended-json';
import BeatmapsetWithDiscussionsJson from 'interfaces/beatmapset-with-discussions-json';
import { isEmpty } from 'lodash';
import { computed, makeObservable, observable } from 'mobx';
import { mapBy, mapByWithNulls } from 'utils/map';
import BeatmapsetDiscussions from './beatmapset-discussions';

export default class BeatmapsetDiscussionsStore implements BeatmapsetDiscussions {
@observable beatmapset: BeatmapsetWithDiscussionsJson;
Expand Down

0 comments on commit 32206c4

Please sign in to comment.