Skip to content

Commit 4360bad

Browse files
committed
use deck's name as NS and dir
1 parent 5a67734 commit 4360bad

File tree

3 files changed

+8
-21
lines changed

3 files changed

+8
-21
lines changed

api/resolvers-pg.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ async function exportFS({ username, reponame, pods }) {
112112
async function dfs(id, parentDir) {
113113
let deck = d[id];
114114
// let dir = deck.id === "ROOT" ? parentDir : `${parentDir}/${deck.id}`;
115-
let dir = `${parentDir}/${deck.id}`;
115+
let dir = `${parentDir}/${deck.name || deck.id}`;
116116
console.log("mkdir", dir);
117117
// if (!fs.existsSync(dir)) {
118118
await fs.promises.mkdir(dir);
@@ -214,7 +214,7 @@ export function computeNamespace(pods, id) {
214214
id = pods[id].parentId;
215215
}
216216
while (id) {
217-
res.push(id);
217+
res.push(pods[id].name || id);
218218
id = pods[id].parentId;
219219
}
220220
return res.reverse().join("/");

ui/src/components/repo/pod.js

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -152,24 +152,11 @@ export function DeckTitle({ id }) {
152152
}}
153153
>
154154
<Box colorScheme="blackAlpha">
155-
{pod.name ? (
156-
<Flex direction="column">
157-
<Code>({pod.id})</Code>
158-
<Code
159-
bg={
160-
pod.exports && pod.exports["self"] ? "blue.200" : "inherit"
161-
}
162-
>
163-
{pod.name}
164-
</Code>
165-
</Flex>
166-
) : (
167-
<Code
168-
bg={pod.exports && pod.exports["self"] ? "blue.200" : "inherit"}
169-
>
170-
{pod.id}
171-
</Code>
172-
)}
155+
<Code
156+
bg={pod.exports && pod.exports["self"] ? "blue.200" : "inherit"}
157+
>
158+
{pod.name || pod.id}
159+
</Code>
173160
</Box>
174161
</Button>
175162

ui/src/lib/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export function computeNamespace(pods, id) {
77
id = pods[id].parent;
88
}
99
while (id) {
10-
res.push(id);
10+
res.push(pods[id].name || id);
1111
id = pods[id].parent;
1212
}
1313
return res.reverse().join("/");

0 commit comments

Comments
 (0)