@angular/material/snack-bar#MatSnackBar TypeScript Examples

The following examples show how to use @angular/material/snack-bar#MatSnackBar. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: add-vulns-to-host-external.component.ts    From Smersh with MIT License 6 votes vote down vote up
constructor(
    private vulnsService: VulnsService,
    private mediaObjectsService: MediaObjectsService,
    private hostsService: HostsService,
    private hostVulnsService: HostVulnsService,
    private activatedRoute: ActivatedRoute,
    private impactService: ImpactsService,
    private _snackBar: MatSnackBar,
    private missionServices: MissionsService,
    private router: Router
  ) {}
Example #2
Source File: base-injectables.ts    From leapp with Mozilla Public License 2.0 6 votes vote down vote up
mustInjected = (): any[] => [
  PositioningService,
  ComponentLoaderFactory,
  BsModalRef,
  BsModalService,
  HttpClient,
  HttpHandler,
  { provide: AppService, useValue: spyAppService },
  { provide: FileService, useValue: spyFileService },
  { provide: KeychainService, useValue: spyKeychainService },
  { provide: MatSnackBar, useValue: spyMatSnackBar },
  { provide: AppNativeService, useValue: spyElectronService },
  { provide: AppProviderService, useValue: spyLeappCoreService },
  { provide: MessageToasterService, useValue: spyMessageToasterService },
]
Example #3
Source File: project-details.component.ts    From barista with Apache License 2.0 6 votes vote down vote up
constructor(
    private projectService: ProjectService,
    private scanApiService: ScanApiService,
    private scanService: ScanService,
    private route: ActivatedRoute,
    private router: Router,
    private snackBar: MatSnackBar,
    private dialog: MatDialog,
    private packageManagerService: PackageManagerService,
    private outputFormatTypeService: OutputFormatTypeService,
    private deploymentTypeService: DeploymentTypeService,
    private projectDevelopmentTypeService: ProjectDevelopmentTypeService,
    private projectStatusTypeService: ProjectStatusTypeService,
    private projectApiService: ProjectApiService,
    private licenseApiService: LicenseApiService,
    private bomManualLicenseApiService: BomManualLicenseApiService,
    private authService: AuthService,
    private tabChangedMessageService: ProjectDetailsTabChangedMessageService,
    private toolTipsCacheService: ToolTipsCacheService,
    private systemConfigService: SystemConfigurationService,
  ) {
    this.projectStatusType$ = this.projectStatusTypeService.entities$;
    this.outputFormatType$ = this.outputFormatTypeService.entities$;
    this.packageManagers$ = this.packageManagerService.entities$;
    this.deploymentType$ = this.deploymentTypeService.entities$;
    this.projectDevelopmentType$ = this.projectDevelopmentTypeService.entities$;
  }
Example #4
Source File: client.service.ts    From App with MIT License 6 votes vote down vote up
constructor(
		public localStorage: LocalStorageService,
		public dataService: DataService,
		private dialog: MatDialog,
		private themingService: ThemingService,
		private cookieService: CookieService,
		private logger: LoggerService,
		private snackBar: MatSnackBar,
	) {
		super(dataService);
	}
Example #5
Source File: home.component.ts    From VIR with MIT License 6 votes vote down vote up
constructor(private router: Router,
              private overlayContainer: OverlayContainer,
              private dialog: MatDialog,
              private readonly fsUtil: FsUtil,
              private readonly electronService: ElectronService,
              public readonly dataStore: DataStore,
              public readonly dataAnalyzer: DataAnalyzer,
              public readonly clock: Clock,
              private readonly snackBar: MatSnackBar,
              private readonly changeDetectorRef: ChangeDetectorRef) {
    this.setActiveTheme(this.activeTheme, this.enableDarkMode)
    this.sideBarDayID = dataStore.getCurrentDayID()
  }
Example #6
Source File: titlebar.component.ts    From WowUp with GNU General Public License v3.0 6 votes vote down vote up
public constructor(
    public electronService: ElectronService,
    private _wowUpService: WowUpService,
    private _ngZone: NgZone,
    private _snackBar: MatSnackBar,
    private _translateService: TranslateService
  ) {
    const windowMaximizedSubscription = this.electronService.windowMaximized$.subscribe((maximized) => {
      this._ngZone.run(() => (this.isMaximized = maximized));
    });

    this._subscriptions = [windowMaximizedSubscription];

    this.electronService.on(IPC_WINDOW_ENTER_FULLSCREEN, () => {
      this.isFullscreen = true;
      const localeKey = this.electronService.isMac ? "APP.FULLSCREEN_SNACKBAR.MAC" : "APP.FULLSCREEN_SNACKBAR.WINDOWS";
      const message = this._translateService.instant(localeKey);
      this._snackBarRef = this._snackBar.openFromComponent(CenteredSnackbarComponent, {
        duration: 5000,
        panelClass: ["wowup-snackbar", "text-1"],
        data: {
          message,
        },
        verticalPosition: "top",
      });
    });

    this.electronService.on(IPC_WINDOW_LEAVE_FULLSCREEN, () => {
      this.isFullscreen = false;
      this._snackBarRef?.dismiss();
      this._snackBarRef = undefined;
    });
  }
Example #7
Source File: app.component.ts    From testube with GNU General Public License v3.0 6 votes vote down vote up
// make size 64% of original size to account for ViewPort oddness in Tesla Theater Mode.


  constructor(snack : MatSnackBar) {
    this.isFullscreen = false;

    if (document.referrer.startsWith('https://www.youtube.com/') == false &&
        navigator.userAgent.match(this.teslaUserAgentRegEx)) {

      snack.open(`Open in Fullscreen?\nClick "GO TO SITE" on next page`,'Yes',
        {panelClass: 'fullscreen-snack'})
        .onAction()
        .subscribe(()=>{
          location.href = 'https://www.youtube.com/redirect?q=https://testube.app';
        })
    } else if (navigator.userAgent.match(this.teslaUserAgentRegEx)) {
      this.isFullscreen = true;
      document.documentElement.setAttribute('style','zoom: '+ this.theaterZoomLevel);
    }
  }
Example #8
Source File: login.component.ts    From budget-angular with GNU General Public License v3.0 6 votes vote down vote up
constructor(
    private authService: AuthService,
    private oauthService: OAuthService,
    private formBuilder: FormBuilder,
    private snackBar: MatSnackBar,
    private dialog: MatDialog,
    private route: ActivatedRoute,
    private router: Router
  ) {}
Example #9
Source File: app.component.ts    From bitcoin-s-ts with MIT License 6 votes vote down vote up
constructor(private titleService: Title, private translate: TranslateService, public router: Router,
    public messageService: MessageService, private snackBar: MatSnackBar, public authService: AuthService,
    private oracleStateService: OracleStateService, private overlay: OverlayContainer) {
    this.loggedIn$ = this.authService.loggedIn.subscribe(r => {
      console.debug('loggedIn')
      this.onLogin()
    })
    this.loggedOut$ = this.authService.loggedOut.subscribe(r => {
      console.debug('loggedOut')
      this.onLogout()
    })
    this.authService.initialize()
  }
Example #10
Source File: create.component.ts    From blockcore-hub with MIT License 6 votes vote down vote up
constructor(
        private authService: AuthenticationService,
        private appState: ApplicationStateService,
        private router: Router,
        private fb: FormBuilder,
        private log: Logger,
        public dialog: MatDialog,
        public snackBar: MatSnackBar,
        private globalService: GlobalService,
        private apiService: ApiService) {

        this.onGenerate();
    }
Example #11
Source File: create.component.ts    From EXOS-Core with MIT License 6 votes vote down vote up
constructor(
        private authService: AuthenticationService,
        private appState: ApplicationStateService,
        private router: Router,
        private fb: FormBuilder,
        private log: Logger,
        public dialog: MatDialog,
        public snackBar: MatSnackBar,
        private globalService: GlobalService,
        private apiService: ApiService) {

        this.onGenerate();
    }
Example #12
Source File: add-edit-mileage.page.ts    From fyle-mobile-app with MIT License 6 votes vote down vote up
constructor(
    private router: Router,
    private activatedRoute: ActivatedRoute,
    private offlineService: OfflineService,
    private loaderService: LoaderService,
    private transactionService: TransactionService,
    private authService: AuthService,
    private accountsService: AccountsService,
    private customInputsService: CustomInputsService,
    private customFieldsService: CustomFieldsService,
    private reportService: ReportService,
    private fb: FormBuilder,
    private projectService: ProjectsService,
    private mileageService: MileageService,
    private transactionsOutboxService: TransactionsOutboxService,
    private policyService: PolicyService,
    private statusService: StatusService,
    private dataTransformService: DataTransformService,
    private duplicateDetectionService: DuplicateDetectionService,
    private modalController: ModalController,
    private networkService: NetworkService,
    private popupService: PopupService,
    private navController: NavController,
    private dateService: DateService,
    private trackingService: TrackingService,
    private tokenService: TokenService,
    private recentlyUsedItemsService: RecentlyUsedItemsService,
    private locationService: LocationService,
    private expenseFieldsService: ExpenseFieldsService,
    private popoverController: PopoverController,
    private modalProperties: ModalPropertiesService,
    private matSnackBar: MatSnackBar,
    private snackbarProperties: SnackbarPropertiesService
  ) {}
Example #13
Source File: upload-assets.component.ts    From assetMG with Apache License 2.0 6 votes vote down vote up
constructor(
    private _uploadService: UploadAssetService,
    private _configService: ConfigService,
    private _uploadAssetService: UploadAssetService,
    private _assetService: AssetService,
    private _snackBar: MatSnackBar,
    public uploadDialogRef: MatDialogRef<UploadAssetsComponent>,
    @Inject(MAT_DIALOG_DATA) public account: Account
  ) {}
Example #14
Source File: example.component.ts    From open-source with MIT License 6 votes vote down vote up
constructor(
    public readonly injector: Injector,
    private readonly cdr: ChangeDetectorRef,
    private readonly snackbar: MatSnackBar,
    private readonly clipboard: Clipboard,
    private readonly route: ActivatedRoute,
    private readonly content: ContentService,
    private readonly i18n: I18nService,
  ) {}
Example #15
Source File: actions.page.ts    From capture-lite with GNU General Public License v3.0 6 votes vote down vote up
constructor(
    private readonly router: Router,
    private readonly actionsService: ActionsService,
    private readonly errorService: ErrorService,
    private readonly translocoService: TranslocoService,
    private readonly blockingActionService: BlockingActionService,
    private readonly route: ActivatedRoute,
    private readonly authService: DiaBackendAuthService,
    private readonly snackBar: MatSnackBar,
    private readonly dialog: MatDialog,
    private readonly storeService: DiaBackendStoreService,
    private readonly orderHistoryService: OrderHistoryService,
    private readonly diaBackendStoreService: DiaBackendStoreService,
    private readonly diaBackendSeriesRepository: DiaBackendSeriesRepository,
    private readonly diaBackendWalletService: DiaBackendWalletService,
    private readonly informationSessionService: InformationSessionService,
    private readonly proofRepository: ProofRepository
  ) {}
Example #16
Source File: genes-table-header.component.ts    From open-genes-frontend with Mozilla Public License 2.0 6 votes vote down vote up
constructor(
    protected _filterService: FilterService,
    protected _favouritesService: FavouritesService,
    protected _snackBar: MatSnackBar,
    protected cdRef: ChangeDetectorRef,
    protected settingsService: SettingsService,
    protected bottomSheet: MatBottomSheet
  ) {
    super(_filterService, _favouritesService, _snackBar, cdRef);
    this.retrievedSettings = this.settingsService.getSettings();
    this.isUiHintsSettingOn = this.retrievedSettings.showUiHints;
  }
Example #17
Source File: addroom.component.ts    From WiLearning with GNU Affero General Public License v3.0 6 votes vote down vote up
constructor(
    public dialogRef: MatDialogRef<AddroomComponent>,
    public i18n: I18nService,
    @Inject(MAT_DIALOG_DATA) public data,
    private fb: FormBuilder,
    private logger: LoggerService,
    private http: HttpClient,
    private snackbar: MatSnackBar,
    private eventbus: EventbusService,
  ) {
    if ( data && data.room ) {
      this.optUpdate = true;
      this.dataRoom = data.room;
      this.name = data.room.name;
      this.speakerPassword = data.room.speakerPassword;
      this.attendeePassword = data.room.attendeePassword;
      this.description = data.room.description;
    }

  }
Example #18
Source File: app.component.spec.ts    From yii-debug-frontend with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
describe('AppComponent', () => {
    beforeEach(
        waitForAsync(async () => {
            await TestBed.configureTestingModule({
                imports: [RouterTestingModule, MatSidenavModule],
                declarations: [AppComponent],
                providers: [MatSnackBar, Overlay],
            }).compileComponents();
        }),
    );

    it('should create the app', async () => {
        const fixture = TestBed.createComponent(AppComponent);
        // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
        const app: AppComponent = fixture.debugElement.componentInstance;
        await expect(app).toBeTruthy();
    });

    it(`should have as title 'Yii Debugger'`, async () => {
        const fixture = TestBed.createComponent(AppComponent);
        // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
        const app: AppComponent = fixture.debugElement.componentInstance;
        await expect(app.title).toEqual('Yii Debugger');
    });
});
Example #19
Source File: clientsCreate.component.ts    From Smersh with MIT License 5 votes vote down vote up
constructor(
    protected service: ClientsService,
    protected router: Router,
    protected route: ActivatedRoute,
    protected snackBar: MatSnackBar
  ) {
    super(service, router, route, snackBar);
  }
Example #20
Source File: snackbar.component.ts    From leapp with Mozilla Public License 2.0 5 votes vote down vote up
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
  constructor(@Inject(MAT_SNACK_BAR_DATA) public data: any, private snackBar: MatSnackBar, private ngZone: NgZone) {}
Example #21
Source File: license-details.component.ts    From barista with Apache License 2.0 5 votes vote down vote up
constructor(
    private route: ActivatedRoute,
    private router: Router,
    private licenseService: LicenseService,
    private snackBar: MatSnackBar,
    private dialog: MatDialog,
  ) {}
Example #22
Source File: day-view.component.ts    From VIR with MIT License 5 votes vote down vote up
constructor(
    private readonly dataStore: DataStore,
    private readonly dataAnalyzer: DataAnalyzer,
    private readonly dialog: MatDialog,
    private readonly snackBar: MatSnackBar,
  ) {
  }
Example #23
Source File: tabs.service.ts    From CloudeeCMS with Apache License 2.0 5 votes vote down vote up
constructor(
        private toaster: MatSnackBar,
        public dialog: MatDialog
    ) { }
Example #24
Source File: home.component.spec.ts    From WowUp with GNU General Public License v3.0 5 votes vote down vote up
describe("HomeComponent", () => {
  let electronService: ElectronService;
  let wowUpService: WowUpService;
  let sessionService: SessionService;
  let addonService: AddonService;
  let warcraftInstallationService: WarcraftInstallationService;
  let dialogFactory: DialogFactory;

  beforeEach(async () => {
    dialogFactory = jasmine.createSpyObj("DialogFactory", [""], {});

    warcraftInstallationService = jasmine.createSpyObj("WarcraftInstallationService", [""], {
      wowInstallations$: new BehaviorSubject<any[]>([]),
    });

    addonService = jasmine.createSpyObj("AddonService", [""], {
      scanUpdate$: new BehaviorSubject<ScanUpdate>({ type: ScanUpdateType.Unknown }).asObservable(),
      syncError$: new Subject<AddonSyncError>(),
      scanError$: new Subject<AddonScanError>(),
      addonInstalled$: new Subject<AddonUpdateEvent>(),
    });

    electronService = jasmine.createSpyObj("ElectronService", [""], {
      isWin: false,
      isLinux: true,
      isMax: false,
      powerMonitor$: new Observable(),
      customProtocol$: new Observable(),
    });

    wowUpService = jasmine.createSpyObj("WowUpService", {
      checkForAppUpdate: () => Promise.resolve(undefined),
    });

    sessionService = jasmine.createSpyObj("SessionService", [""], {});

    await TestBed.configureTestingModule({
      declarations: [HomeComponent],
      imports: [
        MatModule,
        HttpClientModule,
        BrowserAnimationsModule,
        TranslateModule.forRoot({
          loader: {
            provide: TranslateLoader,
            useFactory: httpLoaderFactory,
            deps: [HttpClient],
          },
          compiler: {
            provide: TranslateCompiler,
            useClass: TranslateMessageFormatCompiler,
          },
        }),
        GalleryModule,
        LightboxModule,
      ],
      providers: [MatSnackBar],
      schemas: [CUSTOM_ELEMENTS_SCHEMA],
    })
      .overrideComponent(HomeComponent, {
        set: {
          providers: [
            { provide: ElectronService, useValue: electronService },
            { provide: SessionService, useValue: sessionService },
            { provide: AddonService, useValue: addonService },
            { provide: WowUpService, useValue: wowUpService },
            { provide: DialogFactory, useValue: dialogFactory },
            { provide: WarcraftInstallationService, useValue: warcraftInstallationService },
          ],
        },
      })
      .compileComponents();
  });

  it("should create", () => {
    const fixture = TestBed.createComponent(HomeComponent);
    expect(fixture.componentInstance).toBeTruthy();
  });
});
Example #25
Source File: notification.service.ts    From ASW-Form-Builder with MIT License 5 votes vote down vote up
constructor(public snackBar: MatSnackBar) {
    }
Example #26
Source File: error.handler.ts    From budget-angular with GNU General Public License v3.0 5 votes vote down vote up
constructor(private snackBar: MatSnackBar) {}
Example #27
Source File: snackbar.service.ts    From qbit-matUI with MIT License 5 votes vote down vote up
constructor(private _snackBar: MatSnackBar, private appConfig: ApplicationConfigService) { }
Example #28
Source File: contract-detail.component.ts    From bitcoin-s-ts with MIT License 5 votes vote down vote up
constructor(private translate: TranslateService, private snackBar: MatSnackBar,
    private messsageService: MessageService, private walletStateService: WalletStateService,
    private dlcService: DLCService, private offerService: OfferService,
    private dialog: MatDialog, private formBuilder: FormBuilder, private messageService: MessageService,
    private chartService: ChartService, private darkModeService: DarkModeService) { }
Example #29
Source File: report.component.ts    From blockcore-hub with MIT License 5 votes vote down vote up
constructor(
        public snackBar: MatSnackBar,
        private clipboard: Clipboard,
        private appState: ApplicationStateService,
        public dialogRef: MatDialogRef<ReportComponent>,
        @Inject(MAT_DIALOG_DATA) public data: ReportDialogData) {
    }