Adds script to apply whitelabel settings and resources

Description

  1.  

    1.  

      1. Description

Adds a script called `whitelabel.py` which applies a list of customizations to the app source.

We keep our customizations in a secure repo, because they contain the API key for the LMS.

*JIRA tickets*: OSPR

*Discussions*: This change provides one step in the approach laid out in the [edX Mobile Whitelabel Strategy](https://openedx.atlassian.net/wiki/display/MA/Whitelabel+Strategy) document.

*Partner information*: 3rd party hosted Open edX instance

*Merge deadline*: None

  1.  

    1.  

      1. How to test this PR

1. See this branch's `README.rst` for instructions on how to use the new `whitelabel.py` script. These instructions also need testing, so they're not repeated here.
1. Build and run the updated app to ensure that the customizations you configured made it into the app itself.

Example customization files:
`whitelabel.yaml`:
```yaml

properties: 'edx.properties'
resources: 'Resources'
patches:

  • patches/0001_update_text_for_empty_course_list.patch
    plist:
    CFBundleName: 'MyApp'
    CFBundleDisplayName: 'MyApp'
    CFBundleSpokenName: 'My App'
    CFBundleVersion: 2.6.1
    FacebookDisplayName: 'MyApp'
    ```
    `edx.properties`:
    ```
    edx.ios {
    configFiles = ['private.yaml']
    }
    ```
    `private.yaml`:
    ```yaml
    API_HOST_URL: 'https://myedxapp.example.com/'
    ENVIRONMENT_DISPLAY_NAME: 'MyApp'
    OAUTH_CLIENT_ID: 'abcdefg'
    PHONETIC_PLATFORM_NAME: 'My App'
    PLATFORM_DESTINATION_NAME: 'myedxapp.example.com'
    PLATFORM_NAME: 'My App'
    DISCUSSIONS_ENABLED: true
    FEEDBACK_EMAIL_ADDRESS: 'myapp@example.com'
    ```
    `Resources/Fonts/fonts.json`:
    ```json
    {
    "regular":"HelveticaNeue",
    "semiBold":"HelveticaNeue-Medium",
    "semiBoldItalic":"OpenSans-SemiboldItalic",
    "bold":"HelveticaNeue-Bold",
    "boldItalic":"OpenSans-BoldItalic",
    "extraBold":"OpenSans-ExtraBold",
    "extraBoldItalic":"OpenSans-ExtraBoldItalic",
    "light":"HelveticaNeue-Light",
    "lightItalic":"OpenSans-LightItalic",
    "italic":"OpenSans-Italic"
    }
    ```
    `patches/0001_update_text_for_empty_course_list.patch`:
    ```diff
    diff --git a/Source/IconMessageView.swift b/Source/IconMessageView.swift
    index 5658498a..d201009a 100644

    •  

      • a/Source/IconMessageView.swift
        +++ b/Source/IconMessageView.swift
        @@ -12,6 +12,7 @@ import UIKit
        private let IconMessageSize : CGFloat = 80.0
        private let IconMessageRotatedSize : CGFloat = IconMessageSize * 1.75
        private let IconMessageTextWidth : CGFloat = 240.0
        +private let IconMessageTextHeight : CGFloat = 340.0
        private let IconMessageMargin : CGFloat = 15.0
        private let MessageButtonMargin : CGFloat = 15.0
        private let BottomButtonHorizontalMargin : CGFloat = 12.0
        @@ -117,6 +118,7 @@ class IconMessageView : UIView {
        iconView.tintColor = OEXStyles.sharedStyles().neutralLight()


messageView.numberOfLines = 0
+ messageView.adjustsFontSizeToFitWidth = true

bottomButton.contentEdgeInsets = UIEdgeInsets(top: BottomButtonVerticalMargin, left: BottomButtonHorizontalMargin, bottom: BottomButtonVerticalMargin, right: BottomButtonHorizontalMargin)

@@ -147,6 +149,7 @@ class IconMessageView : UIView {
make.centerX.equalTo(container)
make.width.equalTo(IconMessageTextWidth)
if !hasBottomButton {
+ make.height.lessThanOrEqualTo(IconMessageTextHeight)
make.bottom.equalTo(container)
}
}
diff --git a/Source/en.lproj/Localizable.strings b/Source/en.lproj/Localizable.strings
index 32e9212d..920723bb 100644
— a/Source/en.lproj/Localizable.strings
+++ b/Source/en.lproj/Localizable.strings
@@ -309,7 +309,13 @@
/* Button title showing screen providing information about why a course may not be visible */
"ENROLLMENT_LIST.LOOKING_FOR_COURSE" = "Can't find one of your courses?";
/* Error message when user is not enrolled to any course and course discovery is also disabled.*/
-"ENROLLMENT_LIST.NO_ENROLLMENT" = "It looks like you are not enrolled in any courses yet.";
+"ENROLLMENT_LIST.NO_ENROLLMENT" = "There are no courses on your dashboard.\
+\
+If you are a new student, this might be because you have not activated your account yet. An email should have been sent to the email address you used to register.";
/* Prompt indicating user needs to enter an email address */
"ENTER_EMAIL"="Please enter your user name or e-mail address and try again.";
/* Prompt indicating user needs to enter a password */
```

*Reviewers*

  • [x] @haikuginger

  • [ ] edX reviewer[s] TBD CC @edx/edx-mobile-admin

Done

Assignee

Unassigned

Reporter

Open Source Pull Request Bot

Contributor Name

Jillian Vogel

Repo

edx/edx-app-ios

Customer

Epic Link

None

OSCM Assignee

None

Platform Map Area (Levels 1 & 2)

None

Platform Map Area (Levels 3 & 4)

None

Blended Hour Utilization Percentage

None

edX Theme

None

edX Squad

None

Github Lines Added

None

Github Lines Deleted

None

Priority

Unset