Skip to content

Commit

Permalink
Merge pull request #4490 from traPtitech/fix/share-func
Browse files Browse the repository at this point in the history
Fix/share func
  • Loading branch information
mathsuky authored Jan 25, 2025
2 parents b2b0d5f + 7c529fc commit 30fd5da
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 26 deletions.
18 changes: 14 additions & 4 deletions src/components/Main/MainView/QallView/CameraDetailSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const props = defineProps<{
}>()
const emit = defineEmits<{

Check warning on line 11 in src/components/Main/MainView/QallView/CameraDetailSetting.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/CameraDetailSetting.vue#L11

Added line #L11 was not covered by tests
(e: 'close'): void
(
e: 'save',
data: {
Expand All @@ -18,6 +17,8 @@ const emit = defineEmits<{
selectedVideoInput: MediaDeviceInfo
}
): void
(e: 'add'): void
(e: 'close'): void
}>()
const backgroundType = ref<'original' | 'blur' | 'file' | 'screen'>('original')
Expand Down Expand Up @@ -51,11 +52,22 @@ const handleSave = () => {
backgroundImage: backgroundImage.value,
selectedVideoInput
})
emit('close')
} else {
console.error('No video input device selected')

Check warning on line 57 in src/components/Main/MainView/QallView/CameraDetailSetting.vue

View workflow job for this annotation

GitHub Actions / run lint

Unexpected console statement
}
}

Check warning on line 59 in src/components/Main/MainView/QallView/CameraDetailSetting.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/CameraDetailSetting.vue#L45-L59

Added lines #L45 - L59 were not covered by tests
const handleAddCameraTrack = () => {
addCameraTrack(
selectedVideoInput.value,
backgroundType.value,
backgroundImage.value
)
emit('add')
emit('close')
}

Check warning on line 69 in src/components/Main/MainView/QallView/CameraDetailSetting.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/CameraDetailSetting.vue#L61-L69

Added lines #L61 - L69 were not covered by tests
const handleClose = () => {
emit('close')
}

Check warning on line 73 in src/components/Main/MainView/QallView/CameraDetailSetting.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/CameraDetailSetting.vue#L71-L73

Added lines #L71 - L73 were not covered by tests
Expand Down Expand Up @@ -155,9 +167,7 @@ const handleClose = () => {
<FormButton
label="カメラを追加"
type="tertiary"
@click="
addCameraTrack(selectedVideoInput, backgroundType, backgroundImage)
"
@click="handleAddCameraTrack"
/>
<FormButton label="閉じる" type="secondary" @click="handleClose" />
</div>
Expand Down
67 changes: 67 additions & 0 deletions src/components/Main/MainView/QallView/DetailButton.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<script setup lang="ts">
import { defineProps, useCssModule, computed } from 'vue'
import AIcon from '/@/components/UI/AIcon.vue'

Check warning on line 3 in src/components/Main/MainView/QallView/DetailButton.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/DetailButton.vue#L2-L3

Added lines #L2 - L3 were not covered by tests
const props = defineProps({

Check warning on line 5 in src/components/Main/MainView/QallView/DetailButton.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/DetailButton.vue#L5

Added line #L5 was not covered by tests
onClick: {
type: Function,
required: true
},
inverted: {
type: Boolean,
default: false
}
})
const style = useCssModule()

Check warning on line 16 in src/components/Main/MainView/QallView/DetailButton.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/DetailButton.vue#L16

Added line #L16 was not covered by tests
function handleClick() {
props.onClick?.()
}

Check warning on line 20 in src/components/Main/MainView/QallView/DetailButton.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/DetailButton.vue#L18-L20

Added lines #L18 - L20 were not covered by tests
const iconClass = computed(() => ({
[style.inverted]: props.inverted
}))

Check warning on line 24 in src/components/Main/MainView/QallView/DetailButton.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/DetailButton.vue#L22-L24

Added lines #L22 - L24 were not covered by tests
const buttonClass = computed(() => ({
[style.detailButton]: true,
[style.invertedBackground]: props.inverted,
[style.normalBackground]: !props.inverted
}))

Check warning on line 30 in src/components/Main/MainView/QallView/DetailButton.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/DetailButton.vue#L26-L30

Added lines #L26 - L30 were not covered by tests
</script>

<template>
<button :class="buttonClass" @click="handleClick">
<AIcon name="plus-circle" mdi :class="iconClass" :size="24" />
</button>

Check warning on line 36 in src/components/Main/MainView/QallView/DetailButton.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/DetailButton.vue#L34-L36

Added lines #L34 - L36 were not covered by tests
</template>

<style lang="scss" module>
.detailButton {
position: absolute;
bottom: -6px;
right: -6px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
width: 32px;
height: 32px;
}
.inverted {
filter: invert(1);
}
.invertedBackground {
background-color: white;
width: 24px;
height: 24px;
}
.normalBackground {
background-color: black;
width: 24px;
height: 24px;
}
</style>
42 changes: 21 additions & 21 deletions src/components/Main/MainView/QallView/QallView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type { TrackInfo } from '/@/composables/qall/useLiveKitSDK'
import { useModalStore } from '/@/store/ui/modal'
import CameraDetailSetting from './CameraDetailSetting.vue'
import ScreenShareDetailSetting from './ScreenShareDetailSetting.vue'
import AIcon from '/@/components/UI/AIcon.vue'
import DetailButton from './DetailButton.vue'

Check warning on line 14 in src/components/Main/MainView/QallView/QallView.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/QallView.vue#L11-L14

Added lines #L11 - L14 were not covered by tests
const { pushModal } = useModalStore()

Check warning on line 16 in src/components/Main/MainView/QallView/QallView.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/QallView.vue#L16

Added line #L16 was not covered by tests
Expand Down Expand Up @@ -176,10 +176,7 @@ const handleBackgroundSave = (data: {
backgroundType.value = data.backgroundType
backgroundImage.value = data.backgroundImage
showCameraDetailSetting.value = false
}
const handleClose = () => {
showCameraDetailSetting.value = false
console.log(data.selectedVideoInput)

Check warning on line 179 in src/components/Main/MainView/QallView/QallView.vue

View workflow job for this annotation

GitHub Actions / run lint

Unexpected console statement
}

Check warning on line 180 in src/components/Main/MainView/QallView/QallView.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/QallView.vue#L175-L180

Added lines #L175 - L180 were not covered by tests
const showCameraDetailSetting = ref(false)
Expand Down Expand Up @@ -216,18 +213,23 @@ const showShareScreenSettingDetail = ref(false)
:mdi="false"
:inverted="isScreenSharing"
/>
<button
:class="$style.detailButton"
<DetailButton
@click="

Check warning on line 217 in src/components/Main/MainView/QallView/QallView.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/QallView.vue#L195-L217

Added lines #L195 - L217 were not covered by tests
() => {
showShareScreenSettingDetail = true
}
"
>
<AIcon name="plus-circle" mdi />
</button>
/>
<ScreenShareDetailSetting
:open="showShareScreenSettingDetail"
@add="

Check warning on line 225 in src/components/Main/MainView/QallView/QallView.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/QallView.vue#L222-L225

Added lines #L222 - L225 were not covered by tests
() => {
isScreenSharing = true
screenShareIcon = isScreenSharing
? 'stop-screen-share'
: 'screen-share'
}
"
@close="

Check warning on line 233 in src/components/Main/MainView/QallView/QallView.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/QallView.vue#L233

Added line #L233 was not covered by tests
() => {
showShareScreenSettingDetail = false
Expand All @@ -242,20 +244,24 @@ const showShareScreenSettingDetail = ref(false)
:on-click="toggleVideo"
:inverted="isCameraOn"
/>
<button
:class="$style.detailButton"
<DetailButton
:inverted="isCameraOn"
@click="

Check warning on line 249 in src/components/Main/MainView/QallView/QallView.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/QallView.vue#L238-L249

Added lines #L238 - L249 were not covered by tests
() => {
showCameraDetailSetting = true
}
"
>
<AIcon name="plus-circle" mdi />
</button>
/>
<CameraDetailSetting
:open="showCameraDetailSetting"
:video-inputs="videoInputs"
@save="handleBackgroundSave"
@add="

Check warning on line 259 in src/components/Main/MainView/QallView/QallView.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/QallView.vue#L254-L259

Added lines #L254 - L259 were not covered by tests
() => {
isCameraOn = true
cameraIcon = isCameraOn ? 'video' : 'video-off'
}
"
@close="

Check warning on line 265 in src/components/Main/MainView/QallView/QallView.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/QallView.vue#L265

Added line #L265 was not covered by tests
() => {
showCameraDetailSetting = false
Expand Down Expand Up @@ -384,10 +390,4 @@ const showShareScreenSettingDetail = ref(false)
position: relative;
display: inline-block;
}
.detailButton {
position: absolute;
bottom: -6px;
right: -6px;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,18 @@ const props = defineProps<{
}>()
const emit = defineEmits<{

Check warning on line 10 in src/components/Main/MainView/QallView/ScreenShareDetailSetting.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/ScreenShareDetailSetting.vue#L10

Added line #L10 was not covered by tests
(e: 'add'): void
(e: 'close'): void
}>()
const { addScreenShareTrack } = useQall()

Check warning on line 15 in src/components/Main/MainView/QallView/ScreenShareDetailSetting.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/ScreenShareDetailSetting.vue#L15

Added line #L15 was not covered by tests
const handleScreenShare = () => {
addScreenShareTrack()
emit('add')
emit('close')
}

Check warning on line 21 in src/components/Main/MainView/QallView/ScreenShareDetailSetting.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/ScreenShareDetailSetting.vue#L17-L21

Added lines #L17 - L21 were not covered by tests
const handleClose = () => {
emit('close')
}

Check warning on line 25 in src/components/Main/MainView/QallView/ScreenShareDetailSetting.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/ScreenShareDetailSetting.vue#L23-L25

Added lines #L23 - L25 were not covered by tests
Expand All @@ -26,7 +33,7 @@ const handleClose = () => {
<FormButton
label="画面共有を追加"
type="tertiary"
@click="addScreenShareTrack"
@click="handleScreenShare"
/>
<FormButton label="閉じる" type="secondary" @click="handleClose" />
</div>
Expand Down

0 comments on commit 30fd5da

Please sign in to comment.