Skip to content

Commit

Permalink
Rename from Griffy to Slate
Browse files Browse the repository at this point in the history
  • Loading branch information
tibetsprague committed Mar 14, 2024
1 parent 5de1bee commit af80062
Show file tree
Hide file tree
Showing 48 changed files with 151 additions and 154 deletions.
16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ hdi = "0.3"
hdk = "0.2"
serde = "1"

[workspace.dependencies.griffy]
path = "dnas/griffy/zomes/coordinator/griffy"
[workspace.dependencies.slate]
path = "dnas/slate/zomes/coordinator/slate"

[workspace.dependencies.griffy_integrity]
path = "dnas/griffy/zomes/integrity/griffy"
[workspace.dependencies.slate_integrity]
path = "dnas/slate/zomes/integrity/slate"

[workspace.dependencies.profiles]
path = "dnas/griffy/zomes/coordinator/profiles"
path = "dnas/slate/zomes/coordinator/profiles"

[workspace.dependencies.profiles_integrity]
path = "dnas/griffy/zomes/integrity/profiles"
path = "dnas/slate/zomes/integrity/profiles"

[workspace.dependencies.file_storage]
path = "dnas/griffy/zomes/coordinator/file_storage"
path = "dnas/slate/zomes/coordinator/file_storage"

[workspace.dependencies.file_storage_integrity]
path = "dnas/griffy/zomes/integrity/file_storage"
path = "dnas/slate/zomes/integrity/file_storage"
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Outside of nix shell you will need rust installed:

https://www.rust-lang.org/tools/install or https://rustup.rs/

Enter the nix shell by running this in the root folder of the repository:
Enter the nix shell by running this in the root folder of the repository:

```bash
nix develop
Expand All @@ -22,7 +22,7 @@ npm install
**Run all the other instructions in this README from inside this nix-shell, otherwise they won't work**.

## Running 2 agents

```bash
npm start
```
Expand All @@ -36,7 +36,7 @@ It will also bring up the Holochain Playground for advanced introspection of the
npm run dev
```

This will not launch a UI, you will have to open a browser window and navigate to the Local address provided by VITE. It can take a moment for the UI to come up after visiting the URL, let it load.
This will not launch a UI, you will have to open a browser window and navigate to the Local address provided by VITE. It can take a moment for the UI to come up after visiting the URL, let it load.

## Running the backend tests

Expand All @@ -62,8 +62,8 @@ To package the web happ:
npm run package
```

You'll have the `griffy.webhapp` in `workdir`. This is what you should distribute so that the Holochain Launcher can install it.
You will also have its subcomponent `griffy.happ` in the same folder`.
You'll have the `slate.webhapp` in `workdir`. This is what you should distribute so that the Holochain Launcher can install it.
You will also have its subcomponent `slate.happ` in the same folder`.

## Documentation

Expand Down
4 changes: 2 additions & 2 deletions dnas/griffy/workdir/dna.yaml → dnas/slate/workdir/dna.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
manifest_version: "1"
name: griffy
name: slate

integrity:
network_seed: ~
properties:
type: "Griffy"
type: "Slate"
origin_time: 2023-11-03T00:00:00.0Z
zomes:
- name: syn_integrity
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "griffy-dev",
"name": "slate",
"version": "0.0.1",
"private": true,
"workspaces": [
Expand All @@ -11,12 +11,12 @@
"dev": "VITE_ADMIN_PORT=$(port) VITE_APP_PORT=$(port) SIGNAL_PORT=$(port) BOOTSTRAP_PORT=$(port) UI_PORT=8888 npm run x",
"x": "hc s clean && npm run build:happ && UI_PORT=8888 concurrently \"npm start -w ui\" \"npm run start:happ\" \"hc run-local-services -b $BOOTSTRAP_PORT -s $SIGNAL_PORT\"",
"applet-dev": " UI_PORT=8888 npm run applet-devx",
"applet-devx": "BPORT=46263 SPORT=46262; concurrently \"hc run-local-services -b $BPORT -s $SPORT\" \"npm start -w ui\" \"./we_dev/we.AppImage --dev-config we_dev/config.json --agent-num 1 -b http://127.0.0.1:$BPORT -s ws://127.0.0.1:$SPORT\" \"sleep 10 && ./we_dev/we.AppImage --dev-config we_dev/config.json --agent-num 2 -b http://127.0.0.1:$BPORT -s ws://127.0.0.1:$SPORT\"",
"applet-devx": "BPORT=46263 SPORT=46262; concurrently \"hc run-local-services -b $BPORT -s $SPORT\" \"npm start -w ui\" \"open ./we_dev/We.app --dev-config we_dev/config.json --agent-num 1 -b http://127.0.0.1:$BPORT -s ws://127.0.0.1:$SPORT\" \"sleep 10 && ./we_dev/We.app --dev-config we_dev/config.json --agent-num 2 -b http://127.0.0.1:$BPORT -s ws://127.0.0.1:$SPORT\"",
"network": "hc s clean && npm run build:happ && UI_PORT=8888 concurrently \"npm start -w ui\" \"npm run launch:happ\" \"holochain-playground\"",
"test": "npm run build:zomes && hc app pack workdir --recursive && npm t -w tests",
"launch:happ": "concurrently \"hc run-local-services --bootstrap-port $BOOTSTRAP_PORT --signal-port $SIGNAL_PORT\" \"echo pass | RUST_LOG=warn hc launch --piped -n $AGENTS workdir/griffy.happ --ui-port $UI_PORT network --bootstrap http://127.0.0.1:\"$BOOTSTRAP_PORT\" webrtc ws://127.0.0.1:\"$SIGNAL_PORT\"\"",
"launch:happ": "concurrently \"hc run-local-services --bootstrap-port $BOOTSTRAP_PORT --signal-port $SIGNAL_PORT\" \"echo pass | RUST_LOG=warn hc launch --piped -n $AGENTS workdir/slate.happ --ui-port $UI_PORT network --bootstrap http://127.0.0.1:\"$BOOTSTRAP_PORT\" webrtc ws://127.0.0.1:\"$SIGNAL_PORT\"\"",
"package": "npm run build:happ && npm run package -w ui && hc web-app pack workdir --recursive",
"start:happ": "echo \"starting with admin $VITE_ADMIN_PORT\" && RUST_LOG=warn echo \"pass\" | hc s -f=$VITE_ADMIN_PORT --piped generate workdir/griffy.happ --run=$VITE_APP_PORT -a griffy network -b \"http://127.0.0.1:$BOOTSTRAP_PORT\" webrtc \"ws://127.0.0.1:$SIGNAL_PORT\"",
"start:happ": "echo \"starting with admin $VITE_ADMIN_PORT\" && RUST_LOG=warn echo \"pass\" | hc s -f=$VITE_ADMIN_PORT --piped generate workdir/slate.happ --run=$VITE_APP_PORT -a slate network -b \"http://127.0.0.1:$BOOTSTRAP_PORT\" webrtc \"ws://127.0.0.1:$SIGNAL_PORT\"",
"build:happ": "npm run build:zomes && hc app pack workdir --recursive",
"build:zomes": "RUSTFLAGS='' CARGO_TARGET_DIR=target cargo build --release --target wasm32-unknown-unknown"
},
Expand Down
4 changes: 2 additions & 2 deletions ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<meta charset="UTF-8" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Griffy</title>
<title>Slate</title>

<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">

</head>
<body>
<div id="app"></div>
Expand Down
13 changes: 6 additions & 7 deletions ui/src/AboutDialog.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { getContext } from "svelte";
import '@shoelace-style/shoelace/dist/components/dialog/dialog.js';
import SvgIcon from "./SvgIcon.svelte";
import type { GriffyStore } from "./store";
import type { SlateStore } from "./store";
import {asyncDerived, toPromise} from '@holochain-open-dev/stores'
import { BoardType } from "./boardList";
import type { Board, BoardEphemeralState, BoardState } from "./board";
Expand All @@ -13,7 +13,7 @@
const { getStore } :any = getContext('store');
const store:GriffyStore = getStore();
const store:SlateStore = getStore();
let dialog
Expand Down Expand Up @@ -72,12 +72,12 @@
</script>


<sl-dialog label="Griffy!: UI v0.2.0 for DNA v0.2.0" bind:this={dialog} width={600} >
<sl-dialog label="Slate!: UI v0.2.0 for DNA v0.2.0" bind:this={dialog} width={600} >
<div class="about">
<p>Griffy! is a demonstration Holochain app built by Lightning Rod Labs.</p>
<p>Slate! is a demonstration Holochain app built by Lightning Rod Labs.</p>
<p> <b>Developers:</b>
Check out this hApp's source-code <a href="https://github.com/holochain-apps/griffy">in our github repo</a>.
This project's real-time syncronization is powered by <a href="https://github.com/holochain/syn">Syn</a>,
Check out this hApp's source-code <a href="https://github.com/lightningrodlabs/slate">in our github repo</a>.
This project's real-time syncronization is powered by <a href="https://github.com/holochain/syn">Syn</a>,
a library that makes it really easy to build this kind of real-time collaboaration into Holochain apps.
</p>
<p class="small">Copyright © 2023,2024 Holochain Foundation &amp; Lightning Rod Labs. This software is distributed under the MIT License</p>
Expand Down Expand Up @@ -154,4 +154,3 @@
padding: 0 15px;
}
</style>

8 changes: 4 additions & 4 deletions ui/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
import LogoIcon from "./icons/LogoIcon.svelte";
import { appletServices } from './we';
const appId = import.meta.env.VITE_APP_ID ? import.meta.env.VITE_APP_ID : 'griffy'
const roleName = 'griffy'
const appId = import.meta.env.VITE_APP_ID ? import.meta.env.VITE_APP_ID : 'slate'
const roleName = 'slate'
const appPort = import.meta.env.VITE_APP_PORT ? import.meta.env.VITE_APP_PORT : 8888
const adminPort = import.meta.env.VITE_ADMIN_PORT
const url = `ws://localhost:${appPort}`;
Expand Down Expand Up @@ -79,7 +79,7 @@
break;
case "attachable":
switch (weClient.renderInfo.view.roleName) {
case "griffy":
case "slate":
switch (weClient.renderInfo.view.integrityZomeName) {
case "syn_integrity":
switch (weClient.renderInfo.view.entryType) {
Expand Down Expand Up @@ -119,7 +119,7 @@
throw new Error("Unknown render view type");
}
//@ts-ignore
client = weClient.renderInfo.appletClient;
//@ts-ignore
Expand Down
32 changes: 16 additions & 16 deletions ui/src/AttachmentsBind.svelte
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
<script lang="ts">
import "@shoelace-style/shoelace/dist/components/skeleton/skeleton.js";
import { createEventDispatcher, getContext } from "svelte";
import type { GriffyStore } from "./store";
import type { SlateStore } from "./store";
import type { Board } from "./board";
import SvgIcon from "./SvgIcon.svelte";
import type { AppletInfo, AttachmentType } from "@lightningrodlabs/we-applet";
import { HoloHashMap, type EntryHashMap } from "@holochain-open-dev/utils";
import type { EntryHash } from "@holochain/client";
import { hashEqual } from "./util";
export let activeBoard: Board
const dispatch = createEventDispatcher()
const { getStore } :any = getContext("store");
let store: GriffyStore = getStore();
let store: SlateStore = getStore();
type AppletTypes = {
appletName: string,
attachmentTypes: Record<string,AttachmentType>
}
type Groups = {
logo_src: string,
name: string,
}
let groups: HoloHashMap<EntryHash, Groups> = new HoloHashMap
let appletInfos: HoloHashMap<EntryHash, AppletInfo> = new HoloHashMap
$: attachmentTypes= []
$: groups
export const refresh = async () => {
attachmentTypes = Array.from(store.weClient.attachmentTypes.entries())
groups = new HoloHashMap<EntryHash, Groups>
Expand All @@ -39,7 +39,7 @@
if (!appletInfo) {
appletInfo = await store.weClient.appletInfo(hash)
appletInfos.set(hash, appletInfo)
}
}
for (const groupHash of appletInfo.groupsIds) {
let groupTypes = store.weClient.attachmentTypes.get(groupHash)
if (!groupTypes) {
Expand All @@ -53,12 +53,12 @@
}
groups = groups
attachmentTypes = attachmentTypes
}
}
</script>

<div>
<h3>Create Bound Item From:</h3>
<h3>Create Bound Item From:</h3>
{#each Array.from(groups.entries()) as [groupHash, group]}
<div style="display:flex;flex-direction:column">
<div style="display:flex;align-items:center;">
Expand All @@ -70,14 +70,14 @@
{#if appletInfo.groupsIds.find(id=>hashEqual(id,groupHash))}
<div style="display:flex;align-items:center;margin-right:15px">
<strong style="margin-right:5px;">{appletInfo.appletName}: </strong>

{#each Object.values(record) as aType,i}
<div style="display:flex;align-items:center;">
<sl-icon style="margin-right:3px" src={aType.icon_src}></sl-icon>{aType.label}
<sl-button size="small" circle style="margin-left:3px" on:click={async ()=>{
const hrl = await aType.create({hrl:[store.dnaHash,activeBoard.hash]})
dispatch("add-binding",hrl)
}} >
}} >
<SvgIcon icon=faPlus size=10/>
</sl-button>
{#if i>0}<span style="margin-left:5px">,</span>{/if}
Expand All @@ -87,7 +87,7 @@
{/if}
{/each}
</div>

</div>
{/each}
</div>
Expand Down
16 changes: 8 additions & 8 deletions ui/src/AttachmentsDialog.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { cloneDeep } from "lodash";
import type { Board } from "./board";
import { getContext } from "svelte";
import type { GriffyStore } from "./store";
import type { SlateStore } from "./store";
import { hrlWithContextToB64} from "./util";
import '@shoelace-style/shoelace/dist/components/button/button.js';
import '@shoelace-style/shoelace/dist/components/dialog/dialog.js';
Expand All @@ -12,10 +12,10 @@
import SvgIcon from "./SvgIcon.svelte";
const { getStore } :any = getContext("store");
let store: GriffyStore = getStore();
let store: SlateStore = getStore();
//let card: Card | undefined
let attachments: Array<HrlB64WithContext> = []
$:attachments = attachments
export let activeBoard: Board
Expand Down Expand Up @@ -58,7 +58,7 @@
// const props = cloneDeep(card.props)
// props.attachments = cloneDeep(attachments)
// activeBoard.requestChanges([{
// type: 'update-card-props',
// type: 'update-card-props',
// id: card.id,
// props
// }])
Expand All @@ -76,18 +76,18 @@
on:remove-attachment={(e)=>removeAttachment(e.detail)}/>

<div>
<h3>Search Linkables:</h3>
</div>
<h3>Search Linkables:</h3>
</div>
<sl-button style="margin-top:5px;margin-right: 5px" circle on:click={()=>addAttachment()} >
<SvgIcon icon=link size=12 />
</sl-button>

<AttachmentsBind
bind:this = {bind}
activeBoard={activeBoard}
on:add-binding={(e)=>_addAttachment(e.detail)}
on:add-binding={(e)=>_addAttachment(e.detail)}
/>

{/if}
</sl-dialog>

Expand Down
14 changes: 7 additions & 7 deletions ui/src/AttachmentsList.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import "@shoelace-style/shoelace/dist/components/skeleton/skeleton.js";
import { createEventDispatcher, getContext } from "svelte";
import type { GriffyStore } from "./store";
import type { SlateStore } from "./store";
import { hrlB64WithContextToRaw } from "./util";
import type { HrlB64WithContext } from "@lightningrodlabs/we-applet";
import SvgIcon from "./SvgIcon.svelte";
Expand All @@ -12,12 +12,12 @@
export let allowDelete = true
const { getStore } :any = getContext("store");
let store: GriffyStore = getStore();
let store: SlateStore = getStore();
</script>
<div class="attachments-list">
{#each attachments as attachment, index}
<div
<div
class:attachment-item-with-delete={allowDelete}
class:attachment-item={!allowDelete}
>
Expand All @@ -32,7 +32,7 @@
}}
style="display:flex;flex-direction:row;margin-right:5px"><sl-icon src={attachableInfo.icon_src} slot="prefix"></sl-icon>
{attachableInfo.name}
</sl-button>
</sl-button>
{#if allowDelete}
<sl-button size="small"
on:click={()=>{
Expand All @@ -57,8 +57,8 @@
.attachment-item {
}
.attachment-item-with-delete {
border:1px solid #aaa;
background-color:rgba(0,255,0,.1);
border:1px solid #aaa;
background-color:rgba(0,255,0,.1);
padding:4px;
display:flex;
margin-right:4px;
Expand Down
Loading

0 comments on commit af80062

Please sign in to comment.