Skip to content

Commit

Permalink
Merge branch 'master' into nft_profile_picture
Browse files Browse the repository at this point in the history
  • Loading branch information
irffanasiff committed Jun 9, 2022
2 parents 7bd72a5 + 2df61a8 commit 2136a06
Show file tree
Hide file tree
Showing 163 changed files with 27,967 additions and 12,489 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ jobs:
script: |
const http = require('http');
const {readFileSync} = require('fs');
core.info('waiting 1 minute for strapi data initialization to complete ..');
await new Promise(zzz => setTimeout(zzz, 2 * 60 * 1000));
core.info('waiting 3 minute for strapi data initialization to complete ..');
await new Promise(zzz => setTimeout(zzz, 3 * 60 * 1000));
http
.request(`http://localhost:${process.env.PORT}/_health`, { method: 'HEAD' }, r => {
if (r.statusCode === 204 && r.headers.strapi === 'You are so French!')
Expand Down Expand Up @@ -138,6 +138,7 @@ jobs:
env: { NEXT_PUBLIC_STRAPI_API_URL: "http://localhost:1337" }

- name: Generate archive
if: ${{ github.event_name == 'push' }}
run: |
cd app
echo $GITHUB_SHA > /tmp/.github_sha
Expand Down
2 changes: 1 addition & 1 deletion app/components/clientForms/show.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function RCform({ formId, fw }) {
<Card.Title className={styles.showTitle}>{form.title}</Card.Title>
<Card.Body>
<Form onSubmit={handleSubmit}>
{form.formQs.map((ele, i) => (
{form.data?.attributes.formQs.map((ele, i) => (
<Form.Group key={i} className="mb-3" controlId="formBasicEmail">
<Form.Label>{ele.value}</Form.Label>
{ele.type == "number" ? (
Expand Down
2 changes: 1 addition & 1 deletion app/components/github/contributorslist.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Image from 'next/image';

const ContributorsList = (props) => {

let contributors = props.data.contributors.Contributors;
let contributors = props.data.contributors.data.attributes.Contributors;

return (
<div className="container">
Expand Down
6 changes: 3 additions & 3 deletions app/components/github/githubissueslist.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ const GithubIssue = ({ issue }) => {

const GithubIssuesList = (props) => {
const data =
props.data.issues.Issues.length > 10
? props.data.issues.Issues.slice(0, 10)
: props.data.issues.Issues;
props.data.issues.data.attributes.Issues.length > 10
? props.data.issues.data.attributes.Issues.slice(0, 10)
: props.data.issues.data.attributes.Issues;
return (
<div
className={`${styles.container} d-flex flex-wrap justify-content-center`}
Expand Down
6 changes: 3 additions & 3 deletions app/components/github/githubpullreqeusts.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ const GithubPullReqeust = ({ pull }) => {
};
const GithubPullRequestsList = (props) => {
const data =
props.data.pulls.pulls.length > 6
? props.data.pulls.pulls.slice(0, 6)
: props.data.pulls.pulls;
props.data.pulls.data.attributes.pulls.length > 6
? props.data.pulls.data.attributes.pulls.slice(0, 6)
: props.data.pulls.data.attributes.pulls;

return (
<div
Expand Down
10 changes: 5 additions & 5 deletions app/components/menubar.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,19 @@ export default function Menubar(props) {
</Navbar.Toggle>
<Navbar.Collapse id='basic-navbar-nav'>
<Nav className='mx-auto'>
{props.menu?.body?.map((item,index) => {
return item.sub_menus && item?.sub_menus?.length ? (
{props.menu?.data?.attributes?.body?.map((item,index) => {
return item.sub_menus && item?.sub_menus?.data?.length ? (
<NavDropdown
key = {item.id || item._id || `NavDropDown_${index}`}
title={item.label}
className={`ml-4 fw-normal ${styles.navbarItem}`}
>
{item.sub_menus.map((sub,index) => (
{item.sub_menus.data.map((sub,index) => (
<NavDropdown.Item
key={sub.id || sub._id || `NavDropDownItem_${index}`}
href={sub.url}
href={sub.attributes.url}
>
{sub.label}
{sub.attributes.label}
</NavDropdown.Item>
))}
</NavDropdown>
Expand Down
8 changes: 4 additions & 4 deletions app/components/newscarousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ const Item = (props) => {
return (
<div className={`bg-white m-2 h-auto + ${styles.active_carousel}`}>
<a
href={props.item.url}
href={props.item.attributes.url}
target='_blank'
rel='noreferrer'
className='text-decoration-none text-black :hover'
>
<img
className={styles['carousel-item-image']}
src={props.item.imageUrl}
src={props.item.attributes.imageUrl}
/>
<div className={`p-2 p-md-3 h-auto + ${styles.content}`}>
<h2 className={`${styles.heading}`}>{props.item.name}</h2>
<p className={`${styles.description}`}>{props.item.description}</p>
<h2 className={`${styles.heading}`}>{props.item.attributes.name}</h2>
<p className={`${styles.description}`}>{props.item.attributes.description}</p>
</div>
</a>
</div>
Expand Down
22 changes: 11 additions & 11 deletions app/components/speakerinfotile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,32 @@ import { parseDate, parseTime } from "../lib/dateTime";
export default function SpeakerInfotiles({ data }) {
return (
<>
{data.map((obj) => (
{data?.map((obj) => (
<div
key={obj.id}
className={obj.imageUrl ? Styles.cardWithImage : Styles.card}
className={obj.attributes.imageUrl ? Styles.cardWithImage : Styles.card}
>
{obj.imageUrl && (
{obj.attributes.imageUrl && (
<Image
src={obj.imageUrl}
src={obj.attributes.imageUrl}
width={271}
height={174}
objectFit="cover"
/>
)}
<div className={Styles.card_content}>
<h5 className={Styles.card_heading}>{obj.name}</h5>
{obj.date_time && (
<h5 className={Styles.card_heading}>{obj.attributes.name}</h5>
{obj.attributes.date_time && (
<p className={Styles.talk_timing}>{`${parseDate(
obj.date_time
)} ${parseTime(obj.date_time)}`}</p>
obj.attributes.date_time
)} ${parseTime(obj.attributes.date_time)}`}</p>
)}
<h6
className={obj.live ? Styles.talk_topic_live : Styles.talk_topic}
className={obj.attributes.live ? Styles.talk_topic_live : Styles.talk_topic}
>
{obj.talk_topic}
{obj.attributes.talk_topic}
</h6>
<p className={Styles.speaker_bio}>{obj.short_bio}</p>
<p className={Styles.speaker_bio}>{obj.attributes.short_bio}</p>
</div>
</div>
))}
Expand Down
2 changes: 1 addition & 1 deletion app/lib/api.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export function getStrapiURL(path = "") {
return `${
process.env.NEXT_PUBLIC_STRAPI_API_URL || "http://127.0.0.1:1337"
}${path}`;
}/api${path}`;
}

// Helper to make GET requests to Strapi
Expand Down
15 changes: 8 additions & 7 deletions app/lib/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@ export const githubKitData = async (owner, name, needed) => {
try {
const res = await fetchAPI("/github-repositories");
let neededRepository = new Object();
res.forEach((repo) => {
if (repo.owner === owner && repo.name === name) {
res.data.forEach((repo) => {
if (repo.attributes.owner === owner && repo.attributes.name === name) {
neededRepository["id"] = repo.id;
neededRepository["name"] = repo.name;
neededRepository["owner"] = repo.owner;
neededRepository["repositoryData"] = repo.repositoryData;
neededRepository["name"] = repo.attributes.name;
neededRepository["owner"] = repo.attributes.owner;
neededRepository["repositoryData"] = repo.attributes.repositoryData;
console.log("need", needed, Array.isArray(needed))
if(Array.isArray(needed)){
needed.forEach((neededData) => {
neededRepository[neededData] = repo[neededData];
neededRepository[neededData] = repo.attributes[neededData];
});
}else if(typeof needed !== 'undefined'){
neededRepository[needed] = repo[needed];
neededRepository[needed] = repo.attributes[needed];
}
}
});
Expand Down
12 changes: 6 additions & 6 deletions app/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function Home(props) {
</p>
</Col>
<Col className='mb-5 d-flex flex-column align-items-center'>
<h6 className='py-2 fs-6'> <a href={props?.guides?.location} target="_blank">Read the Guides</a> | <a href={props?.releaseNotes?.location} target="_blank">Read Release Notes</a> </h6>
<h6 className='py-2 fs-6'> <a href={props?.guides?.data?.location} target="_blank">Read the Guides</a> | <a href={props?.releaseNotes?.data?.location} target="_blank">Read Release Notes</a> </h6>
<Searchbox></Searchbox>
</Col>
<Col>
Expand All @@ -56,19 +56,19 @@ function Home(props) {
<h2 className={`mx-auto w-auto pb-5 ${styles.title}`}>
Latest Community News
</h2>
<Newscarousel carousels={props.carousels}></Newscarousel>
<Newscarousel carousels={props.carousels.data}></Newscarousel>
</div>

<h2 className={`mx-auto w-auto m-5 ${styles.title}`}>
Get What You Need...
</h2>
<Personacircle personas={props.personas}></Personacircle>
<Personacircle personas={props.personas.data}></Personacircle>

<div className={` d-flex flex-column py-5 align-items-center`}>
<h2 className={`mx-auto w-auto m-5 ${styles.title}`}>
Community Activity
</h2>
<Discourserankedlist topposts={props.topPosts}></Discourserankedlist>
<Discourserankedlist topposts={props.topPosts.data}></Discourserankedlist>
</div>
</Container>
</>
Expand All @@ -79,8 +79,8 @@ export default withFirebaseAuthUser()(Home);
export async function getStaticProps({ params }) {
const carousels = await fetchAPI('/carousels');
const personas = await fetchAPI('/personas');
const guides = await fetchAPI('/guides');
const releaseNotes = await fetchAPI('/release-notes');
const guides = await fetchAPI('/guide');
const releaseNotes = await fetchAPI('/release-note');
const topNavItems = await fetchAPI('/top-nav-item');
const topPosts = await fetchAPI('/discourses');

Expand Down
2 changes: 1 addition & 1 deletion app/pages/virtualconf/mainstage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const Mainstage = ({ speakers }) => {
<Container>
<h2 className={styles.heading}>Speakers</h2>
<div className={styles.speakersContainer}>
<SpeakerInfotiles data={speakers} />
<SpeakerInfotiles data={speakers.data} />
</div>
</Container>{' '}
</main>
Expand Down
2 changes: 2 additions & 0 deletions cms/.env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
HOST=0.0.0.0
PORT=1337
APP_KEYS=km0QgjouyuXrRtyclpqncQ==,eJRdLckHY4J5cOfQNmKs+w==,zHVrFOcuFTLlwsabLJNIaw==,P9XerXlU/TTeIzsOdizoOQ==
JWT_SECRET=ZJsy2B+U7Z+3/WXXn66kbQ==
2 changes: 0 additions & 2 deletions cms/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,3 @@ exports
build
.strapi-updater.json

# lock files
package-lock.json
2 changes: 1 addition & 1 deletion cms/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v14.18.3
v16.4.0
7 changes: 7 additions & 0 deletions cms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ This stores the structure and data used to statically generate the community sys

By default, strapi listens on port 1337. If you're using WSL2 on Windows and also running Docker Desktop, port 1337 may not be available on your system. To use port 3000 instead, set the environment variable `PORT` to 3000.

#### If migrating form Strapi v3 to v4, please -

> Delete the old `.tmp` and `build` folders (if exists).
> Add the `APP_KEYS`, and `JWT_SECRET` environment variables. (For a quick start, you could use the same keys as in `.env.example`)
```
export PORT=3000
```
Expand All @@ -16,6 +22,7 @@ Start strapi:
git clone https://github.com/rocketchat/RC4Community
cd cms
npm i
npm run build
INITIALIZE_DATA=true npm run develop
```

Expand Down
52 changes: 0 additions & 52 deletions cms/api/carousel/config/routes.json

This file was deleted.

8 changes: 0 additions & 8 deletions cms/api/carousel/models/carousel.js

This file was deleted.

52 changes: 0 additions & 52 deletions cms/api/communities/config/routes.json

This file was deleted.

Loading

0 comments on commit 2136a06

Please sign in to comment.