diff --git a/.gitignore b/.gitignore index 8a41dc73..8e4c47f9 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ pids *.pid *.seed *.pid.lock +screenshots/ # Directory for instrumented libs generated by jscoverage/JSCover lib-cov @@ -69,3 +70,9 @@ typings/ extensionDirectory-build/index.css extensionDirectory-build/index.js extensionDirectory-build/payload.js + +# chrome store files +build.zip + +# Puppeteer store files +.cache/ \ No newline at end of file diff --git a/README.md b/README.md index bbbcf1ac..9c81b2ab 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ But equally important are the things it **does not** do: This tool was originally developed exclusively for use by VLA in their clincs in 2018. But as volunteer attorneys use the tool in clincs, they have started using it in their own practices as well. -- **Anyone with data access...** The extension can only be used by people who already have access to state criminal databases - the extension does not grant any data access itself. But the extension will work for anyone who has access to criminal dockets through [VT Courts Online](https://secure.vermont.gov/vtcdas/user) or [Vermont Judiciary Public Portal](https://publicportal.courts.vt.gov/Portal). +- **Anyone with data access...** The extension can only be used by people who already have access to state criminal databases - the extension does not grant any data access itself. But the extension will work for anyone who has access to criminal dockets through [VT Courts Online](https://secure.vermont.gov/vtcdas/user) or [Vermont Judiciary Public Portal](https://portal.vtcourts.gov/Portal). - **... but primarily attorneys.** Although anyone with data access can use this tool to generate petitions, they will need to be reviewed (and possibly corrected or modified) by an attorney familiar with expungement statutues. There are a lot of intracasies in expunging & sealing records and conflicts and inaccuracies in the official records that require expert review. diff --git a/civic.json b/civic.json index dee1773a..6665f3d0 100644 --- a/civic.json +++ b/civic.json @@ -6,7 +6,7 @@ "type": "Chrome Browser Extension", "homepage": "https://codeforbtv.github.io/expunge-vt/", "repository": "https://github.com/codeforbtv/expunge-vt", - "thumbnail": "https://codeforbtv.github.io/expunge-vt/extensionDirectory/images/icon_128.png", + "thumbnail": "https://codeforbtv.github.io/expunge-vt/extensionDirectory/images/icon_128x.png", "geography": [ "Vermont" ], diff --git a/clinicDocs/001_Notice of Appearance - pro se.pdf b/clinicDocs/001_Notice of Appearance - pro se.pdf old mode 100755 new mode 100644 diff --git a/clinicDocs/007_Motion to Expunge Non-Conviction - 7603 Nonstipulated.pdf b/clinicDocs/007_Motion to Expunge Non-Conviction - 7603 Nonstipulated.pdf old mode 100755 new mode 100644 diff --git a/clinicDocs/5119(g) Nonstipulated.pdf b/clinicDocs/5119(g) Nonstipulated.pdf old mode 100755 new mode 100644 diff --git a/clinicDocs/5119(g) Stipulated.pdf b/clinicDocs/5119(g) Stipulated.pdf old mode 100755 new mode 100644 diff --git a/clinicDocs/7602 NonStip.pdf b/clinicDocs/7602 NonStip.pdf old mode 100755 new mode 100644 diff --git a/clinicDocs/7602 Stipulated.pdf b/clinicDocs/7602 Stipulated.pdf old mode 100755 new mode 100644 diff --git a/clinicDocs/7603 stipulated.pdf b/clinicDocs/7603 stipulated.pdf old mode 100755 new mode 100644 diff --git a/extensionDirectory-build/background.js b/extensionDirectory-build/background.js deleted file mode 100644 index bdf7e942..00000000 --- a/extensionDirectory-build/background.js +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -'use strict'; - -chrome.runtime.onInstalled.addListener(function () { - chrome.declarativeContent.onPageChanged.removeRules(undefined, function () { - chrome.declarativeContent.onPageChanged.addRules([ - { - conditions: [ - new chrome.declarativeContent.PageStateMatcher({ - // Allow opening popup on all domains. (Overrides following matchers.) - pageUrl: { hostContains: '' }, - }), - new chrome.declarativeContent.PageStateMatcher({ - // Code for BTV has demo dockets for practicing - pageUrl: { hostContains: 'codeforbtv.org' }, - }), - new chrome.declarativeContent.PageStateMatcher({ - // Odyssey site - pageUrl: { hostContains: 'publicportal.courts.vt.gov' }, - }), - new chrome.declarativeContent.PageStateMatcher({ - // Odyssey logout confirmation page - pageUrl: { hostContains: 'odysseyidentityprovider.tylerhost.net' }, - }), - new chrome.declarativeContent.PageStateMatcher({ - pageUrl: { urlContains: 'chrome-extension://' }, - }), - new chrome.declarativeContent.PageStateMatcher({ - // Activate extention on new tabs (helpful for navigating to Odyssey) - pageUrl: { urlContains: 'chrome://newtab/' }, - }), - ], - actions: [new chrome.declarativeContent.ShowPageAction()], - }, - ]); - }); -}); - -chrome.runtime.onStartup.addListener(function () { - chrome.storage.local.clear(); -}); diff --git a/extensionDirectory-build/images/VLA_logo-200-97px.png b/extensionDirectory-build/images/VLA_logo-200-97px.png deleted file mode 100644 index 7df4562c..00000000 Binary files a/extensionDirectory-build/images/VLA_logo-200-97px.png and /dev/null differ diff --git a/extensionDirectory-build/images/code4BTV-logo-300-300.png b/extensionDirectory-build/images/code4BTV-logo-300-300.png deleted file mode 100644 index b3817eb5..00000000 Binary files a/extensionDirectory-build/images/code4BTV-logo-300-300.png and /dev/null differ diff --git a/extensionDirectory-build/images/icon_128.png b/extensionDirectory-build/images/icon_128.png deleted file mode 100644 index 2554e541..00000000 Binary files a/extensionDirectory-build/images/icon_128.png and /dev/null differ diff --git a/extensionDirectory-build/images/icon_16.png b/extensionDirectory-build/images/icon_16.png deleted file mode 100644 index 2f033d67..00000000 Binary files a/extensionDirectory-build/images/icon_16.png and /dev/null differ diff --git a/extensionDirectory-build/images/icon_32.png b/extensionDirectory-build/images/icon_32.png deleted file mode 100644 index b979b67d..00000000 Binary files a/extensionDirectory-build/images/icon_32.png and /dev/null differ diff --git a/extensionDirectory-build/images/icon_48.png b/extensionDirectory-build/images/icon_48.png deleted file mode 100644 index db610253..00000000 Binary files a/extensionDirectory-build/images/icon_48.png and /dev/null differ diff --git a/extensionDirectory-build/manage-counts.html b/extensionDirectory-build/manage-counts.html deleted file mode 100644 index 98cef6f2..00000000 --- a/extensionDirectory-build/manage-counts.html +++ /dev/null @@ -1,261 +0,0 @@ - - - - Add and Edit Counts - - - - - - - - - -
-
-
-

Counts for {{petitioner.name}}

-
- - - - View Petitions - -
-
-
- -
-

Petitioner Information

- -
- - -
- -
- -
-
- -
-

- Count {{index + 1}}: - {{group.description}} -

-

{{group.docketNum}} {{group.county | toCountyCode}}

- -
-
- - -
- - - - -
- - -
- -
- -
- - -
- - - -
- -
- - - -
-
- -
- -
- - - - - -
- -

- {{group.titleNum || '-'}} V.S.A. § {{group.sectionNum || - '-'}} ({{group.offenseClass || '-'}}) -

- -
- -
- -
- -
-
- - - - diff --git a/extensionDirectory-build/manifest.json b/extensionDirectory-build/manifest.json deleted file mode 100644 index 7884ead7..00000000 --- a/extensionDirectory-build/manifest.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "ExpungeVT!", - "version": "4.1.1", - "description": "Co-counsel Edition - Expunge Harder. Expunge Smarter.", - "permissions": [ - "storage", - "declarativeContent", - "activeTab", - "downloads" - ], - "background": { - "service_worker": "background.js" - }, - "action": { - "default_icon": { - "16": "images/icon_16.png", - "32": "images/icon_32.png", - "48": "images/icon_48.png", - "128": "images/icon_128.png" - }, - "default_popup": "popup.html" - }, - "icons": { - "16": "images/icon_16.png", - "32": "images/icon_32.png", - "48": "images/icon_48.png", - "128": "images/icon_128.png" - }, - "manifest_version": 3, - "content_security_policy": { - "extension_pages": "script-src 'self'; object-src 'self'" - }, - "externally_connectable": { - "ids": [ - "*" - ] - } -} \ No newline at end of file diff --git a/extensionDirectory-build/payload.js b/extensionDirectory-build/payload.js deleted file mode 100644 index c06b6718..00000000 --- a/extensionDirectory-build/payload.js +++ /dev/null @@ -1,36 +0,0 @@ -(() => { - // payload.js - docketData = { - domain: window.location.hostname, - url: window.location.href, - rawDocket: null, - savedDocket: false - }; - switch (docketData.domain) { - case "publicportal.courts.vt.gov": - case "htmlpreview.github.io": { - docketData.rawDocket = document.getElementById("roa-content").innerHTML; - break; - } - } - if (docketData.url.startsWith("file")) { - let title = document.title; - docketData.rawDocket = document.getElementById("roa-content").innerHTML; - if (title === "ExpungeVT Case Record") { - docketData.domain = "expungeVtRecord"; - } else { - answer = window.confirm("This does not look like a case file. Are you sure you want to proceed?"); - if (answer) { - docketData.domain = "localhost"; - } else { - docketData.rawDocket = null; - } - } - } - var answer; - if (docketData.rawDocket !== null) { - chrome.runtime.sendMessage(docketData); - } else { - alert("Uh oh. ExpungeVT doesn't support this site. If you are trying to load a case, open the file from your computer so it opens in Chrome and follow the instructions from there. You may need to right click or ctrl+click (on Mac) on the file to open the file in Chrome."); - } -})(); diff --git a/extensionDirectory-build/popup.html b/extensionDirectory-build/popup.html deleted file mode 100644 index e35b4c25..00000000 --- a/extensionDirectory-build/popup.html +++ /dev/null @@ -1,321 +0,0 @@ - - - - - - - - - - -
-
-
- Home - Home -
- -
- - - -
-

-

- -

- Vermont Judiciary Public Portal - -

-
- -

Terms & Conditions

-
- -
-
-
-
-
- -
-
-

Name:

- -
-
-

DOB:

- -
-
-

Address:

- -
-
-

Email:

- -
-
-
- - Home - Home -
-
-
- - - -
-
- Closing all petition windows (without closing browser) may help - stop unexpected behavior. Save your file in the petitions screen - before closing the browser, and try restarting the browser. If you - are still experiencing issues, contact - Code for BTV for assistance. -
-
-
-
-
- - - -
-
- -
- - -
-
-
-
- -
- -
-
-
- -
-
-
- -
-
-

County: {{count.county}}

- -

- Statute: {{count.titleNum}} V.S.A. -  ({{count.offenseClass}}) -

-

- Disposition: {{count.offenseDisposition}} - Check Docket Sheet -

-
-
- Offense Date:
-  Not Entered - {{count.allegedOffenseDate | dateFormatSimple}} - ({{count.allegedOffenseDate | - stringAgeInYearsAtDate(saved.defDOB)}}) -
-
- Arrest/Citation Date:
-  Not Entered - {{count.arrestCitationDate | dateFormatSimple}} - ({{count.arrestCitationDate | - stringAgeInYearsAtDate(saved.defDOB)}}) -
-
- Disposition Date:
-  Pending - {{count.dispositionDate | dateFormatSimple}} - ({{count.dispositionDate | - stringAgeInYearsAtDate(saved.defDOB)}}) -
-
-
-
-
- -
-
-

- ExpungeVT is a Code for BTV product developed in coordination with - Vermont Legal Aid. - Reset Settings -

-
-
-
- - - diff --git a/extensionDirectory/.mocharc.js b/extensionDirectory/.mocharc.js new file mode 100644 index 00000000..099acc01 --- /dev/null +++ b/extensionDirectory/.mocharc.js @@ -0,0 +1,4 @@ +module.exports = { + 'watch-files': ['**/*spec.js'], + 'timeout': 0, +} \ No newline at end of file diff --git a/extensionDirectory/.puppeteerrc.cjs b/extensionDirectory/.puppeteerrc.cjs new file mode 100644 index 00000000..bfb3194d --- /dev/null +++ b/extensionDirectory/.puppeteerrc.cjs @@ -0,0 +1,5 @@ +const {join} = require('path'); + +module.exports = { + cacheDirectory: join(__dirname, '.cache', 'puppeteer'), +}; \ No newline at end of file diff --git a/extensionDirectory/background.js b/extensionDirectory/background.js index bdf7e942..798dfe2e 100644 --- a/extensionDirectory/background.js +++ b/extensionDirectory/background.js @@ -21,6 +21,10 @@ chrome.runtime.onInstalled.addListener(function () { // Odyssey site pageUrl: { hostContains: 'publicportal.courts.vt.gov' }, }), + new chrome.declarativeContent.PageStateMatcher({ + // Odyssey site + pageUrl: { hostContains: 'portal.vtcourts.gov' }, + }), new chrome.declarativeContent.PageStateMatcher({ // Odyssey logout confirmation page pageUrl: { hostContains: 'odysseyidentityprovider.tylerhost.net' }, diff --git a/extensionDirectory/build.js b/extensionDirectory/build.js index a980efc4..a92d8d03 100644 --- a/extensionDirectory/build.js +++ b/extensionDirectory/build.js @@ -1,24 +1,41 @@ const vuePlugin = require("esbuild-plugin-vue3") const esbuild = require('esbuild'); -const copyStaticFiles = require('esbuild-copy-static-files') +const exec = require('child_process').exec; +const { copyFileSync, cpSync } = require('fs'); esbuild.build({ - entryPoints: ['background.js', 'filings.js', 'index.js', 'payload.js', 'saveFile.js'], + entryPoints: ['background.js', 'store.mjs', 'index.js', 'manage-counts.js', 'payload.js', 'filings.js', 'saveFile.js'], bundle: true, outdir: 'build/', plugins: [vuePlugin(), - copyStaticFiles({ - src: './static', - dest: './build' - })], + { + name: "postbuild", + setup(build) { + build.onEnd((result) => { + const staticDir = './static'; + const packageJson = './package.json'; + const buildDir = './build/'; + const productionBuild = "npm install --omit=dev"; + cpSync(staticDir, buildDir, { + force: true, + recursive: true + }); + copyFileSync(packageJson, buildDir + packageJson); + exec(productionBuild, + { + cwd: buildDir + }) + }) + } + }], loader: { - '.eot': 'dataurl', - '.png': 'file', - '.ttf': 'dataurl', - '.svg': 'dataurl', - '.woff': 'dataurl', - '.woff2': 'dataurl', - }, + '.eot': 'dataurl', + '.png': 'file', + '.ttf': 'dataurl', + '.svg': 'dataurl', + '.woff': 'dataurl', + '.woff2': 'dataurl', + }, define: { "process.env.NODE_ENV": JSON.stringify("development"), }, diff --git a/extensionDirectory/components.js b/extensionDirectory/components.js deleted file mode 100644 index 07df41b8..00000000 --- a/extensionDirectory/components.js +++ /dev/null @@ -1,266 +0,0 @@ -//Vue Components -import Vue from 'vue/dist/vue'; -import moment from 'moment'; - -Vue.component('docket-caption', { - template: `
-
-

STATE OF VERMONT,

-

Respondent

-

v.

-

{{name}},

-

Petitioner

-
-
- `, - props: ['name'], -}); - -Vue.component('filing-nav', { - template: `
-
    - -
    - -
-
- `, - filters: { - navTitleFilter(txt) { - const trimStip = txt.startsWith('Stipulated ') - ? txt.substring(11) + ' (Stip)' - : txt; - const trimPetion = trimStip.startsWith('Petition to ') - ? trimStip.substring(12) - : trimStip; - return trimPetion; - }, - /** - * The subtitle for each petition in the nav varies depending on several factors. - * @todo Finish selecting the best subtitles after all other PRs are merged in - * @param {object} filing All the info for the current filing - */ - petitionCountFilter(filing) { - // NoA subtitle - if (filing.type == 'NoA') { - // default (ungrouped): "####-##-## (N Counts)" - if (!this.app.groupCounts && !this.app.groupNoas) { - return `${filing.docketNums[0].num} (${filing.numCountsString})`; - } - // two cases, same text: "N Dockets (N Counts)" - // 1. groupNoas only - // 2. groupCounts & groupNoas - else { - return `${filing.docketNums.length} Dockets (${filing.numCountsString})`; - } - } - // Petition subtitles - else { - // default (ungrouped): "N Counts" (or blank if counts == 1) - if (!this.app.groupCounts && !this.app.groupNoas) { - return filing.counts.length > 1 - ? `${filing.counts.length} Counts` - : ''; - } - // groupCounts: "####-##-##" - else if (this.app.groupNoas && !this.app.groupCounts) { - return `${filing.docketNums[0].num}`; - } - // groupCounts: "N Dockets (N Counts)" - else if (this.app.groupNoas && this.app.groupCounts) { - return `${filing.docketNums.length} Dockets (${filing.numCountsString})`; - } - } - }, - }, - props: ['filings'], -}); - -Vue.component('filing-footer', { - template: `
-

Stipulated and agreed this         day of                             , 20      .

-
-

State's Attorney/Attorney General

-
-
- - `, - props: ['stipulated'], -}); - -Vue.component('filing-dated-city', { - template: ` -

- Dated in the city of , - on the day of , - in the month of ,
- in the year 20. -

- `, -}); - -Vue.component('pills-row', { - template: `
- - Mis - - - Fel - - - - Surcharge - -
- `, - props: ['count', 'dob'], - methods: { - decimalAgeInYears: function (value) { - if (!value) return ''; - if (!this.dob) return ''; - let fromTime = moment(value).diff(moment(this.dob)); - let duration = moment.duration(fromTime); - return (duration.asDays() / 365.25).toFixed(2); - }, - dispositionTrimmer: function (dispo) { - let trimmedDisp = ''; - if (dispo.length > 15) { - trimmedDisp = dispo.substring(0, 15) + '...'; - } else { - trimmedDisp = dispo; - } - return trimmedDisp; - }, - }, -}); - -/* TODO: implement or remove - * A seemingly useful component that returns a plain-english explaination of a given filing type. - */ -Vue.component('filing-type-heading', { - methods: { - getCheckoutPhrases(fType) { - checkoutPhrases = [ - { - type: 'ExC', - stipType: 'StipExC', - phrase: - 'The following are prior conviction(s) for which we prepared a petition to expunge:', - }, - { - type: 'ExNC', - stipType: 'StipExNC', - phrase: - 'The following are cases that DID NOT result in a conviction and we prepared a petition to expunge:', - }, - { - type: 'ExNCrim', - stipType: 'StipExNCrim', - phrase: - 'The following are counts that are no longer crimes and we prepared a petition to expunge:', - }, - { - type: 'SC', - stipType: 'StipSC', - phrase: - 'The following are prior convictions and we prepared a petition to seal:', - }, - { - type: 'SDui', - stipType: 'StipSDui', - phrase: - 'The following is a prior DUI conviction and we filed a petition to seal:', - }, - ]; - - for (i = 0; i < checkoutPhrases.length; i++) { - if ( - checkoutPhrases[i]['type'] == fType || - checkoutPhrases[i]['stipType'] == fType - ) { - return checkoutPhrases[i]['phrase']; - } - } - }, - }, - template: ` -
-

- {{getCheckoutPhrases(heading)}} -

-
- `, - props: ['heading'], -}); - -Vue.component('checkout-offense-row', { - methods: { - isStipulated: function (filingType) { - return ( - filingType == 'StipExC' || - filingType == 'StipExNC' || - filingType == 'StipExNCrim' || - filingType == 'StipSC' || - filingType == 'StipSDui' - ); - }, - dateFormatSimple: function (value) { - if (!value) return ''; - return moment(value).format('MM/DD/YYYY'); - }, - toCountyCode: function (value) { - if (!value) return ''; - return countyCodeFromCounty(value); - }, - }, - template: ` - - -   - - {{filing.description}} - -
-
Offense: {{dateFormatSimple(filing.allegedOffenseDate)}}
- -
Arrest: {{dateFormatSimple(filing.arrestCitationDate)}}
- -
Disposed: {{dateFormatSimple(filing.dispositionDate)}}
- -
- - {{filing.offenseDisposition}} - {{filing.docketNum}} {{toCountyCode(filing.county)}} - `, - props: ['filing'], -}); \ No newline at end of file diff --git a/extensionDirectory/components/checkout-offense-row.vue b/extensionDirectory/components/checkout-offense-row.vue index a2601ed2..0ff48b35 100644 --- a/extensionDirectory/components/checkout-offense-row.vue +++ b/extensionDirectory/components/checkout-offense-row.vue @@ -1,4 +1,6 @@ @@ -69,8 +69,8 @@ export default { {{group.county}}
diff --git a/extensionDirectory/components/filing-type-heading.vue b/extensionDirectory/components/filing-type-heading.vue index cc22bef4..27ff7a86 100644 --- a/extensionDirectory/components/filing-type-heading.vue +++ b/extensionDirectory/components/filing-type-heading.vue @@ -25,7 +25,13 @@ export default { type: "SC", stipType: "StipSC", phrase: - "The following are prior convictions and we prepared a petition to seal:", + "The following are prior convictions from under the age of 25 and we prepared a petition to seal:", + }, + { + type: 'SCAdult', + stipType: 'StipSCAdult', + phrase: + 'The following are prior convictions and we prepared a petition to seal:', }, { type: "SDui", @@ -33,6 +39,12 @@ export default { phrase: "The following is a prior DUI conviction and we filed a petition to seal:", }, + { + type: 'NegOp', + stipType: 'StipNegOp', + phrase: + 'The following is a prior Negligent Operation conviction and we filed a petition to seal:', + }, ]; for (i = 0; i < checkoutPhrases.length; i++) { diff --git a/extensionDirectory-build/filings.html b/extensionDirectory/components/filings.vue similarity index 61% rename from extensionDirectory-build/filings.html rename to extensionDirectory/components/filings.vue index c733bd10..b7d9f47e 100644 --- a/extensionDirectory-build/filings.html +++ b/extensionDirectory/components/filings.vue @@ -1,1443 +1,2179 @@ - - - - Petitions - - - - - - - - - -
- - - - - - - - -
- - - - - + + + diff --git a/extensionDirectory/components/manage-counts.vue b/extensionDirectory/components/manage-counts.vue new file mode 100644 index 00000000..3dc3026d --- /dev/null +++ b/extensionDirectory/components/manage-counts.vue @@ -0,0 +1,519 @@ +filingNav + + + diff --git a/extensionDirectory/components/pills-row.vue b/extensionDirectory/components/pills-row.vue index 43f10e02..ac0bc226 100644 --- a/extensionDirectory/components/pills-row.vue +++ b/extensionDirectory/components/pills-row.vue @@ -1,5 +1,8 @@