-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
π«π§¬ β [CPW-2 CPW-8 SGV2-141]: Merge pull request #132 from Signal-K/CPW-8
πͺ΄π« β [CPW-2 CPW-8 SGV2-141]: Post cards + APPEEARS api classifications
- Loading branch information
Showing
450 changed files
with
33,983 additions
and
6,242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: [main] | ||
schedule: | ||
- cron: '0 21 * * 0' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# Override automatic language detection by changing the below list | ||
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] | ||
language: ['javascript'] | ||
# Learn more... | ||
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
# We must fetch at least the immediate parents so that if this is | ||
# a pull request then we can checkout the head. | ||
fetch-depth: 2 | ||
|
||
# If this run was triggered by a pull request event, then checkout | ||
# the head of the pull request instead of the merge commit. | ||
- run: git checkout HEAD^2 | ||
if: ${{ github.event_name == 'pull_request' }} | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v1 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# If you wish to specify custom queries, you can do so here or in a config file. | ||
# By default, queries listed here will override any specified in a config file. | ||
# Prefix the list here with "+" to use these queries and those in the config file. | ||
# queries: ./path/to/local/query, your-org/your-repo/queries@main | ||
|
||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). | ||
# If this step fails, then you should remove it and run the build manually (see below) | ||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v1 | ||
|
||
# βΉοΈ Command-line programs to run using the OS shell. | ||
# π https://git.io/JvXDl | ||
|
||
# βοΈ If the Autobuild fails above, remove it and uncomment the following three lines | ||
# and modify them (or add more) to build your code if your project | ||
# uses a compiled language | ||
|
||
#- run: | | ||
# make bootstrap | ||
# make release | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Push to Space | ||
on: push | ||
|
||
jobs: | ||
push-to-space: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Deta Space Deployment Github Action | ||
uses: neobrains/[email protected] | ||
with: | ||
access_token: ${{ secrets.ACCESS_TOKEN }} | ||
project_id: ${{ secrets.PROJECT_ID }} | ||
space_push: true | ||
list_on_discovery: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
[submodule "api"] | ||
path = api | ||
[submodule "app"] | ||
path = app | ||
url = https://github.com/signal-k/sytizen | ||
branch = wb3-14--generate-asset-id-statselements-for-container | ||
branch = wb3-14--generate-asset-id-statselements-for-container | ||
|
||
# should be api, not app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"jira-plugin.workingProject": "", | ||
"liveServer.settings.port": 5501, | ||
"solidity.defaultCompiler": "localFile", | ||
"solidity.compileUsingRemoteVersion": "v0.8.11+commit.d7f03943" | ||
"solidity.compileUsingRemoteVersion": "v0.8.11+commit.d7f03943", | ||
"solidity.defaultCompiler": "localFile" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Spacefile Docs: https://go.deta.dev/docs/spacefile/v0 | ||
v: 0 | ||
micros: | ||
- name: client | ||
src: ./ | ||
engine: next | ||
primary: true |
Submodule api
deleted from
8f4235
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
import React, { useEffect, useState } from "react"; | ||
import { useSession, useSupabaseClient } from "@supabase/auth-helpers-react"; | ||
import { Container, Row, ButtonGroup, ToggleButton } from "react-bootstrap"; | ||
|
||
import Login from "../../../pages/login"; | ||
import PlanetGalleryCard from "../../Gameplay/Planets/PlanetGalleryCard"; | ||
import DashboardLayout from "../../Tests/Layout/Dashboard"; | ||
|
||
export default function PlanetStatusGalleryIndex() { | ||
const supabase = useSupabaseClient(); | ||
const session = useSession(); | ||
const [planets, setPlanets] = useState([]); | ||
const [selectedClassificationStatus, setSelectedClassificationStatus] = | ||
useState<string | null>("incomplete"); | ||
|
||
useEffect(() => { | ||
getPlanets(); | ||
}, [session, selectedClassificationStatus]); | ||
|
||
const getPlanets = async () => { | ||
try { | ||
let query = supabase | ||
.from("planetsss") | ||
.select("*") | ||
.order("created_at", { ascending: false }) | ||
.limit(20) | ||
.gte("id", 45) | ||
.lt("id", 102); | ||
|
||
if (selectedClassificationStatus !== null) { | ||
query = query.eq("classification_status", selectedClassificationStatus); | ||
} else { | ||
query = query.is("classification_status", null); // Filter planets with no classification_status | ||
} | ||
|
||
const { data, error } = await query; | ||
|
||
// if (data != null) { | ||
// setPlanets(data); | ||
// } | ||
|
||
if (error) { | ||
throw error; | ||
} | ||
} catch (error: any) { | ||
alert(error.message); | ||
} | ||
}; | ||
|
||
const classificationStatusOptions = [ | ||
{ value: "incomplete", label: "Incomplete" }, | ||
{ value: "in progress", label: "In Progress" }, | ||
{ value: "completed", label: "Completed" }, | ||
]; | ||
|
||
const buttonStyle = { | ||
backgroundColor: "rgba(255, 255, 255, 0.2)", | ||
border: "none", | ||
color: "black", | ||
transition: "background-color 0.3s ease", | ||
cursor: "pointer", | ||
marginRight: "8px", | ||
}; | ||
|
||
const activeButtonStyle = { | ||
backgroundColor: "rgba(255, 255, 255, 0.3)", | ||
}; | ||
|
||
if (!session) { | ||
return <Login />; | ||
} | ||
|
||
return ( | ||
<DashboardLayout> | ||
<Container> | ||
<ButtonGroup className="mb-3"> | ||
{classificationStatusOptions.map((option) => ( | ||
<ToggleButton | ||
key={option.value} | ||
type="radio" | ||
variant="outline-secondary" | ||
name="classification_status" | ||
value={option.value} | ||
checked={selectedClassificationStatus === option.value} | ||
onChange={() => setSelectedClassificationStatus(option.value)} | ||
style={ | ||
selectedClassificationStatus === option.value | ||
? { ...buttonStyle, ...activeButtonStyle } | ||
: buttonStyle | ||
} | ||
> | ||
{option.label} | ||
</ToggleButton> | ||
))} | ||
</ButtonGroup> | ||
<Row> | ||
{/* {planets.map((planet) => ( | ||
<PlanetGalleryCard key={planet.id} planet={planet} /> | ||
))} */} | ||
<p>Test</p> | ||
</Row> | ||
</Container> | ||
</DashboardLayout> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import React, { useEffect, useState } from "react"; | ||
import axios from "axios"; | ||
import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; | ||
import Login from "../../../pages/login"; | ||
|
||
interface Planet { | ||
id: number; | ||
content: string; | ||
} | ||
|
||
const AdminPlanetStatusUpdater: React.FC = () => { | ||
const supabase = useSupabaseClient(); | ||
const session = useSession(); | ||
|
||
if (!session) { | ||
return ( | ||
<Login /> | ||
) | ||
} | ||
|
||
const [planets, setPlanets] = useState<Planet[]>([]); | ||
useEffect(() => { | ||
fetchPlanets(); | ||
}, []); | ||
|
||
const fetchPlanets = async () => { | ||
try { | ||
const { data, error } = await supabase | ||
.from('planetsss') | ||
.select('id, content') | ||
if (error) { | ||
console.error('Error fetching planets: ', error) | ||
} else { | ||
setPlanets(data); | ||
} | ||
} catch (error) { | ||
console.error('Error fetching planets: ', error); | ||
}; | ||
}; | ||
|
||
const updatePlanetStatus = async (planetId: number) => { | ||
try { | ||
const { error } = await supabase.from('planet_status').upsert({ | ||
planet_id: planetId, | ||
status: 'in progress', | ||
updated_by: '' | ||
}); | ||
if (error) { | ||
console.error('Error updating planet status: ', error); | ||
} else { console.log('Planet status updated successfully'); }; | ||
} catch (error) { | ||
console.error('Error updating planet status:', error); | ||
} | ||
}; | ||
|
||
return ( | ||
<div> | ||
<h2 className="text-xl font-bold text-gray-800">Admin component</h2> | ||
{planets.map((planet) => ( | ||
<div key={planet.id}> | ||
<p>{planet.content}</p> | ||
<button onClick={() => updatePlanetStatus(planet.id)}>Update status</button> | ||
</div> | ||
))}; | ||
</div> | ||
); | ||
}; | ||
|
||
export default AdminPlanetStatusUpdater; |
Oops, something went wrong.