-
Notifications
You must be signed in to change notification settings - Fork 528
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8205 from ever-co/stage
Stage
- Loading branch information
Showing
61 changed files
with
1,811 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
apps/gauzy/src/app/pages/integrations/gauzy-ai/gauzy-ai-routing.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 0 additions & 65 deletions
65
apps/gauzy/src/app/pages/integrations/integrations-routing.module.ts
This file was deleted.
Oops, something went wrong.
114 changes: 96 additions & 18 deletions
114
apps/gauzy/src/app/pages/integrations/integrations.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,117 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { Inject, NgModule } from '@angular/core'; | ||
import { ROUTES, RouterModule } from '@angular/router'; | ||
import { | ||
NbButtonModule, | ||
NbCardModule, | ||
NbSelectModule, | ||
NbIconModule, | ||
NbInputModule, | ||
NbSelectModule, | ||
NbSpinnerModule, | ||
NbButtonModule, | ||
NbIconModule, | ||
NbTooltipModule | ||
} from '@nebular/theme'; | ||
import { NgxPermissionsModule } from 'ngx-permissions'; | ||
import { TranslateModule } from '@ngx-translate/core'; | ||
import { PageRouteRegistryService } from '@gauzy/ui-core/core'; | ||
import { SmartDataViewLayoutModule, SharedModule, TableComponentsModule } from '@gauzy/ui-core/shared'; | ||
import { IntegrationsRoutingModule } from './integrations-routing.module'; | ||
import { createIntegrationsRoutes } from './integrations.routes'; | ||
import { IntegrationsComponent } from './integrations.component'; | ||
import { IntegrationLayoutComponent } from './layout/layout.component'; | ||
import { IntegrationListComponent } from './components/integration-list/list.component'; | ||
|
||
// Nebular Modules | ||
const NB_MODULES = [ | ||
NbButtonModule, | ||
NbCardModule, | ||
NbIconModule, | ||
NbInputModule, | ||
NbSelectModule, | ||
NbSpinnerModule, | ||
NbTooltipModule | ||
]; | ||
|
||
@NgModule({ | ||
declarations: [IntegrationLayoutComponent, IntegrationListComponent, IntegrationsComponent], | ||
imports: [ | ||
CommonModule, | ||
NbButtonModule, | ||
NbCardModule, | ||
NbInputModule, | ||
NbSelectModule, | ||
NbSpinnerModule, | ||
NbTooltipModule, | ||
IntegrationsRoutingModule, | ||
SharedModule, | ||
NbIconModule, | ||
...NB_MODULES, | ||
RouterModule.forChild([]), | ||
NgxPermissionsModule.forChild(), | ||
TranslateModule.forChild(), | ||
SharedModule, | ||
SmartDataViewLayoutModule, | ||
TableComponentsModule | ||
], | ||
declarations: [IntegrationLayoutComponent, IntegrationListComponent, IntegrationsComponent] | ||
exports: [RouterModule], | ||
providers: [ | ||
{ | ||
provide: ROUTES, | ||
useFactory: (provider: PageRouteRegistryService) => createIntegrationsRoutes(provider), | ||
deps: [PageRouteRegistryService], | ||
multi: true | ||
} | ||
] | ||
}) | ||
export class IntegrationsModule {} | ||
export class IntegrationsModule { | ||
private static hasRegisteredPageRoutes = false; // Flag to check if routes have been registered | ||
|
||
constructor(@Inject(PageRouteRegistryService) readonly _pageRouteRegistryService: PageRouteRegistryService) { | ||
// Register the routes | ||
this.registerPageRoutes(); | ||
} | ||
|
||
/** | ||
* Registers the routes for the integrations module. | ||
* Ensures that the routes are only registered once. | ||
* | ||
* @returns | ||
*/ | ||
registerPageRoutes(): void { | ||
if (IntegrationsModule.hasRegisteredPageRoutes) { | ||
return; | ||
} | ||
|
||
// Register the routes for upwork integration | ||
this._pageRouteRegistryService.registerPageRoute({ | ||
// Register the location 'integrations' | ||
location: 'integrations', | ||
// Register the path 'upwork' | ||
path: 'upwork', | ||
// Register the loadChildren function to load the UpworkModule lazy module | ||
loadChildren: () => import('../upwork/upwork.module').then((m) => m.UpworkModule) | ||
}); | ||
|
||
// Register the routes for hubstaff integration | ||
this._pageRouteRegistryService.registerPageRoute({ | ||
// Register the location 'integrations' | ||
location: 'integrations', | ||
// Register the path 'hubstaff' | ||
path: 'hubstaff', | ||
// Register the loadChildren function to load the HubstaffModule lazy module | ||
loadChildren: () => import('../hubstaff/hubstaff.module').then((m) => m.HubstaffModule) | ||
}); | ||
|
||
// Register the routes for gauzy-ai integration | ||
this._pageRouteRegistryService.registerPageRoute({ | ||
// Register the location 'integrations' | ||
location: 'integrations', | ||
// Register the path 'gauzy-ai' | ||
path: 'gauzy-ai', | ||
// Register the loadChildren function to load the GauzyAIModule lazy module | ||
loadChildren: () => import('./gauzy-ai/gauzy-ai.module').then((m) => m.GauzyAIModule), | ||
data: { selectors: false } | ||
}); | ||
|
||
// Register the routes for github integration | ||
this._pageRouteRegistryService.registerPageRoute({ | ||
// Register the location 'integrations' | ||
location: 'integrations', | ||
// Register the path 'github' | ||
path: 'github', | ||
// Register the loadChildren function to load the GithubModule lazy module | ||
loadChildren: () => import('./github/github.module').then((m) => m.GithubModule), | ||
data: { selectors: false } | ||
}); | ||
|
||
// Set hasRegisteredRoutes to true | ||
IntegrationsModule.hasRegisteredPageRoutes = true; | ||
} | ||
} |
Oops, something went wrong.