# Pull Request Template ## Description Replace Hook mixin with useHook composable Fixes # (issue) ## Type of change Please delete options that are not relevant. - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality not to work as expected) - [ ] This change requires a documentation update ## How Has This Been Tested? Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration. ## Checklist: - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my code - [ ] I have commented on my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules --------- Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
65 lines
2.2 KiB
Vue
65 lines
2.2 KiB
Vue
<script>
|
|
import { useIntegrationHook } from 'dashboard/composables/useIntegrationHook';
|
|
export default {
|
|
props: {
|
|
integrationId: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
},
|
|
setup(props) {
|
|
const { integration, hasConnectedHooks } = useIntegrationHook(
|
|
props.integrationId
|
|
);
|
|
return { integration, hasConnectedHooks };
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<div class="flex-shrink flex-grow overflow-auto p-4">
|
|
<div class="flex flex-col">
|
|
<div
|
|
class="bg-white dark:bg-slate-800 border border-solid border-slate-75 dark:border-slate-700/50 rounded-xl mb-4 p-4"
|
|
>
|
|
<div class="flex">
|
|
<div class="flex h-[6.25rem] w-[6.25rem]">
|
|
<img
|
|
:src="`/dashboard/images/integrations/${integration.id}.png`"
|
|
class="max-w-full rounded-md border border-slate-50 dark:border-slate-700/50 shadow-sm block dark:hidden bg-white dark:bg-slate-900"
|
|
/>
|
|
<img
|
|
:src="`/dashboard/images/integrations/${integration.id}-dark.png`"
|
|
class="max-w-full rounded-md border border-slate-50 dark:border-slate-700/50 shadow-sm hidden dark:block bg-white dark:bg-slate-900"
|
|
/>
|
|
</div>
|
|
<div class="flex flex-col justify-center m-0 mx-4 flex-1">
|
|
<h3
|
|
class="text-xl font-medium mb-1 text-slate-800 dark:text-slate-100"
|
|
>
|
|
{{ integration.name }}
|
|
</h3>
|
|
<p class="text-slate-700 dark:text-slate-200">
|
|
{{ integration.description }}
|
|
</p>
|
|
</div>
|
|
<div class="flex justify-center items-center mb-0 w-[15%]">
|
|
<div v-if="hasConnectedHooks">
|
|
<div @click="$emit('delete', integration.hooks[0])">
|
|
<woot-button class="nice alert">
|
|
{{ $t('INTEGRATION_APPS.DISCONNECT.BUTTON_TEXT') }}
|
|
</woot-button>
|
|
</div>
|
|
</div>
|
|
<div v-else>
|
|
<woot-button class="button nice" @click="$emit('add')">
|
|
{{ $t('INTEGRATION_APPS.CONNECT.BUTTON_TEXT') }}
|
|
</woot-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|