BF2042 Portal GitHub Plugin
About
This is a plugin for the Battlefield Portal Browser Extension which adds the feature to pull/push your portal experience changes to GitHub repositories.
This plugin is also aiming to enable editing on a Battlefield Portal experience as a team, by utilizing feature branches and merging them.
The plugin utilizes the GutHub REST API with the Octokit Javascript library by using GitHub Personal Access Tokens.
Install
- Install the Battlefield Portal Browser Extension
- Chrome: https://chrome.google.com/webstore/detail/bf2042-portal-extensions/ojegdnmadhmgfijhiibianlhbkepdhlj
- Firefox: https://addons.mozilla.org/en-US/firefox/addon/bf2042-portal-extensions/
- Pin the extension to be able to click on it
- Click on the extension icon and a popup should appear
- Click on
official extension manifest
in the text to automatically fill the “Manifest URL” and “Version” input.
- Click confirm
- Reload any Rules Editor Page and right-click in the Workspace
- A context menu should appear which shows an
Options >
item (if not, reload the page again and check that the Portal browser extension is active)
- Click on
Options >
and then Plugin Manager
- In the Plugin Manager click on
Add Plugin
on the top-right corner
- Enter the Plugin Manifest URL below and click
Review
, then click Confirm
after seeing the sourcecode of the plugin.
- After the plugin was added to the list of plugins, you need to reload the rules editor page in order to activate it
Plugin manifest.json URL
https://the0zzy.github.io/bf2042-portal-github-plugin/manifest.json
How to use
- Create a GitHub Personal Access Token as described here.
- Create a new repository and initialize it
- Open the rule editor in one of your portal experiences
- Open the context menu by right-clicking in the workspace area (not on a block)
- If the plugin was initialized correctly, you should see some
GitHub...
menu items at the bottom.
- Click on
GitHub Setup
to connect your repository of step 2 with this experience.
- Enter your personal access token of step 1
- Enter the repository name of step 2
If everything was successfull, the options for GitHub Pull
and GitHub Commit
should become available in the context menu.
When leaving the commit message blank, the plugin will generate a commit message out of the undo stack in the workspace.
The plugin stores your rules as a formatted workspace.json
file in the root folder of your repository.
You can define a repository and according login data per Portal Experience (based on “playgroundId”).
The information will be stored in the browser filesystem in the context of the Battlefield Portal domain.
How to co-edit/contribute on a Battlefield Portal experience
– THIS TOPIC IS WORK IN PROGRESS –
This plugin is also aiming to enable editing on a Battlefield Portal experience as a team, by utilizing feature branches and merging them.
How to - For the experience/repository owner
A - GitHub Account and Repository
- Create a GitHub account
- Create a GitHub Personal Access Token as described here.
- create a new (public) repository at GitHub with the online guide and initialize it with a readme etc.
B - Install Browser Plugin
- Install the Battlefield Portal Browser Extension
- Chrome: https://chrome.google.com/webstore/detail/bf2042-portal-extensions/ojegdnmadhmgfijhiibianlhbkepdhlj
- Firefox: https://addons.mozilla.org/en-US/firefox/addon/bf2042-portal-extensions/
- Pin the extension to be able to click on it
- Click on the extension icon >
Options
- Click on
Add plugin
and enter the following url
https://the0zzy.github.io/bf2042-portal-github-plugin/manifest.json
C - Setup/Commit Portal Experience
- Create or open a portal experience of your own at the rule/logic editor pane at portal.battlefield.com
- Open the context menu by right-clicking in the workspace area (not on a block)
- If the plugin was initialized correctly, you should see some
GitHub...
menu items at the bottom.
- Click on
GitHub Setup
to connect your repository with this experience.
- Enter your personal access token and tab to another field in the setup dialog (this will trigger the GitHub login in the background)
- Select the desired repository and select the “main” branch
- Select your desired options of how the plugin should work within this experience (“Commit on Save” is recommend)
- Now you can do a first commit of your experience by opening the context menu again and select
GitHub Commit
D - Create “Issues” to work on
- Within the issues tab of your repository you can create issues/To-Dos, which should be implementable as isolated as possible.
- in an issue you can create a specific branch for developing/working on it, so that your “main” branch stays clean and stable
How to - For contributors of an experience
A - Prerequisites
- Create a GitHub account
- Create a GitHub Personal Access Token as described here.
- Install the Battlefield Portal Browser Extension
- Chrome: https://chrome.google.com/webstore/detail/bf2042-portal-extensions/ojegdnmadhmgfijhiibianlhbkepdhlj
- Firefox: https://addons.mozilla.org/en-US/firefox/addon/bf2042-portal-extensions/
- Pin the extension to be able to click on it
- Click on the extension icon >
Options
- Click on
Add plugin
and enter the following url
https://the0zzy.github.io/bf2042-portal-github-plugin/manifest.json