Skip to content

Commit 1d3655e

Browse files
committed
feat(apps): create the code of conduct frontend application
Create the initial code of conduct frontend
1 parent 3f26e9e commit 1d3655e

Some content is hidden

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

47 files changed

+1230
-206
lines changed

angular.json

Lines changed: 0 additions & 104 deletions
This file was deleted.

apps/.firebaserc

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1-
{}
1+
{
2+
"projects": {},
3+
"targets": {
4+
"internal-200822": {
5+
"hosting": {
6+
"code-of-conduct": [
7+
"code-of-conduct"
8+
]
9+
}
10+
}
11+
},
12+
"etags": {}
13+
}

apps/BUILD.bazel

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ load("@build_bazel_rules_nodejs//:index.bzl", "copy_to_bin", "nodejs_binary")
33
copy_to_bin(
44
name = "static_runfiles",
55
srcs = [
6+
".firebaserc",
67
"firebase.json",
78
"firestore.indexes.json",
89
"firestore.rules",
@@ -19,8 +20,12 @@ nodejs_binary(
1920
# Firebase function files
2021
"//apps/functions:functions_compiled",
2122
"//apps/functions:functions_files",
23+
24+
# Firebase hosted application files
25+
"//apps/code-of-conduct:application_files",
2226
],
2327
entry_point = "@npm//:node_modules/firebase-tools/lib/bin/firebase.js",
28+
tags = ["ibazel_notify_changes"],
2429
templated_args = [
2530
"--project",
2631
"internal-200822",

apps/code-of-conduct/BUILD.bazel

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
load("//tools:defaults.bzl", "esbuild", "esbuild_config", "ng_module")
2+
load("@io_bazel_rules_sass//:defs.bzl", "npm_sass_library", "sass_binary")
3+
load("@build_bazel_rules_nodejs//:index.bzl", "copy_to_bin")
4+
5+
package(default_visibility = ["//apps/code-of-conduct:__subpackages__"])
6+
7+
ng_module(
8+
name = "main",
9+
srcs = [
10+
"environment.ts",
11+
"main.ts",
12+
],
13+
deps = [
14+
"//apps/code-of-conduct/app",
15+
"//apps/code-of-conduct/app:app_routes",
16+
"@npm//@angular/common",
17+
"@npm//@angular/compiler",
18+
"@npm//@angular/fire",
19+
"@npm//@angular/material",
20+
"@npm//@angular/platform-browser",
21+
"@npm//@angular/router",
22+
"@npm//zone.js",
23+
],
24+
)
25+
26+
npm_sass_library(
27+
name = "angular_material_sass_deps",
28+
deps = ["@npm//@angular/material"],
29+
)
30+
31+
sass_binary(
32+
name = "styles",
33+
src = "styles.scss",
34+
include_paths = [
35+
"external/npm/node_modules",
36+
],
37+
deps = [
38+
":angular_material_sass_deps",
39+
],
40+
)
41+
42+
esbuild_config(
43+
name = "esbuild_config",
44+
config_file = "esbuild.config.mjs",
45+
deps = [
46+
"//shared-scripts/angular-optimization:js_lib",
47+
"@npm//@angular/compiler-cli",
48+
],
49+
)
50+
51+
esbuild(
52+
name = "bundles",
53+
config = ":esbuild_config",
54+
entry_points = [":main.ts"],
55+
platform = "browser",
56+
target = "es2016",
57+
deps = [
58+
":main",
59+
],
60+
)
61+
62+
copy_to_bin(
63+
name = "application_files_in_bin",
64+
srcs = [
65+
"favicon.ico",
66+
"index.html",
67+
"robots.txt",
68+
],
69+
)
70+
71+
filegroup(
72+
name = "application_files",
73+
srcs = [
74+
":application_files_in_bin",
75+
":bundles",
76+
":styles",
77+
"@npm//:node_modules/zone.js/dist/zone.js",
78+
],
79+
visibility = ["//apps:__pkg__"],
80+
)
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
load("//tools:defaults.bzl", "ng_module")
2+
load("@io_bazel_rules_sass//:defs.bzl", "sass_binary")
3+
4+
package(default_visibility = ["//apps/code-of-conduct:__subpackages__"])
5+
6+
ng_module(
7+
name = "app",
8+
srcs = [
9+
"app.component.ts",
10+
],
11+
assets = [
12+
":app.component.css",
13+
"app.component.html",
14+
],
15+
deps = [
16+
"//apps/code-of-conduct/app/block-user",
17+
"//apps/code-of-conduct/app/user-table",
18+
"//apps/shared/account",
19+
"@npm//@angular/common",
20+
"@npm//@angular/core",
21+
"@npm//@angular/router",
22+
],
23+
)
24+
25+
sass_binary(
26+
name = "app-style",
27+
src = "app.component.scss",
28+
)
29+
30+
ng_module(
31+
name = "block_service",
32+
srcs = [
33+
"block.service.ts",
34+
],
35+
deps = [
36+
"@npm//@angular/common",
37+
"@npm//@angular/core",
38+
"@npm//@angular/fire",
39+
"@npm//@angular/material",
40+
"@npm//rxjs",
41+
],
42+
)
43+
44+
ng_module(
45+
name = "app_routes",
46+
srcs = [
47+
"app.routes.ts",
48+
],
49+
deps = [
50+
"//apps/code-of-conduct/app/login",
51+
"//apps/code-of-conduct/app/main",
52+
"//apps/shared/account",
53+
"@npm//@angular/router",
54+
],
55+
)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<mat-toolbar class="app-header-bar" color="primary">
2+
<a routerLink='/' class="title">Code of Conduct</a>
3+
<span class="spacer"></span>
4+
<account-menu-button></account-menu-button>
5+
</mat-toolbar>
6+
<router-outlet></router-outlet>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
block-user {
2+
margin: 15px auto;
3+
}
4+
5+
.app-header-bar {
6+
position: sticky;
7+
top: 0;
8+
z-index: 1;
9+
10+
a {
11+
color: inherit;
12+
font-size: 1.5em;
13+
text-decoration: none;
14+
}
15+
16+
.spacer {
17+
flex: 1;
18+
}
19+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import {Component} from '@angular/core';
2+
import {MatToolbarModule} from '@angular/material/toolbar';
3+
import {RouterModule} from '@angular/router';
4+
import {AccountComponent} from '../../shared/account/account.component.js';
5+
import {BlockUserComponent} from './block-user/block-user.component.js';
6+
import {UserTableComponent} from './user-table/user-table.component.js';
7+
8+
@Component({
9+
standalone: true,
10+
selector: 'app-root',
11+
templateUrl: './app.component.html',
12+
styleUrls: ['./app.component.scss'],
13+
imports: [
14+
MatToolbarModule,
15+
RouterModule,
16+
BlockUserComponent,
17+
AccountComponent,
18+
UserTableComponent,
19+
],
20+
})
21+
export class AppComponent {}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import {Routes} from '@angular/router';
2+
import {isLoggedInGuard} from '../../shared/account/account.guard.js';
3+
4+
export const routes: Routes = [
5+
{
6+
path: 'login',
7+
loadComponent: () => import('./login/login.component.js').then((m) => m.LoginComponent),
8+
},
9+
{
10+
path: '',
11+
canActivate: [isLoggedInGuard],
12+
loadComponent: () => import('./main/main.component.js').then((m) => m.MainComponent),
13+
},
14+
];
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
load("//tools:defaults.bzl", "ng_module")
2+
load("@io_bazel_rules_sass//:defs.bzl", "sass_binary")
3+
4+
package(default_visibility = ["//apps/code-of-conduct:__subpackages__"])
5+
6+
ng_module(
7+
name = "block-user",
8+
srcs = glob(["*.ts"]),
9+
assets = [
10+
":block-user.component.css",
11+
":block-user.component.html",
12+
],
13+
deps = [
14+
"//apps/code-of-conduct/app:block_service",
15+
"@npm//@angular/common",
16+
"@npm//@angular/core",
17+
"@npm//@angular/fire",
18+
"@npm//@angular/forms",
19+
"@npm//@angular/material",
20+
],
21+
)
22+
23+
sass_binary(
24+
name = "block-user-style",
25+
src = "block-user.component.scss",
26+
)

0 commit comments

Comments
 (0)