Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edited repo to pass github actions for deployment #95

Closed
wants to merge 50 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
68a7fd8
add deadline
github-classroom[bot] Sep 10, 2024
0071cf8
initial commit to add the Q&A category
shinyumh Sep 15, 2024
a555146
added subcategories
shinyumh Sep 15, 2024
9e5cbfb
changes made in project 1
shinyumh Sep 15, 2024
25104eb
added refactored code from previous assignment
bencondemi Sep 19, 2024
760ca62
added team member names to the README
bencondemi Sep 19, 2024
1eabdf2
moved tpl files into correct folders according to the commit from slack
bencondemi Sep 20, 2024
b859768
Merge pull request #12 from CMU-313/melody/proj1
shinyumh Sep 20, 2024
cd9f005
Merge pull request #13 from CMU-313/melody/qacategory
shinyumh Sep 20, 2024
c1b6d99
Merge pull request #14 from CMU-313/dev
bencondemi Sep 20, 2024
31b5959
Merge pull request #16 from CMU-313/bc/tpls
bencondemi Sep 20, 2024
05e2e40
feat(categorySearch): Enhance category search functionality
Sep 20, 2024
0445c20
Added line at the end of categorySearch.js
Sep 20, 2024
a7f7597
implemented endorse buttons on the front end only
bencondemi Sep 23, 2024
7d89fae
eliminated commented code in test/post.js
bencondemi Sep 23, 2024
9141ff0
eliminated trailing space on line 781 in test/posts.js
bencondemi Sep 23, 2024
49ca7bc
Merge pull request #21 from CMU-313/bc/dev
bencondemi Sep 25, 2024
a0faa02
Merge pull request #17 from CMU-313/og/p1
bencondemi Sep 25, 2024
b0983f8
fixing an issue from omars PR that damaged q&a category
bencondemi Sep 27, 2024
3402bbe
Merge branch 'f24' into bc/dev
bencondemi Sep 27, 2024
a8c86ff
fixed linter error due to lack of newline
bencondemi Sep 27, 2024
c9f2491
fixing linter error
bencondemi Sep 27, 2024
c000907
Merge remote-tracking branch 'origin/bc/dev' into bc/dev
bencondemi Sep 27, 2024
4aec172
Merge pull request #24 from CMU-313/bc/dev
bencondemi Sep 27, 2024
c23c78b
added endorse javascript logic, event handlers and listeners
JackSun815 Sep 30, 2024
653ae04
added controllers for endorse
JackSun815 Sep 30, 2024
cd50ca8
Fixed endorse feature, add interactionafter button click
JackSun815 Sep 30, 2024
3a4d108
added user guide; still incomplete
shinyumh Sep 30, 2024
e0a4263
added instructions for using frontend repo
shinyumh Sep 30, 2024
d87c61f
Merge pull request #26 from CMU-313/melody/userguide
bencondemi Oct 4, 2024
fcb0120
committing dump.rdb to checkout main branch
bencondemi Oct 4, 2024
8dab9b7
Merge branch 'f24' into bc/dev
bencondemi Oct 4, 2024
f4fbfc5
allowing users to edit their own posts even after an hour has passed
bencondemi Oct 4, 2024
cc0b3de
deleting commented code to appease linter and updating user guide
bencondemi Oct 4, 2024
aa38428
Ran into error: Invalid API call when endorsing
JackSun815 Oct 5, 2024
ae39fec
added files to .gitignore to update PR for edit feature
bencondemi Oct 5, 2024
044920b
Merge pull request #29 from CMU-313/bc/dev
bencondemi Oct 10, 2024
f2e464e
Added Test Units
Oct 10, 2024
04de743
Bug Fix Please check @test/topics/endorse.js
Oct 11, 2024
2d9aa55
added to userguide.md
bencondemi Oct 11, 2024
bbc1870
WORKS
Oct 11, 2024
4c8ad6e
.
Oct 11, 2024
9b7aab3
Merge pull request #33 from CMU-313/bc/dev
rilical Oct 11, 2024
0780639
Merge pull request #32 from CMU-313/endorse-backend
bencondemi Oct 11, 2024
c41202a
Unit Tests
Oct 11, 2024
cd10955
Add or update the Azure App Service build and deployment workflow config
bencondemi Oct 21, 2024
b7cb6e3
Delete .github/workflows/f24_nodebb-d-buggers.yml
bencondemi Oct 21, 2024
6ca6bea
Update azure-deploy-f24.yml per the user guide
bencondemi Oct 21, 2024
1d232de
stashing userguide.md
bencondemi Oct 23, 2024
a43987d
removed broken implementations to pass github actions for deployment
bencondemi Oct 23, 2024
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
8 changes: 4 additions & 4 deletions .github/workflows/azure-deploy-f24.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
./.github/workflows/test.yaml

build-and-deploy:
if: github.repository == 'cmu-313/NodeBB'
if: github.repository == 'CMU-313/nodebb-f24-d-buggers'
needs: lint-and-test

runs-on: ubuntu-latest
Expand All @@ -34,7 +34,7 @@ jobs:

- name: Set up NodeBB
run: |
./nodebb setup '{"url":"https://nodebb-f24.azurewebsites.net:443",
./nodebb setup '{"url":"https://nodebb-d-buggers.azurewebsites.net:443",
"admin:username": "admin",
"admin:password": "${{ secrets.ADMIN_PASSWORD }}",
"admin:password:confirm": "${{ secrets.ADMIN_PASSWORD }}",
Expand All @@ -48,7 +48,7 @@ jobs:
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: 'nodebb-f24'
app-name: 'nodebb-d-buggers'
slot-name: 'Production'
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_BFAB97B1AB1441ACA7C63280F91AD3F3 }}
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_114CAAE57AF4486D9FDF1ED38DBB21FD }}
package: .
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,7 @@ link-plugins.sh
test.sh

.docker/**
!**/.gitkeep
!**/.gitkeep


dump.rdb
2 changes: 1 addition & 1 deletion .mocharc.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
reporter: dot
timeout: 25000
exit: true
bail: true
bail: false
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## Team Member Names
Ben Condemi,
Melody Hu,
Jack Sun,
Omar Ghabaye,

[![Review Assignment Due Date](https://classroom.github.com/assets/deadline-readme-button-22041afd0340ce965d47ae6ef1cefeee28c7c493a6346c4f15d667ab976d596c.svg)](https://classroom.github.com/a/ithVU1OO)
# ![NodeBB](public/images/sm-card.png)

[![Workflow](https://github.com/CMU-313/NodeBB/actions/workflows/test.yaml/badge.svg)](https://github.com/CMU-313/NodeBB/actions/workflows/test.yaml)
Expand Down
57 changes: 55 additions & 2 deletions install/data/categories.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,67 @@
"icon" : "fa-comments-o",
"order": 2
},
{
"name": "Questions & Answers",
"description": "Have a question for the professors or TAs about the class? Ask here!",
"descriptionParsed": "<p>Have a question for the professors or TAs about the class? Ask here!</p>\n",
"bgColor": "#A020F0",
"color": "#ffffff",
"icon" : "fa-otter",
"order": 3
},
{
"name": "Projects",
"description": "Questions about projects",
"descriptionParsed": "<p>Questions about projects</p>\n",
"bgColor": "#A020F0",
"color": "#ffffff",
"icon" : "fa-cat",
"parentCid" : 3,
"order": 1,
"cloneChildren": true
},
{
"name": "Exams",
"description": "Questions about exams",
"descriptionParsed": "<p>Questions about exams</p>\n",
"bgColor": "#A020F0",
"color": "#ffffff",
"icon" : "fa-dog",
"parentCid" : 3,
"order": 2,
"cloneChildren": true
},
{
"name": "Logistics",
"description": "Questions about logistics",
"descriptionParsed": "<p>Questions about logistics</p>\n",
"bgColor": "#A020F0",
"color": "#ffffff",
"icon" : "fa-dragon",
"parentCid" : 3,
"order": 3,
"cloneChildren": true
},
{
"name": "Lectures",
"description": "Questions about lectures",
"descriptionParsed": "<p>Questions about lectures</p>\n",
"bgColor": "#A020F0",
"color": "#ffffff",
"icon" : "fa-hippo",
"parentCid" : 3,
"order": 4,
"cloneChildren": true
},
{
"name": "Blogs",
"description": "Blog posts from individual members",
"descriptionParsed": "<p>Blog posts from individual members</p>\n",
"bgColor": "#86ba4b",
"color": "#ffffff",
"icon" : "fa-newspaper-o",
"order": 4
"order": 5
},
{
"name": "Comments & Feedback",
Expand All @@ -33,6 +86,6 @@
"bgColor": "#e95c5a",
"color": "#ffffff",
"icon" : "fa-question",
"order": 3
"order": 4
}
]
22 changes: 11 additions & 11 deletions install/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@
"@isaacs/ttlcache": "1.4.1",
"@nodebb/spider-detector": "2.0.3",
"@popperjs/core": "2.11.8",
"@socket.io/redis-adapter": "8.3.0",
"ace-builds": "1.33.2",
"archiver": "7.0.1",
"async": "3.2.5",
"autoprefixer": "10.4.19",
"bcryptjs": "2.4.3",
"benchpressjs": "2.5.1",
"body-parser": "1.20.2",
"body-parser": "^1.20.3",
"bootbox": "6.0.0",
"bootstrap": "5.3.3",
"bootswatch": "5.3.3",
Expand All @@ -58,15 +59,15 @@
"connect-multiparty": "2.2.0",
"connect-pg-simple": "9.0.1",
"connect-redis": "7.1.1",
"cookie-parser": "1.4.6",
"cookie-parser": "^1.4.7",
"cron": "3.1.7",
"cropperjs": "1.6.2",
"csrf-sync": "4.0.3",
"daemon": "1.1.0",
"diff": "5.2.0",
"esbuild": "0.21.2",
"express": "4.19.2",
"express-session": "1.18.0",
"express": "^4.21.1",
"express-session": "^1.18.1",
"express-useragent": "1.0.15",
"fetch-cookie": "3.0.1",
"file-loader": "6.2.0",
Expand All @@ -75,6 +76,7 @@
"helmet": "7.1.0",
"html-to-text": "9.0.5",
"imagesloaded": "5.0.0",
"ioredis": "5.4.1",
"ipaddr.js": "2.2.0",
"jquery": "3.7.1",
"jquery-deserialize": "2.0.0",
Expand Down Expand Up @@ -102,7 +104,7 @@
"nodebb-plugin-markdown": "12.2.6",
"nodebb-plugin-mentions": "4.4.3",
"nodebb-plugin-ntfy": "1.7.4",
"nodebb-plugin-spam-be-gone": "2.2.2",
"nodebb-plugin-spam-be-gone": "^0.4.4",
"nodebb-rewards-essentials": "1.0.0",
"nodebb-theme-harmony": "1.2.63",
"nodebb-theme-lavender": "7.1.8",
Expand All @@ -120,7 +122,6 @@
"postcss-clean": "1.2.0",
"progress-webpack-plugin": "1.0.16",
"prompt": "1.3.0",
"ioredis": "5.4.1",
"rimraf": "5.0.7",
"rss": "1.2.2",
"rtlcss": "4.1.1",
Expand All @@ -130,9 +131,8 @@
"serve-favicon": "2.5.0",
"sharp": "0.32.6",
"sitemap": "7.1.1",
"socket.io": "4.7.5",
"socket.io": "^4.8.0",
"socket.io-client": "4.7.5",
"@socket.io/redis-adapter": "8.3.0",
"sortablejs": "1.15.2",
"spdx-license-list": "6.9.0",
"terser-webpack-plugin": "5.3.10",
Expand All @@ -143,7 +143,7 @@
"toobusy-js": "0.5.1",
"tough-cookie": "4.1.4",
"validator": "13.12.0",
"webpack": "5.91.0",
"webpack": "^5.95.0",
"webpack-merge": "5.10.0",
"winston": "3.13.0",
"workerpool": "9.1.1",
Expand All @@ -164,7 +164,7 @@
"grunt-contrib-watch": "1.1.0",
"husky": "8.0.3",
"jsdom": "24.0.0",
"lint-staged": "15.2.2",
"lint-staged": "^15.2.10",
"mocha": "10.4.0",
"mocha-lcov-reporter": "1.3.0",
"mockdate": "3.0.5",
Expand Down Expand Up @@ -195,4 +195,4 @@
"url": "https://github.com/barisusakli"
}
]
}
}
9 changes: 8 additions & 1 deletion public/scss/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,11 @@ html[data-dir="rtl"] {
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }
}
}
}

.btn-link {
&:hover, &.active {
background-color: var(--btn-ghost-hover-color);
text-decoration: none;
}
}
7 changes: 7 additions & 0 deletions public/src/client/topic/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ define('forum/topic/events', [
'posts.downvote': togglePostVote,
'posts.unvote': togglePostVote,

'event:post_endorsed': onPostEndorsed,

'event:new_notification': onNewNotification,
'event:new_post': posts.onNewPost,
};
Expand Down Expand Up @@ -187,6 +189,11 @@ define('forum/topic/events', [
});
}

function onPostEndorsed(data) {
const postEl = $('[data-pid="' + data.postId + '"]');
postEl.addClass('endorsed');
}

function togglePostDeleteState(data) {
const postEl = components.get('post', 'pid', data.pid);

Expand Down
42 changes: 41 additions & 1 deletion public/src/client/topic/postTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ define('forum/topic/postTools', [
PostTools.toggle = function (pid, isDeleted) {
const postEl = components.get('post', 'pid', pid);

postEl.find('[component="post/quote"], [component="post/bookmark"], [component="post/reply"], [component="post/flag"], [component="user/chat"]')
postEl.find('[component="post/quote"], [component="post/bookmark"], [component="post/reply"], [component="post/flag"], [component="user/chat"],[component="post/endorse"]')
.toggleClass('hidden', isDeleted);

postEl.find('[component="post/delete"]').toggleClass('hidden', isDeleted).parent().attr('hidden', isDeleted ? '' : null);
Expand Down Expand Up @@ -111,6 +111,43 @@ define('forum/topic/postTools', [
onReplyClicked($(this), tid);
});

// Add endorse functionality
postContainer.on('click', '[component="post/endorse"]', function (event) {
event.preventDefault();
console.log('Endorse Post Container'); // Log to confirm button is clicked

const pid = $(this).closest('[data-pid]').attr('data-pid'); // Get post ID
if (!pid) {
console.error('No post ID found');
return;
}

endorsePost($(this), pid);
});

function endorsePost(button, pid) {
console.log('Endorsing post with ID:', pid);

// Emit socket event to endorse the post
socket.emit('plugins.endorse.post', { postId: pid }, function (err, result) {
if (err) {
return console.error('Error endorsing post: ' + err.message);
}

// Success: Update the button text and endorsement count
button.text('Endorsed').addClass('endorsed');

// Optionally update the endorsement count (assuming result contains the count)
const countElement = button.find('.endorse-count');
if (countElement.length && result.endorsements) {
countElement.text(result.endorsements);
}

app.alertSuccess('Post successfully endorsed!');
});
}


$('.topic').on('click', '[component="topic/reply"]', function (e) {
e.preventDefault();
onReplyClicked($(this), tid);
Expand All @@ -130,6 +167,7 @@ define('forum/topic/postTools', [
});

postContainer.on('click', '[component="post/upvote"]', function () {
console.log('Upvote button clicked');
return votes.toggleVote($(this), '.upvoted', 1);
});

Expand Down Expand Up @@ -169,6 +207,7 @@ define('forum/topic/postTools', [
});

postContainer.on('click', '[component="post/edit"]', function () {
console.log('Edit button clicked');
const btn = $(this);

const timestamp = parseInt(getData(btn, 'data-timestamp'), 10);
Expand Down Expand Up @@ -199,6 +238,7 @@ define('forum/topic/postTools', [
}
});


function checkDuration(duration, postTimestamp, languageKey) {
if (!ajaxify.data.privileges.isAdminOrMod && duration && Date.now() - postTimestamp > duration * 1000) {
const numDays = Math.floor(duration / 86400);
Expand Down
1 change: 1 addition & 0 deletions public/src/modules/categorySearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,4 @@ define('categorySearch', ['alerts', 'bootstrap', 'api'], function (alerts, boots

return categorySearch;
});

Loading