Skip to content

Commit

Permalink
feat(event): adiciona rsvp button na página pública
Browse files Browse the repository at this point in the history
  • Loading branch information
guiseek committed Dec 1, 2024
1 parent 1fc010f commit 63597bd
Show file tree
Hide file tree
Showing 16 changed files with 298 additions and 72 deletions.
3 changes: 2 additions & 1 deletion apps/devmx/src/app/handlers/auth-error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ export class AuthErrorHandler implements ErrorHandler {
this.showMessage(error.status, message);

if (error.status === 401) {
this.router.navigateByUrl('/conta/autenticacao');
const queryParams = { redirectTo: this.router.url };
this.router.navigate(['/', 'conta', 'autenticacao'], { queryParams });
localStorage.removeItem('accessToken');
}
}
Expand Down
5 changes: 1 addition & 4 deletions apps/devmx/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="translucent" />
<meta name="mobile-web-app-capable" content="yes" />
<meta
name="description"
content="Plataforma que oferece online o mesmo ciclo de funcionamento da comunidade DevParaná"
/>
<meta name="description" content="A plataforma da comunidade" />
<meta
name="keywords"
content="comunidade, devparaná, pessoas, desenvolvedoras, programação, paraná, brasil"
Expand Down
5 changes: 5 additions & 0 deletions apps/devmx/src/scss/components/_links.theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,10 @@
.mdc-icon-button:not(.mdc-fab):hover {
color: mat.get-theme-color($theme, secondary, 70);
}

.mat-mdc-outlined-button:not(:disabled) {
border: 2px solid mat.get-theme-color($theme, on-surface);
color: mat.get-theme-color($theme, on-surface);
}
}
}
105 changes: 105 additions & 0 deletions devmx.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
{
"folders": [
{
"path": "."
}
],
"settings": {
"workbench.colorCustomizations": {
"editor.background": "#1C1C1C",
"editor.foreground": "#D4D4D4",
"editorCursor.foreground": "#FFFFFF",
"editor.lineHighlightBackground": "#242424",
"editorLineNumber.foreground": "#555555",
"editor.selectionBackground": "#4A4A4A",
"editor.selectionHighlightBackground": "#1A1A1A60",
"editor.wordHighlightBackground": "#2A2A2A60",
"editor.wordHighlightStrongBackground": "#3A3A3A60",
"activityBar.background": "#1C1C1C",
"sideBar.background": "#1C1C1C",
"sideBar.foreground": "#D4D4D4",
"sideBarSectionHeader.background": "#2A2A2A",
"titleBar.activeBackground": "#1C1C1C",
"titleBar.activeForeground": "#FFFFFF",
"statusBar.background": "#1C1C1C",
"statusBar.foreground": "#FFFFFF",
"panel.background": "#1C1C1C",
"panel.border": "#343434",
"terminal.background": "#1C1C1C",
"terminal.foreground": "#D4D4D4",
"button.background": "#343434",
"button.foreground": "#FFFFFF",
"dropdown.background": "#2A2A2A",
"dropdown.foreground": "#D4D4D4",
"input.background": "#2A2A2A",
"input.foreground": "#FFFFFF",
"scrollbarSlider.background": "#3A3A3A",
"scrollbarSlider.hoverBackground": "#4A4A4A",
"scrollbarSlider.activeBackground": "#5A5A5A",
"tab.activeBackground": "#1C1C1C",
"tab.activeForeground": "#FFFFFF",
"tab.inactiveBackground": "#2A2A2A",
"tab.inactiveForeground": "#A0A0A0",
"tab.border": "#343434",
"editorGroupHeader.tabsBackground": "#1C1C1C",
"editorGroupHeader.tabsBorder": "#343434",
"minimap.background": "#1C1C1C",
"minimapSlider.background": "#3A3A3A",
"minimapSlider.hoverBackground": "#4A4A4A",
"minimapSlider.activeBackground": "#5A5A5A"
},
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "comment",
"settings": {
"foreground": "#00A656",
"fontStyle": "italic"
}
},
{
"scope": ["keyword", "storage.type"],
"settings": {
"foreground": "#1A84FF"
}
},
{
"scope": "string",
"settings": {
"foreground": "#FB8700"
}
},
{
"scope": "variable.language",
"settings": {
"foreground": "#00A656"
}
},
{
"scope": "variable.other",
"settings": {
"foreground": "#E6C9B7"
}
},
{
"scope": "constant.numeric",
"settings": {
"foreground": "#FB8700"
}
},
{
"scope": "entity.name.function",
"settings": {
"foreground": "#1A84FF"
}
},
{
"scope": "entity.name.type",
"settings": {
"foreground": "#00A656"
}
}
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ export class AuthenticationFacade extends State<AuthenticationState> {

const request$ = this.createUserUseCase.execute(data);
request$.pipe(take(1)).subscribe();

return request$;
}

signOut() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ <h3>{{'@' + user.name}}</h3>
@if (user.profile && user.profile.minibio) {
<mat-card>
<mat-card-content>
<devmx-markdown [content]="user.profile.minibio" />
<devmx-markdown-view [content]="user.profile.minibio" />
</mat-card-content>
</mat-card>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { PresentationCardListComponent } from '@devmx/presentation-ui-shared';
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
import { MatProgressBarModule } from '@angular/material/progress-bar';
import { PresentationFacade } from '@devmx/presentation-data-access';
import { MarkdownComponent } from '@devmx/shared-ui-global/editor';
import { MarkdownViewComponent } from '@devmx/shared-ui-global/markdown';
import { AuthenticationFacade } from '@devmx/account-data-access';
import { EventCardListComponent } from '@devmx/event-ui-shared';
import { IconComponent } from '@devmx/shared-ui-global/icon';
Expand All @@ -24,7 +24,7 @@ import { RolePipe } from '@devmx/account-ui-shared';
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [
MatCardModule,
MarkdownComponent,
MarkdownViewComponent,
PresentationCardListComponent,
EventCardListComponent,
MatProgressBarModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
</mat-card-header>

<mat-card-content class="authentication-card-content">
<a routerLink="../cadastrar" mat-button>Quero criar minha conta</a>
<a
[routerLink]="['..','cadastrar']"
[queryParams]="route.snapshot.queryParams"
mat-button
>Quero criar minha conta</a
>
</mat-card-content>

<mat-vertical-stepper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { CodeFieldComponent } from '@devmx/account-ui-shared';
import { MatButtonModule } from '@angular/material/button';
import { MatInputModule } from '@angular/material/input';
import { MatCardModule } from '@angular/material/card';
import { Router, RouterLink } from '@angular/router';
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
import { AuthenticationForm } from '../../forms';
import { AsyncPipe } from '@angular/common';
import {
Expand Down Expand Up @@ -38,6 +38,7 @@ import {
],
})
export class AuthenticationContainer {
route = inject(ActivatedRoute);
router = inject(Router);

stepper = viewChild(MatStepper);
Expand All @@ -50,7 +51,9 @@ export class AuthenticationContainer {
this.authenticationFacade.connected$
.pipe(takeUntilDestroyed())
.subscribe((connected) => {
if (connected) this.router.navigate(['/']);
const { redirectTo } = this.route.snapshot.queryParams;
if (connected && redirectTo) this.router.navigateByUrl(redirectTo);
else if (connected) this.router.navigate(['/']);
});

this.form.controls.code.valueChanges
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import { MatInputModule } from '@angular/material/input';
import { MessageService } from '@devmx/shared-ui-global';
import { MatCardModule } from '@angular/material/card';
import { ReactiveFormsModule } from '@angular/forms';
import { RouterLink } from '@angular/router';
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
import { CreateUserForm } from '../../forms';
import { take } from 'rxjs';

@Component({
selector: 'devmx-registration',
Expand All @@ -23,22 +24,33 @@ import { CreateUserForm } from '../../forms';
MatButtonModule,
MatInputModule,
MatCardModule,
RouterLink,
RouterModule,
],
})
export class RegistrationContainer {
authFacade = inject(AuthenticationFacade);

message = inject(MessageService);

dialog = inject(DialogFacade);

authFacade = inject(AuthenticationFacade);
route = inject(ActivatedRoute);

router = inject(Router);

form = new CreateUserForm();

onSubmit() {
if (this.form.valid) {
const value = this.form.getRawValue();
this.authFacade.createUser(value);
const create$ = this.authFacade.createUser(value);
create$.pipe(take(1)).subscribe(() => {
const { redirectTo } = this.route.snapshot.queryParams;

const queryParams = { redirectTo };
const path = ['/', 'conta', 'autenticacao', 'acessar'];
this.router.navigate(path, { queryParams });
});

const message = `Conta ${value.name} criada`;
this.message.open({ message });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
/>
</div>

<a mat-stroked-button [routerLink]="['/', 'sobre', form.controls.name.value]">
Acessar página pública
</a>

<devmx-account-social />
</aside>
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
UserFacade,
AuthenticationFacade,
} from '@devmx/account-data-access';
import { RouterLink } from '@angular/router';


@Component({
Expand All @@ -43,6 +44,7 @@ import {
SelectFileComponent,
MatButtonModule,
AvatarComponent,
RouterLink
],
})
export class AccountContainer {
Expand Down
Loading

0 comments on commit 63597bd

Please sign in to comment.