Refactor NotificationsClient (#270)

This commit is contained in:
Steve Faulkner
2020-10-12 22:10:28 -05:00
committed by GitHub
parent 3b64d75322
commit cfb9a0b321
28 changed files with 75 additions and 157 deletions

View File

@@ -2,13 +2,9 @@ import { AccountKind, TagNames, DefaultAccountExperience } from "../../Common/Co
import Explorer from "../../Explorer/Explorer";
import { NotificationsClient } from "./NotificationsClient";
export default class EmulatorExplorerFactory {
public static createExplorer(): Explorer {
const explorer: Explorer = new Explorer({
notificationsClient: new NotificationsClient()
});
const explorer: Explorer = new Explorer();
explorer.databaseAccount({
name: "",
id: "",

View File

@@ -1,16 +0,0 @@
import Q from "q";
import * as DataModels from "../../Contracts/DataModels";
import { NotificationsClientBase } from "../../Common/NotificationsClientBase";
export class NotificationsClient extends NotificationsClientBase {
private static readonly _notificationsApiSuffix: string = "/api/notifications";
public constructor() {
super(NotificationsClient._notificationsApiSuffix);
}
public fetchNotifications(): Q.Promise<DataModels.Notification[]> {
// no notifications for the emulator
return Q([]);
}
}

View File

@@ -1,11 +1,8 @@
import Explorer from "../../Explorer/Explorer";
import { NotificationsClient } from "./NotificationsClient";
export default class HostedExplorerFactory {
public createExplorer(): Explorer {
const explorer = new Explorer({
notificationsClient: new NotificationsClient()
});
const explorer = new Explorer();
return explorer;
}

View File

@@ -1,9 +0,0 @@
import { NotificationsClientBase } from "../../Common/NotificationsClientBase";
export class NotificationsClient extends NotificationsClientBase {
private static readonly _notificationsApiSuffix: string = "/api/guest/notifications";
public constructor() {
super(NotificationsClient._notificationsApiSuffix);
}
}

View File

@@ -1,11 +1,8 @@
import Explorer from "../../Explorer/Explorer";
import { NotificationsClient } from "./NotificationsClient";
export default class PortalExplorerFactory {
public createExplorer(): Explorer {
var explorer = new Explorer({
notificationsClient: new NotificationsClient()
});
var explorer = new Explorer();
return explorer;
}

View File

@@ -1,9 +0,0 @@
import { NotificationsClientBase } from "../../Common/NotificationsClientBase";
export class NotificationsClient extends NotificationsClientBase {
private static readonly _notificationsApiSuffix: string = "/api/notifications";
public constructor() {
super(NotificationsClient._notificationsApiSuffix);
}
}