Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
104 changes: 0 additions & 104 deletions angular.json

This file was deleted.

14 changes: 13 additions & 1 deletion apps/.firebaserc
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
{}
{
"projects": {},
"targets": {
"internal-200822": {
"hosting": {
"code-of-conduct": [
"code-of-conduct"
]
}
}
},
"etags": {}
}
5 changes: 5 additions & 0 deletions apps/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ load("@build_bazel_rules_nodejs//:index.bzl", "copy_to_bin", "nodejs_binary")
copy_to_bin(
name = "static_runfiles",
srcs = [
".firebaserc",
"firebase.json",
"firestore.indexes.json",
"firestore.rules",
Expand All @@ -19,8 +20,12 @@ nodejs_binary(
# Firebase function files
"//apps/functions:functions_compiled",
"//apps/functions:functions_files",

# Firebase hosted application files
"//apps/code-of-conduct:application_files",
],
entry_point = "@npm//:node_modules/firebase-tools/lib/bin/firebase.js",
tags = ["ibazel_notify_changes"],
templated_args = [
"--project",
"internal-200822",
Expand Down
80 changes: 80 additions & 0 deletions apps/code-of-conduct/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
load("//tools:defaults.bzl", "esbuild", "esbuild_config", "ng_module")
load("@io_bazel_rules_sass//:defs.bzl", "npm_sass_library", "sass_binary")
load("@build_bazel_rules_nodejs//:index.bzl", "copy_to_bin")

package(default_visibility = ["//apps/code-of-conduct:__subpackages__"])

ng_module(
name = "main",
srcs = [
"environment.ts",
"main.ts",
],
deps = [
"//apps/code-of-conduct/app",
"//apps/code-of-conduct/app:app_routes",
"@npm//@angular/common",
"@npm//@angular/compiler",
"@npm//@angular/fire",
"@npm//@angular/material",
"@npm//@angular/platform-browser",
"@npm//@angular/router",
"@npm//zone.js",
],
)

npm_sass_library(
name = "angular_material_sass_deps",
deps = ["@npm//@angular/material"],
)

sass_binary(
name = "styles",
src = "styles.scss",
include_paths = [
"external/npm/node_modules",
],
deps = [
":angular_material_sass_deps",
],
)

esbuild_config(
name = "esbuild_config",
config_file = "esbuild.config.mjs",
deps = [
"//shared-scripts/angular-optimization:js_lib",
"@npm//@angular/compiler-cli",
],
)

esbuild(
name = "bundles",
config = ":esbuild_config",
entry_points = [":main.ts"],
platform = "browser",
target = "es2016",
deps = [
":main",
],
)

copy_to_bin(
name = "application_files_in_bin",
srcs = [
"favicon.ico",
"index.html",
"robots.txt",
],
)

filegroup(
name = "application_files",
srcs = [
":application_files_in_bin",
":bundles",
":styles",
"@npm//:node_modules/zone.js/dist/zone.js",
],
visibility = ["//apps:__pkg__"],
)
55 changes: 55 additions & 0 deletions apps/code-of-conduct/app/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
load("//tools:defaults.bzl", "ng_module")
load("@io_bazel_rules_sass//:defs.bzl", "sass_binary")

package(default_visibility = ["//apps/code-of-conduct:__subpackages__"])

ng_module(
name = "app",
srcs = [
"app.component.ts",
],
assets = [
":app.component.css",
"app.component.html",
],
deps = [
"//apps/code-of-conduct/app/block-user",
"//apps/code-of-conduct/app/user-table",
"//apps/shared/account",
"@npm//@angular/common",
"@npm//@angular/core",
"@npm//@angular/router",
],
)

sass_binary(
name = "style",
src = "app.component.scss",
)

ng_module(
name = "block_service",
srcs = [
"block.service.ts",
],
deps = [
"@npm//@angular/common",
"@npm//@angular/core",
"@npm//@angular/fire",
"@npm//@angular/material",
"@npm//rxjs",
],
)

ng_module(
name = "app_routes",
srcs = [
"app.routes.ts",
],
deps = [
"//apps/code-of-conduct/app/login",
"//apps/code-of-conduct/app/main",
"//apps/shared/account",
"@npm//@angular/router",
],
)
6 changes: 6 additions & 0 deletions apps/code-of-conduct/app/app.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<mat-toolbar class="app-header-bar" color="primary">
<a routerLink='/' class="title">Code of Conduct</a>
<span class="spacer"></span>
<account-menu-button></account-menu-button>
</mat-toolbar>
<router-outlet></router-outlet>
19 changes: 19 additions & 0 deletions apps/code-of-conduct/app/app.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
block-user {
margin: 15px auto;
}

.app-header-bar {
position: sticky;
top: 0;
z-index: 1;

a {
color: inherit;
font-size: 1.5em;
text-decoration: none;
}

.spacer {
flex: 1;
}
}
21 changes: 21 additions & 0 deletions apps/code-of-conduct/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import {Component} from '@angular/core';
import {MatToolbarModule} from '@angular/material/toolbar';
import {RouterModule} from '@angular/router';
import {AccountComponent} from '../../shared/account/account.component.js';
import {BlockUserComponent} from './block-user/block-user.component.js';
import {UserTableComponent} from './user-table/user-table.component.js';

@Component({
standalone: true,
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
imports: [
MatToolbarModule,
RouterModule,
BlockUserComponent,
AccountComponent,
UserTableComponent,
],
})
export class AppComponent {}
14 changes: 14 additions & 0 deletions apps/code-of-conduct/app/app.routes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {Routes} from '@angular/router';
import {isLoggedInGuard} from '../../shared/account/account.guard.js';

export const routes: Routes = [
{
path: 'login',
loadComponent: () => import('./login/login.component.js').then((m) => m.LoginComponent),
},
{
path: '',
canActivate: [isLoggedInGuard],
loadComponent: () => import('./main/main.component.js').then((m) => m.MainComponent),
},
];
29 changes: 29 additions & 0 deletions apps/code-of-conduct/app/block-user/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
load("//tools:defaults.bzl", "ng_module")
load("@io_bazel_rules_sass//:defs.bzl", "sass_binary")

package(default_visibility = ["//apps/code-of-conduct:__subpackages__"])

ng_module(
name = "block-user",
srcs = glob(
["*.ts"],
exclude = ["*.spec.ts"],
),
assets = [
":block-user.component.css",
":block-user.component.html",
],
deps = [
"//apps/code-of-conduct/app:block_service",
"@npm//@angular/common",
"@npm//@angular/core",
"@npm//@angular/fire",
"@npm//@angular/forms",
"@npm//@angular/material",
],
)

sass_binary(
name = "block-user-style",
src = "block-user.component.scss",
)
Loading