mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-21 09:51:11 +00:00
Refactor NotificationsClient (#270)
This commit is contained in:
@@ -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: "",
|
||||
|
||||
@@ -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([]);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user