Skip to content
Open

Jay #144

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
59fab83
setup tests
justinnguyen0 Nov 11, 2023
96455bc
Merge pull request #1 from CSE-210-Team-6/justin-tests
justinnguyen0 Nov 11, 2023
262cb0b
setup tests
justinnguyen0 Nov 11, 2023
c6b3b9f
Merge pull request #2 from CSE-210-Team-6/justin-tests
justinnguyen0 Nov 11, 2023
5c46a91
add first test
justinnguyen0 Nov 11, 2023
3ad97dc
Merge pull request #3 from CSE-210-Team-6/justin-tests
justinnguyen0 Nov 11, 2023
c1b434e
add more tests
justinnguyen0 Nov 12, 2023
f3ff5db
Merge pull request #4 from CSE-210-Team-6/justin-tests
justinnguyen0 Nov 12, 2023
702926d
add more tests
justinnguyen0 Nov 12, 2023
a2f64f4
Merge pull request #5 from CSE-210-Team-6/justin-tests
justinnguyen0 Nov 12, 2023
bab8692
CI-CD Workflow
kashishvjain Nov 12, 2023
2f64f75
Update test.yml
kashishvjain Nov 12, 2023
4ec4c04
Merge pull request #10 from CSE-210-Team-6/kashishvjain-patch-1
kashishvjain Nov 12, 2023
99b77d0
add more tests
justinnguyen0 Nov 12, 2023
1009b78
Merge pull request #12 from CSE-210-Team-6/justin-tests
justinnguyen0 Nov 12, 2023
534f92f
refactor for jest to pass
justinnguyen0 Nov 12, 2023
0e777db
Merge pull request #13 from CSE-210-Team-6/justin-tests
justinnguyen0 Nov 12, 2023
1453359
add more tests for storage.js
justinnguyen0 Nov 12, 2023
e8658aa
Merge pull request #14 from CSE-210-Team-6/justin-tests
justinnguyen0 Nov 12, 2023
df85684
add more tests for storage.js
justinnguyen0 Nov 12, 2023
51f643d
Merge pull request #15 from CSE-210-Team-6/justin-tests
justinnguyen0 Nov 13, 2023
3741ace
test: add tests for notes.js
Melody-Creator Nov 13, 2023
c741d6a
Merge pull request #16 from CSE-210-Team-6/test
Melody-Creator Nov 16, 2023
66fa56d
Kashish reformat (#17)
kashishvjain Nov 17, 2023
2847b55
add more tests
justinnguyen0 Nov 18, 2023
cca7681
Merge pull request #18 from CSE-210-Team-6/justin-tests
justinnguyen0 Nov 18, 2023
f83d0f5
Add files via upload
sora1998 Nov 18, 2023
b8895dd
Add files via upload
sora1998 Nov 18, 2023
90d8264
refactor routes
Tigojiang Nov 18, 2023
4bd52aa
refactor: added JS Docs
Melody-Creator Nov 18, 2023
5d8dfd6
Merge pull request #19 from CSE-210-Team-6/enze
sora1998 Nov 18, 2023
90f442e
Merge pull request #20 from CSE-210-Team-6/ever-reformat
Melody-Creator Nov 18, 2023
6b756b8
add jsdocs
ekdnam Nov 18, 2023
3bae377
add basicauth object
ekdnam Nov 18, 2023
5f92df8
refactor account.js
ekdnam Nov 18, 2023
206e1dc
add jsdocs to webfiger.js
ekdnam Nov 18, 2023
0ba959e
camel case
ekdnam Nov 18, 2023
bc78dfe
aditya-refactor
ekdnam Nov 18, 2023
65cac1b
Merge branch 'main' into jay
Tigojiang Nov 23, 2023
a43b3e2
Update admin.js
Tigojiang Nov 23, 2023
2ad77b5
Update admin.js
Tigojiang Nov 23, 2023
af210c0
Update admin.js
Tigojiang Nov 23, 2023
1411499
Update admin.js
Tigojiang Nov 23, 2023
0fd97c4
Update admin.js
Tigojiang Nov 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ module.exports = {
sourceType: 'module'
},
rules: {
}
},
ignorePatterns: ["**/*.jest.js"],
}
25 changes: 25 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Unit Tests

on: [push, pull_request]

jobs:
tests:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 16.x]

steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm install

- name: Run tests
run: npm test
3 changes: 3 additions & 0 deletions babel.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [['@babel/preset-env', {targets: {node: 'current'}}]],
};
12 changes: 12 additions & 0 deletions compose-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
services:
app:
entrypoint:
- sleep
- infinity
image: docker/dev-environments-javascript:stable-1
init: true
volumes:
- type: bind
source: /var/run/docker.sock
target: /var/run/docker.sock

81 changes: 44 additions & 37 deletions design/dashboard.handlebars
Original file line number Diff line number Diff line change
@@ -1,43 +1,50 @@
<div class="stream">
<header>
<span>{{prefs.icons.latest}} Latest</span>
<a href="/private" id="newPosts" class="unread" hidden></a>
</header>
<div id="home_stream">
{{#if activitystream}}
{{#each activitystream}}
{{#with this}}
<div class="activity">
{{#if boost}}
<div class="boost">
🚀 boosted by <a href="/private/feeds/{{getUsername booster.id}}">{{booster.name}}</a>
</div>
{{/if}}
{{> note note=note me=../me}}
</div>
{{/with}}
{{/each}}
{{else}}
<div class="empty">
<p>Follow some people to fill your feed with posts.</p>
<p>I suggest following me!
I'm <a href="/private/feeds/benbrown@hackers.town">benbrown@hackers.town</a>
</p>
</div>
<header class="stream-header">
<span>{{prefs.icons.latest}} Latest</span>
<a href="/private" id="newPosts" class="unread-link" hidden></a>
</header>
<main id="home_stream">
{{#if activitystream}}
{{#each activitystream}}
<article class="activity">
{{#with this}}
{{#if boost}}
<section class="boost-notification">
🚀 Boosted by
<a href="/private/feeds/{{getUsername booster.id}}">{{booster.name}}</a>
</section>
{{/if}}
{{> note note=note me=../me}}
{{/with}}
</article>
{{/each}}
{{else}}
<div class="empty-state">
<p>Follow some people to fill your feed with posts.</p>
<p>Suggestion: Follow
<a href="/private/feeds/benbrown@hackers.town">benbrown@hackers.town</a>
</p>
</div>
{{/if}}
</main>

{{#if next}}
<footer>
<a href="/private?offset={{next}}" class="more-link">More</a>
</footer>
{{/if}}
</div>


{{#if next}}
<a href="/private?offset={{next}}" class="moreLink">More</a>
{{/if}}
</div>
<script>
// take note of the most recent post date
{{#isEq offset "0"}}
{{#each ../activitystream}} {{#if @first}}
app.latestPost("{{or this.boost.published this.note.published}}");
{{/if}}{{/each}}
{{/isEq}}
app.pollForPosts();
document.addEventListener('DOMContentLoaded', () => {
// Take note of the most recent post date
{{#isEq offset "0"}}
{{#each ../activitystream}}
{{#if @first}}
app.latestPost("{{or this.boost.published this.note.published}}");
{{/if}}
{{/each}}
{{/isEq}}
app.pollForPosts();
});
</script>
63 changes: 37 additions & 26 deletions design/dms.handlebars
Original file line number Diff line number Diff line change
@@ -1,27 +1,38 @@
{{#if error}}
<div class="error">
{{error.message}}
</div>
{{else}}
<div class="stream">
{{#if feed}}
<header><a href="/private/dms">Inbox</a> &raquo; Messages with <a href="/private/feeds/{{getUsername feed.id}}">{{feed.preferredUsername}}</a></header>
<div class="inbox">
<div class="messages" id="inbox_stream">
{{#each inbox}}
{{> dm message=this me=../me}}
{{/each}}
</div>
{{> minicomposer inReplyTo=lastIncoming to=feed.id}}
</div>
{{else}}
<!-- TODO: empty state? -->
<div class="empty">
Select a conversation. To create a new one, navigate to a profile.
</div>
{{/if}}
</div>
{{/if}}
<article>
{{#if error}}
<aside class="notification error">
{{error.message}}
</aside>
{{else}}
<section class="stream">
{{#if feed}}
<header>
<nav>
<a href="/private/dms">Inbox</a> ›
Messages with
<a href="/private/feeds/{{getUsername feed.id}}">{{feed.preferredUsername}}</a>
</nav>
</header>
<div class="message-container">
<ul class="messages-list" id="inbox_stream">
{{#each inbox}}
<li>
{{> dm message=this me=../me}}
</li>
{{/each}}
</ul>
{{> minicomposer inReplyTo=lastIncoming to=feed.id}}
</div>
{{else}}
<div class="empty-state">
Select a conversation. To create a new one, navigate to a profile.
</div>
{{/if}}
</section>
{{/if}}
</article>
<script>
app.pollForPosts();
</script>
document.addEventListener('DOMContentLoaded', () => {
app.pollForPosts();
});
</script>
81 changes: 44 additions & 37 deletions design/feeds.handlebars
Original file line number Diff line number Diff line change
@@ -1,40 +1,47 @@
{{#if error}}
<div class="error">
{{error.message}}
</div>
{{else}}
<div class="stream">
{{#if feed}}
{{> profileHeader actor=feed nobio=true}}
{{/if}}
{{#if activitystream}}
{{#each activitystream}}
{{#with this}}
<div class="activity">
{{#if boost}}
<div class="boost">
🚀 boosted by <a href="/private/feeds/{{getUsername booster.id}}">{{booster.name}}</a>
</div>
{{> note note=note}}
{{else}}
{{> note note=note hidebyline=true}}
{{/if}}
</div>
{{/with}}
{{/each}}
{{else}}
<!-- TODO: empty state? -->
<div class="empty">
No posts. <a href="/private/feeds/{{getUsername feed.id}}">Reload</a>
</div>
{{/if}}
<div class="content-area">
{{#if error}}
<aside class="error-message">
{{error.message}}
</aside>
{{else}}
<section class="stream">
{{#if feed}}
{{> profileHeader actor=feed nobio=true}}
{{/if}}

{{#if activitystream}}
{{#each activitystream}}
{{#with this}}
<article class="activity-post">
{{#if boost}}
<div class="boost-notice">
🚀 Boosted by
<a href="/private/feeds/{{getUsername booster.id}}">{{booster.name}}</a>
</div>
{{> note note=note}}
{{else}}
{{> note note=note hidebyline=true}}
{{/if}}
</article>
{{/with}}
{{/each}}
{{else}}
<div class="empty-state">
No posts. <a href="/private/feeds/{{getUsername feed.id}}">Reload</a>
</div>
{{/if}}

{{#if next}}
<a href="?offset={{next}}" class="moreLink">More</a>
{{/if}}
{{#if next}}
<footer class="pagination">
<a href="?offset={{next}}" class="more-link">More</a>
</footer>
{{/if}}
</section>
{{/if}}
</div>

</div>
{{/if}}
<script>
app.pollForPosts();
</script>
document.addEventListener('DOMContentLoaded', () => {
app.pollForPosts();
});
</script>
41 changes: 26 additions & 15 deletions design/findresults.handlebars
Original file line number Diff line number Diff line change
@@ -1,23 +1,34 @@
<div class="stream">
<section class="stream">
<header>
<form method="get" action="/private/find">
<label for="lookup">Find People</label>
<input type="search" placeholder="user@instance.town" id="lookup" name="handle" value="{{query}}" />
<form method="get" action="/private/find" class="search-form">
<label for="lookup">Find People</label>
<input
type="search"
placeholder="user@instance.town"
id="lookup"
name="handle"
aria-label="Search for people"
value="{{query}}" />
<button type="submit" class="search-button">Search</button>
</form>

</header>

{{#if results}}
{{#each results}}
<div class="activity">
{{> personCard actor=this nobio=true}}
</div>
{{/each}}
<div class="results-container">
{{#each results}}
<div class="search-result">
{{> personCard actor=this nobio=true}}
</div>
{{/each}}
</div>
{{else}}
<div class="activity">
Nobody results
<div class="no-results">
No results found.
</div>
{{/if}}
</div>
</section>
<script>
app.pollForPosts();
</script>
document.addEventListener('DOMContentLoaded', () => {
app.pollForPosts();
});
</script>
28 changes: 17 additions & 11 deletions design/followers.handlebars
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
<div class="stream">
<header>
<span>🤷🏽‍♂️ Followers</span>
</header>
<div class="followers-stream">
<header class="followers-header">
<span>🤷🏽‍♂️ Followers</span>
</header>

{{#each followers}}
<div class="activity">
{{> personCard actor=this}}
</div>
{{/each}}
<section class="followers-list">
{{#each followers}}
<article class="follower">
{{> personCard actor=this}}
</article>
{{/each}}
</section>
</div>

{{> peopleTools}}

<script>
app.pollForPosts();
</script>
document.addEventListener('DOMContentLoaded', () => {
app.pollForPosts();
});
</script>
Loading