Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
56 changes: 56 additions & 0 deletions examples/template-url/wafir.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Uses simpler.grants.gov's issue templates for an example on how to use templateUrl
title: "Project Management Portal"
targets:
- id: "main-repo"
type: "github/issues"
target: "HHS/simpler-grants-gov"
authRef: "YOUR_INSTALLATION_ID"

forms:
- id: "bug-report"
label: "Bug Report"
icon: "🐞"
targets: ["main-repo"]
templateUrl: "https://raw.githubusercontent.com/HHS/simpler-grants-gov/main/.github/ISSUE_TEMPLATE/1_bug_report.yml"

- id: "feature-request"
label: "Feature Request"
icon: "💡"
targets: ["main-repo"]
templateUrl: "https://raw.githubusercontent.com/HHS/simpler-grants-gov/main/.github/ISSUE_TEMPLATE/2_feature_request.yml"

- id: "internal-decision"
label: "Internal Decision"
icon: "⚖️"
targets: ["main-repo"]
templateUrl: "https://raw.githubusercontent.com/HHS/simpler-grants-gov/main/.github/ISSUE_TEMPLATE/3_internal_decision.yml"

- id: "internal-deliverable"
label: "Internal Deliverable"
icon: "📦"
targets: ["main-repo"]
templateUrl: "https://raw.githubusercontent.com/HHS/simpler-grants-gov/main/.github/ISSUE_TEMPLATE/4_internal_deliverable.yml"

- id: "internal-epic"
label: "Internal Epic"
icon: "🏔️"
targets: ["main-repo"]
templateUrl: "https://raw.githubusercontent.com/HHS/simpler-grants-gov/main/.github/ISSUE_TEMPLATE/5_internal_epic.yml"

- id: "internal-task"
label: "Internal Task"
icon: "✅"
targets: ["main-repo"]
templateUrl: "https://raw.githubusercontent.com/HHS/simpler-grants-gov/main/.github/ISSUE_TEMPLATE/6_internal_task.yml"

- id: "internal-proposal"
label: "Internal Proposal"
icon: "📝"
targets: ["main-repo"]
templateUrl: "https://raw.githubusercontent.com/HHS/simpler-grants-gov/main/.github/ISSUE_TEMPLATE/7_internal_proposal.yml"

- id: "internal-recurring-sam"
label: "Recurring SAM"
icon: "🔄"
targets: ["main-repo"]
templateUrl: "https://raw.githubusercontent.com/HHS/simpler-grants-gov/main/.github/ISSUE_TEMPLATE/8_internal_reoccuring_sam.yml"
43 changes: 43 additions & 0 deletions packages/wafir/injector.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**
* HOW TO ADD TO CHROME:
* 1. Press Ctrl+Shift+B (Cmd+Shift+B on Mac) to ensure your Bookmarks Bar is visible.
* 2. Right-click any empty space on the Bookmarks Bar and select "Add Page...".
* 3. In the "Name" field, type something like "Launch Wafir".
* 4. In the "URL" field, paste the MINIFIED code provided below (the one starting with javascript:).
* 5. Click "Save".
*
* TO USE:
* Go to any website and click the "Launch Wafir" bookmark you just created.
*/
(function () {
const TAG_NAME = "wafir-widget";
const SCRIPT_URL =
"https://wafir-all.s3.us-east-2.amazonaws.com/wafir/latest/wafir.js";

const BRIDGE_URL = ""; // Blank for default
const CONFIG_URL = "https://your-config-url.com";

// Prevent multiple injections
if (document.querySelector(TAG_NAME)) {
console.log("Widget already loaded.");
return;
}

const script = document.createElement("script");
script.type = "module";
script.crossOrigin = "anonymous"; // Required for loading ES modules from S3/CORS
script.src = SCRIPT_URL;

script.onload = () => {
const widget = document.createElement(TAG_NAME);

// Set the attributes only if they are provided
if (BRIDGE_URL) widget.setAttribute("bridge-url", BRIDGE_URL);
if (CONFIG_URL) widget.setAttribute("config-url", CONFIG_URL);

// Append to body
document.body.appendChild(widget);
};

document.head.appendChild(script);
})();
Loading