Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Success page for non direct connect #2644

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions frontend/public/images/logo/lfx.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 9 additions & 2 deletions frontend/src/app.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div id="app">
<div class="sm:hidden md:block lg:block xl:block">
<lfx-header-v2 id="lfx-header" product="Community Management" />
<lfx-header-v2 v-if="!$route.meta.hideLfxHeader" id="lfx-header" product="Community Management" />
<router-view v-slot="{ Component }">
<transition>
<component :is="Component" v-if="Component" />
Expand Down Expand Up @@ -71,11 +71,18 @@ export default {

window.addEventListener('resize', this.handleResize);
this.handleResize();
this.init();
const queryParameters = new URLSearchParams(window.location.search);
if (queryParameters.get('state') === 'noconnect' && window.location.pathname.includes('/integration')) {
return;
}
this.listProjectGroups({
limit: null,
reset: true,
});
if (['/auth/callback'].includes(window.location.pathname)) {
return;
}
this.init();
},

unmounted() {
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/modules/auth/services/auth.service.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Auth0Service } from '@/modules/auth/services/auth0.service';

class AuthServiceClass {
setToken(token: string) {
localStorage.setItem('jwt', token);
Expand All @@ -18,6 +20,7 @@ class AuthServiceClass {
logout() {
localStorage.removeItem('jwt');
localStorage.removeItem('currentTenant');
Auth0Service.logout();
}

isDevmode() {
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/modules/auth/store/auth.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ import useSessionTracking from '@/shared/modules/monitoring/useSessionTracking';

export default {
init() {
if (window.location.pathname === '/auth/callback') {
return;
}
Auth0Service.isAuthenticated()
.then((isAuthenticated: boolean) => {
if (!isAuthenticated) {
Expand Down
48 changes: 34 additions & 14 deletions frontend/src/modules/integration/integration-routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { PermissionGuard } from '@/shared/modules/permissions/router/PermissionG
import { LfPermission } from '@/shared/modules/permissions/types/Permissions';

const IntegrationListPage = () => import(
'@/modules/integration/components/integration-list-page.vue'
'@/modules/integration/pages/integration-list-page.vue'
);
const IntegrationSuccessPage = () => import(
'@/modules/integration/pages/integration-success-page.vue'
);

export default [
Expand All @@ -14,7 +17,6 @@ export default [
component: Layout,
exact: true,
meta: {
auth: true,
title: 'Integrations',
eventKey: PageEventKey.INTEGRATIONS,
hideBanner: true,
Expand All @@ -25,25 +27,34 @@ export default [
path: '/integrations',
exact: true,
meta: {
auth: true,
},
beforeEnter: [
PermissionGuard(LfPermission.integrationRead),
(to, from, next) => {
const segmentId = localStorage.getItem('segmentId');
const segmentGrandparentId = localStorage.getItem('segmentGrandparentId');
console.log(to.query.state);
const state = to.query.state ?? '';

// Redirect to integrations list page with correct id
if (segmentId && Object.keys(to.query).length) {
next({
name: 'integration',
params: {
id: segmentId,
grandparentId: segmentGrandparentId,
},
query: to.query,
});
return;
if (Object.keys(to.query).length) {
if (state === 'noconnect') {
next({
name: 'integrationSuccess',
query: to.query,
});
return;
}
if (segmentId !== 'null') {
next({
name: 'integration',
params: {
id: segmentId,
grandparentId: segmentGrandparentId,
},
query: to.query,
});
return;
}
}

localStorage.setItem('segmentId', null);
Expand Down Expand Up @@ -71,4 +82,13 @@ export default [
},
],
},
{
name: 'integrationSuccess',
path: '/integrations/success',
component: IntegrationSuccessPage,
exact: true,
meta: {
hideLfxHeader: true,
},
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ import { mapGetters } from 'vuex';
import AppLfIntegrationsPageHeader from '@/modules/lf/layout/components/lf-integrations-page-header.vue';
import ConfirmDialog from '@/shared/dialog/confirm-dialog';
import Message from '@/shared/message/message';
import AppIntegrationList from './integration-list.vue';
import AppIntegrationList from '../components/integration-list.vue';

export default {
name: 'AppIntegrationListPage',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<template>
<div class="py-10 h-screen w-full flex flex-col items-center justify-center">
<section class="flex justify-center items-center pb-10">
<div class="w-20 h-20 bg-white shadow-md rounded-full flex items-center justify-center mr-4">
<lf-icon name="git-repository-line" :size="40" />
</div>
<div class="flex items-center gap-2">
<div class="w-1 h-1 rounded-full bg-gray-300" />
<div class="w-1 h-1 rounded-full bg-gray-300" />
<div class="w-1 h-1 rounded-full bg-gray-300" />
<div class="w-1 h-1 rounded-full bg-gray-300" />
</div>
<div class="px-2">
<lf-icon name="checkbox-circle-fill" :size="20" class="text-green-500" />
</div>
<div class="flex items-center gap-2">
<div class="w-1 h-1 rounded-full bg-gray-300" />
<div class="w-1 h-1 rounded-full bg-gray-300" />
<div class="w-1 h-1 rounded-full bg-gray-300" />
<div class="w-1 h-1 rounded-full bg-gray-300" />
</div>
<div class="w-20 h-20 bg-white shadow-md rounded-full flex items-center justify-center ml-4">
<div>
<img alt="LFX logo" src="/images/logo/lfx.svg" />
</div>
</div>
</section>
<section class="flex flex-col items-center">
<h4 class="text-center pb-10">
LFX CM successfully installed
</h4>
<p class="text-medium text-center pb-10 max-w-148">
To finalize the process of connecting this GitHub organization to LFX Community Management,
each repository must be mapped to its corresponding sub-project.
</p>
<div class="bg-primary-50 border border-primary-100 flex items-center px-3 py-1.5 rounded-md">
<lf-icon name="information-line" :size="20" class="text-primary-800" />
<p class="ml-2 text-small text-primary-800">
You must have a LF account and permissions to access Community Management in order to complete this final step.
</p>
</div>
</section>
</div>
</template>

<script lang="ts" setup>
import LfIcon from '@/ui-kit/icon/Icon.vue';
</script>

<script lang="ts">
export default {
name: 'LfIntegrationSuccessPage',
};
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ import AppLfAuditLogsPage from '@/modules/lf/segments/pages/lf-audit-logs-page.v
import LfDevmode from '@/modules/lf/segments/components/dev/devmode.vue';
import { LfRole } from '@/shared/modules/permissions/types/Roles';
import AppOrganizationCommonPage from '@/modules/organization/pages/organization-common-page.vue';
// import AppOrganizationCommonPage from '@/modules/organization/pages/organization-common-page.vue';

const route = useRoute();
const router = useRouter();
Expand Down
3 changes: 2 additions & 1 deletion frontend/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ const spacing = {
88: '22rem',
96: '24rem',
100: '25rem',
120: '30rem'
120: '30rem',
148: '37rem'
}

module.exports = {
Expand Down
Loading