Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 0 additions & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ module.exports = defineConfig([
extends: [angular.configs.tsRecommended],
processor: angular.processInlineTemplates,
rules: {
// Ionic's base level; `recommended` makes it an error, which is meant for libraries.
'@typescript-eslint/explicit-module-boundary-types': 'warn',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-inferrable-types': ['error', { ignoreParameters: true }],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"lint": "npm run eslint && npm run lint:sass && npm run prettier -- --check",
"lint:sass": "stylelint \"src/**/*.scss\"",
"lint:fix": "npm run eslint -- --fix && npm run prettier -- --write",
"eslint": "ng lint",
"eslint": "ng lint --max-warnings 0",
"prettier": "prettier \"**/*.{ts,html}\""
},
"repository": {
Expand Down
16 changes: 8 additions & 8 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export class AppComponent implements OnInit {
});
}

async ngOnInit() {
async ngOnInit(): Promise<void> {
this.initializeApp();
await this.storage.create();
this.checkLoginStatus();
Expand All @@ -141,7 +141,7 @@ export class AppComponent implements OnInit {
});
}

initializeApp() {
initializeApp(): void {
this.platform.ready().then(() => {
if (this.platform.is('hybrid')) {
StatusBar.hide();
Expand All @@ -150,19 +150,19 @@ export class AppComponent implements OnInit {
});
}

checkLoginStatus() {
checkLoginStatus(): Promise<void> {
return this.userService.isLoggedIn().then((loggedIn) => {
return this.updateLoggedInStatus(loggedIn);
});
}

updateLoggedInStatus(loggedIn: boolean) {
updateLoggedInStatus(loggedIn: boolean): void {
setTimeout(() => {
this.loggedIn.set(loggedIn);
}, 300);
}

listenForLoginEvents() {
listenForLoginEvents(): void {
window.addEventListener('user:login', () => {
this.updateLoggedInStatus(true);
});
Expand All @@ -176,19 +176,19 @@ export class AppComponent implements OnInit {
});
}

logout() {
logout(): void {
this.userService.logout().then(() => {
return this.router.navigateByUrl('/app/tabs/schedule');
});
}

openTutorial() {
openTutorial(): void {
this.menu.enable(false);
this.storage.set('ion_did_tutorial', false);
this.router.navigateByUrl('/tutorial');
}

toggleDarkMode() {
toggleDarkMode(): void {
document.documentElement.classList.toggle('ion-palette-dark', this.dark);
}
}
4 changes: 2 additions & 2 deletions src/app/pages/about-popover/about-popover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ export class PopoverPage {
private router = inject(Router);
private popoverCtrl = inject(PopoverController);

support() {
support(): void {
this.router.navigate(['/support']);
this.popoverCtrl.dismiss();
}

close(url: string) {
close(url: string): void {
window.open(url, '_blank');
this.popoverCtrl.dismiss();
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/about/about.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class AboutPage {
addIcons({ ellipsisHorizontal, ellipsisVertical });
}

async presentPopover(event: Event) {
async presentPopover(event: Event): Promise<void> {
const popover = await this.popoverCtrl.create({
component: PopoverPage,
event,
Expand Down
14 changes: 7 additions & 7 deletions src/app/pages/account/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ export class AccountPage implements AfterViewInit {

username = signal<string>('');

ngAfterViewInit() {
ngAfterViewInit(): void {
this.getUsername();
}

updatePicture() {
updatePicture(): void {
console.log('Clicked to update picture');
}

// Present an alert with the current username populated
// clicking OK will update the username and display it
// clicking Cancel will close the alert and do nothing
async changeUsername() {
async changeUsername(): Promise<void> {
const alert = await this.alertCtrl.create({
header: 'Change Username',
buttons: [
Expand All @@ -67,22 +67,22 @@ export class AccountPage implements AfterViewInit {
await alert.present();
}

getUsername() {
getUsername(): void {
this.user.getUsername().then((username) => {
this.username.set(username ?? '');
});
}

changePassword() {
changePassword(): void {
console.log('Clicked to change password');
}

logout() {
logout(): void {
this.user.logout();
this.router.navigateByUrl('/login');
}

support() {
support(): void {
this.router.navigateByUrl('/support');
}
}
4 changes: 2 additions & 2 deletions src/app/pages/login/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class LoginPage {
login: UserOptions = { username: '', password: '' };
submitted = false;

onLogin(form: NgForm) {
onLogin(form: NgForm): void {
this.submitted = true;

if (form.valid) {
Expand All @@ -52,7 +52,7 @@ export class LoginPage {
}
}

onSignup() {
onSignup(): void {
this.router.navigateByUrl('/signup');
}
}
2 changes: 1 addition & 1 deletion src/app/pages/map/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class MapPage implements AfterViewInit {

@ViewChild('mapCanvas', { static: true }) mapElement!: ElementRef;

ngAfterViewInit() {
ngAfterViewInit(): void {
this.locationService
.loadLocations()
.pipe(takeUntilDestroyed(this.destroyRef))
Expand Down
8 changes: 4 additions & 4 deletions src/app/pages/schedule-filter/schedule-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class ScheduleFilterPage {
});
}

ionViewWillEnter() {
ionViewWillEnter(): void {
this.ios.set(this.config.get('mode') === 'ios');

// passed in array of track names that should be excluded (unchecked)
Expand All @@ -100,20 +100,20 @@ export class ScheduleFilterPage {
});
}

selectAll(check: boolean) {
selectAll(check: boolean): void {
// set all to checked or unchecked
this.tracks.update((tracks) => tracks.map((track) => ({ ...track, isChecked: check })));
}

applyFilters() {
applyFilters(): void {
// Pass back a new array of track names to exclude
const excludedTrackNames = this.tracks()
.filter((c) => !c.isChecked)
.map((c) => c.name);
this.dismiss(excludedTrackNames);
}

dismiss(data?: string[]) {
dismiss(data?: string[]): void {
// using the injected ModalController this page
// can "dismiss" itself and pass back data
this.modalCtrl.dismiss(data);
Expand Down
12 changes: 6 additions & 6 deletions src/app/pages/schedule/schedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ export class SchedulePage implements OnInit {
});
}

ngOnInit() {
ngOnInit(): void {
this.updateSchedule();
this.ios = this.config.get('mode') === 'ios';
}

updateSchedule() {
updateSchedule(): void {
// Close any open sliding items when the schedule updates
if (this.scheduleList) {
this.scheduleList.closeSlidingItems();
Expand All @@ -134,7 +134,7 @@ export class SchedulePage implements OnInit {
});
}

async presentFilter() {
async presentFilter(): Promise<void> {
const modal = await this.modalCtrl.create({
component: ScheduleFilterPage,
presentingElement: this.routerOutlet.nativeEl,
Expand All @@ -149,7 +149,7 @@ export class SchedulePage implements OnInit {
}
}

async addFavorite(slidingItem: IonItemSliding, sessionData: Session) {
async addFavorite(slidingItem: IonItemSliding, sessionData: Session): Promise<void> {
if (this.user.hasFavorite(sessionData.name)) {
// Prompt to remove favorite
this.removeFavorite(slidingItem, sessionData, 'Favorite already added');
Expand Down Expand Up @@ -177,7 +177,7 @@ export class SchedulePage implements OnInit {
}
}

async removeFavorite(slidingItem: IonItemSliding, sessionData: Session, title: string) {
async removeFavorite(slidingItem: IonItemSliding, sessionData: Session, title: string): Promise<void> {
const alert = await this.alertCtrl.create({
header: title,
message: 'Would you like to remove this session from your favorites?',
Expand Down Expand Up @@ -207,7 +207,7 @@ export class SchedulePage implements OnInit {
await alert.present();
}

async openSocial(network: string, fab: IonFab) {
async openSocial(network: string, fab: IonFab): Promise<void> {
const loading = await this.loadingCtrl.create({
message: `Posting to ${network}`,
duration: Math.random() * 1000 + 500,
Expand Down
10 changes: 5 additions & 5 deletions src/app/pages/session-detail/session-detail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class SessionDetailPage {
addIcons({ shareOutline, starOutline, star, cloudDownload, share });
}

ionViewWillEnter() {
ionViewWillEnter(): void {
this.confService.load().subscribe((data) => {
if (data && data.schedule && data.schedule[0] && data.schedule[0].groups) {
const sessionId = this.route.snapshot.paramMap.get('sessionId');
Expand All @@ -72,15 +72,15 @@ export class SessionDetailPage {
});
}

ionViewDidEnter() {
ionViewDidEnter(): void {
this.defaultHref.set('/app/tabs/schedule');
}

sessionClick(item: string) {
sessionClick(item: string): void {
console.log('Clicked', item);
}

toggleFavorite() {
toggleFavorite(): void {
const sessionName = this.session()?.name;
if (!sessionName) {
return;
Expand All @@ -94,7 +94,7 @@ export class SessionDetailPage {
}
}

shareSession() {
shareSession(): void {
console.log('Clicked share session');
}
}
2 changes: 1 addition & 1 deletion src/app/pages/signup/signup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class SignupPage {
signup: UserOptions = { username: '', password: '' };
submitted = false;

onSignup(form: NgForm) {
onSignup(form: NgForm): void {
this.submitted = true;

if (form.valid) {
Expand Down
8 changes: 4 additions & 4 deletions src/app/pages/speaker-detail/speaker-detail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class SpeakerDetailPage {
});
}

ionViewWillEnter() {
ionViewWillEnter(): void {
this.confService.load().subscribe((data) => {
const speakerId = this.route.snapshot.paramMap.get('speakerId');
if (data && data.speakers) {
Expand All @@ -78,11 +78,11 @@ export class SpeakerDetailPage {
});
}

openExternalUrl(url: string) {
openExternalUrl(url: string): void {
window.open(url, '_blank');
}

async openSpeakerShare(speaker: any) {
async openSpeakerShare(speaker: any): Promise<void> {
const actionSheet = await this.actionSheetCtrl.create({
header: 'Share ' + speaker.name,
buttons: [
Expand All @@ -108,7 +108,7 @@ export class SpeakerDetailPage {
await actionSheet.present();
}

async openContact(speaker: Speaker) {
async openContact(speaker: Speaker): Promise<void> {
const mode = 'ios'; // this.config.get('mode');

const actionSheet = await this.actionSheetCtrl.create({
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/speaker-list/speaker-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class SpeakerListPage {

speakers = signal<Speaker[]>([]);

ionViewDidEnter() {
ionViewDidEnter(): void {
this.confData.getSpeakers().subscribe((speakers) => {
this.speakers.set(speakers);
});
Expand Down
4 changes: 2 additions & 2 deletions src/app/pages/support/support.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ export class SupportPage {
submitted = false;
supportMessage: string;

async ionViewDidEnter() {
async ionViewDidEnter(): Promise<void> {
const toast = await this.toastCtrl.create({
message: 'This does not actually send a support request.',
duration: 3000,
});
await toast.present();
}

async submit(form: NgForm) {
async submit(form: NgForm): Promise<void> {
this.submitted = true;

if (form.valid) {
Expand Down
6 changes: 3 additions & 3 deletions src/app/pages/tutorial/tutorial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ export class TutorialPage {
});
}

startApp() {
startApp(): void {
this.router
.navigateByUrl('/app/tabs/schedule', { replaceUrl: true })
.then(() => this.storage.set('ion_did_tutorial', true));
}

ionViewWillEnter() {
ionViewWillEnter(): void {
this.storage.get('ion_did_tutorial').then((res) => {
if (res === true) {
this.router.navigateByUrl('/app/tabs/schedule', { replaceUrl: true });
Expand All @@ -41,7 +41,7 @@ export class TutorialPage {
this.menu.enable(false);
}

ionViewWillLeave() {
ionViewWillLeave(): void {
// enable the root left menu when leaving the tutorial page
this.menu.enable(true);
}
Expand Down
Loading
Loading