Skip to content

Commit

Permalink
replace imports for toasts from @nextcloud/dialogs with local functions
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Sukharev <[email protected]>
  • Loading branch information
Antreesy committed Apr 17, 2023
1 parent ab70e97 commit 7cdb74e
Show file tree
Hide file tree
Showing 58 changed files with 83 additions and 104 deletions.
2 changes: 1 addition & 1 deletion src/PublicShareSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
<script>
import PreventUnload from 'vue-prevent-unload'

import { showError } from '@nextcloud/dialogs'
import { loadState } from '@nextcloud/initial-state'

import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
Expand All @@ -76,6 +75,7 @@ import { getPublicShareConversationData } from './services/filesIntegrationServi
import {
leaveConversationSync,
} from './services/participantsService.js'
import { showError } from './utils/showToasts.js'
import { signalingKill } from './utils/webrtc/index.js'

// Styles
Expand Down
2 changes: 1 addition & 1 deletion src/components/AdminSettings/MatterbridgeIntegration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
</template>

<script>
import { showError } from '@nextcloud/dialogs'
import { loadState } from '@nextcloud/initial-state'

import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
Expand All @@ -81,6 +80,7 @@ import {
stopAllBridges,
getMatterbridgeVersion,
} from '../../services/matterbridgeService.js'
import { showError } from '../../utils/showToasts.js'

export default {
name: 'MatterbridgeIntegration',
Expand Down
3 changes: 2 additions & 1 deletion src/components/AdminSettings/RecordingServers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ import debounce from 'debounce'

import Plus from 'vue-material-design-icons/Plus.vue'

import { showSuccess } from '@nextcloud/dialogs'
import { formatFileSize } from '@nextcloud/files'
import { loadState } from '@nextcloud/initial-state'

Expand All @@ -82,6 +81,8 @@ import NcNoteCard from '@nextcloud/vue/dist/Components/NcNoteCard.js'

import RecordingServer from '../../components/AdminSettings/RecordingServer.vue'

import { showSuccess } from '../../utils/showToasts.js'

export default {
name: 'RecordingServers',

Expand Down
2 changes: 1 addition & 1 deletion src/components/AdminSettings/SIPBridge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@
import debounce from 'debounce'

import axios from '@nextcloud/axios'
import { showSuccess } from '@nextcloud/dialogs'
import { loadState } from '@nextcloud/initial-state'
import { generateOcsUrl } from '@nextcloud/router'

import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcMultiselect from '@nextcloud/vue/dist/Components/NcMultiselect.js'

import { setSIPSettings } from '../../services/settingsService.js'
import { showSuccess } from '../../utils/showToasts.js'

export default {
name: 'SIPBridge',
Expand Down
2 changes: 1 addition & 1 deletion src/components/AdminSettings/SignalingServers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ import debounce from 'debounce'

import Plus from 'vue-material-design-icons/Plus.vue'

import { showSuccess } from '@nextcloud/dialogs'
import { loadState } from '@nextcloud/initial-state'

import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
Expand All @@ -97,6 +96,7 @@ import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadi
import SignalingServer from '../../components/AdminSettings/SignalingServer.vue'

import { SIGNALING } from '../../constants.js'
import { showSuccess } from '../../utils/showToasts.js'

export default {
name: 'SignalingServers',
Expand Down
3 changes: 2 additions & 1 deletion src/components/AdminSettings/StunServers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,14 @@ import debounce from 'debounce'

import Plus from 'vue-material-design-icons/Plus.vue'

import { showSuccess } from '@nextcloud/dialogs'
import { loadState } from '@nextcloud/initial-state'

import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'

import StunServer from '../../components/AdminSettings/StunServer.vue'

import { showSuccess } from '../../utils/showToasts.js'

export default {
name: 'StunServers',

Expand Down
3 changes: 2 additions & 1 deletion src/components/AdminSettings/TurnServers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,14 @@ import debounce from 'debounce'

import Plus from 'vue-material-design-icons/Plus.vue'

import { showSuccess } from '@nextcloud/dialogs'
import { loadState } from '@nextcloud/initial-state'

import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'

import TurnServer from '../../components/AdminSettings/TurnServer.vue'

import { showSuccess } from '../../utils/showToasts.js'

export default {
name: 'TurnServers',

Expand Down
4 changes: 2 additions & 2 deletions src/components/BreakoutRoomsEditor/SendMessageDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@
</template>

<script>
import { showError, showSuccess } from '@nextcloud/dialogs'

import NcModal from '@nextcloud/vue/dist/Components/NcModal.js'

import NewMessageForm from '../NewMessageForm/NewMessageForm.vue'

import { showError, showSuccess } from '../../utils/showToasts.js'

export default {
name: 'SendMessageDialog',

Expand Down
2 changes: 1 addition & 1 deletion src/components/CallView/CallView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@
<script>
import debounce from 'debounce'

import { showMessage } from '@nextcloud/dialogs'
import { subscribe, unsubscribe } from '@nextcloud/event-bus'
import { loadState } from '@nextcloud/initial-state'

Expand All @@ -154,6 +153,7 @@ import VideoVue from './shared/VideoVue.vue'
import { SIMULCAST } from '../../constants.js'
import { fetchPeers } from '../../services/callsService.js'
import { EventBus } from '../../services/EventBus.js'
import { showMessage } from '../../utils/showToasts.js'
import { localMediaModel, localCallParticipantModel, callParticipantCollection } from '../../utils/webrtc/index.js'
import RemoteVideoBlocker from '../../utils/webrtc/RemoteVideoBlocker.js'

Expand Down
2 changes: 1 addition & 1 deletion src/components/CallView/shared/LocalMediaControls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ import NetworkStrength2Alert from 'vue-material-design-icons/NetworkStrength2Ale
import VideoIcon from 'vue-material-design-icons/Video.vue'
import VideoOff from 'vue-material-design-icons/VideoOff.vue'

import { showMessage } from '@nextcloud/dialogs'
import { emit } from '@nextcloud/event-bus'

import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js'
Expand All @@ -197,6 +196,7 @@ import VolumeIndicator from '../../VolumeIndicator/VolumeIndicator.vue'

import { PARTICIPANT } from '../../../constants.js'
import isInCall from '../../../mixins/isInCall.js'
import { showMessage } from '../../../utils/showToasts.js'
import { CONNECTION_QUALITY } from '../../../utils/webrtc/analyzers/PeerConnectionAnalyzer.js'
import { callAnalyzer } from '../../../utils/webrtc/index.js'
import SpeakingWhileMutedWarner from '../../../utils/webrtc/SpeakingWhileMutedWarner.js'
Expand Down
3 changes: 1 addition & 2 deletions src/components/CallView/shared/LocalVideo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,13 @@ import attachMediaStream from 'attachmediastream'
import Hex from 'crypto-js/enc-hex.js'
import SHA1 from 'crypto-js/sha1.js'

import { showError, showInfo, TOAST_PERMANENT_TIMEOUT } from '@nextcloud/dialogs'

import NcAvatar from '@nextcloud/vue/dist/Components/NcAvatar.js'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'

import VideoBackground from './VideoBackground.vue'

import video from '../../../mixins/video.js'
import { showError, showInfo, TOAST_PERMANENT_TIMEOUT } from '../../../utils/showToasts.js'
import { ConnectionState } from '../../../utils/webrtc/models/CallParticipantModel.js'

export default {
Expand Down
4 changes: 2 additions & 2 deletions src/components/ConversationSettings/BasicInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@
<script>
import { Fragment } from 'vue-frag'

import { showError } from '@nextcloud/dialogs'

import ConversationAvatarEditor from './ConversationAvatarEditor.vue'
import EditableTextField from './EditableTextField.vue'

import { showError } from '../../utils/showToasts.js'

export default {
name: 'BasicInfo',

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,15 @@ import Upload from 'vue-material-design-icons/Upload.vue'

import { getRequestToken } from '@nextcloud/auth'
import axios from '@nextcloud/axios'
import { getFilePickerBuilder, showError } from '@nextcloud/dialogs'
import { getFilePickerBuilder } from '@nextcloud/dialogs'
import { generateUrl } from '@nextcloud/router'

import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'

import ConversationIcon from '../ConversationIcon.vue'

import { showError } from '../../utils/showToasts.js'

// eslint-disable-next-line n/no-extraneous-import
import 'cropperjs/dist/cropper.css'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,14 @@
<script>
import Pencil from 'vue-material-design-icons/Pencil.vue'

import { showError, showSuccess } from '@nextcloud/dialogs'

import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
import NcNoteCard from '@nextcloud/vue/dist/Components/NcNoteCard.js'

import PermissionEditor from '../PermissionsEditor/PermissionsEditor.vue'

import { PARTICIPANT } from '../../constants.js'
import { showError, showSuccess } from '../../utils/showToasts.js'

const PERMISSIONS = PARTICIPANT.PERMISSIONS

Expand Down
3 changes: 2 additions & 1 deletion src/components/ConversationSettings/DangerZone.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,13 @@
</template>

<script>
import { showError } from '@nextcloud/dialogs'
import { emit } from '@nextcloud/event-bus'

import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcNoteCard from '@nextcloud/vue/dist/Components/NcNoteCard.js'

import { showError } from '../../utils/showToasts.js'

export default {
name: 'DangerZone',
components: {
Expand Down
4 changes: 2 additions & 2 deletions src/components/ConversationSettings/ExpirationSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
</template>

<script>
import { showError, showSuccess } from '@nextcloud/dialogs'

import NcMultiselect from '@nextcloud/vue/dist/Components/NcMultiselect.js'

import { showError, showSuccess } from '../../utils/showToasts.js'

export default {
name: 'ExpirationSettings',

Expand Down
3 changes: 1 addition & 2 deletions src/components/ConversationSettings/LinkShareSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,13 @@ import ArrowRight from 'vue-material-design-icons/ArrowRight.vue'
import ClipboardTextOutline from 'vue-material-design-icons/ClipboardTextOutline.vue'
import Email from 'vue-material-design-icons/Email.vue'

import { showError, showSuccess } from '@nextcloud/dialogs'

import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
import NcPasswordField from '@nextcloud/vue/dist/Components/NcPasswordField.js'

import { CONVERSATION } from '../../constants.js'
import { copyConversationLinkToClipboard } from '../../services/urlService.js'
import { showError, showSuccess } from '../../utils/showToasts.js'

export default {
name: 'LinkShareSettings',
Expand Down
2 changes: 1 addition & 1 deletion src/components/ConversationSettings/ListableSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@
</template>

<script>
import { showError, showSuccess } from '@nextcloud/dialogs'
import { loadState } from '@nextcloud/initial-state'

import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'

import { CONVERSATION } from '../../constants.js'
import { showError, showSuccess } from '../../utils/showToasts.js'

export default {
name: 'ListableSettings',
Expand Down
3 changes: 1 addition & 2 deletions src/components/ConversationSettings/LobbySettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,12 @@
</template>

<script>
import { showError, showSuccess } from '@nextcloud/dialogs'

import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
import NcDatetimePicker from '@nextcloud/vue/dist/Components/NcDatetimePicker.js'
import NcNoteCard from '@nextcloud/vue/dist/Components/NcNoteCard.js'

import { WEBINAR } from '../../constants.js'
import { showError, showSuccess } from '../../utils/showToasts.js'

export default {
name: 'LobbySettings',
Expand Down
3 changes: 1 addition & 2 deletions src/components/ConversationSettings/LockingSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,11 @@
</template>

<script>
import { showError, showSuccess } from '@nextcloud/dialogs'

import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
import NcNoteCard from '@nextcloud/vue/dist/Components/NcNoteCard.js'

import { CONVERSATION } from '../../constants.js'
import { showError, showSuccess } from '../../utils/showToasts.js'

export default {
name: 'LockingSettings',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ import Vue from 'vue'
import Message from 'vue-material-design-icons/Message.vue'
import Plus from 'vue-material-design-icons/Plus.vue'

import { showSuccess } from '@nextcloud/dialogs'
import { imagePath } from '@nextcloud/router'

import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
Expand All @@ -117,6 +116,7 @@ import {
getBridge,
getBridgeProcessState,
} from '../../../services/matterbridgeService.js'
import { showSuccess } from '../../../utils/showToasts.js'

Vue.directive('tooltip', Tooltip)

Expand Down
3 changes: 1 addition & 2 deletions src/components/ConversationSettings/SipSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,10 @@
</template>

<script>
import { showError, showSuccess } from '@nextcloud/dialogs'

import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'

import { WEBINAR } from '../../constants.js'
import { showError, showSuccess } from '../../utils/showToasts.js'

export default {
name: 'SipSettings',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@ import flushPromises from 'flush-promises' // TODO fix after migration to @vue/t
import { cloneDeep } from 'lodash'
import Vuex from 'vuex'

import { showSuccess, showError } from '@nextcloud/dialogs'

import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js'

import Conversation from './Conversation.vue'

import { CONVERSATION, PARTICIPANT, ATTENDEE } from '../../../constants.js'
import storeConfig from '../../../store/storeConfig.js'
import { showSuccess, showError } from '../../../utils/showToasts.js'

jest.mock('@nextcloud/dialogs', () => ({
jest.mock('../../../utils/showToasts.js', () => ({
showSuccess: jest.fn(),
showError: jest.fn(),
}))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ import ExitToApp from 'vue-material-design-icons/ExitToApp.vue'
import EyeOutline from 'vue-material-design-icons/EyeOutline.vue'
import Star from 'vue-material-design-icons/Star.vue'

import { showError } from '@nextcloud/dialogs'
import { emit } from '@nextcloud/event-bus'

import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js'
Expand All @@ -129,6 +128,7 @@ import ConversationIcon from './../../ConversationIcon.vue'

import { CONVERSATION, PARTICIPANT, ATTENDEE } from '../../../constants.js'
import { copyConversationLinkToClipboard } from '../../../services/urlService.js'
import { showError } from '../../../utils/showToasts.js'

export default {
name: 'Conversation',
Expand Down
2 changes: 1 addition & 1 deletion src/components/LeftSidebar/LeftSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@
<script>
import debounce from 'debounce'

import { showError } from '@nextcloud/dialogs'
import { emit } from '@nextcloud/event-bus'
import { loadState } from '@nextcloud/initial-state'

Expand All @@ -158,6 +157,7 @@ import {
} from '../../services/conversationsService.js'
import { EventBus } from '../../services/EventBus.js'
import CancelableRequest from '../../utils/cancelableRequest.js'
import { showError } from '../../utils/showToasts.js'

export default {

Expand Down
Loading

0 comments on commit 7cdb74e

Please sign in to comment.