From d4daf65a4d89bc1fb3a8f6221868219f2d69dea6 Mon Sep 17 00:00:00 2001 From: clauspeterhuebner Date: Wed, 14 May 2025 16:42:46 +0200 Subject: [PATCH] linting --- frontend/src/components/CommunitySwitch.vue | 42 ++-- .../RedeemCommunitySelection.vue | 74 +++---- frontend/src/pages/TransactionLink.vue | 181 +++++++++--------- 3 files changed, 163 insertions(+), 134 deletions(-) diff --git a/frontend/src/components/CommunitySwitch.vue b/frontend/src/components/CommunitySwitch.vue index 16f1a4b7b..8775e8667 100644 --- a/frontend/src/components/CommunitySwitch.vue +++ b/frontend/src/components/CommunitySwitch.vue @@ -46,7 +46,7 @@ const validCommunityIdentifier = ref(false) const { onResult } = useQuery(selectCommunities) onResult(({ data }) => { - console.log('CommunitySwitch.onResult...data=', data) + // console.log('CommunitySwitch.onResult...data=', data) if (data) { communities.value = data.communities setDefaultCommunity() @@ -56,29 +56,42 @@ onResult(({ data }) => { const communityIdentifier = computed(() => route.params.communityIdentifier) function updateCommunity(community) { - console.log('CommunitySwitch.updateCommunity...community=', community) + // console.log('CommunitySwitch.updateCommunity...community=', community) emit('update:model-value', community) } function setDefaultCommunity() { - console.log('CommunitySwitch.setDefaultCommunity... communityIdentifier= communities=', communityIdentifier, communities) + // console.log( + // 'CommunitySwitch.setDefaultCommunity... communityIdentifier= communities=', + // communityIdentifier, + // communities, + // ) if (communityIdentifier.value && communities.value.length >= 1) { - console.log('CommunitySwitch.setDefaultCommunity... communities.value.length=', communities.value.length) + // console.log( + // 'CommunitySwitch.setDefaultCommunity... communities.value.length=', + // communities.value.length, + // ) const foundCommunity = communities.value.find((community) => { - console.log('CommunitySwitch.setDefaultCommunity... community=', community) + // console.log('CommunitySwitch.setDefaultCommunity... community=', community) if ( community.uuid === communityIdentifier.value || community.name === communityIdentifier.value ) { validCommunityIdentifier.value = true - console.log('CommunitySwitch.setDefaultCommunity...true validCommunityIdentifier=', validCommunityIdentifier) + // console.log( + // 'CommunitySwitch.setDefaultCommunity...true validCommunityIdentifier=', + // validCommunityIdentifier, + // ) return true } - console.log('CommunitySwitch.setDefaultCommunity...false validCommunityIdentifier=', validCommunityIdentifier) + // console.log( + // 'CommunitySwitch.setDefaultCommunity...false validCommunityIdentifier=', + // validCommunityIdentifier, + // ) return false }) if (foundCommunity) { - console.log('CommunitySwitch.setDefaultCommunity...foundCommunity=', foundCommunity) + // console.log('CommunitySwitch.setDefaultCommunity...foundCommunity=', foundCommunity) updateCommunity(foundCommunity) return } @@ -87,13 +100,20 @@ function setDefaultCommunity() { if (validCommunityIdentifier.value && !communityIdentifier.value) { validCommunityIdentifier.value = false - console.log('CommunitySwitch.setDefaultCommunity...validCommunityIdentifier=', validCommunityIdentifier) + // console.log( + // 'CommunitySwitch.setDefaultCommunity...validCommunityIdentifier=', + // validCommunityIdentifier, + // ) } if (props.modelValue?.uuid === '' && communities.value.length) { - console.log('CommunitySwitch.setDefaultCommunity...props.modelValue= communities=', props.modelValue, communities.value.length) + // console.log( + // 'CommunitySwitch.setDefaultCommunity...props.modelValue= communities=', + // props.modelValue, + // communities.value.length, + // ) const foundCommunity = communities.value.find((community) => !community.foreign) - console.log('CommunitySwitch.setDefaultCommunity...foundCommunity=', foundCommunity) + // console.log('CommunitySwitch.setDefaultCommunity...foundCommunity=', foundCommunity) if (foundCommunity) { updateCommunity(foundCommunity) } diff --git a/frontend/src/components/LinkInformations/RedeemCommunitySelection.vue b/frontend/src/components/LinkInformations/RedeemCommunitySelection.vue index 2be3d8b7b..46e9eb81f 100644 --- a/frontend/src/components/LinkInformations/RedeemCommunitySelection.vue +++ b/frontend/src/components/LinkInformations/RedeemCommunitySelection.vue @@ -77,15 +77,15 @@ const currentRecipientCommunity = computed( const emit = defineEmits(['update:recipientCommunity']) const isForeignCommunitySelected = computed(() => { - console.log( - 'RedeemCommunitySelection.isForeignCommunitySelected...recipientCommunity=', - currentRecipientCommunity.value, - ) + // console.log( + // 'RedeemCommunitySelection.isForeignCommunitySelected...recipientCommunity=', + // currentRecipientCommunity.value, + // ) return currentRecipientCommunity.value.foreign }) function setRecipientCommunity(community) { - console.log('RedeemCommunitySelection.setRecipientCommunity...community=', community) + // console.log('RedeemCommunitySelection.setRecipientCommunity...community=', community) emit('update:recipientCommunity', { uuid: community.uuid, name: community.name, @@ -95,10 +95,19 @@ function setRecipientCommunity(community) { } function extractHomeCommunityFromLinkData(linkData) { - console.log('RedeemCommunitySelection.extractHomeCommunityFromLinkData... props.linkData=', props.linkData) - console.log('RedeemCommunitySelection.extractHomeCommunityFromLinkData...linkData=', linkData) - console.log('RedeemCommunitySelection.extractHomeCommunityFromLinkData...communities=', linkData.communities) - console.log('RedeemCommunitySelection.extractHomeCommunityFromLinkData...linkData.value=', linkData.value) + // console.log( + // 'RedeemCommunitySelection.extractHomeCommunityFromLinkData... props.linkData=', + // props.linkData, + // ) + // console.log('RedeemCommunitySelection.extractHomeCommunityFromLinkData...linkData=', linkData) + // console.log( + // 'RedeemCommunitySelection.extractHomeCommunityFromLinkData...communities=', + // linkData.communities, + // ) + // console.log( + // 'RedeemCommunitySelection.extractHomeCommunityFromLinkData...linkData.value=', + // linkData.value, + // ) if (linkData.communities?.length === 0) { return { @@ -109,15 +118,15 @@ function extractHomeCommunityFromLinkData(linkData) { } } const communities = linkData.communities - console.log( - 'RedeemCommunitySelection.extractHomeCommunityFromLinkData...communities=', - communities, - ) + // console.log( + // 'RedeemCommunitySelection.extractHomeCommunityFromLinkData...communities=', + // communities, + // ) const homeCommunity = communities?.find((c) => c.foreign === false) - console.log( - 'RedeemCommunitySelection.extractHomeCommunityFromLinkData...homeCommunity=', - homeCommunity, - ) + // console.log( + // 'RedeemCommunitySelection.extractHomeCommunityFromLinkData...homeCommunity=', + // homeCommunity, + // ) return { uuid: homeCommunity.uuid, name: homeCommunity.name, @@ -130,20 +139,21 @@ const { mutate: createRedeemJwt } = useMutation(createRedeemJwtMutation) async function onSwitch(event) { event.preventDefault() // Prevent the default navigation - console.log('RedeemCommunitySelection.onSwitch... props=', props) + // console.log('RedeemCommunitySelection.onSwitch... props=', props) if (isForeignCommunitySelected.value) { - console.log('RedeemCommunitySelection.onSwitch vor createRedeemJwt params:', { - gradidoId: props.linkData.senderUser?.gradidoID, - senderCommunityUuid: senderCommunity.value.uuid, - senderCommunityName: senderCommunity.value.name, - recipientCommunityUuid: currentRecipientCommunity.value.uuid, - code: props.redeemCode, - amount: props.linkData.amount, - memo: props.linkData.memo, - firstName: props.linkData.senderUser?.firstName, - alias: props.linkData.senderUser?.alias, - validUntil: props.linkData.validUntil, - }) + // console.log('RedeemCommunitySelection.onSwitch vor createRedeemJwt params:', { + // gradidoId: props.linkData.senderUser?.gradidoID, + // senderCommunityUuid: senderCommunity.value.uuid, + // senderCommunityName: senderCommunity.value.name, + // recipientCommunityUuid: currentRecipientCommunity.value.uuid, + // code: props.redeemCode, + // amount: props.linkData.amount, + // memo: props.linkData.memo, + // firstName: props.linkData.senderUser?.firstName, + // alias: props.linkData.senderUser?.alias, + // validUntil: props.linkData.validUntil, + // }) + // eslint-disable-next-line no-useless-catch try { const { data } = await createRedeemJwt({ gradidoId: props.linkData.senderUser?.gradidoID, @@ -157,14 +167,14 @@ async function onSwitch(event) { alias: props.linkData.senderUser?.alias, validUntil: props.linkData.validUntil, }) - console.log('RedeemCommunitySelection.onSwitch... response=', data) + // console.log('RedeemCommunitySelection.onSwitch... response=', data) if (!data?.createRedeemJwt) { throw new Error('Failed to get redeem token') } const targetUrl = currentRecipientCommunity.value.url.replace(/\/api\/?$/, '') window.location.href = targetUrl + '/redeem/' + data.createRedeemJwt } catch (error) { - console.error('RedeemCommunitySelection.onSwitch error:', error) + // console.error('RedeemCommunitySelection.onSwitch error:', error) throw error } } diff --git a/frontend/src/pages/TransactionLink.vue b/frontend/src/pages/TransactionLink.vue index d0bae00c5..26d3c4b7f 100644 --- a/frontend/src/pages/TransactionLink.vue +++ b/frontend/src/pages/TransactionLink.vue @@ -1,4 +1,3 @@ -