Skip to content

Commit

Permalink
Migrate Core Data changes to 126 and re-add rawFeatures
Browse files Browse the repository at this point in the history
  • Loading branch information
chipsnyder committed Jun 16, 2021
1 parent 68ea549 commit 3c9c396
Show file tree
Hide file tree
Showing 10 changed files with 1,784 additions and 365 deletions.
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ abstract_target 'Apps' do
## Gutenberg (React Native)
## =====================
##
gutenberg :tag => 'v1.56.0-alpha1'
gutenberg :commit => '074f93540c9b953c8a1a8089a9544b4a9b443b9c'

## Third party libraries
## =====================
Expand Down
184 changes: 95 additions & 89 deletions Podfile.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ extension BlockEditorSettings {
///
@NSManaged public var rawStyles: String?

/// Stores the raw JSON string that comes from the Global Styles Setting Request.
///
@NSManaged public var rawFeatures: String?

/// Stores a set of attributes describing values that are represented with arrays in the API request.
/// Available types are defined in `BlockEditorSettingElementTypes`
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ extension BlockEditorSettings {
self.lastUpdated = Date()
self.checksum = remoteSettings.checksum
self.rawStyles = remoteSettings.rawStyles
self.rawFeatures = remoteSettings.rawFeatures

var parsedElements = Set<BlockEditorSettingElement>()

remoteSettings.colors?.enumerated().forEach({ (index, color) in
Expand Down
2 changes: 1 addition & 1 deletion WordPress/Classes/WordPress.xcdatamodeld/.xccurrentversion
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<plist version="1.0">
<dict>
<key>_XCCurrentVersionName</key>
<string>WordPress 125.xcdatamodel</string>
<string>WordPress 126.xcdatamodel</string>
</dict>
</plist>
1,052 changes: 1,052 additions & 0 deletions WordPress/Classes/WordPress.xcdatamodeld/WordPress 126.xcdatamodel/contents

Large diffs are not rendered by default.

25 changes: 13 additions & 12 deletions WordPress/WordPress.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@
24B1AE3124FEC79900B9F334 /* RemoteFeatureFlagTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24B1AE3024FEC79900B9F334 /* RemoteFeatureFlagTests.swift */; };
24C69A8B2612421900312D9A /* UserSettingsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24C69A8A2612421900312D9A /* UserSettingsTests.swift */; };
24C69AC22612467C00312D9A /* UserSettingsTestsObjc.m in Sources */ = {isa = PBXBuildFile; fileRef = 24C69AC12612467C00312D9A /* UserSettingsTestsObjc.m */; };
24CE2EB1258D687A0000C297 /* BuildFile in Frameworks */ = {isa = PBXBuildFile; productRef = 24CE2EB0258D687A0000C297 /* SwiftPackageProductDependency */; };
24CE2EB1258D687A0000C297 /* WordPressFlux in Frameworks */ = {isa = PBXBuildFile; productRef = 24CE2EB0258D687A0000C297 /* WordPressFlux */; };
24F3789825E6E62100A27BB7 /* NSManagedObject+Lookup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24F3789725E6E62100A27BB7 /* NSManagedObject+Lookup.swift */; };
2611CC62A62F9E6BC25350FE /* Pods_WordPressScreenshotGeneration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB390AA9C94F16E78184E9D1 /* Pods_WordPressScreenshotGeneration.framework */; };
26D66DEC36ACF7442186B07D /* Pods_WordPressThisWeekWidget.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 979B445A45E13F3289F2E99E /* Pods_WordPressThisWeekWidget.framework */; };
Expand Down Expand Up @@ -4193,7 +4193,7 @@
FABB26322602FC2C00C8785C /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 296890770FE971DC00770264 /* Security.framework */; };
FABB26332602FC2C00C8785C /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83F3E25F11275E07004CD686 /* MapKit.framework */; };
FABB26342602FC2C00C8785C /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83F3E2D211276371004CD686 /* CoreLocation.framework */; };
FABB26352602FC2C00C8785C /* BuildFile in Frameworks */ = {isa = PBXBuildFile; productRef = FABB1FA62602FC2C00C8785C /* SwiftPackageProductDependency */; };
FABB26352602FC2C00C8785C /* WordPressFlux in Frameworks */ = {isa = PBXBuildFile; productRef = FABB1FA62602FC2C00C8785C /* WordPressFlux */; };
FABB26362602FC2C00C8785C /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8355D7D811D260AA00A61362 /* CoreData.framework */; };
FABB26372602FC2C00C8785C /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 834CE7331256D0DE0046A4A3 /* CFNetwork.framework */; };
FABB26382602FC2C00C8785C /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83043E54126FA31400EC9953 /* MessageUI.framework */; };
Expand Down Expand Up @@ -5302,14 +5302,14 @@
46365555260E1DE5006398E4 /* WordPress 118.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "WordPress 118.xcdatamodel"; sourceTree = "<group>"; };
464688D6255C71D200ECA61C /* SiteDesignPreviewViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SiteDesignPreviewViewController.swift; sourceTree = "<group>"; };
464688D7255C71D200ECA61C /* TemplatePreviewViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TemplatePreviewViewController.xib; sourceTree = "<group>"; };
4655B6E9264EEEC9003F90AC /* WordPress 125.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "WordPress 125.xcdatamodel"; sourceTree = "<group>"; };
465B097924C877E500336B6C /* GutenbergLightNavigationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GutenbergLightNavigationController.swift; sourceTree = "<group>"; };
465F89F6263B690C00F4C950 /* wp-block-editor-v1-settings-success-NotThemeJSON.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "wp-block-editor-v1-settings-success-NotThemeJSON.json"; sourceTree = "<group>"; };
465F8A09263B692600F4C950 /* wp-block-editor-v1-settings-success-ThemeJSON.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "wp-block-editor-v1-settings-success-ThemeJSON.json"; sourceTree = "<group>"; };
46638DF5244904A3006E8439 /* GutenbergBlockProcessor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GutenbergBlockProcessor.swift; sourceTree = "<group>"; };
466653492501552A00165DD4 /* LayoutPreviewViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LayoutPreviewViewController.swift; sourceTree = "<group>"; };
467D3DF925E4436000EB9CB0 /* SitePromptView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SitePromptView.swift; sourceTree = "<group>"; };
467D3E0B25E4436D00EB9CB0 /* SitePromptView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SitePromptView.xib; sourceTree = "<group>"; };
46875345267A919000B0E58F /* WordPress 126.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "WordPress 126.xcdatamodel"; sourceTree = "<group>"; };
469CE06B24BCED75003BDC8B /* CategorySectionTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CategorySectionTableViewCell.swift; sourceTree = "<group>"; };
469CE06C24BCED75003BDC8B /* CategorySectionTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CategorySectionTableViewCell.xib; sourceTree = "<group>"; };
469CE06F24BCFB04003BDC8B /* CollapsableHeaderCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollapsableHeaderCollectionViewCell.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -7527,7 +7527,7 @@
296890780FE971DC00770264 /* Security.framework in Frameworks */,
83F3E26011275E07004CD686 /* MapKit.framework in Frameworks */,
83F3E2D311276371004CD686 /* CoreLocation.framework in Frameworks */,
24CE2EB1258D687A0000C297 /* BuildFile in Frameworks */,
24CE2EB1258D687A0000C297 /* WordPressFlux in Frameworks */,
8355D7D911D260AA00A61362 /* CoreData.framework in Frameworks */,
834CE7341256D0DE0046A4A3 /* CFNetwork.framework in Frameworks */,
83043E55126FA31400EC9953 /* MessageUI.framework in Frameworks */,
Expand Down Expand Up @@ -7671,7 +7671,7 @@
FABB26322602FC2C00C8785C /* Security.framework in Frameworks */,
FABB26332602FC2C00C8785C /* MapKit.framework in Frameworks */,
FABB26342602FC2C00C8785C /* CoreLocation.framework in Frameworks */,
FABB26352602FC2C00C8785C /* BuildFile in Frameworks */,
FABB26352602FC2C00C8785C /* WordPressFlux in Frameworks */,
FABB26362602FC2C00C8785C /* CoreData.framework in Frameworks */,
FABB26372602FC2C00C8785C /* CFNetwork.framework in Frameworks */,
FABB26382602FC2C00C8785C /* MessageUI.framework in Frameworks */,
Expand Down Expand Up @@ -8326,7 +8326,7 @@
path = Classes;
sourceTree = "<group>";
};
29B97314FDCFA39411CA2CEA = {
29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
isa = PBXGroup;
children = (
F14B5F6F208E648200439554 /* config */,
Expand Down Expand Up @@ -14365,7 +14365,7 @@
);
name = WordPress;
packageProductDependencies = (
24CE2EB0258D687A0000C297 /* SwiftPackageProductDependency */,
24CE2EB0258D687A0000C297 /* WordPressFlux */,
);
productName = WordPress;
productReference = 1D6058910D05DD3D006BFB54 /* WordPress.app */;
Expand Down Expand Up @@ -14621,7 +14621,7 @@
);
name = Jetpack;
packageProductDependencies = (
FABB1FA62602FC2C00C8785C /* SwiftPackageProductDependency */,
FABB1FA62602FC2C00C8785C /* WordPressFlux */,
);
productName = WordPress;
productReference = FABB26522602FC2C00C8785C /* Jetpack.app */;
Expand Down Expand Up @@ -14856,7 +14856,7 @@
bg,
sk,
);
mainGroup = 29B97314FDCFA39411CA2CEA;
mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
productRefGroup = 19C28FACFE9D520D11CA2CBB /* Products */;
projectDirPath = "";
projectRoot = "";
Expand Down Expand Up @@ -24569,11 +24569,11 @@
/* End XCConfigurationList section */

/* Begin XCSwiftPackageProductDependency section */
24CE2EB0258D687A0000C297 /* SwiftPackageProductDependency */ = {
24CE2EB0258D687A0000C297 /* WordPressFlux */ = {
isa = XCSwiftPackageProductDependency;
productName = WordPressFlux;
};
FABB1FA62602FC2C00C8785C /* SwiftPackageProductDependency */ = {
FABB1FA62602FC2C00C8785C /* WordPressFlux */ = {
isa = XCSwiftPackageProductDependency;
productName = WordPressFlux;
};
Expand All @@ -24595,6 +24595,7 @@
E125443B12BF5A7200D87A0A /* WordPress.xcdatamodeld */ = {
isa = XCVersionGroup;
children = (
46875345267A919000B0E58F /* WordPress 126.xcdatamodel */,
E6EE8807266ABE9F009BC219 /* WordPress 125.xcdatamodel */,
984FB2B22646001E00878DE0 /* WordPress 124.xcdatamodel */,
9804E0B42639D88C00532095 /* WordPress 123.xcdatamodel */,
Expand Down Expand Up @@ -24721,7 +24722,7 @@
8350E15911D28B4A00A7B073 /* WordPress.xcdatamodel */,
E125443D12BF5A7200D87A0A /* WordPress 2.xcdatamodel */,
);
currentVersion = E6EE8807266ABE9F009BC219 /* WordPress 125.xcdatamodel */;
currentVersion = 46875345267A919000B0E58F /* WordPress 126.xcdatamodel */;
name = WordPress.xcdatamodeld;
path = Classes/WordPress.xcdatamodeld;
sourceTree = "<group>";
Expand Down
2 changes: 2 additions & 0 deletions WordPress/WordPressTest/BlockEditorSettingsServiceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,10 @@ class BlockEditorSettingsServiceTests: XCTestCase {

if isGlobalStyles {
XCTAssertNotNil(self.blog.blockEditorSettings?.rawStyles)
XCTAssertNotNil(self.blog.blockEditorSettings?.rawFeatures)
} else {
XCTAssertNil(self.blog.blockEditorSettings?.rawStyles)
XCTAssertNil(self.blog.blockEditorSettings?.rawFeatures)
}
XCTAssertGreaterThan(self.blog.blockEditorSettings!.colors!.count, 0)
XCTAssertGreaterThan(self.blog.blockEditorSettings!.gradients!.count, 0)
Expand Down
Loading

0 comments on commit 3c9c396

Please sign in to comment.