Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 202 -fix css issue #209

Merged
merged 3 commits into from
Jul 3, 2024
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
6 changes: 1 addition & 5 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
const createFilters = require('./lib/createFilters')
const populateUrlMetadata = require('./lib/populateUrlMetadata')

var token = ''
var repoList = []
var intervalIds = []
Expand Down Expand Up @@ -42,7 +39,6 @@ function initializeExtension() {
}

intervalIds.forEach(clearInterval)

saveAppliedFilters({ currentRepo, issueNumber, organization, url })

const kaminoButton = $(Handlebars.templates.button().replace(/(\r\n|\n|\r)/gm, ''))
Expand Down Expand Up @@ -120,7 +116,7 @@ function saveAppliedFilters(urlMetadata) {
filters: [],
},
(item) => {
const filters = createFilters(newFilter, item)
const { filters, changed } = createFilters(newFilter, item)

// only save if changed, otherwise the max quota per minute will be exceeded throwing errors
if (changed) {
Expand Down
7 changes: 4 additions & 3 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -213,19 +213,20 @@ a {
display: none;
}

.open {
display: inline;
.sidebar-kamino .open {
display: block;
}

button.close {
-webkit-appearance: none;
appearance: none;
padding: 0;
cursor: pointer;
background: 0 0;
border: 0;
}

.close {
.modal-header .close {
float: right;
font-size: 21px;
font-weight: 700;
Expand Down
4 changes: 2 additions & 2 deletions lib/createFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function createFilters(newFilter, item) {
item.filters.push(newFilter)
}

return item.filters
return { filters: item.filters, changed }
}

module.exports = createFilters
module.exports = createFilters;
2 changes: 1 addition & 1 deletion lib/populateUrlMetadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ function populateUrlMetadata(href) {
return { error: 'Cannot parse this url' }
}

module.exports = populateUrlMetadata
module.exports = populateUrlMetadata;
22 changes: 19 additions & 3 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,28 @@
{
"matches": ["*://github.com/*/*/issues"],
"exclude_matches": ["*://github.com/*/*/issues/*"],
"js": ["./jquery/jquery-3.6.0.min.js", "./handlebars.runtime.min-v4.7.7.js", "./batch.js", "./template.js"],
"js": [
"./jquery/jquery-3.6.0.min.js",
"./handlebars.runtime.min-v4.7.7.js",
"./lib/populateUrlMetadata.js",
"./lib/createFilters.js",
"./batch.js",
"./template.js"
],
"css": ["./css/style.css"],
"run_at": "document_end"
},
{
"matches": ["*://github.com/*/*/issues/*"],
"exclude_matches": ["*://github.com/*/*/issues"],
"js": ["./jquery/jquery-3.6.0.min.js", "./handlebars.runtime.min-v4.7.7.js", "./app.js", "./template.js"],
"js": [
"./jquery/jquery-3.6.0.min.js",
"./handlebars.runtime.min-v4.7.7.js",
"./lib/populateUrlMetadata.js",
"./lib/createFilters.js",
"./app.js",
"./template.js"
],
"css": ["./css/style.css"],
"run_at": "document_end"
}
Expand All @@ -28,7 +42,7 @@
"options_page": "options.html",
"permissions": ["tabs", "background", "scripting", "storage", "webNavigation"],
"host_permissions": ["*://github.com/*"],
"version": "4.0.0",
"version": "4.0.1",
"web_accessible_resources": [
{
"resources": [
Expand All @@ -38,6 +52,8 @@
"./css/options.css",
"jquery/jquery-3.6.0.min.js",
"handlebars.runtime.min-v4.7.7.js",
"lib/populateUrlMetadata.js",
"lib/createFilters.js",
"template.js",
"app.js",
"options.html",
Expand Down
9 changes: 6 additions & 3 deletions tests/createFilters.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ describe('createFilter', () => {
],
}

const filters = createFilters(newFilter, existingFilters)
const {changed, filters} = createFilters(newFilter, existingFilters)
expect(filters).toHaveLength(2)
expect(changed).toBeTruthy()
expect(filters[1].filter).toEqual('test-filter')
})

Expand All @@ -40,8 +41,9 @@ describe('createFilter', () => {
],
}

const filters = createFilters(newFilter, existingFilters)
const {changed, filters} = createFilters(newFilter, existingFilters)
expect(filters).toHaveLength(1)
expect(changed).toBeTruthy()
expect(filters[0].filter).toEqual('test-filter')
})

Expand All @@ -62,8 +64,9 @@ describe('createFilter', () => {
],
}

const filters = createFilters(newFilter, existingFilters)
const {changed, filters} = createFilters(newFilter, existingFilters)
expect(filters).toHaveLength(1)
expect(changed).toEqual(false)
expect(filters[0].filter).toEqual('test-filter')
})
})
Loading