Skip to content

Commit

Permalink
Merge branch 'refs/heads/chrome-extension' into edge-extension
Browse files Browse the repository at this point in the history
# Conflicts:
#	package.json
  • Loading branch information
evandor committed Apr 10, 2024
2 parents b81ccbf + 72a6949 commit 7eb422c
Show file tree
Hide file tree
Showing 10 changed files with 97 additions and 36 deletions.
66 changes: 53 additions & 13 deletions .github/workflows/electron-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build/release
name: Build/release Electron

on: push

Expand All @@ -14,19 +14,59 @@ jobs:
steps:
- name: Check out Git repository
uses: actions/checkout@v1

- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
- uses: actions/setup-node@v1
with:
node-version: 18

- name: Build/release Electron app
uses: samuelmeuli/action-electron-builder@v1
- name: 'Create env file'
run: |
touch .env
echo STAGE=PRD >> .env
echo FIREBASE_ACTIVE=true >> .env
echo BACKEND_URL="https://tabsets-72089.web.app" >> .env
echo TABSETS_PWA_URL="https://pwa.tabsets.net" >> .env
echo FIREBASE_API_KEY="${{ secrets.FIREBASE_API_KEY }}" >> .env
echo FIREBASE_AUTH_DOMAIN="tabsets-72089.firebaseapp.com" >> .env
echo FIREBASE_PROJECT_ID="tabsets-72089" >> .env
echo FIREBASE_APP_ID="${{ secrets.FIREBASE_APP_ID }}" >> .env
echo FIREBASE_MESSAGING_SENDER_ID="${{ secrets.FIREBASE_MESSAGING_SENDER_ID }}" >> .env
echo FIREBASE_STORAGE_BUCKET="tabsets-72089.appspot.com" >> .env
echo FIREBASE_DATABASE_URL="${{ secrets.FIREBASE_DATABASE_URL }}" >> .env
echo FIREBASE_MESSAGING_KEY="${{ secrets.FIREBASE_MESSAGING_KEY }}" >> .env
- name: Build
run: |
yarn install
npm run "build electron (publish)"
- uses: AButler/[email protected]
with:
# GitHub token, automatically provided to the action
# (No need to define this secret in the repo settings)
github_token: ${{ secrets.github_token }}
files: "dist/electron/Packaged/*;"
repo-token: ${{ secrets.GITHUB_TOKEN }}
# - name: Create Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
# with:
# tag_name: ${{ github.ref }}
# release_name: Release ${{ github.ref }}
# body: |
# Changes in this Release
# - First Change
# - Second Change
# draft: true
# prerelease: true

# If the commit is tagged with a version (e.g. "v1.0.0"),
# release the app after building
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
# - name: Install Node.js, NPM and Yarn
# uses: actions/setup-node@v1
# with:
# node-version: 18
#
# - name: Build/release Electron app
# uses: samuelmeuli/action-electron-builder@v1
# with:
# # GitHub token, automatically provided to the action
# # (No need to define this secret in the repo settings)
# github_token: ${{ secrets.github_token }}
#
# # If the commit is tagged with a version (e.g. "v1.0.0"),
# # release the app after building
# release: ${{ startsWith(github.ref, 'refs/tags/v') }}
12 changes: 11 additions & 1 deletion .github/workflows/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
branches:
- 'chrome-extension'
jobs:
sync-branch:
sync-branch-firefox:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
Expand All @@ -17,6 +17,11 @@ jobs:
target_branch: firefox-extension
github_token: ${{ secrets.GITHUB_TOKEN }}

sync-branch-edge:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- name: Merge chrome-extension -> edge-extension
uses: devmasx/[email protected]
with:
Expand All @@ -25,6 +30,11 @@ jobs:
target_branch: edge-extension
github_token: ${{ secrets.GITHUB_TOKEN }}

sync-branch-opera:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- name: Merge chrome-extension -> opera-extension
uses: devmasx/[email protected]
with:
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"build bex (prd)": "mv .env .env.tmp && cp .prd.env .env && quasar build -m bex && mv .env.tmp .env",
"build bex (publish)": "quasar build -m bex",
"build pwa": "quasar build -m pwa",
"build electron (prd)": "mv .env .env.tmp && cp .prd.env .env && quasar build -m electron",
"build electron (prd)": "mv .env .env.tmp && cp .prd.env .env && quasar build -m electron && mv .env.tmp .env",
"build electron (publish)": "quasar build -m electron",
"zip extension": "cd dist/bex && zip -r tabsets.zip .",
"build capacitor": "quasar build -m capacitor -T ios",
"icon": "icongenie generate -i src/assets/icon.png",
Expand Down
2 changes: 1 addition & 1 deletion src-bex/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
"alarms",
"scripting",
"sidePanel",
"contextMenus",
"bookmarks"
],
"optional_permissions": [
"pageCapture",
"contextMenus",
"notifications",
"webRequest",
"tabGroups"
Expand Down
2 changes: 1 addition & 1 deletion src/boot/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {boot} from 'quasar/wrappers'

const INDEX_DB_VERSION = 21
const INDEX_DB_VERSION = 22

const CLEANUP_PERIOD_IN_MINUTES = 10 // in prod: 10
const EXPIRE_DATA_PERIOD_IN_MINUTES = 60 // in prod: 60
Expand Down
6 changes: 3 additions & 3 deletions src/domain/commands/GrantPermissionCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ export class GrantPermissionCommand implements Command<boolean> {
// usePermissionsStore().activateFeature('history')
} else if ("notifications" === this.permission) {
usePermissionsStore().activateFeature('notifications')
} else if ("contextMenus" === this.permission) {
//usePermissionsStore().grantPermission("notifications")
ChromeApi.buildContextMenu()
// } else if ("contextMenus" === this.permission) {
// //usePermissionsStore().grantPermission("notifications")
// ChromeApi.buildContextMenu()
}
return new ExecutionResult(
granted,
Expand Down
2 changes: 1 addition & 1 deletion src/models/AppFeature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export enum FeatureIdent {
//CATEGORIZATION = "CATEGORIZATION",
NOTIFICATIONS = "NOTIFICATIONS",
ANNOTATIONS = "ANNOTATIONS",
CONTEXT_MENUS = "CONTEXT_MENUS",
//CONTEXT_MENUS = "CONTEXT_MENUS",
ARCHIVE_TABSET = "ARCHIVE_TABSET",
//WINDOW_MANAGEMENT = "WINDOW_MANAGEMENT",
COLOR_TAGS = "COLOR_TAGS",
Expand Down
10 changes: 5 additions & 5 deletions src/models/AppFeatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class AppFeatures {
new AppFeature(FeatureIdent.NOTES, FeatureType.EXPERIMENTAL, 'Activate Notes', 'o_note', ['all']),

new AppFeature(FeatureIdent.WEBSITE_CLIP, FeatureType.EXPERIMENTAL, 'Create an image clip from a website and store it', 'filter_center_focus', ['bex'])
.setActivateCommands([new GrantPermissionCommand('notifications'),new GrantPermissionCommand('contextMenus')]),
.setActivateCommands([new GrantPermissionCommand('notifications')]),

new AppFeature(FeatureIdent.STANDALONE_APP, FeatureType.RECOMMENDED, 'Standalone App', 'o_open_in_new', ['bex']),

Expand All @@ -54,11 +54,11 @@ export class AppFeatures {
.setActivateCommands([new GrantPermissionCommand('notifications')])
.setDeactivateCommands([new RevokePermissionCommand('notifications')]),

new AppFeature(FeatureIdent.ANNOTATIONS, FeatureType.EXPERIMENTAL, 'Annotate Websites', 'o_auto_awesome', ['bex'])
.setActivateCommands([new GrantPermissionCommand('contextMenus')]),
new AppFeature(FeatureIdent.ANNOTATIONS, FeatureType.EXPERIMENTAL, 'Annotate Websites', 'o_auto_awesome', ['bex']),
// .setActivateCommands([new GrantPermissionCommand('contextMenus')]),

new AppFeature(FeatureIdent.CONTEXT_MENUS, FeatureType.OPTIONAL, 'Use Tabsets Context Menu', 'o_list', ['all'])
.setActivateCommands([new GrantPermissionCommand('contextMenus')]),
// new AppFeature(FeatureIdent.CONTEXT_MENUS, FeatureType.OPTIONAL, 'Use Tabsets Context Menu', 'o_list', ['all'])
// .setActivateCommands([new GrantPermissionCommand('contextMenus')]),


new AppFeature(FeatureIdent.ARCHIVE_TABSET, FeatureType.OPTIONAL, 'Archive Tabsets', 'o_inventory_2', ['all']),
Expand Down
10 changes: 5 additions & 5 deletions src/pages/FeaturesPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -445,11 +445,11 @@ text.set(FeatureIdent.TABSETS_SHARING.toLowerCase(), {
needsAccount: true,
permissions: []
})
text.set(FeatureIdent.CONTEXT_MENUS.toLowerCase(), {
name: 'Tabsets Context Menus on Websites',
description: 'Integrate more deeply with Tabsets by using context menus. This might be available automatically when using some other features.',
permissions: []
})
// text.set(FeatureIdent.CONTEXT_MENUS.toLowerCase(), {
// name: 'Tabsets Context Menus on Websites',
// description: 'Integrate more deeply with Tabsets by using context menus. This might be available automatically when using some other features.',
// permissions: []
// })
text.set(FeatureIdent.ENTITY_MANAGER.toLowerCase(), {
name: 'Entitiy Manager',
description: 'Define your own entities to manage',
Expand Down
20 changes: 15 additions & 5 deletions src/services/ChromeApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class ChromeApi {
if (chrome && chrome.contextMenus) {
chrome.contextMenus.removeAll(
() => {
chrome.contextMenus.create({id: 'tabset_extension', title: 'Tabset Extension', contexts: ['all']},
chrome.contextMenus.create({id: 'tabset_extension', title: 'Tabsets Extension', contexts: ['page']},
() => {
// chrome.contextMenus.create({
// id: 'open_tabsets_page',
Expand Down Expand Up @@ -187,8 +187,8 @@ class ChromeApi {
chrome.contextMenus.create({
id: 'save_to_currentTS',
parentId: 'tabset_extension',
title: 'Save to current Tabset',
contexts: ['all']
title: 'Save to current Tabset (' + useTabsStore().currentTabsetName + ')',
contexts: ['page']
})

//console.log("context menu", useWindowsStore().currentChromeWindows)
Expand All @@ -214,10 +214,20 @@ class ChromeApi {
}
console.debug(` > context menu: save_as_tabset for ${tabsStore.tabsets.size} tabset(s)`)
const allTabsets = [...tabsStore.tabsets.values()] as Tabset[]

if (allTabsets.length > 0) {
chrome.contextMenus.create({
id: 'separator',
parentId: 'tabset_extension',
type: 'separator',
contexts: ['page']
})
}

if (allTabsets.length > 15) {
const result = _(allTabsets)
.groupBy(o => (o.name && o.name.length > 0) ? o.name[0].toUpperCase() : ' ')
.map((tabsets, firstLetter) => ({ firstLetter, tabsets }))
.map((tabsets, firstLetter) => ({firstLetter, tabsets}))
.sortBy(r => r.firstLetter)
.value();

Expand All @@ -230,7 +240,7 @@ class ChromeApi {
})

_.forEach(_.sortBy(r.tabsets, ['name']), (ts: Tabset) => {
this.createSubmenu(ts,'save_as_tab_folder|' + r.firstLetter, ts.name)
this.createSubmenu(ts, 'save_as_tab_folder|' + r.firstLetter, ts.name)
})

})
Expand Down

0 comments on commit 7eb422c

Please sign in to comment.