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

Release #7256

Merged
merged 44 commits into from
Dec 8, 2023
Merged

Release #7256

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
da00531
wip: Open AI API Key saved with integration
rahul-rocket Dec 2, 2023
ca78837
fix: #7174 | translate auth pages
coderNadir Dec 5, 2023
507d2de
Merge branch 'develop' into fix/gauzy-ai-integration
rahul-rocket Dec 6, 2023
c3e8888
fix: added Open AI Key Secret option in Gauzy AI integration
rahul-rocket Dec 6, 2023
a160839
wip: display AI integration settings
rahul-rocket Dec 6, 2023
6eeb1b1
chore: console migration each file
rahul-rocket Dec 6, 2023
4b2ef73
feat: create text mask directive
adkif Dec 6, 2023
8ab7fc2
feat: improve UI
adkif Dec 6, 2023
88dcf34
feat: add generated date
adkif Dec 6, 2023
a86d313
fix: #7174 | remove html code from translation json file
coderNadir Dec 6, 2023
7658c3f
Merge pull request #7243 from ever-co/chore/console-migrations
evereq Dec 6, 2023
dbcdb35
Merge pull request #7238 from ever-co/fix/#7174-translate-auth-pages
evereq Dec 6, 2023
a1c92e9
fix: integration settings sensitive keys are wrapped in mask
rahul-rocket Dec 7, 2023
ab03047
feat: #7246 displayed consumer keys with mask format
rahul-rocket Dec 7, 2023
a6de0c1
Update deploy-render-demo.yml
evereq Dec 7, 2023
d42469d
fix: #7246 removed unnecessary import
rahul-rocket Dec 7, 2023
1f21dee
fix: removed console.log for github middleware
rahul-rocket Dec 7, 2023
afffd1c
feat: #7246 send openai secret key dynamically
rahul-rocket Dec 7, 2023
1944abe
fix: #7229 | fix preventing shortcuts from being triggered when typin…
coderNadir Dec 7, 2023
520a9aa
fix: #7246 show some error toasters nofication
rahul-rocket Dec 7, 2023
159f354
fix: #7246 open ai api key secret is optional
rahul-rocket Dec 7, 2023
d8acd3f
fix: added back console.log configuration
rahul-rocket Dec 7, 2023
8ddb63c
fix: typo for apiKey and apiSecret
rahul-rocket Dec 7, 2023
d99c4bb
fix: #7246 disabled selectors visibility for AI integration
rahul-rocket Dec 7, 2023
316c4d6
fix: cspell spelling
rahul-rocket Dec 7, 2023
7516858
fix: for now disabled form reset after add integration
rahul-rocket Dec 7, 2023
7aa7d0f
Merge pull request #7247 from ever-co/fix/#7246-gauzy-ai-integration
rahul-rocket Dec 7, 2023
ab72024
fix: surround splashScreen with try/catch
adkif Dec 7, 2023
705400a
fix: replace UIerror with a simple console.error
adkif Dec 7, 2023
479f382
fix: #7229 | add (pantone) word to .cspell.json file to avoid check s…
coderNadir Dec 7, 2023
8e93dfc
fix: #7242 | fix date string overflow the bar on timesheets weekly tab
coderNadir Dec 7, 2023
5153a88
Merge branch 'develop' into fix/#7229-quick-actions-triggered-on-sear…
rahul-rocket Dec 8, 2023
44c110c
Merge pull request #7248 from ever-co/fix/#7229-quick-actions-trigger…
rahul-rocket Dec 8, 2023
cebeb0d
fix: increase padding for custom header
rahul-rocket Dec 8, 2023
a50a8cf
fix: #7242 deepscan issue
rahul-rocket Dec 8, 2023
6d07a54
Merge pull request #7251 from ever-co/fix/#7242-date-string-overflow-…
rahul-rocket Dec 8, 2023
1f77885
fix: #7246 added screenshot description tooltip
rahul-rocket Dec 8, 2023
319cb6c
fix: #7246 added screenshot description tooltip for gallery
rahul-rocket Dec 8, 2023
d9d43d0
Merge pull request #7250 from ever-co/fix/surround-splashscreen-with-…
evereq Dec 8, 2023
5a025a7
fix: #7246 added screenshot description tooltip for screenshot
rahul-rocket Dec 8, 2023
3a3bbfd
fix: #7246 screenshot gallery change button colors
rahul-rocket Dec 8, 2023
c0b8399
fix: #7246 same delete button style
rahul-rocket Dec 8, 2023
4735317
Merge pull request #7253 from ever-co/feat/#7246-screenshot-description
rahul-rocket Dec 8, 2023
1d8edb1
Merge pull request #7255 from ever-co/develop
evereq Dec 8, 2023
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
5 changes: 4 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,10 @@
"SCALEWAY",
"VULTR",
"Codegen",
"icns"
"icns",
"pantone"
"openai",
"OPENAI"
],
"useGitignore": true,
"ignorePaths": [
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-render-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy to Render Demo
on:
workflow_run:
workflows: ['Build and Publish Docker Images Demo']
branches: [develop, temp]
branches: [render]
types:
- completed

Expand Down
10 changes: 7 additions & 3 deletions apps/desktop-timer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,13 @@ app.on('ready', async () => {
API_BASE_URL: getApiBaseUrl(configs || {}),
IS_INTEGRATED_DESKTOP: configs?.isLocalServer,
};
splashScreen = new SplashScreen(pathWindow.timeTrackerUi);
await splashScreen.loadURL();
splashScreen.show();
try {
splashScreen = new SplashScreen(pathWindow.timeTrackerUi);
await splashScreen.loadURL();
splashScreen.show();
} catch (error) {
console.error(error);
}
if (!settings) {
launchAtStartup(true, false);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs/internal/Observable';
import { IIntegrationKeySecretPairInput, IIntegrationTenant } from '@gauzy/contracts';
import { IIntegrationAICreateInput, IIntegrationTenant } from '@gauzy/contracts';
import { API_PREFIX } from '../../constants';

@Injectable({
Expand All @@ -18,7 +18,7 @@ export class GauzyAIService {
* @param input
* @returns
*/
addIntegration(input: IIntegrationKeySecretPairInput): Observable<IIntegrationTenant> {
create(input: IIntegrationAICreateInput): Observable<IIntegrationTenant> {
return this._http.post<IIntegrationTenant>(`${API_PREFIX}/integration/gauzy-ai`, input);
}
}
15 changes: 8 additions & 7 deletions apps/gauzy/src/app/@core/services/integrations.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,17 @@ export class IntegrationsService {
}

/**
* Get an IntegrationTenant by ID with optional relations.
*
* @param integrationId
* @param relations
* @returns
* @param id - The ID of the IntegrationTenant.
* @param relations - Optional relations for the request.
* @returns {Observable<any>} An Observable of the HTTP response.
*/
fetchIntegrationTenant(
integrationId: IIntegrationTenant['id'],
getIntegrationTenant(
id: IIntegrationTenant['id'],
relations: IBaseRelationsEntityModel
) {
return this._http.get<any>(`${API_PREFIX}/integration-tenant/${integrationId}`, {
): Observable<IIntegrationTenant> {
return this._http.get<any>(`${API_PREFIX}/integration-tenant/${id}`, {
params: toParams({ ...relations })
});
}
Expand Down
2 changes: 2 additions & 0 deletions apps/gauzy/src/app/@shared/directives/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { UnderConstructionDirective } from './under-construction.directive';
import { ReadMoreDirective } from './read-more';
import { TimeTrackingAuthorizedDirective } from './time-tracking-authorized-directive';
import { NoSpaceEdgesDirective } from './no-space-edges.directive';
import { TextMaskDirective } from './text-mask.directive';

export const DIRECTIVES = [
AutocompleteOffDirective,
Expand All @@ -16,4 +17,5 @@ export const DIRECTIVES = [
OutsideDirective,
UnderConstructionDirective,
NoSpaceEdgesDirective,
TextMaskDirective
];
69 changes: 69 additions & 0 deletions apps/gauzy/src/app/@shared/directives/text-mask.directive.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import { Directive, ElementRef, Renderer2, Input } from '@angular/core';

// Interface representing the configuration for text masking
interface IMaskConfig {
text: string;
showOriginal: boolean;
replacement: number;
}

@Directive({
selector: '[gaTextMask]'
})
export class TextMaskDirective {
// Default configuration for text masking
private readonly _config: IMaskConfig = {
text: '',
showOriginal: false,
replacement: 0.5
};

// Constructor to inject dependencies
constructor(
private readonly el: ElementRef,
private readonly renderer: Renderer2
) { }

// Apply the configured text mask to the element
private applyTextMask(): void {
// Get the text based on the showOriginal configuration
const text = this.config.showOriginal ? this.config.text : this.maskText(this.config.text);

// Set the masked or original text to the element's inner text
this.renderer.setProperty(this.el.nativeElement, 'innerText', text);
}

// Mask the given text based on the configured replacement percentage
private maskText(value: string): string {
// If text is not provided, return an empty string
if (!value) {
return '';
}

// Convert the text into an array of characters
const text = value.split('');

// Replace the specified percentage of characters with asterisks ('*')
for (let i = 0; i < Math.floor(this.config.replacement * text.length); i++) {
text[i] = '*';
}

// Join the array back into a string and return the masked text
return text.join('');
}

// Getter for the current configuration
public get config(): IMaskConfig {
return this._config;
}

// Setter for updating the configuration and applying the text mask
@Input()
public set config(partialConfig: Partial<IMaskConfig>) {
// Merge the provided partial configuration with the default configuration
Object.assign(this._config, partialConfig);

// Apply the text mask with the updated configuration
this.applyTextMask();
}
}
13 changes: 12 additions & 1 deletion apps/gauzy/src/app/@shared/gallery/gallery.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@
<div class="gallery-header d-flex p-2">
<span class="spacer"></span>
<div class="ml-auto">
<button
<button
*ngIf="item?.description"
status="info"
nbButton
[nbTooltip]="item?.description"
>
<nb-icon icon="info-outline"></nb-icon>
</button>
<button
class="ml-2"
status="success"
nbButton
(click)="downloadFile(item?.fullUrl)"
[nbTooltip]="'BUTTONS.DOWNLOAD' | translate"
Expand All @@ -11,6 +21,7 @@
</button>
<button
class="ml-2"
status="danger"
nbButton (click)="close()"
[nbTooltip]="'BUTTONS.CLOSE' | translate"
>
Expand Down
16 changes: 8 additions & 8 deletions apps/gauzy/src/app/@shared/gallery/gallery.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import {
} from '@angular/core';
import { trigger, style, animate, transition } from '@angular/animations';
import { NbDialogRef } from '@nebular/theme';
import { GalleryItem } from './gallery.directive';
import { GalleryService } from './gallery.service';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { saveAs } from 'file-saver';
import { GalleryItem } from './gallery.directive';
import { GalleryService } from './gallery.service';

export const fadeInOutAnimation = trigger('fadeInOut', [
transition(':enter', [
Expand Down Expand Up @@ -124,12 +124,12 @@ export class GalleryComponent implements OnInit, OnDestroy {
ngOnDestroy() { }

downloadFile(url: string) {
if(url) {
if (url) {
this.galleryService
.downloadFile(url)
.subscribe(blob => {
saveAs(blob, url.replace(/^.*[\\\/]/, ''))
});
}
.downloadFile(url)
.subscribe(blob => {
saveAs(blob, url.replace(/^.*[\\\/]/, ''))
});
}
}
}
27 changes: 23 additions & 4 deletions apps/gauzy/src/app/@shared/gallery/gallery.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from '@angular/core';
import { NbDialogService } from '@nebular/theme';
import { sortBy } from 'underscore';
import { IScreenshot } from '@gauzy/contracts';
import { GalleryComponent } from './gallery.component';
import { GalleryService } from './gallery.service';

Expand All @@ -17,19 +18,22 @@ export interface GalleryItem {
fullUrl: string;
recordedAt?: Date;
employeeId?: string;
description?: IScreenshot['description'];
}

@Directive({
selector: '[ngxGallery]'
})
export class GalleryDirective implements OnDestroy, OnInit {
disableClick: boolean = false;
dialogRef: ComponentRef<GalleryComponent>;
public disableClick: boolean = false;
public dialogRef: ComponentRef<GalleryComponent>;

// Inputs
@Input() employeeId: string;
@Input() item: GalleryItem | GalleryItem[];
@Input() items: GalleryItem[] = [];

// Input with Setter
@Input() set disabled(value: any) {
this.disableClick = value || false;
if (this.disableClick) {
Expand All @@ -43,18 +47,28 @@ export class GalleryDirective implements OnDestroy, OnInit {
private readonly el: ElementRef,
private readonly nbDialogService: NbDialogService,
private readonly galleryService: GalleryService
) {}
) { }

/**
* Host listener for click events
*/
@HostListener('click', [])
onClick(): void {
// Check if clicking is disabled
if (this.disableClick) {
return;
}

// Deep copy the 'item' property
let items = JSON.parse(JSON.stringify(this.item));

// Sort the items array by 'createdAt' in descending order
items = sortBy(items, 'createdAt').reverse();

// Extract the first item from the sorted array
const item = items instanceof Array ? items[0] : items;

// Open a dialog (possibly a gallery) using NbDialogService
this.nbDialogService.open(GalleryComponent, {
context: {
items: this.items,
Expand All @@ -66,10 +80,15 @@ export class GalleryDirective implements OnDestroy, OnInit {
}

ngOnInit() {
// Check if 'item' is an array; if not, convert it to a single-element array
const item = this.item instanceof Array ? this.item : [this.item];

// Sort the 'item' array by 'createdAt'
this.item = sortBy(item, 'createdAt');

// Append the sorted 'item' array to the gallery service
this.galleryService.appendItems(this.item);
}

ngOnDestroy() {}
ngOnDestroy() { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@
<ng-container *ngIf="timeSlot?.isAllowDelete">
<ng-container *ngIf="multiple">
<nb-checkbox
size="tiny"
[(ngModel)]="isSelected"
(click)="$event.stopPropagation()"
(ngModelChange)="toggleSelect(timeSlot)"
></nb-checkbox>
</ng-container>
<button
class="ml-auto select-hidden"
status="basic"
status="danger"
nbButton
size="tiny"
(click)="$event.stopPropagation()"
Expand All @@ -46,11 +47,20 @@
(confirm)="deleteSlot(timeSlot)"
>
<nb-icon
status="danger"
icon="trash-2-outline"
></nb-icon>
</button>
</ng-container>
<button
*ngIf="lastScreenshot?.description"
class="ml-2"
status="info"
nbButton
size="tiny"
[nbTooltip]="lastScreenshot?.description"
>
<nb-icon icon="info-outline" size="small"></nb-icon>
</button>
</div>
<div class="view-button select-hidden">
<ng-container *ngIf="timeSlot?.screenshots?.length > 0">
Expand Down
Loading