diff --git a/backend/src/services/integrationService.ts b/backend/src/services/integrationService.ts index 62df8f408b..a5e9d89264 100644 --- a/backend/src/services/integrationService.ts +++ b/backend/src/services/integrationService.ts @@ -28,8 +28,8 @@ import { softDeleteRepositories, } from '@crowd/data-access-layer/src/repositories' import { + getMappedAllWithSegmentName, getMappedRepos, - getMappedWithSegmentName, hasMappedRepos, } from '@crowd/data-access-layer/src/segments' import { @@ -2683,10 +2683,10 @@ export default class IntegrationService { getMappedRepos(qx, segmentId, PlatformType.GITHUB_NANGO), getMappedRepos(qx, segmentId, PlatformType.GITLAB), ]) - const project = await getMappedWithSegmentName(qx, segmentId, githubPlatforms) + const projects = await getMappedAllWithSegmentName(qx, segmentId, githubPlatforms) return { - project, + projects, repositories: [...githubMappedRepos, ...githubNangoMappedRepos, ...gitlabMappedRepos], } } diff --git a/frontend/config/styles/components/button.scss b/frontend/config/styles/components/button.scss index 2a1bda5ab5..5be6605b72 100644 --- a/frontend/config/styles/components/button.scss +++ b/frontend/config/styles/components/button.scss @@ -180,6 +180,27 @@ --lf-btn-secondary-ghost-loading-background: var(--lf-color-transparent); --lf-btn-secondary-ghost-loading-border: var(--lf-color-transparent); + /* Danger Ghost */ + --lf-btn-danger-ghost-text: var(--lf-color-red-500); + --lf-btn-danger-ghost-background: var(--lf-color-transparent); + --lf-btn-danger-ghost-border: var(--lf-color-transparent); + --lf-btn-danger-ghost-shadow: var(--shadow-none); + // Hover + --lf-btn-danger-ghost-hover-text: var(--lf-color-red-500); + --lf-btn-danger-ghost-hover-background: var(--lf-color-red-100); + --lf-btn-danger-ghost-hover-border: var(--lf-color-red-100); + // Active + --lf-btn-danger-ghost-active-text: var(--lf-color-red-500); + --lf-btn-danger-ghost-active-background: var(--lf-color-red-100); + --lf-btn-danger-ghost-active-border: var(--lf-color-red-100); + // Disabled + --lf-btn-danger-ghost-disabled-text: var(--lf-color-red-200); + --lf-btn-danger-ghost-disabled-background: var(--lf-color-transparent); + --lf-btn-danger-ghost-disabled-border: var(--lf-color-transparent); + // Loading + --lf-btn-danger-ghost-loading-text: var(--lf-color-red-200); + --lf-btn-danger-ghost-loading-background: var(--lf-color-transparent); + --lf-btn-danger-ghost-loading-border: var(--lf-color-transparent); /* Secondary Gray */ --lf-btn-secondary-gray-text: var(--lf-color-primary-500); @@ -272,4 +293,27 @@ --lf-btn-secondary-link-loading-text: var(--lf-color-gray-400); --lf-btn-secondary-link-loading-background: var(--lf-color-transparent); --lf-btn-secondary-link-loading-border: var(--lf-color-transparent); + + /* Outline */ + --lf-btn-outline-text: var(--lf-color-neutral-900); + --lf-btn-outline-background: var(--lf-color-white); + --lf-btn-outline-border: var(--lf-color-neutral-200); + --lf-btn-outline-shadow: var(--shadow-none); + // Hover + --lf-btn-outline-hover-text: var(--lf-color-neutral-900); + --lf-btn-outline-hover-background: var(--lf-color-neutral-50); + --lf-btn-outline-hover-border: var(--lf-color-neutral-200); + // Active + --lf-btn-outline-active-text: var(--lf-color-neutral-900); + --lf-btn-outline-active-background: var(--lf-color-neutral-50); + --lf-btn-outline-active-border: var(--lf-color-neutral-200); + // Disabled + --lf-btn-outline-disabled-text: var(--lf-color-neutral-400); + --lf-btn-outline-disabled-background: var(--lf-color-white); + --lf-btn-outline-disabled-border: var(--lf-color-neutral-200); + // Loading + --lf-btn-outline-loading-text: var(--lf-color-neutral-400); + --lf-btn-outline-loading-background: var(--lf-color-white); + --lf-btn-outline-loading-border: var(--lf-color-neutral-200); + } diff --git a/frontend/config/styles/components/switch.scss b/frontend/config/styles/components/switch.scss index 8cfdf9d97e..d04e92358f 100644 --- a/frontend/config/styles/components/switch.scss +++ b/frontend/config/styles/components/switch.scss @@ -24,19 +24,9 @@ // Disabled Unchecked --lf-switch-disabled-unchecked-handle: var(--lf-color-white); - - // Disabled Checked + --lf-switch-disabled-background: var(--lf-color-gray-200); --lf-switch-disabled-checked-handle: var(--lf-color-white); - - /* ---------------------------------- *\ - Switch sizes - \* ---------------------------------- */ - - /* Tiny */ - --lf-switch-tiny-height: #{rem(16)}; - --lf-switch-tiny-width: #{rem(30)}; - --lf-switch-tiny-font-size: #{rem(12)}; - --lf-switch-tiny-line-height: #{rem(15)}; + --lf-switch-disabled-checked-background: var(--lf-color-primary-500); /* Small */ --lf-switch-small-height: #{rem(20)}; diff --git a/frontend/config/styles/variables/_colors.scss b/frontend/config/styles/variables/_colors.scss index c2f81c877f..23f697f78a 100755 --- a/frontend/config/styles/variables/_colors.scss +++ b/frontend/config/styles/variables/_colors.scss @@ -31,6 +31,18 @@ --lf-color-secondary-200: #99AFC9; --lf-color-secondary-100: #CCD7E4; --lf-color-secondary-50: #E6EBF2; + + // Brand + --lf-color-brand-900: #000816; + --lf-color-brand-800: #002648; + --lf-color-brand-700: #004880; + --lf-color-brand-600: #006DBE; + --lf-color-brand-500: #0094FF; + --lf-color-brand-400: #54ABFF; + --lf-color-brand-300: #83C1FF; + --lf-color-brand-200: #ADD6FF; + --lf-color-brand-100: #D6EBFF; + --lf-color-brand-50: #EBF5FF; // Gray --lf-color-gray-900: #111827; @@ -45,6 +57,19 @@ --lf-color-gray-100: #F3F4F6; --lf-color-gray-50: #F9FAFB; + // Neutral + --lf-color-neutral-900: #0F172B; + --lf-color-neutral-800: #1D293D; + --lf-color-neutral-700: #314158; + --lf-color-neutral-600: #45556C; + --lf-color-neutral-500: #62748E; + --lf-color-neutral-400: #90A1B9; + --lf-color-neutral-300: #CAD5E2; + --lf-color-neutral-250: #e6e6e6; + --lf-color-neutral-200: #E2E8F0; + --lf-color-neutral-100: #F1F5F9; + --lf-color-neutral-50: #F8FAFC; + // Red --lf-color-red-900: #7F1D1D; --lf-color-red-800: #991B1B; diff --git a/frontend/src/assets/images/integrations/git-repository-line.svg b/frontend/src/assets/images/integrations/git-repository-line.svg new file mode 100644 index 0000000000..1e3f5e8110 --- /dev/null +++ b/frontend/src/assets/images/integrations/git-repository-line.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/src/assets/scss/drawer.scss b/frontend/src/assets/scss/drawer.scss index f667a657b8..99f198a23c 100644 --- a/frontend/src/assets/scss/drawer.scss +++ b/frontend/src/assets/scss/drawer.scss @@ -1,7 +1,8 @@ .el-drawer { @apply opacity-100; - --el-drawer-padding-primary: 24px; + --el-drawer-padding-primary: 20px 24px; box-shadow: -4px 0px 10px rgba(0, 0, 0, 0.05); + overflow: unset; &__header { @apply mb-4; @@ -12,7 +13,25 @@ } &__footer { - @apply p-6 bg-gray-50 border-t border-gray-200; + @apply px-6 py-5 bg-gray-50 border-t border-gray-100 bg-white; + position: relative; + + &::before { + content: ''; + position: absolute; + top: -20px; + left: 0; + right: 0; + height: 20px; + background: linear-gradient(to top, rgba(0, 0, 0, 0.06), transparent); + pointer-events: none; + opacity: 0; + transition: opacity 0.2s ease; + } + } + + &.has-scroll .el-drawer__footer::before { + opacity: 1; } &__close-btn { diff --git a/frontend/src/assets/scss/form/input.scss b/frontend/src/assets/scss/form/input.scss index 7b332adcf5..5c0e9502a1 100644 --- a/frontend/src/assets/scss/form/input.scss +++ b/frontend/src/assets/scss/form/input.scss @@ -48,6 +48,22 @@ border: 1px solid var(--el-input-focus-border-color); } } + + &.is-rounded .el-input__wrapper{ + @apply rounded-full; + } +} + +.input-label-container { + @apply border border-solid border-gray-200 rounded-full flex items-stretch; + + span { + @apply text-gray-900 text-small px-3 bg-gray-50 border-r border-r-gray-200 flex items-center + rounded-l-full; + } + .el-input__wrapper{ + @apply border-none rounded-l-none rounded-r-full #{!important}; + } } // Inner input/textarea color diff --git a/frontend/src/assets/scss/form/select.scss b/frontend/src/assets/scss/form/select.scss index 4ecfa45905..65f5a86940 100644 --- a/frontend/src/assets/scss/form/select.scss +++ b/frontend/src/assets/scss/form/select.scss @@ -138,3 +138,15 @@ } } } + +.el-select.el-select--pill { + .el-select__wrapper { + &.el-tooltip__trigger { + @apply rounded-full; + } + + .el-select__suffix i{ + @apply text-gray-900; + } + } +} \ No newline at end of file diff --git a/frontend/src/assets/scss/layout.scss b/frontend/src/assets/scss/layout.scss index be9dbc148f..3c01ee078a 100644 --- a/frontend/src/assets/scss/layout.scss +++ b/frontend/src/assets/scss/layout.scss @@ -102,3 +102,7 @@ input:-webkit-autofill:active { transition: background-color 5000s ease-in-out 0s; -webkit-text-fill-color: #000 !important; } + +.el-overlay .el-splitter-panel{ + overflow: unset; +} \ No newline at end of file diff --git a/frontend/src/config/integrations/confluence/components/confluence-connect.vue b/frontend/src/config/integrations/confluence/components/confluence-connect.vue index 3608911b5f..d17f76d541 100644 --- a/frontend/src/config/integrations/confluence/components/confluence-connect.vue +++ b/frontend/src/config/integrations/confluence/components/confluence-connect.vue @@ -1,6 +1,6 @@ diff --git a/frontend/src/config/integrations/devto/components/devto-connect.vue b/frontend/src/config/integrations/devto/components/devto-connect.vue index 3e49ed40b5..e906f63908 100644 --- a/frontend/src/config/integrations/devto/components/devto-connect.vue +++ b/frontend/src/config/integrations/devto/components/devto-connect.vue @@ -4,7 +4,7 @@ - + Connect diff --git a/frontend/src/config/integrations/devto/config.ts b/frontend/src/config/integrations/devto/config.ts index 2e1692da18..fc359da4c1 100644 --- a/frontend/src/config/integrations/devto/config.ts +++ b/frontend/src/config/integrations/devto/config.ts @@ -8,7 +8,7 @@ const devto: IntegrationConfig = { key: 'devto', name: 'DEV', image, - description: 'Connect DEV to sync profile information and comments on articles.', + description: 'Sync profile information and comments on articles.', connectComponent: DevtoConnect, connectedParamsComponent: DevtoParams, showProgress: false, diff --git a/frontend/src/config/integrations/discord/components/discord-connect.vue b/frontend/src/config/integrations/discord/components/discord-connect.vue index 3424c20c83..17f321d683 100644 --- a/frontend/src/config/integrations/discord/components/discord-connect.vue +++ b/frontend/src/config/integrations/discord/components/discord-connect.vue @@ -4,7 +4,7 @@ - + Connect diff --git a/frontend/src/config/integrations/discord/config.ts b/frontend/src/config/integrations/discord/config.ts index 173a7af1a5..1b20fb65f2 100644 --- a/frontend/src/config/integrations/discord/config.ts +++ b/frontend/src/config/integrations/discord/config.ts @@ -8,7 +8,7 @@ const discord: IntegrationConfig = { key: 'discord', name: 'Discord', image, - description: 'Connect Discord to sync messages, threads, forum channels, and new joiners.', + description: 'Sync messages, threads, forum channels, and new joiners.', connectComponent: DiscordConnect, connectedParamsComponent: DiscordParams, showProgress: false, diff --git a/frontend/src/config/integrations/discourse/components/discourse-connect.vue b/frontend/src/config/integrations/discourse/components/discourse-connect.vue index 690b04a97d..50bc32751c 100644 --- a/frontend/src/config/integrations/discourse/components/discourse-connect.vue +++ b/frontend/src/config/integrations/discourse/components/discourse-connect.vue @@ -4,7 +4,7 @@ - + Connect diff --git a/frontend/src/config/integrations/discourse/components/discourse-settings-drawer.vue b/frontend/src/config/integrations/discourse/components/discourse-settings-drawer.vue index c4497710b0..990f25dcbb 100644 --- a/frontend/src/config/integrations/discourse/components/discourse-settings-drawer.vue +++ b/frontend/src/config/integrations/discourse/components/discourse-settings-drawer.vue @@ -7,6 +7,8 @@ pre-title="Integration" :show-footer="true" has-border + close-on-click-modal="true" + :close-function="canClose" @close="handleCancel()" > + + + diff --git a/frontend/src/config/integrations/gerrit/config.ts b/frontend/src/config/integrations/gerrit/config.ts index 3783f1727b..59a79c2fea 100644 --- a/frontend/src/config/integrations/gerrit/config.ts +++ b/frontend/src/config/integrations/gerrit/config.ts @@ -10,7 +10,7 @@ const gerrit: IntegrationConfig = { key: 'gerrit', name: 'Gerrit', image, - description: 'Connect Gerrit to sync documentation activities from your repos.', + description: 'Sync documentation activities from Gerrit repositories.', connectComponent: GerritConnect, connectedParamsComponent: GerritParams, dropdownComponent: GerritDropdown, diff --git a/frontend/src/config/integrations/git/components/git-connect.vue b/frontend/src/config/integrations/git/components/git-connect.vue index b825ee9b59..fa1993afd1 100644 --- a/frontend/src/config/integrations/git/components/git-connect.vue +++ b/frontend/src/config/integrations/git/components/git-connect.vue @@ -5,7 +5,7 @@ - + Connect diff --git a/frontend/src/config/integrations/git/components/git-params.vue b/frontend/src/config/integrations/git/components/git-params.vue index 0f06207ed3..f47da4f894 100644 --- a/frontend/src/config/integrations/git/components/git-params.vue +++ b/frontend/src/config/integrations/git/components/git-params.vue @@ -1,27 +1,69 @@ - + + diff --git a/frontend/src/config/integrations/git/config.ts b/frontend/src/config/integrations/git/config.ts index 9e4de87ca4..8c1004b5fb 100644 --- a/frontend/src/config/integrations/git/config.ts +++ b/frontend/src/config/integrations/git/config.ts @@ -10,7 +10,7 @@ const git: IntegrationConfig = { key: 'git', name: 'Git', image, - description: 'Connect Git to sync commit activities from your repos.', + description: 'Sync commit activities from Git repositories.', connectComponent: GitConnect, dropdownComponent: GitDropdown, connectedParamsComponent: GitParams, diff --git a/frontend/src/config/integrations/github-nango/components/connect/github-connect.vue b/frontend/src/config/integrations/github-nango/components/connect/github-connect.vue deleted file mode 100644 index fbf455d262..0000000000 --- a/frontend/src/config/integrations/github-nango/components/connect/github-connect.vue +++ /dev/null @@ -1,76 +0,0 @@ - - - - - diff --git a/frontend/src/config/integrations/github-nango/components/github-connect.vue b/frontend/src/config/integrations/github-nango/components/github-connect.vue deleted file mode 100644 index cf0ed4d7d7..0000000000 --- a/frontend/src/config/integrations/github-nango/components/github-connect.vue +++ /dev/null @@ -1,44 +0,0 @@ - - - - - diff --git a/frontend/src/config/integrations/github-nango/components/github-mapped-repos.vue b/frontend/src/config/integrations/github-nango/components/github-mapped-repos.vue deleted file mode 100644 index f8d1dbfe24..0000000000 --- a/frontend/src/config/integrations/github-nango/components/github-mapped-repos.vue +++ /dev/null @@ -1,72 +0,0 @@ - - - - - diff --git a/frontend/src/config/integrations/github-nango/components/github-params.vue b/frontend/src/config/integrations/github-nango/components/github-params.vue index 278198f817..e0281b05dd 100644 --- a/frontend/src/config/integrations/github-nango/components/github-params.vue +++ b/frontend/src/config/integrations/github-nango/components/github-params.vue @@ -1,76 +1,31 @@ - - diff --git a/frontend/src/config/integrations/github/components/github-connect.vue b/frontend/src/config/integrations/github/components/github-connect.vue index 7dac4be9c2..13c5f6dcf1 100644 --- a/frontend/src/config/integrations/github/components/github-connect.vue +++ b/frontend/src/config/integrations/github/components/github-connect.vue @@ -1,38 +1,113 @@ diff --git a/frontend/src/config/integrations/github/components/github-mappings-display.vue b/frontend/src/config/integrations/github/components/github-mappings-display.vue new file mode 100644 index 0000000000..431d182ad7 --- /dev/null +++ b/frontend/src/config/integrations/github/components/github-mappings-display.vue @@ -0,0 +1,89 @@ + + + + + diff --git a/frontend/src/config/integrations/github/components/github-params.vue b/frontend/src/config/integrations/github/components/github-params.vue index 275c1af234..942c81718f 100644 --- a/frontend/src/config/integrations/github/components/github-params.vue +++ b/frontend/src/config/integrations/github/components/github-params.vue @@ -1,59 +1,18 @@ diff --git a/frontend/src/config/integrations/github/components/settings/github-settings-drawer.vue b/frontend/src/config/integrations/github/components/settings/github-settings-drawer.vue index ab46827e4d..19ca04d0e9 100644 --- a/frontend/src/config/integrations/github/components/settings/github-settings-drawer.vue +++ b/frontend/src/config/integrations/github/components/settings/github-settings-drawer.vue @@ -6,6 +6,8 @@ pre-title="Integration" :show-footer="true" has-border + close-on-click-modal="true" + :close-function="canClose" @close="isDrawerVisible = false" > + + + + diff --git a/frontend/src/modules/admin/modules/integration/components/drawer-description.vue b/frontend/src/modules/admin/modules/integration/components/drawer-description.vue new file mode 100644 index 0000000000..a378137946 --- /dev/null +++ b/frontend/src/modules/admin/modules/integration/components/drawer-description.vue @@ -0,0 +1,31 @@ + + + diff --git a/frontend/src/modules/admin/modules/integration/components/drawer-footer-buttons.vue b/frontend/src/modules/admin/modules/integration/components/drawer-footer-buttons.vue new file mode 100644 index 0000000000..6abda6d623 --- /dev/null +++ b/frontend/src/modules/admin/modules/integration/components/drawer-footer-buttons.vue @@ -0,0 +1,121 @@ + + + + + diff --git a/frontend/src/modules/admin/modules/integration/components/integration-confirmation-modal.vue b/frontend/src/modules/admin/modules/integration/components/integration-confirmation-modal.vue new file mode 100644 index 0000000000..bbce588051 --- /dev/null +++ b/frontend/src/modules/admin/modules/integration/components/integration-confirmation-modal.vue @@ -0,0 +1,86 @@ + + + + + diff --git a/frontend/src/modules/admin/modules/integration/components/integration-list-item.vue b/frontend/src/modules/admin/modules/integration/components/integration-list-item.vue index ba0b8f0e4c..e2f1e941e5 100644 --- a/frontend/src/modules/admin/modules/integration/components/integration-list-item.vue +++ b/frontend/src/modules/admin/modules/integration/components/integration-list-item.vue @@ -1,9 +1,9 @@ + + diff --git a/frontend/src/ui-kit/lfx/tabs/tabs.scss b/frontend/src/ui-kit/lfx/tabs/tabs.scss new file mode 100644 index 0000000000..dee1b7ed67 --- /dev/null +++ b/frontend/src/ui-kit/lfx/tabs/tabs.scss @@ -0,0 +1,32 @@ +.lfx-c-tabs { + @apply flex relative whitespace-nowrap w-fit transition bg-gray-100 rounded-full gap-1 p-1; + + &--small { + .lfx-c-tab { + --lf-tab-font-size: var(--lf-tabs-small-font-size); + --lf-tab-line-height: var(--lf-tabs-small-line-height); + --lf-tab-padding: var(--lf-tabs-small-padding); + } + } + + &--medium { + .lfx-c-tab { + --lf-tab-font-size: var(--lf-tabs-medium-font-size); + --lf-tab-line-height: var(--lf-tabs-medium-line-height); + --lf-tab-padding: var(--lf-tabs-medium-padding); + } + } +} + +.lfx-c-tab { + @apply flex items-center justify-center text-center cursor-pointer transition-all select-none; + @apply rounded-full px-3 py-1 text-gray-600 font-normal leading-5 text-sm; + + &:hover { + background: var(--lf-tab-hover-background); + } + + &.is-active { + @apply bg-white text-gray-900 font-medium; + } +} diff --git a/frontend/src/ui-kit/lfx/tabs/tabs.vue b/frontend/src/ui-kit/lfx/tabs/tabs.vue new file mode 100644 index 0000000000..9f61cca9ca --- /dev/null +++ b/frontend/src/ui-kit/lfx/tabs/tabs.vue @@ -0,0 +1,70 @@ + + + + + diff --git a/frontend/src/ui-kit/lfx/tabs/types/TabsSize.ts b/frontend/src/ui-kit/lfx/tabs/types/TabsSize.ts new file mode 100644 index 0000000000..fd90a69e52 --- /dev/null +++ b/frontend/src/ui-kit/lfx/tabs/types/TabsSize.ts @@ -0,0 +1,6 @@ +export const tabsSize = [ + 'small', + 'medium', +] as const; + +export type TabsSize = typeof tabsSize[number]; diff --git a/frontend/src/ui-kit/switch/switch.scss b/frontend/src/ui-kit/switch/switch.scss index bd5a180eda..c28046d43a 100644 --- a/frontend/src/ui-kit/switch/switch.scss +++ b/frontend/src/ui-kit/switch/switch.scss @@ -40,7 +40,7 @@ // Disabled &:disabled { --lf-switch-handle: var(--lf-switch-disabled-unchecked-handle); - --lf-switch-background: var(--lf-switch-unchecked-background); + --lf-switch-background: var(--lf-switch-disabled-background); @apply cursor-not-allowed opacity-60; &:checked { diff --git a/frontend/tailwind.config.js b/frontend/tailwind.config.js index 4787e63d16..dac7f04623 100644 --- a/frontend/tailwind.config.js +++ b/frontend/tailwind.config.js @@ -120,6 +120,18 @@ module.exports = { 100: 'var(--lf-color-secondary-100)', 50: 'var(--lf-color-secondary-50)', }, + brand: { + 900: 'var(--lf-color-brand-900)', + 800: 'var(--lf-color-brand-800)', + 700: 'var(--lf-color-brand-700)', + 600: 'var(--lf-color-brand-600)', + 500: 'var(--lf-color-brand-500)', + 400: 'var(--lf-color-brand-400)', + 300: 'var(--lf-color-brand-300)', + 200: 'var(--lf-color-brand-200)', + 100: 'var(--lf-color-brand-100)', + 50: 'var(--lf-color-brand-50)', + }, gray: { 900: 'var(--lf-color-gray-900)', 800: 'var(--lf-color-gray-800)', @@ -133,6 +145,18 @@ module.exports = { 100: 'var(--lf-color-gray-100)', 50: 'var(--lf-color-gray-50)', }, + neutral: { + 900: 'var(--lf-color-neutral-900)', + 800: 'var(--lf-color-neutral-800)', + 700: 'var(--lf-color-neutral-700)', + 600: 'var(--lf-color-neutral-600)', + 500: 'var(--lf-color-neutral-500)', + 400: 'var(--lf-color-neutral-400)', + 300: 'var(--lf-color-neutral-300)', + 200: 'var(--lf-color-neutral-200)', + 100: 'var(--lf-color-neutral-100)', + 50: 'var(--lf-color-neutral-50)', + }, red: { 900: 'var(--lf-color-red-900)', 800: 'var(--lf-color-red-800)', @@ -193,7 +217,7 @@ module.exports = { lg: '0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)', xl: '0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)', '2xl': '0 25px 50px -12px rgb(0 0 0 / 0.25)', - xs: '0 1px 2px -1px rgba(0, 0, 0, 0.10), 0 1px 3px 0 rgba(0, 0, 0, 0.10)', + xs: '0 1px 2px 0 rgba(0, 0, 0, 0.02)', }, fontSize: { '4xs': ['0.5rem'], diff --git a/services/libs/data-access-layer/src/segments/index.ts b/services/libs/data-access-layer/src/segments/index.ts index 9174044baa..0d1ce81acc 100644 --- a/services/libs/data-access-layer/src/segments/index.ts +++ b/services/libs/data-access-layer/src/segments/index.ts @@ -351,6 +351,39 @@ export async function getMappedWithSegmentName( return result?.segment_name ?? null } +export async function getMappedAllWithSegmentName( + qx: QueryExecutor, + segmentId: string, + platforms: PlatformType[], +): Promise<{ segmentName: string; url: string }[]> { + if (platforms.length === 0) { + return [] + } + + const results = await qx.select( + ` + SELECT DISTINCT s.name as segment_name, r.url + FROM public.repositories r + LEFT JOIN integrations i ON r."sourceIntegrationId" = i.id + LEFT JOIN segments s ON i."segmentId" = s.id + WHERE r."segmentId" = $(segmentId) + AND r."deletedAt" IS NULL + AND ( + i.id IS NULL + OR (i.platform = ANY($(platforms)::text[]) AND i."segmentId" <> $(segmentId)) + ) + `, + { segmentId, platforms }, + ) + + return results + .filter((r: { segment_name: string; url: string }) => r.segment_name) + .map((r: { segment_name: string; url: string }) => ({ + segmentName: r.segment_name, + url: r.url, + })) +} + export interface ISegment { id: string name: string