From 675a8d37c0adf5e76509222f0bd682ae751e2098 Mon Sep 17 00:00:00 2001 From: CookingWithCale Date: Thu, 4 Jan 2024 23:15:02 -0800 Subject: [PATCH] Abilities.Add: Can select a dummy account, repo, issue, and child issue #28.A --- .github/ISSUE_TEMPLATE/artifact.md | 5 +- .github/ISSUE_TEMPLATE/bug_report.md | 28 +- .github/ISSUE_TEMPLATE/change.md | 3 +- .github/ISSUE_TEMPLATE/feature_request.md | 3 +- .github/ISSUE_TEMPLATE/incident.md | 2 +- .github/ISSUE_TEMPLATE/session.md | 16 - Extension/Ctlr/Background.ts | 23 +- Extension/Ctlr/Utils.ts | 6 + Extension/Model/index.ts | 571 +++++++++++++++------- Extension/View/Icons.tsx | 2 - Extension/View/Issues.tsx | 7 + Extension/View/MissionSelector.tsx | 137 ++++++ Extension/View/Popup.tsx | 75 +-- Extension/View/SettingsEditor.tsx | 4 +- readme.md | 2 + 15 files changed, 611 insertions(+), 273 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/session.md create mode 100644 Extension/Ctlr/Utils.ts create mode 100644 Extension/View/Issues.tsx create mode 100644 Extension/View/MissionSelector.tsx diff --git a/.github/ISSUE_TEMPLATE/artifact.md b/.github/ISSUE_TEMPLATE/artifact.md index b89b9d6..9a05285 100644 --- a/.github/ISSUE_TEMPLATE/artifact.md +++ b/.github/ISSUE_TEMPLATE/artifact.md @@ -5,10 +5,11 @@ title: 'Artifact' labels: '' assignees: 'CookingWithCale' --- +# -# Artifact Description - +## Artifacts Report +Describe the outdated code that got overlooked... ## Files Affected diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 3eaf9f0..6e24d32 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -5,15 +5,13 @@ title: '' labels: '' assignees: 'CookingWithCale' --- +# - -### A - -#### Problem +## Problem The bug I am reporting is... -##### Reproduction +### Reproduction Steps to reproduce the behavior: @@ -22,42 +20,42 @@ Steps to reproduce the behavior: 3. Scroll down to '....' 4. See error -##### ExpectedBehavior +### ExpectedBehavior A clear and concise description of what you expected to happen. -##### Screenshots +### Screenshots If applicable, add screenshots to help explain your problem. -##### Platform +### Platform - OS: [e.g. Windows 10 2004] - Version [e.g. 0.6.1] -##### Context +### Context Add any other context about the problem here. -#### Solution +## Solution The solution to the bug is... -##### File Affected +### File Affected 1. `*.*` -#### Hierarchy +## Hierarchy * #1 -#### Tags +## Tags RequestFeature -#### Sessions +## Sessions -* CookingWithCale/.github#1 +* CookingWithCale/.github#9 ## License diff --git a/.github/ISSUE_TEMPLATE/change.md b/.github/ISSUE_TEMPLATE/change.md index c5191eb..7ed4925 100644 --- a/.github/ISSUE_TEMPLATE/change.md +++ b/.github/ISSUE_TEMPLATE/change.md @@ -1,10 +1,11 @@ --- name: Change -about: A breaking change to the infrastructure. +about: A proposed breaking change to the infrastructure. title: 'Change' labels: '' assignees: 'CookingWithCale' --- +# diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index c382c25..3f7ba63 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -5,7 +5,6 @@ title: '' labels: '' assignees: 'CookingWithCale' --- - ### A #### Problem @@ -30,7 +29,7 @@ RequestFeature #### Sessions -* CookingWithCale/.github#2 +* CookingWithCale/.github#9 ## License diff --git a/.github/ISSUE_TEMPLATE/incident.md b/.github/ISSUE_TEMPLATE/incident.md index c1b4f3c..5acb0c1 100644 --- a/.github/ISSUE_TEMPLATE/incident.md +++ b/.github/ISSUE_TEMPLATE/incident.md @@ -1,7 +1,7 @@ --- name: Incident about: A Incident Command System incident; i.e. a real-world event with time, place, etc. -title: 'Incident. @2022-' +title: 'Incident @2024-' labels: '' assignees: 'CookingWithCale' --- diff --git a/.github/ISSUE_TEMPLATE/session.md b/.github/ISSUE_TEMPLATE/session.md deleted file mode 100644 index 8901540..0000000 --- a/.github/ISSUE_TEMPLATE/session.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -name: Session -about: A mission-driven development mission with a problem-solution analysis -title: 'Session @2023-' -labels: '' -assignees: 'CookingWithCale' ---- -# - -## Participants - -1. CookingWithCale/.github#9 - -## License - -Copyright [AStartup](https://astartup.net); all rights reserved. diff --git a/Extension/Ctlr/Background.ts b/Extension/Ctlr/Background.ts index 5984d11..0e53d24 100644 --- a/Extension/Ctlr/Background.ts +++ b/Extension/Ctlr/Background.ts @@ -1,7 +1,10 @@ // Copyright AStartup; license at https://github.com/AStarStartup/AStartupMCC -import { } - from '../Model' +import { CommandStructureInit, CommandStructureSet, ModelConfigInit, +ModelConfigGet, ModelConfigSet, ModelIssueInit, ModelIssueSet, +ModelMissionInit, ModelMissionSet, ModelSessionInit, ModelSessionSet, +ModelSyndicateInit, ModelSyndicateSet } from '../Model' + console.log("[Background.ts]") chrome.runtime.onMessage.addListener((message, sender, sendResponse) => { @@ -11,28 +14,26 @@ console.log("[Background.ts]") }) chrome.alarms.onAlarm.addListener((alarm) => { - if (alarm.name === "FeedUpdate") { - console.log('tick') - //chrome.storage.local.get(["feeds", "segments"], (res) => { - // FeedEstuarySorterProcess(res.feeds, res.segments) + if (alarm.name === "Update") { + //console.log('tick') + //ModelConfigGet().then((options) => { + // console.log(options) //}) } }) // @todo Inspect video timestamp 3:38:30 for spooky shit. -import { ModelConfigInit, ModelConfigSet, CommandStructureInit, CommandStructureSet, ModelIssueInit, ModelIssueSet, ModelMissionInit, ModelMissionSet, ModelSessionInit, ModelSessionSet, - ModelSyndicateSet } from '../Model' chrome.runtime.onInstalled.addListener(() => { ModelConfigSet(ModelConfigInit) CommandStructureSet(CommandStructureInit) ModelIssueSet(ModelIssueInit) ModelMissionSet(ModelMissionInit) ModelSessionSet(ModelSessionInit) - ModelSyndicateSet(ModelMissionInit) + ModelSyndicateSet(ModelSyndicateInit) - chrome.alarms.create("FeedUpdate", { - periodInMinutes: 15/60, + chrome.alarms.create("Update", { + periodInMinutes: 1/60, }) chrome.contextMenus.create({ diff --git a/Extension/Ctlr/Utils.ts b/Extension/Ctlr/Utils.ts new file mode 100644 index 0000000..1f69f4b --- /dev/null +++ b/Extension/Ctlr/Utils.ts @@ -0,0 +1,6 @@ +// Copyright AStartup; license at https://github.com/AStarStartup/AStartupMCC + +export function IssueStringNumber(input: string) { + if (input[0] != '#') return -1 + return parseInt(input.substring(1,)) +} diff --git a/Extension/Model/index.ts b/Extension/Model/index.ts index 4eb0110..50d131e 100644 --- a/Extension/Model/index.ts +++ b/Extension/Model/index.ts @@ -1,24 +1,7 @@ -// Copyright AStartup; license at https://github.com/AStarStartup/AStartupMCC +// Copyright AStartup; license at https://github.com/AStartupMCC export const UsernameInit = 'CookingWithCale' -export type GitHubIssue = { - title: string - number: number - brief: string -} - -export type GitHubRepo = { - name: string - issues_closed: GitHubIssue - issues_open: GitHubIssue -} - -export type GitHubAccount = { - type: string - repos: GitHubRepo -} - /* Data model config that do not get synced with the server. */ export type ModelAppState = { } @@ -40,8 +23,7 @@ export type ModelConfig = { session?: number //< Current session number. account?: string //< Current account. repo?: string //< Current repo. - mission: number //< Current mission number. - child_mission?: string //< Current child mission. + mission: string //< Current mission string. } const SessionFocusLengthMax = 100 //< Max length of a session focus heading. @@ -151,10 +133,9 @@ export const ModelConfigInit: ModelConfig = { me: UsernameInit, them: '', session: 0, - account: '', - repo: '', - mission: 0, - child_mission: '' + account: 'AStarStartup', + repo: 'AStartupMCC', + mission: '' } // Unpacks the account/repo#MissionNumber.ChildMission from the input string. export function MissionStringUnpack(input: string) { @@ -278,173 +259,389 @@ export const CommandStructureInit = { } } } +export type GitHubIssue = { + title: string //< Issue title. + open: boolean //< Open (true) or closed (false). +} + +export type GitHubRepo = { + visibility: boolean //< visibility: public (true) or private (false). + issues_open: Object //< All of the open issue tickets. +} +export type GitHubAccount = { + type: string //< Account type: 'Person' or 'Org'. + repos: Object //< Account repos. +} + +export const ModelSyndicateInit: Object = { + "AStarStartup": { + "Type": "Org", + "Repos": { + "AStartupMCC": { + "issues": { + "86": "Abilities.Add: Can set and crop background in OBS for thumbnail", + "85": "ContextMenu.Add quick paste feature", + "75": "ContextMenu.AddAbility Right click on GitHub issue tickets and add them to the current mission or set as the current mission", + "71": "Options.Abilities: Can switch property key casing", + "28": "Abilities.Add: Can select a dummy account, repo, mission, and child mission", + "22": "Timesheet Logger (v0.1)", + "14": "ProductManager.Abilities.Add: Can add and remove products" + }, + "visibility": true + }, + "AStartupToolkit": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": true + }, + "LinearId": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": true + }, + "OBSFX": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": true + }, + ".github": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": true + }, + "AStartupGitTemplate": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": true + }, + "AStartupCookbook": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": true + }, + "AStartupWorld": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": false + }, + "StreamSeq": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": false + }, + "Channel": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": false + }, + "OBSTouchGIMP": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": false + }, + "Typecraft": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": false + }, + } + }, + "CookingWithCale": { + "Type": "Person", + "Repos": { + "BadThing": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": true + }, + ".github": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": true + }, + "FreedomCookbook": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": true + }, + "SickBay>": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": true + }, + "metascrapper": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": false + }, + "MetamediaDownloader": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": false + }, + "Self": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": false + } + } + }, + "KabukiStarship": { + "Type": "Person", + "Repos": { + "Script2": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": true + }, + ".github": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": true + }, + "Actors": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": true + }, + "iGeekPolygonWorld": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": true + }, + "KabukiLIcenses": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": true + }, + "iGeekCookbook": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": true + }, + "StarshipCookbook": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": true + }, + "KabukiPressCookbook": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": true + }, + "MusictechCookbook": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": true + }, + "iGeek": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": true + }, + "iGeekCardsWorld": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": true + }, + "KabukiStarship.github.io": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": true + }, + "KabukiToolkit": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": true + }, + "IMUL": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": true + }, + "ScriptTek": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": true + }, + "iGeekMazeWorld": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": true + }, + "iGeekPacWorld": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": true + }, + "iGeekTileWorld": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": true + }, + "iGeekVirusWorld": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": true + }, + "KabukiBenchmark": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": true + }, + "KabukiPress": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": false + }, + "KabukiSearch": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": false + }, + "SearchFor4.669": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": false + }, + "IAmPy": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": false + }, + "iGeekWikiWorld": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": false + }, + "iGeekUlator": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": false + }, + "iGeekBlockWorld": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": false + }, + "KabukiDB": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": false + }, + "KabukiTheater": { + "issues_open": { + "1": "Session.Next.Monday", + "2": "Session.Next.Tuesday" + }, + "visibility": false + } + } + } +} + +/* export const ModelStateInit: ModelState = { command_structure: CommandStructureInit, issue: {}, mission: {}, config: ModelConfigInit, session: {}, - syndicate: { - "CookingWithCale": { - "Repos": { - "AStarStartup/AStartupMCC": { - "Visibility": true - }, - "AStarStartup/AStartupToolkit": { - "Visibility": true - }, - "AStarStartup/LinearId": { - "Visibility": true - }, - "AStarStartup/OBSFX": { - "Visibility": true - }, - "AStarStartup/.github": { - "Visibility": true - }, - "AStarStartup/AStartupGitTemplate": { - "Visibility": true - }, - "AStarStartup/AStartupCookbook": { - "Visibility": true - }, - "AStarStartup/AStartupWorld": { - "Visibility": false - }, - "AStarStartup/StreamSeq": { - "Visibility": false - }, - "AStarStartup/Channel": { - "Visibility": false - }, - "AStarStartup/OBSTouchGIMP": { - "Visibility": false - }, - "AStarStartup/Typecraft": { - "Visibility": false - }, - "KabukiStarship/Script2": { - "Visibility": true - }, - "KabukiStarship/.github": { - "Visibility": true - }, - "KabukiStarship/Actors": { - "Visibility": true - }, - "KabukiStarship/iGeekPolygonWorld": { - "Visibility": true - }, - "KabukiStarship/KabukiLIcenses": { - "Visibility": true - }, - "KabukiStarship/iGeekCookbook": { - "Visibility": true - }, - "KabukiStarship/StarshipCookbook": { - "Visibility": true - }, - "KabukiStarship/KabukiPressCookbook": { - "Visibility": true - }, - "KabukiStarship/MusictechCookbook": { - "Visibility": true - }, - "KabukiStarship/iGeek": { - "Visibility": true - }, - "KabukiStarship/iGeekCardsWorld": { - "Visibility": true - }, - "KabukiStarship/KabukiStarship.github.io": { - "Visibility": true - }, - "KabukiStarship/KabukiToolkit": { - "Visibility": true - }, - "KabukiStarship/IMUL": { - "Visibility": true - }, - "KabukiStarship/ScriptTek": { - "Visibility": true - }, - "KabukiStarship/iGeekMazeWorld": { - "Visibility": true - }, - "KabukiStarship/iGeekPacWorld": { - "Visibility": true - }, - "KabukiStarship/iGeekTileWorld": { - "Visibility": true - }, - "KabukiStarship/iGeekVirusWorld": { - "Visibility": true - }, - "KabukiStarship/KabukiBenchmark": { - "Visibility": true - }, - "KabukiStarship/KabukiPress": { - "Visibility": false - }, - "KabukiStarship/KabukiSearch": { - "Visibility": false - }, - "KabukiStarship/SearchFor4.669": { - "Visibility": false - }, - "KabukiStarship/IAmPy": { - "Visibility": false - }, - "KabukiStarship/iGeekWikiWorld": { - "Visibility": false - }, - "KabukiStarship/iGeekUlator": { - "Visibility": false - }, - "KabukiStarship/iGeekBlockWorld": { - "Visibility": false - }, - "KabukiStarship/KabukiDB": { - "Visibility": false - }, - "KabukiStarship/KabukiTheater": { - "Visibility": false - }, - "CookingWithCale/BadThing": { - "Visibility": true - }, - "CookingWithCale/.github": { - "Visibility": true - }, - "CookingWithCale/FreedomCookbook": { - "Visibility": true - }, - "CookingWithCale/MarkdownCookbook": { - "Visibility": true - }, - "CookingWithCale/MarkdownSoftwareEngineering": { - "Visibility": true - }, - "CookingWithCale/SickBay>": { - "Visibility": true - }, - "CookingWithCale/MarkdownGameDev": { - "Visibility": true - }, - "CookingWithCale/metascrapper": { - "Visibility": false - }, - "CookingWithCale/MetamediaDownloader": { - "Visibility": false - }, - "CookingWithCale/Self": { - "Visibility": false - } - } - }, - } -} + syndicate: ModelSyndicateInit +}*/ export function ModelConfigGet(): Promise { const keys: ModelKeys[] = ['config'] @@ -470,7 +667,7 @@ export function CommandStructureGet(): Promise { const keys: ModelKeys[] = ['command_structure'] return new Promise((resolve) => { chrome.storage.local.get(keys, (state: ModelState) => { - resolve(state.config ?? ModelStateInit) + resolve(state.command_structure ?? CommandStructureInit) }) }) } @@ -543,10 +740,6 @@ export function ModelSessionSet(session: Object): Promise { }) } -export const ModelSyndicateInit: Object = { - "CookingWithCale": {} -} - export function ModelSyndicateGet(): Promise { const keys: ModelKeys[] = ['syndicate'] return new Promise((resolve) => { diff --git a/Extension/View/Icons.tsx b/Extension/View/Icons.tsx index 4da6b3f..2408dd7 100644 --- a/Extension/View/Icons.tsx +++ b/Extension/View/Icons.tsx @@ -1,5 +1,3 @@ -// Copyright AStartup; license at https://github.com/AStarStartup/AStartupMCC - import React from 'react' export function IconGear() { diff --git a/Extension/View/Issues.tsx b/Extension/View/Issues.tsx new file mode 100644 index 0000000..541bb05 --- /dev/null +++ b/Extension/View/Issues.tsx @@ -0,0 +1,7 @@ +// Copyright AStartup; license at https://github.com/AStarStartup/AStartupMCC + +import { ModelSyndicateGet, ModelConfigGet, ModelConfigSet } from '../Model' + +export function Issues({props}) { + +} \ No newline at end of file diff --git a/Extension/View/MissionSelector.tsx b/Extension/View/MissionSelector.tsx new file mode 100644 index 0000000..ec56ebe --- /dev/null +++ b/Extension/View/MissionSelector.tsx @@ -0,0 +1,137 @@ +// Copyright AStartup; license at https://github.com/AStarStartup/AStartupMCC + +import React, { useState } from 'react' +import { ModelConfig, ModelConfigSet } from '../Model' + +// Checks if the issue_num_title starts off with #mission_number_string (i.e #123). +export function IssueIsSelected(issue_num_title: string, mission_number_string: string) { + const MLength = mission_number_string.length + //if(MLength < 1 || issue_num_title.length <= MLength) return false; + // Example issue_is_selected: "ABC" or "A123" or "#123 Working example" + let issue_is_selected = issue_num_title[0] != '#' && MLength < 1 + && issue_num_title.length <= MLength + //if(!issue_is_selected) return issue_is_selected + let i = 0 + for(; i < MLength; ++i) { + if(issue_num_title[i + 1] != mission_number_string[i]) { + issue_is_selected = false + break + } + } + return issue_is_selected && issue_num_title[i + 1] == ' ' +} + +export default function MissionSelector(props: { + Config : ModelConfig + ConfigSet: (o: ModelConfig) => void + Syndicate: object + }) { + + const { Config, ConfigSet, Syndicate } = props + let { account, mission, repo } = Config + console.log('MissionSelector: account:"' + account + '" repo:"' + repo + + '" mission:"' + mission + '"') + console.log('Config:') + console.log(Config) + console.log("Syndicate:") + console.log(Syndicate) + console.log("repo:") + console.log(repo) + + let repos: string[] = [] + let issues: string[] = [] + + //const [ Account, AccountSet ] = useState(Config.account) + + console.log('Iterating through Syndicates...') + Object.entries(Syndicate || {}).forEach(([account_key, account_value]) => { + if(account != account_key && account != 'All') return + console.log('Processing entries for account:' + account + ' s_key:' + account_key) + //Accounts.push(key) + let Repos = Object(account_value)['Repos'] + console.log('Account:"' + + Object.keys(Syndicate).find(key => Syndicate[key] === account_value) + '"') + console.assert(Repos != undefined) + console.log('Repos:') + console.log(Repos) + console.log('Iterating through Repos:') + repos.push(repo ?? '.github') + Object.entries(Repos || {}).forEach(([repo_key, repo_value]) => { + console.log('key:"' + repo_key + '" + repo_value:') + console.log(repo_value) + if(account === account_key && repo === repo_key) { + console.log('Creating list of issues...') + let repo_issues = Object(repo_value)['issues_open'] + console.log('my_issues:') + console.log(repo_issues) + Object.entries(repo_issues || {}).map(([issue_key, issue_value]) => { + issues.push('#' + issue_key + ' ' + issue_value) + console.log("'#' + key2 + ' ' + value2:" + '#' + issue_key + ' ' + + issue_value) + }) + } + else { + repos.push(repo_key) + } + }) + console.log('Done!') + }) + console.log("repos:") + console.log(repos) + console.log("issues:") + console.log(issues) + + + return
+
+ + +
+
+ + +
+
+ + +
+
+} \ No newline at end of file diff --git a/Extension/View/Popup.tsx b/Extension/View/Popup.tsx index 15215a2..c5db852 100644 --- a/Extension/View/Popup.tsx +++ b/Extension/View/Popup.tsx @@ -1,21 +1,35 @@ // Copyright AStartup; license at https://github.com/AStarStartup/AStartupMCC -import React, { useEffect, useState, useReducer } from 'react'; -import { createRoot } from 'react-dom/client'; -import { ModelConfig, ModelConfigInit, ModelConfigGet } from '../Model'; +import React, { useEffect, useState } from 'react' +import { createRoot } from 'react-dom/client' +import MissionSelector from './MissionSelector' +import { ModelConfig, ModelConfigGet, ModelConfigInit, ModelSyndicateGet } from '../Model' const Popup = () => { - console.log('>Popup'); - const [Config, ConfigSet] = useState( - ModelConfigInit); - const [IsSaving, IsSavingSet] = useState(false); - if (Config == null) return
Options == null
- let { me: username, session, account, repo, mission, child_mission } = Config; + console.log('>Popup') + const [Config, ConfigSet] = useState(ModelConfigInit) + const [Syndicate, SyndicateSet ] = useState({}) + const [IsSaving, IsSavingSet] = useState(false) useEffect(() => { - console.log('[useEffect]'); - ModelConfigGet().then(options_new => ConfigSet(options_new)); - }, []); + console.log('[useEffect]') + ModelConfigGet().then(options_new => ConfigSet(options_new)) + ModelSyndicateGet().then(syndicate_new => SyndicateSet(syndicate_new)) + }, []) + if (Config == null) return
Options == null
+ let { me, account, repo, mission } = Config + /* + const handleCityButtonClick = () => { + if (cityInput === '') { + return + } + const updatedCities = [...cities, cityInput] + setStoredCities(updatedCities).then(() => { + setCities(updatedCities) + setCityInput('') + }) + } + */ const SessionFocusChange = (username: string) => { } @@ -23,26 +37,23 @@ const Popup = () => { function LogInOutHandle() { } - /* -
{tags.length}/{Options.session_focus_length_max}
*/ - return ( -
- -
-

{username}

-

Session #{session}

-

{account}

-

{repo}

-
{mission}
-
{child_mission}
- SessionFocusChange(event.target.value) } - disabled={ IsSaving } - /> -
- ) + + + return
+ +
+

Account: {account}

+

Repo: {repo}

+

Mission: {mission}

+ SessionFocusChange(event.target.value) } + disabled={ IsSaving } + /> + +
} const container = document.createElement('div') diff --git a/Extension/View/SettingsEditor.tsx b/Extension/View/SettingsEditor.tsx index 31cce15..6b37e0a 100644 --- a/Extension/View/SettingsEditor.tsx +++ b/Extension/View/SettingsEditor.tsx @@ -3,7 +3,7 @@ import { ModelAppState, ModelConfig } from '../Model' import React, { Dispatch, useState } from "react"; -const ConfigEditor = (props: { +const SettingsEditor = (props: { options: ModelConfig, dispatch: Dispatch, is_saving: boolean, @@ -67,4 +67,4 @@ const ConfigEditor = (props: { } -export default ConfigEditor +export default SettingsEditor diff --git a/readme.md b/readme.md index c403006..3cafc92 100644 --- a/readme.md +++ b/readme.md @@ -1,5 +1,7 @@ The AStartup Mission Control Center is a browser extension and OBS plugin for A-Startups. +![example workflow](https://github.com/AStarStartup/AStartupMCC/actions/workflows/test.yml/badge.svg) + ## Quick Links * [AStartup Cookbook](https://github.com/AStarStartup/AStartupCookbook) - An open-source book that teaches you to invent, launch, and run a modern startup with Mission-driven Development (IDD) and I am You Language (IMUL) on GitHub.