Skip to content

Commit bb27a29

Browse files
authored
Merge pull request #3020 from StoDevX/event-urls-server
Move Event url extraction to ccc-server
2 parents 1fb64c1 + 74feb82 commit bb27a29

File tree

10 files changed

+7
-110
lines changed

10 files changed

+7
-110
lines changed

flow-typed/npm/get-urls_v7.x.x.js

Lines changed: 0 additions & 19 deletions
This file was deleted.

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@
105105
"bugsnag-react-native": "2.10.2",
106106
"delay": "4.0.1",
107107
"events": "3.0.0",
108-
"get-urls": "8.0.0",
109108
"glamorous-native": "1.4.0",
110109
"jsc-android": "224109.x.x",
111110
"keyword-search": "0.1.1",
@@ -152,7 +151,6 @@
152151
"tinycolor2": "1.4.1",
153152
"titlecase": "1.1.2",
154153
"url": "0.11.0",
155-
"whatwg-url": "7.0.0",
156154
"wordwrap": "1.0.0"
157155
},
158156
"devDependencies": {

source/app.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
// @flow
22

3-
// monkey-patches
4-
import './init/global--buffer'
5-
import './init/monkey-patch--url'
6-
73
// initialization
84
import './init/constants'
95
import './init/fetch'

source/init/global--buffer.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

source/init/monkey-patch--url.js

Lines changed: 0 additions & 26 deletions
This file was deleted.

source/views/calendar/calendar-util.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import {Platform, Alert, Linking, Share} from 'react-native'
44
import RNCalendarEvents from 'react-native-calendar-events'
5-
import getUrls from 'get-urls'
65
import type {EventType} from './types'
76
import {notify} from '@frogpond/analytics'
87
import {detailTimes} from './times'
@@ -91,12 +90,6 @@ async function requestCalendarAccess(): Promise<boolean> {
9190
return true
9291
}
9392

94-
export function getLinksFromEvent(event: EventType) {
95-
// Clean up returns, newlines, tabs, and misc symbols...
96-
// ...and search for links in the text
97-
return Array.from(getUrls(event.description))
98-
}
99-
10093
export function getTimes(event: EventType) {
10194
const {allDay, start, end} = detailTimes(event)
10295

source/views/calendar/event-detail.android.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {openUrl} from '@frogpond/open-url'
88
import {Card} from '../../components/card'
99
import * as c from '@frogpond/colors'
1010
import {ButtonCell} from '@frogpond/tableview'
11-
import {getLinksFromEvent, shareEvent, getTimes} from './calendar-util'
11+
import {shareEvent, getTimes} from './calendar-util'
1212
import {AddToCalendar} from '../../components/add-to-calendar'
1313
import {ListFooter} from '@frogpond/lists'
1414

@@ -84,7 +84,7 @@ export class EventDetail extends React.PureComponent<Props> {
8484
<MaybeCard content={event.location} header="Location" />
8585
<MaybeCard content={event.description} header="Description" />
8686

87-
<Links urls={getLinksFromEvent(event)} />
87+
<Links urls={event.links} />
8888

8989
<AddToCalendar
9090
event={event}

source/views/calendar/event-detail.ios.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type {TopLevelViewPropsType} from '../types'
77
import {ShareButton} from '../../components/nav-buttons'
88
import {openUrl} from '@frogpond/open-url'
99
import {ListFooter} from '@frogpond/lists'
10-
import {getLinksFromEvent, shareEvent, getTimes} from './calendar-util'
10+
import {shareEvent, getTimes} from './calendar-util'
1111
import {AddToCalendar} from '../../components/add-to-calendar'
1212

1313
const styles = StyleSheet.create({
@@ -31,11 +31,9 @@ function MaybeSection({header, content}: {header: string, content: string}) {
3131
}
3232

3333
function Links({header, event}: {header: string, event: EventType}) {
34-
const links = getLinksFromEvent(event)
35-
36-
return links.length ? (
34+
return event.links.length ? (
3735
<Section header={header}>
38-
{links.map(url => (
36+
{event.links.map(url => (
3937
<Cell
4038
key={url}
4139
accessory="DisclosureIndicator"

source/views/calendar/types.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export type EventType = {
2424
startTime: moment,
2525
endTime: moment,
2626
isOngoing: boolean,
27+
links: Array<string>,
2728
config: {
2829
startTime: boolean,
2930
endTime: boolean,

yarn.lock

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3259,13 +3259,6 @@ get-stream@^3.0.0:
32593259
version "3.0.0"
32603260
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14"
32613261

3262-
3263-
version "8.0.0"
3264-
resolved "https://registry.yarnpkg.com/get-urls/-/get-urls-8.0.0.tgz#62a0225cf96e2336b57e5041781f015141f81511"
3265-
dependencies:
3266-
normalize-url "^3.3.0"
3267-
url-regex "^4.0.0"
3268-
32693262
get-value@^2.0.3, get-value@^2.0.6:
32703263
version "2.0.6"
32713264
resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28"
@@ -3666,10 +3659,6 @@ invert-kv@^1.0.0:
36663659
version "1.0.0"
36673660
resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6"
36683661

3669-
ip-regex@^1.0.1:
3670-
version "1.0.3"
3671-
resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-1.0.3.tgz#dc589076f659f419c222039a33316f1c7387effd"
3672-
36733662
is-accessor-descriptor@^0.1.6:
36743663
version "0.1.6"
36753664
resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6"
@@ -5323,10 +5312,6 @@ normalize-path@^2.0.1, normalize-path@^2.1.1:
53235312
dependencies:
53245313
remove-trailing-separator "^1.0.1"
53255314

5326-
normalize-url@^3.3.0:
5327-
version "3.3.0"
5328-
resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-3.3.0.tgz#b2e1c4dc4f7c6d57743df733a4f5978d18650559"
5329-
53305315
npm-bundled@^1.0.1:
53315316
version "1.0.5"
53325317
resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.5.tgz#3c1732b7ba936b3a10325aef616467c0ccbcc979"
@@ -7172,10 +7157,6 @@ [email protected]:
71727157
version "1.1.2"
71737158
resolved "https://registry.yarnpkg.com/titlecase/-/titlecase-1.1.2.tgz#78113d1108086b8326331a3247dea8f5a49ea853"
71747159

7175-
tlds@^1.187.0:
7176-
version "1.203.1"
7177-
resolved "https://registry.yarnpkg.com/tlds/-/tlds-1.203.1.tgz#4dc9b02f53de3315bc98b80665e13de3edfc1dfc"
7178-
71797160
tmp@^0.0.33:
71807161
version "0.0.33"
71817162
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"
@@ -7223,7 +7204,7 @@ tough-cookie@>=2.3.3, tough-cookie@^2.2.0, tough-cookie@^2.3.3, tough-cookie@~2.
72237204
psl "^1.1.24"
72247205
punycode "^1.4.1"
72257206

7226-
tr46@^1.0.0, tr46@^1.0.1:
7207+
tr46@^1.0.0:
72277208
version "1.0.1"
72287209
resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09"
72297210
dependencies:
@@ -7335,13 +7316,6 @@ urix@^0.1.0:
73357316
version "0.1.0"
73367317
resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72"
73377318

7338-
url-regex@^4.0.0:
7339-
version "4.1.1"
7340-
resolved "https://registry.yarnpkg.com/url-regex/-/url-regex-4.1.1.tgz#a5617b22e15e26dac57ce74c3f52088bcdfec995"
7341-
dependencies:
7342-
ip-regex "^1.0.1"
7343-
tlds "^1.187.0"
7344-
73457319
url-template@^2.0.8:
73467320
version "2.0.8"
73477321
resolved "https://registry.yarnpkg.com/url-template/-/url-template-2.0.8.tgz#fc565a3cccbff7730c775f5641f9555791439f21"
@@ -7448,14 +7422,6 @@ whatwg-url-compat@~0.6.5:
74487422
dependencies:
74497423
tr46 "~0.0.1"
74507424

7451-
7452-
version "7.0.0"
7453-
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.0.0.tgz#fde926fa54a599f3adf82dff25a9f7be02dc6edd"
7454-
dependencies:
7455-
lodash.sortby "^4.7.0"
7456-
tr46 "^1.0.1"
7457-
webidl-conversions "^4.0.2"
7458-
74597425
whatwg-url@^6.3.0:
74607426
version "6.4.0"
74617427
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.4.0.tgz#08fdf2b9e872783a7a1f6216260a1d66cc722e08"

0 commit comments

Comments
 (0)