Skip to content

Commit 8f48977

Browse files
evereqdependabot[bot]rahul-rocketgreptile-apps[bot]syns2191
authored
Stage (#9591)
* chore(deps-dev): bump simple-git from 3.31.1 to 3.32.3 Bumps [simple-git](https://github.com/steveukx/git-js/tree/HEAD/simple-git) from 3.31.1 to 3.32.3. - [Release notes](https://github.com/steveukx/git-js/releases) - [Changelog](https://github.com/steveukx/git-js/blob/main/simple-git/CHANGELOG.md) - [Commits](https://github.com/steveukx/git-js/commits/simple-git@3.32.3/simple-git) --- updated-dependencies: - dependency-name: simple-git dependency-version: 3.32.3 dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps): bump tar from 7.5.10 to 7.5.11 Bumps [tar](https://github.com/isaacs/node-tar) from 7.5.10 to 7.5.11. - [Release notes](https://github.com/isaacs/node-tar/releases) - [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md) - [Commits](isaacs/node-tar@v7.5.10...v7.5.11) --- updated-dependencies: - dependency-name: tar dependency-version: 7.5.11 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps): bump hono from 4.12.5 to 4.12.7 Bumps [hono](https://github.com/honojs/hono) from 4.12.5 to 4.12.7. - [Release notes](https://github.com/honojs/hono/releases) - [Commits](honojs/hono@v4.12.5...v4.12.7) --- updated-dependencies: - dependency-name: hono dependency-version: 4.12.7 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps): bump sequelize from 6.37.7 to 6.37.8 Bumps [sequelize](https://github.com/sequelize/sequelize) from 6.37.7 to 6.37.8. - [Release notes](https://github.com/sequelize/sequelize/releases) - [Changelog](https://github.com/sequelize/sequelize/blob/main/CHANGELOG.md) - [Commits](sequelize/sequelize@v6.37.7...v6.37.8) --- updated-dependencies: - dependency-name: sequelize dependency-version: 6.37.8 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * fix(core): resolve expired S3 presigned URLs for employee time slot profile images (#9588) * fix(core): resolve expired S3 presigned URLs for employee time slot profile images * Update packages/core/src/lib/user/user.service.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Update packages/core/src/lib/time-tracking/statistic/statistic.service.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Apply suggestion from @greptile-apps[bot] * Apply suggestion from @greptile-apps[bot] * fix(core): resolve expired S3 presigned URLs for employee time slot profile images * Apply suggestion from @greptile-apps[bot] * Apply suggestion from @greptile-apps[bot] * Apply suggestion from @greptile-apps[bot] * Apply suggestion from @greptile-apps[bot] --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Fix/desktop start server (#9582) * fix: desktop start server * fix: missing env key in desktop local server * fix: missing env key in desktop server * fix: remove unused imported binding module * fix: add jwt secret to the setup configuration * fix: typo component * fix: translate module at secret module * fix: add translate jwt secret key to all lang * fix: i18n value * fix: remove unused method * [Feat] Plugin subscription management (#9580) * fix(ui): update plugin category effects to use forkJoin for bulk updates and deletions * fix: Use Number.isNaN for robust date validation This commit addresses a minor bug by using the more reliable `Number.isNaN()` method, which is the recommended global function for checking `NaN`. It's a small, self-contained change that can be safely committed and reverted independently. * refactor: Migrate plugin user management UI to Smart Tables Replaces the custom list rendering and infinite scroll logic with `angular2-smart-table` and `ga-pagination` components for both available and assigned users. This refactoring includes: - Removing manual list iteration, user display, and pagination/scroll logic from the template. - Introducing `angular2-smart-table` components and their data sources (`LocalDataSource`). - Defining the smart table settings and custom render components for displaying user and assignment details. - Updating the component's lifecycle hooks and data binding to work with the new table structure. - Removing associated styling for the old list components and adding styles for the new table containers. This is a major UI overhaul, replacing a significant portion of the component's template, styling, and TypeScript logic. Grouping these changes into a single commit ensures the entire UI migration is self-contained. The smart table settings, including columns like `_access` (for the upcoming feature), are fully defined here to provide a complete and functional (though not yet fully interactive for the new feature) table UI. * feat: Integrate Plugin Tenant User Access Management UI Wires up the user interface for managing plugin tenant user access. This includes: - Adding bulk access control buttons ('Enable All', 'Disable All') to the 'Current Assignments' tab in the HTML. - Implementing `onToggleUserAccess`, `onEnableAllUsers`, and `onDisableAllUsers` methods in the component to dispatch actions to the facade. - Adding the `NbToggleModule` and `AccessToggleCellComponent` imports, as well as necessary logic to `bindSourcesToStreams` for handling the access toggle within the Smart Table. This commit completes the implementation of the new user access management feature by integrating the UI components with the facade methods introduced in the previous commit. * feat: Integrate effects manager and update dependencies across multiple modules * feat: user management tab with bulk actions and smart table integration * feat(desktop): add plugin access verification ◦ add user assignment flows and services ◦ sync plugin access on assignment changes ◦ update plugin system interfaces, events, and channels ◦ include migration for plugin user scope table * feat(plugin-tenant): add unassign operation for users Introduce a new 'unassign' operation to manage plugin tenant users. This operation removes a user from both the allowed and denied lists for a specific plugin tenant. It updates the command handler, command DTO, and the enum for available operations. Fix a bug in the 'get-plugin-tenant-users' query handler where denied users were incorrectly fetched from the allowed users table. The query now correctly retrieves denied users from the dedicated denied users table. * feat(plugin-user-management): add unassign user functionality Introduce a new 'unassign' operation to completely remove users from plugin tenants, rather than just changing their active/inactive status. Refactor user assignment loading to fetch all users (allowed and denied) by default, providing a comprehensive view of plugin assignments. Implement optimistic UI updates for allow, deny, and unassign actions, reducing server reloads and improving responsiveness. Enhance the user management UI with: * A dedicated 'Disabled Users' count. * Improved empty states for both overall plugin assignments and specific tabs. * Confirmation dialogs for bulk enable/disable and individual unassign actions. * Clearer status badges and tooltips. * Add translation keys for various user management components. * feat(plugin-user-assignment): enhance operation state management and UI feedback * feat(plugin-user-assignment): add translations * feat(plugin-subscription): improve error handling and response structure in subscription management * fix: false promise validate * feat(cspell): add new words to the spell checker dictionary * fix(plugin-electron): correct channel name for updateTenantEnabled method * feat: add ai fixes for user management in plugin marketplace - Updated user management tab styles to use CSS variables for colors and shadows. - Refactored user management component to utilize Angular's dependency injection for services. - Improved loading states in user management component templates with skeleton loaders. - Introduced new interfaces for user row data to enhance type safety. - Replaced direct property access with computed properties in user cell components for better reactivity. - Enhanced the plugin access sync service to handle timeout errors gracefully. - Updated internationalization strings for clarity and consistency. - Removed unused effects from the plugin routing module to streamline the codebase. * fix(plugin-subscription): improve error handling when fetching updated subscriptions * fix: bulk enable/disable actions are not permission-gated, so users without assign rights can trigger access changes. Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> * fix: the new table styles are scoped to .available-users, but the assign tab uses .assign-users-section, so Assign Users table styling is not applied. Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> * fix: replace skeleton loaders with spinner for loading states in user management tab * refactor(integrations): move plugin effects provider to module level Previously, `providePluginsEffects()` was declared directly within the route configuration for the 'plugins' path. This change moves the provider to the `IntegrationsModule`'s main `providers` array. Elevating the provider's scope ensures that plugin-related effects are available consistently across the entire integrations feature area, not just limited to the lazy-loaded 'plugins' route. --------- Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> * (fix) override default overlay config to disable use of top-layered popovers (#9590) * fix: override default overlay config to disable use of top-layered popovers * refactor(angular): replace `APP_INITIALIZER` with `provideAppInitializer` * Update app.module.ts * Update app.module.ts * Update packages/plugins/posthog-ui/src/lib/posthog.module.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Update apps/gauzy/src/app/app.module.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Update packages/plugins/posthog-ui/src/lib/posthog.module.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update apps/gauzy/src/app/app.module.ts * Update apps/gauzy/src/app/app.module.ts --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix(timesheet): allow manual time for admins by default (#9589) * fix(timesheet): allow manual time for admins by default * Apply suggestion from @greptile-apps[bot] * Update packages/ui-core/shared/src/lib/directives/read-more.directive.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update packages/ui-core/shared/src/lib/directives/read-more.directive.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update apps/gauzy/src/app/pages/employees/timesheet/daily/daily/daily.component.html Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update packages/core/src/lib/employee/commands/handlers/employee.create.handler.ts Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> * Apply suggestion from @greptile-apps[bot] * Update apps/gauzy/src/app/pages/employees/timesheet/daily/daily/daily.component.html Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> * Update packages/ui-core/shared/src/lib/directives/read-more.directive.ts Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> * Apply suggestion from @greptile-apps[bot] * Apply suggestion from @greptile-apps[bot] * Update packages/ui-core/shared/src/lib/directives/read-more.directive.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Apply suggestion from @greptile-apps[bot] * Apply suggestion from @coderabbitai[bot] Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Revert "Apply suggestion from @coderabbitai[bot]" This reverts commit f59b7a4. * Update read-more.directive.ts --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Rahul R. <41804588+rahul-rocket@users.noreply.github.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: syns <sutralian@gmail.com> Co-authored-by: Kifungo A <45813955+adkif@users.noreply.github.com> Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2 parents 1e755fb + 4392c16 commit 8f48977

File tree

103 files changed

+3120
-1788
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+3120
-1788
lines changed

.cspell.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,10 @@
876876
"Démarrer",
877877
"Neue",
878878
"viewports",
879-
"sidemenu"
879+
"sidemenu",
880+
"ptdu",
881+
"ptau",
882+
"Centralises"
880883
],
881884
"useGitignore": true,
882885
"ignorePaths": [

.scripts/electron-desktop-environment/concrete-environment-content/desktop-api-server-environment-content.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ export class DesktopApiServerEnvironmentContent implements IContentGenerator {
2929
IS_DESKTOP_TIMER: ${false},
3030
IS_DESKTOP: ${false},
3131
IS_SERVER: ${true},
32-
IS_SERVER_API: ${true}
32+
IS_SERVER_API: ${true},
33+
JWT_SECRET: '${variable.DESKTOP_JWT_SECRET || ''}',
34+
JWT_REFRESH_TOKEN_SECRET: '${variable.DESKTOP_JWT_REFRESH_TOKEN_SECRET || ''}'
3335
`;
3436
}
3537
}

.scripts/electron-desktop-environment/concrete-environment-content/desktop-environment-content.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ export class DesktopEnvironmentContent implements IContentGenerator {
2929
IS_DESKTOP_TIMER: ${false},
3030
IS_DESKTOP: ${true},
3131
IS_SERVER: ${false},
32-
IS_SERVER_API: ${false}
32+
IS_SERVER_API: ${false},
33+
JWT_SECRET: '${variable.DESKTOP_JWT_SECRET || ''}',
34+
JWT_REFRESH_TOKEN_SECRET: '${variable.DESKTOP_JWT_REFRESH_TOKEN_SECRET || ''}'
3335
`;
3436
}
3537
}

.scripts/electron-desktop-environment/concrete-environment-content/desktop-server-environment-content.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ export class DesktopServerEnvironmentContent implements IContentGenerator {
2929
IS_DESKTOP_TIMER: ${false},
3030
IS_DESKTOP: ${false},
3131
IS_SERVER: ${true},
32-
IS_SERVER_API: ${false}
32+
IS_SERVER_API: ${false},
33+
JWT_SECRET: '${variable.DESKTOP_JWT_SECRET || ''}',
34+
JWT_REFRESH_TOKEN_SECRET: '${variable.DESKTOP_JWT_REFRESH_TOKEN_SECRET || ''}'
3335
`;
3436
}
3537
}

.scripts/electron-desktop-environment/interfaces/i-desktop-environment.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ export interface IDesktopEnvironment extends Env {
1313
IS_DESKTOP: boolean;
1414
IS_SERVER: boolean;
1515
IS_SERVER_API: boolean;
16+
DESKTOP_JWT_SECRET: string;
17+
DESKTOP_JWT_REFRESH_TOKEN_SECRET: string;
1618
}

.scripts/env.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ export type Env = Readonly<{
155155
AGENT_APP_WELCOME_CONTENT: string;
156156
AGENT_POOL_ACTIVITY_INTERVAL: number;
157157
GAUZY_DESKTOP_TRAY_ICON: string;
158+
DESKTOP_JWT_SECRET: string;
159+
DESKTOP_JWT_REFRESH_TOKEN_SECRET: string;
158160
}>;
159161

160162
export const env: Env = cleanEnv(
@@ -400,6 +402,12 @@ export const env: Env = cleanEnv(
400402
}),
401403
GAUZY_DESKTOP_TRAY_ICON: str({
402404
default: 'assets/icons/default-tray-icon.png'
405+
}),
406+
DESKTOP_JWT_SECRET: str({
407+
default: 'secretKey'
408+
}),
409+
DESKTOP_JWT_REFRESH_TOKEN_SECRET: str({
410+
default: 'refreshTokenSecretKey'
403411
})
404412
},
405413
{ strict: true, dotEnvPath: __dirname + '/../.env' }

apps/agent/src/main.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
22
import {
3-
APP_INITIALIZER,
43
ErrorHandler,
54
enableProdMode,
65
importProvidersFrom,
@@ -181,12 +180,10 @@ bootstrapApplication(AppComponent, {
181180
provide: Sentry.TraceService,
182181
deps: [Router]
183182
},
184-
{
185-
provide: APP_INITIALIZER,
186-
useFactory: () => () => {},
187-
deps: [Sentry.TraceService],
188-
multi: true
189-
},
183+
// Ensure Sentry TraceService is instantiated during app initialization.
184+
provideAppInitializer(() => {
185+
inject(Sentry.TraceService);
186+
}),
190187
{ provide: DEFAULT_TIMEOUT, useValue: 80000 },
191188
{
192189
provide: GAUZY_ENV,

apps/desktop-timer/src/main.ts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,6 @@ import { bootstrapApplication, BrowserModule } from '@angular/platform-browser';
1111
import { provideAnimations } from '@angular/platform-browser/animations';
1212
import { Router } from '@angular/router';
1313
import { akitaConfig, enableAkitaProdMode, persistState } from '@datorama/akita';
14-
import {
15-
NbDatepickerModule,
16-
NbDialogModule,
17-
NbDialogService,
18-
NbIconLibraries,
19-
NbMenuModule,
20-
NbSidebarModule,
21-
NbThemeModule,
22-
NbToastrModule
23-
} from '@nebular/theme';
24-
import * as Sentry from '@sentry/angular';
2514
import {
2615
ActivityWatchInterceptor,
2716
APIInterceptor,
@@ -37,6 +26,7 @@ import {
3726
LoggerService,
3827
NgxDesktopThemeModule,
3928
OrganizationInterceptor,
29+
providePluginsEffects,
4030
RefreshTokenInterceptor,
4131
ServerConnectionService,
4232
ServerErrorInterceptor,
@@ -48,6 +38,18 @@ import {
4838
import { environment as gauzyEnvironment } from '@gauzy/ui-config';
4939
import { provideI18n } from '@gauzy/ui-core/i18n';
5040
import { TablerIconsModule } from '@gauzy/ui-core/icons';
41+
import {
42+
NbDatepickerModule,
43+
NbDialogModule,
44+
NbDialogService,
45+
NbIconLibraries,
46+
NbMenuModule,
47+
NbSidebarModule,
48+
NbThemeModule,
49+
NbToastrModule
50+
} from '@nebular/theme';
51+
import { provideEffectsManager } from '@ngneat/effects-ng';
52+
import * as Sentry from '@sentry/angular';
5153
import { AppRoutingModule } from './app/app-routing.module';
5254
import { AppComponent } from './app/app.component';
5355
import { AppService } from './app/app.service';
@@ -70,6 +72,8 @@ if (environment.SENTRY_DSN) {
7072

7173
bootstrapApplication(AppComponent, {
7274
providers: [
75+
provideEffectsManager(),
76+
providePluginsEffects(),
7377
provideZoneChangeDetection(),
7478
importProvidersFrom(
7579
BrowserModule,

apps/desktop/src/app/app.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export class AppComponent implements OnInit, AfterViewInit {
3434
ngOnInit(): void {
3535
this._electronService.ipcRenderer.send('app_is_init');
3636
this._isInitialized = true;
37+
this.tokenRefreshService.start();
3738
}
3839

3940
ngAfterViewInit(): void {

apps/desktop/src/index.ts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,8 @@ async function startServer(setupConfig: DesktopSetupConfig, restart = false) {
347347
process.env.API_PORT = setupConfig.port ? String(setupConfig.port) : String(environment.API_DEFAULT_PORT);
348348
process.env.API_HOST = '0.0.0.0';
349349
process.env.API_BASE_URL = `http://127.0.0.1:${setupConfig.port || environment.API_DEFAULT_PORT}`;
350+
process.env.JWT_SECRET = setupConfig.secret?.jwt;
351+
process.env.JWT_REFRESH_TOKEN_SECRET = setupConfig.secret?.refresh_token;
350352

351353
console.log('Setting additional environment variables...', process.env.API_PORT);
352354
console.log('Setting additional environment variables...', process.env.API_HOST);
@@ -359,7 +361,7 @@ async function startServer(setupConfig: DesktopSetupConfig, restart = false) {
359361
await server.start(
360362
{ api: path.join(__dirname, 'api/main.js') },
361363
process.env,
362-
appWindowManager.setupWindow,
364+
appWindowManager.setupWindow ?? timeTrackerWindow,
363365
signal
364366
);
365367
} catch (error) {
@@ -585,17 +587,8 @@ app.on('ready', async () => {
585587
new AppMenu(timeTrackerWindow, settingsWindow, updaterWindow, knex, pathWindow, null, true);
586588

587589
if (configs && configs.isSetup) {
588-
if (!configs.serverConfigConnected && !configs?.isLocalServer) {
589-
await appWindowManager.initSetupWindow(pathWindow.timeTrackerUi);
590-
appWindowManager.setupWindow?.show();
591-
closeSplashScreen();
592-
appWindowManager.setupWindow?.webContents?.send?.('setup-data', {
593-
...configs
594-
});
595-
} else {
596-
setGlobalVariable(configs);
597-
await startServer(configs);
598-
}
590+
setGlobalVariable(configs);
591+
await startServer(configs);
599592
} else {
600593
await appWindowManager.initSetupWindow(pathWindow.timeTrackerUi);
601594
appWindowManager.setupWindow?.show?.();

0 commit comments

Comments
 (0)