Changeset - 0c6c590664ad
[Not reviewed]
default
0 3 0
drewp@bigasterisk.com - 20 months ago 2023-05-27 00:00:26
drewp@bigasterisk.com
fix up effectListing
3 files changed with 16 insertions and 8 deletions:
0 comments (0 inline, 0 general)
light9/effect/listing/web/Light9EffectListing.ts
Show inline comments
 
import debug from "debug";
 
import { css, html, LitElement } from "lit";
 
import { customElement, property } from "lit/decorators.js";
 
import { customElement } from "lit/decorators.js";
 
import { NamedNode } from "n3";
 
import { sortBy } from "underscore";
 
import { getTopGraph } from "../../../web/RdfdbSyncedGraph";
 
import { SyncedGraph } from "../../../web/SyncedGraph";
 
export {ResourceDisplay} from "../../../web/ResourceDisplay"
 
export { ResourceDisplay } from "../../../web/ResourceDisplay";
 

	
 
debug.enable("*");
 
const log = debug("listing");
 

	
 
@@ -16,11 +17,11 @@ export class Light9EffectListing extends
 
      <h1>Effects</h1>
 
      <rdfdb-synced-graph></rdfdb-synced-graph>
 

	
 
      ${this.effectClasses.map((e: NamedNode) => html`<light9-effect-class .uri=${e}></light9-effect-class>`)}
 
      ${this.effects.map((e: NamedNode) => html`<light9-effect-class .uri=${e}></light9-effect-class>`)}
 
    `;
 
  }
 
  graph!: SyncedGraph;
 
  effectClasses: NamedNode[] = [];
 
  effects: NamedNode[] = [];
 

	
 
  constructor() {
 
    super();
 
@@ -32,8 +33,14 @@ export class Light9EffectListing extends
 

	
 
  getClasses() {
 
    const U = this.graph.U();
 
    this.effectClasses = this.graph.subjects(U("rdf:type"), U(":Effect")) as NamedNode[];
 
    this.effectClasses = sortBy(this.effectClasses, (ec: any) => this.graph.stringValue(ec, U("rdfs:label")));
 
    this.effects = this.graph.subjects(U("rdf:type"), U(":Effect")) as NamedNode[];
 
    this.effects = sortBy(this.effects, (ec: NamedNode) => {
 
      try {
 
        return this.graph.stringValue(ec, U("rdfs:label"));
 
      } catch (e) {
 
        return ec.value;
 
      }
 
    });
 
    this.requestUpdate();
 
  }
 
}
light9/effect/listing/web/index.html
Show inline comments
 
@@ -3,7 +3,7 @@
 
  <head>
 
    <title>effect listing</title>
 
    <meta charset="utf-8" />
 
    <link rel="stylesheet" href="./style.css">    
 
    <link rel="stylesheet" href="../style.css">    
 
    <script type="module" src="../effectListing/Light9EffectListing"></script>
 
  </head>
 
  <body>
light9/effect/listing/web/vite.config.ts
Show inline comments
 
@@ -4,9 +4,10 @@ const servicePort = 8218;
 
export default defineConfig({
 
  base: "/effectListing/",
 
  root: "./light9/effect/listing/web",
 
  publicDir: "../web",
 
  publicDir: "../../..",
 
  server: {
 
    host: "0.0.0.0",
 
    base: 'effectListing',
 
    strictPort: true,
 
    port: servicePort + 100,
 
    hmr: {
0 comments (0 inline, 0 general)