Skip to content

Commit 01087c6

Browse files
authored
Add ability to fully edit a source (#90)
* Add new component * Replaced alert editor with full-screen modal * Error checking * Improve UI for editing source and pollingFrequency * Display fixes * Version bump * url macro
1 parent f6ee20d commit 01087c6

File tree

14 files changed

+235
-59
lines changed

14 files changed

+235
-59
lines changed

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
applicationId "com.frostcube.justrss"
88
minSdkVersion rootProject.ext.minSdkVersion
99
targetSdkVersion rootProject.ext.targetSdkVersion
10-
versionCode 34
11-
versionName "3.4.1"
10+
versionCode 35
11+
versionName "3.5.0"
1212
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1313
aaptOptions {
1414
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.

ios/App/App.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@
353353
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.productivity";
354354
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
355355
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
356-
MARKETING_VERSION = 3.4.1;
356+
MARKETING_VERSION = 3.5.0;
357357
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
358358
PRODUCT_BUNDLE_IDENTIFIER = com.frostcube.justrss;
359359
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -376,7 +376,7 @@
376376
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.productivity";
377377
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
378378
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
379-
MARKETING_VERSION = 3.4.1;
379+
MARKETING_VERSION = 3.5.0;
380380
PRODUCT_BUNDLE_IDENTIFIER = com.frostcube.justrss;
381381
PRODUCT_NAME = "$(TARGET_NAME)";
382382
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "just-rss",
3-
"version": "3.4.1",
3+
"version": "3.5.0",
44
"author": "FrostCube",
55
"homepage": "https://frostcube.com/",
66
"scripts": {

src/app/lib/macros.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// AngularJS URL Validation
2+
export const URL_REGEX = /^[A-Za-z][A-Za-z\d.+-]*:\/*(?:\w+(?::\w+)?@)?[^\s/]+(?::\d+)?(?:\/[\w#!:.?+=&%@\-/]*)?$/;

src/app/services/settings.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class SettingsService {
2727
compressedFeed: false,
2828
locale: 'en-AU',
2929
retrievalTimeout: 5000, // 5 seconds
30-
defaultPollingFrequency: 0, // Unlimited
30+
defaultPollingFrequency: 60, // 1 minute
3131
maxFeedLength: 10,
3232
mutedWords: [],
3333
highlightedWords: []

src/app/services/sources.service.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,14 @@ export class SourcesService {
9999
public setSource(feedUrl: string, updatedDict: IFeedDict) {
100100
const index = this._feedList.findIndex(feed => feed.url === feedUrl);
101101
console.log('[SourcesService] Updating feed: ' + feedUrl);
102-
this._feedList[index] = updatedDict;
102+
if (index > -1) {
103+
this._feedList[index] = updatedDict;
104+
// Persist the updated feed list
105+
this.storageService.set(STORAGE_FEED_LIST, this._feedList);
106+
} else {
107+
console.warn('[SourcesService] setSource: feed not found, adding as new feed: ' + feedUrl);
108+
this.addSource(updatedDict);
109+
}
103110
}
104111

105112
public getSource(feedUrl: string): IFeedDict {

src/app/settings/settings.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ <h1>Preferences</h1>
4343
<ion-item>
4444
<ion-select label="Default Polling Frequency"
4545
[(ngModel)]="defaultPollingFrequency" (ionChange)="update()">
46-
<ion-select-option value="0">Unlimited (Default)</ion-select-option>
47-
<ion-select-option value="60">1 minute</ion-select-option>
46+
<ion-select-option value="0">Unlimited</ion-select-option>
47+
<ion-select-option value="60">1 minute (Default)</ion-select-option>
4848
<ion-select-option value="600">10 minutes</ion-select-option>
4949
<ion-select-option value="3600">1 hour</ion-select-option>
5050
</ion-select>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<ion-header>
2+
<ion-toolbar>
3+
<ion-buttons slot="start">
4+
<ion-button (click)="cancel()">Cancel</ion-button>
5+
</ion-buttons>
6+
<ion-title>Edit Source</ion-title>
7+
<ion-buttons slot="end">
8+
<ion-button color="primary" (click)="save()" [disabled]="form.invalid">Save</ion-button>
9+
</ion-buttons>
10+
</ion-toolbar>
11+
</ion-header>
12+
13+
<ion-content class="ion-padding">
14+
<form [formGroup]="form">
15+
<ion-item>
16+
<ion-label position="stacked">Title</ion-label>
17+
<ion-input formControlName="title" type="text"></ion-input>
18+
</ion-item>
19+
<div *ngIf="form.get('title')?.touched && form.get('title')?.invalid" class="ion-padding-start ion-text-danger">Title is required.</div>
20+
21+
<ion-item>
22+
<ion-label position="stacked">URL</ion-label>
23+
<ion-input formControlName="url" type="url" inputmode="url"></ion-input>
24+
</ion-item>
25+
<div *ngIf="form.get('url')?.touched && form.get('url')?.invalid" class="ion-padding-start ion-text-danger">Please enter a valid URL.</div>
26+
27+
<ion-item>
28+
<ion-label position="stacked">Description</ion-label>
29+
<ion-textarea formControlName="description"></ion-textarea>
30+
</ion-item>
31+
32+
<ion-item>
33+
<ion-label position="stacked">Polling Frequency (seconds)</ion-label>
34+
<ion-select formControlName="pollingFrequency">
35+
<ion-select-option [value]="0">Unlimited</ion-select-option>
36+
<ion-select-option [value]="60">1 minute (Default)</ion-select-option>
37+
<ion-select-option [value]="600">10 minutes</ion-select-option>
38+
<ion-select-option [value]="3600">1 hour</ion-select-option>
39+
</ion-select>
40+
</ion-item>
41+
42+
<ion-item>
43+
<ion-label>Podcast</ion-label>
44+
<ion-toggle slot="end" formControlName="podcast"></ion-toggle>
45+
</ion-item>
46+
47+
<ion-item>
48+
<ion-label position="stacked">Tags (comma-separated)</ion-label>
49+
<ion-input formControlName="tags" type="text"></ion-input>
50+
</ion-item>
51+
</form>
52+
</ion-content>

src/app/source-edit/source-edit.component.scss

Whitespace-only changes.

0 commit comments

Comments
 (0)