Centralize node type icons
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Garrett Mills 2020-10-14 08:47:03 -05:00
parent ff75876e2d
commit 413fb8b94e
Signed by: garrettmills
GPG Key ID: D2BF5FBA8298F246
5 changed files with 18 additions and 31 deletions

View File

@ -12,6 +12,7 @@ import {OptionMenuComponent} from './components/option-menu/option-menu.componen
import {SelectorComponent} from './components/sharing/selector/selector.component';
import {SessionService} from './service/session.service';
import {SearchComponent} from './components/search/Search.component';
import {NodeTypeIcons} from './structures/node-types';
@Component({
selector: 'app-root',
@ -64,13 +65,7 @@ export class AppComponent implements OnInit {
}
};
public typeIcons = {
branch: 'fa fa-folder',
node: 'fa fa-quote-left',
page: 'fa fa-sticky-note',
db: 'fa fa-database',
code: 'fa fa-code',
};
public typeIcons = NodeTypeIcons;
public get appName(): string {
return this.session.appName || 'Noded';

View File

@ -1,5 +1,6 @@
import { Component, OnInit } from '@angular/core';
import {PopoverController} from '@ionic/angular';
import {NodeTypeIcons} from '../../../structures/node-types';
@Component({
selector: 'editor-node-picker',
@ -8,14 +9,7 @@ import {PopoverController} from '@ionic/angular';
})
export class NodePickerComponent implements OnInit {
public typeIcons = {
branch: 'fa fa-folder',
node: 'fa fa-quote-left',
norm: 'fa fa-quote-left',
page: 'fa fa-sticky-note',
db: 'fa fa-database',
code: 'fa fa-code',
};
public typeIcons = NodeTypeIcons;
constructor(
private popover: PopoverController,

View File

@ -3,6 +3,7 @@ import {IonInput, ModalController} from '@ionic/angular';
import {ApiService} from '../../service/api.service';
import {BehaviorSubject} from 'rxjs';
import {Router} from '@angular/router';
import {NodeTypeIcons} from '../../structures/node-types';
export interface SearchResult {
title: string;
@ -26,12 +27,7 @@ export class SearchComponent implements OnInit {
@Input() query = '';
public results: BehaviorSubject<SearchResult[]> = new BehaviorSubject<SearchResult[]>([]);
public typeIcons = {
node: 'fa fa-quote-left',
page: 'fa fa-sticky-note',
db: 'fa fa-database',
code: 'fa fa-code',
};
public typeIcons = NodeTypeIcons;
constructor(
protected modal: ModalController,

View File

@ -7,6 +7,7 @@ import {LoadingController, PopoverController} from '@ionic/angular';
import {NodePickerComponent} from '../../components/editor/node-picker/node-picker.component';
import {HostOptionsComponent} from '../../components/editor/host-options/host-options.component';
import {EditorService} from '../../service/editor.service';
import {NodeTypeIcons} from '../../structures/node-types';
@Component({
selector: 'app-editor',
@ -17,16 +18,7 @@ export class EditorPage implements OnInit {
// @ViewChildren('editorHosts') editorHosts;
// @ViewChild('titleBar') titleBar;
public typeIcons = {
branch: 'fa fa-folder',
node: 'fa fa-quote-left',
norm: 'fa fa-quote-left',
page: 'fa fa-sticky-note',
db: 'fa fa-database',
database_ref: 'fa fa-database',
code: 'fa fa-code',
code_ref: 'fa fa-code',
};
public typeIcons = NodeTypeIcons;
@Input() pageId: string;
public pageName = '';

View File

@ -0,0 +1,10 @@
export const NodeTypeIcons = {
branch: 'fa fa-folder',
node: 'fa fa-quote-left',
norm: 'fa fa-quote-left',
page: 'fa fa-sticky-note',
db: 'fa fa-database',
database_ref: 'fa fa-database',
code: 'fa fa-code',
code_ref: 'fa fa-code',
};