Skip to content

Commit

Permalink
fix(style): fix
Browse files Browse the repository at this point in the history
* fix(style)

* fix(graph): fix physics
  • Loading branch information
asAlwaysZahra authored Sep 9, 2024
1 parent 2789897 commit c6033a1
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 15 deletions.
4 changes: 2 additions & 2 deletions api-config/api-url.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const environment = {
// apiUrl: 'https://localhost:44322',
apiUrl: 'http://localhost:8085',
apiUrl: 'https://localhost:44322',
// apiUrl: 'http://localhost:8085',
};
7 changes: 5 additions & 2 deletions src/app/graph/components/data-analysis/graph-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ export function getOptions() {

const svgDataUrl =
'data:image/svg+xml;charset=UTF-8,' +
encodeURIComponent(`
encodeURIComponent(`
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="${labelColor}" >
<path d="M480-480q-66 0-113-47t-47-113q0-66 47-113t113-47q66 0 113 47t47 113q0 66-47 113t-113 47ZM160-160v-112q0-34 17.5-62.5T224-378q62-31 126-46.5T480-440q66 0 130 15.5T736-378q29 15 46.5 43.5T800-272v112H160Z"/>
</svg>
`);

return {
physics: false,
physics: {
stabilization: true,
barnesHut: { damping: 1, springLength: 150 },
},
edges: {
smooth: { enabled: false, type: 'vertical', roundness: 0 },
arrows: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
color: var(--mat-optgroup-label-text-color);

.profile-image {
max-height: 2rem;
//max-height: 2rem;
background-color: #ccc;
border-radius: 100%;
border-radius: 50%;
width: 2rem !important;
height: 2rem !important;
}

.icon {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { MatSnackBar } from '@angular/material/snack-bar';
import { AuthService } from '../../../user/services/auth/auth.service';
import { DangerSuccessNotificationComponent } from '../danger-success-notification/danger-success-notification.component';
import { LoadingService } from '../../services/loading.service';
import { UserInformation } from '../../../user/models/ManageUsers';

@Component({
selector: 'app-dashboard-header',
Expand All @@ -12,18 +13,20 @@ import { LoadingService } from '../../services/loading.service';
})
export class DashboardHeaderComponent implements AfterViewInit {
@Input({ required: true }) title = '';
@Input() userInfo!: UserInformation;
profilePic = 'empty-profile.png';

constructor(
private themeService: ThemeService,
private _snackBar: MatSnackBar,
private authService: AuthService,
private loadingService: LoadingService
private loadingService: LoadingService,
) {}

ngAfterViewInit(): void {
this.authService.getPermissions().subscribe({
next: (data) => {
console.log(123, data);
this.profilePic =
data?.image == 'default-image-url' || !data?.image
? 'empty-profile.png'
Expand All @@ -45,7 +48,7 @@ export class DashboardHeaderComponent implements AfterViewInit {
this.themeService.changeThemeState();
this.themeService.theme$.subscribe((data) => {
const themeChanger = document.getElementById(
'theme-changer-icon'
'theme-changer-icon',
) as HTMLElement;
themeChanger.textContent = data === 'dark' ? 'light_mode' : 'dark_mode';
});
Expand All @@ -58,7 +61,7 @@ export class DashboardHeaderComponent implements AfterViewInit {
{
duration: 2000,
panelClass: ['info-notification'],
}
},
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,26 @@ export class ProfileHeaderComponent {
const input = event.target as HTMLInputElement;
if (input.files && input.files.length > 0) {
const file = input.files[0];

this.userService.uploadImage(file).subscribe({
next: () => {
this._snackBar.openFromComponent(DangerSuccessNotificationComponent, {
data: 'User profile image updated successfully!',
panelClass: ['notification-class-success'],
duration: 2000,
});
this.loadingService.setLoading(false);
this.userService
.getLoginUserInfo()
.subscribe((data: UserInformation) => {

this.userService.getLoginUserInfo().subscribe({
next: (data: UserInformation) => {
this.userInfo = data;
});
this.loadingService.setLoading(false);
},
error: () => {
this.loadingService.setLoading(false);
},
});

this.loadingService.setLoading(false);
},
error: (error) => {
this._snackBar.openFromComponent(DangerSuccessNotificationComponent, {
Expand Down

0 comments on commit c6033a1

Please sign in to comment.