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

Dev to Stage #1448

Open
wants to merge 20 commits into
base: stage
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
f3c233d
(add) : codeowners
sohit-dg Oct 7, 2024
e708043
chore(DEV-106): added git hooks and setup.sh script.
sohitkumar Oct 7, 2024
48a3b93
Merge pull request #1441 from digitalgreenorg/feat/git-hooks
sohitkumar Oct 7, 2024
a06ed7b
chore(DEV-106): pr_validation file added.
sohitkumar Oct 7, 2024
a7d2a4e
chore(DEV-106): setup.sh modified for echo
sohitkumar Oct 7, 2024
ce0d2e4
chore(DEV-106): pr_validation.yml
sohitkumar Oct 7, 2024
c2185e3
Merge branch 'dev' into feat/git-hooks
sohitkumar Oct 7, 2024
600e157
Merge pull request #1443 from digitalgreenorg/feat/git-hooks
sohit-dg Oct 7, 2024
136be8c
(update) : showEmbeddings enable only when the enableAI flag is true
sohitkumar Oct 22, 2024
1e3077c
Merge pull request #1444 from digitalgreenorg/feat/disable-embedding
kanhaiyasuthar0 Oct 22, 2024
ce0c5ab
(update) : added enableAI flag for visibilty of chat button
sohitkumar Oct 22, 2024
82503d2
Merge pull request #1445 from digitalgreenorg/feat/disable-embedding
kanhaiyasuthar0 Oct 22, 2024
2d26eee
(update) : corrected the image ref name
sohitkumar Oct 23, 2024
039da12
Merge pull request #1446 from digitalgreenorg/feat/disable-embedding
kanhaiyasuthar0 Oct 23, 2024
220e85e
fix(FARMSTACK-34): add truthy operator
sohitkumar Oct 24, 2024
b87acd9
Merge pull request #1447 from digitalgreenorg/fix/participant-layout
sohit-dg Oct 24, 2024
87ba8fd
fix(FARMSTACK-35): removed unnecessary state update for categories wh…
sohitkumar Oct 25, 2024
74cf2e7
Merge pull request #1449 from digitalgreenorg/fix/dashboard
sohit-dg Oct 25, 2024
c078f60
fix(FARMSTACK-36): added option as per the user accesibilty
sohitkumar Oct 25, 2024
da726aa
Merge pull request #1450 from digitalgreenorg/fix/moa
sohitkumar Oct 25, 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
7 changes: 7 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Frontend related files
*.js @sohit-dg
*.jsx @sohit-dg
*.ts @sohit-dg
*.tsx @sohit-dg
*.css @sohit-dg
*.scss @sohit-dg
42 changes: 21 additions & 21 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
name: Build on Pull Request
# name: Build on Pull Request

on:
pull_request:
branches:
- dev
# on:
# pull_request:
# branches:
# - dev

jobs:
build:
runs-on: ubuntu-latest
# jobs:
# build:
# runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
# steps:
# - name: Checkout code
# uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
# - name: Set up Node.js
# uses: actions/setup-node@v3
# with:
# node-version: "18"

- name: Install dependencies
run: npm install -f
# - name: Install dependencies
# run: npm install -f

- name: Build the project
env:
CI: false
run: npm run build
# - name: Build the project
# env:
# CI: false
# run: npm run build
26 changes: 26 additions & 0 deletions .github/workflows/pr_validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: PR Title Validation

on:
pull_request:
types: [opened, edited]

jobs:
validate:
runs-on: ubuntu-latest

steps:
- name: Check PR Title
run: |
title="${{ github.event.pull_request.title }}"

# Validate PR title
if [[ "$title" != feat* ]] && \
[[ "$title" != fix* ]] && \
[[ "$title" != refactor* ]] && \
[[ "$title" != style* ]] && \
[[ "$title" != chore* ]]; then
echo "Error: Pull request title must start with 'feat', 'fix', 'refactor', 'style', or 'chore'."
exit 1
fi

echo "Pull request title is valid."
20 changes: 20 additions & 0 deletions hooks/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

# Retrieve the commit message from the file specified as the first argument
commit_msg=$(cat "$1")
echo "Commit message: '$commit_msg'"

# Define a regular expression for the commit message format
commit_regex="^(feat|fix|chore|refactor|docs|test|style|ci|perf|build)\([A-Z]+-[0-9]+\): .+"

# Check if the commit message matches the required format
if [[ ! "$commit_msg" =~ $commit_regex ]]; then
echo "Error: Invalid commit message format."
echo "Your commit message must follow the format: TYPE(PROJECT-123): description."
echo "Valid types: feat, fix, chore, refactor, docs, test, style, ci, perf, build"
echo "Example: feat(PROJECT-123): add authentication module"
exit 1
fi

# If the commit message matches, allow the commit
exit 0
6 changes: 6 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

# Set up the custom Git hooks directory
git config core.hooksPath ./hooks

echo "Git ~ hooks directory set to ./hooks"
18 changes: 8 additions & 10 deletions src/features/default/src/Components/DatasetCard/DatasetCard.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import location from '../../Assets/Img/location.svg';
import category from '../../Assets/Img/category.svg';
import apartment from '../../Assets/Img/apartment.svg';
import globe_img from '../../Assets/Img/globe_img.svg';
import location from "../../Assets/Img/location.svg";
import category_icon from "../../Assets/Img/category.svg";
import apartment from "../../Assets/Img/apartment.svg";
import globe_img from "../../Assets/Img/globe_img.svg";
import { Card, Typography, useMediaQuery, useTheme } from "@mui/material";
import React from "react";
import LocalStyle from "./DatasetCard.module.css";
Expand All @@ -26,7 +26,7 @@ const DatasetCart = (props) => {
className={mobile ? LocalStyle.cardContainerSm : LocalStyle.cardContainer}
>
<div className="published">
<img src={globe_img} />
<img src={globe_img} />
<span className="published_text">
Published on:{" "}
{publishDate?.split("T")[0]
Expand All @@ -36,16 +36,14 @@ const DatasetCart = (props) => {
</div>
<div className="d_content_title">{title}</div>
<div className={"organisation"}>
{orgnisationName && (
<img src={apartment} />
)}
{orgnisationName && <img src={apartment} />}
{orgnisationName && (
<span className="organisation_text">{orgnisationName}</span>
)}
</div>
<div className="d_content_text">
<div className="category">
<img src={category} alt="category" />
<img src={category_icon} alt="category" />
<span className="category_text">
{Object.keys(category).length
? category?.length > 1
Expand All @@ -55,7 +53,7 @@ const DatasetCart = (props) => {
</span>
</div>
<div className="location">
<img src={location} alt="location" />
<img src={location} alt="location" />
<span className="location_text">
{geography?.country?.name
? geography?.country?.name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,6 @@ const AddDataSet = (props) => {
});
setStandardisedFiles(tempStandardisedFiles);

setCategorises(response?.data?.categories);

const updateSubCategoryIds = () => {
const ids = new Set(
response?.data?.categories?.flatMap((category) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ const DataSetsView = (props) => {
)}
datasetId={response?.data?.id}
id={tempFile.id}
getDataset={getDataset}
usagePolicy={tempFile.usage_policy}
fileType={tempFile.accessibility}
userType={userType === "guest" ? "guest" : ""}
Expand Down
2 changes: 2 additions & 0 deletions src/features/default/src/Components/Resources/ResourceCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import { TbEditCircle } from "react-icons/tb";
import { CgDetailsMore } from "react-icons/cg";
import { IoMdMore } from "react-icons/io";
import UrlConstant from "../../Constants/UrlConstants";
import globalConfig from "globalConfig";

const cardSx = {
maxWidth: 368,
Expand Down Expand Up @@ -318,6 +319,7 @@ const ResourceCard = ({
</span>
</div>
{getTokenLocal() &&
globalConfig.enableAI &&
(isLoggedInUserAdmin() ||
isLoggedInUserCoSteward() ||
isLoggedInUserParticipant()) ? (
Expand Down
Loading