diff --git a/config/Symphony.config b/config/Symphony.config index 87b6c6b4..b12bdb96 100644 --- a/config/Symphony.config +++ b/config/Symphony.config @@ -1,5 +1,5 @@ { - "url":"https://foundation-dev.symphony.com", + "url":"https://my.symphony.com", "minimizeOnClose" : "ENABLED", "launchOnStartup" : "ENABLED", "alwaysOnTop" : "DISABLED", diff --git a/installer/mac/README.md b/installer/mac/README.md index 853c4358..f7b9ec4f 100644 --- a/installer/mac/README.md +++ b/installer/mac/README.md @@ -2,7 +2,7 @@ ## Overview -Using [Packages](http://s.sudre.free.fr/Software/Packages/about.html), we can build a .pkg file for an existing app (.app). The tool allows us to customise the installation procedure so as to capture the user entered pod url amongst other settings. +Using [Packages](http://s.sudre.free.fr/Software/Packages/about.html), we can build a .pkg file for an existing app (.app). The tool allows us to customise the installation procedure to capture the admin entered values from `/tmp/sym_settings.txt` and `/tmp/sym_permissions.txt` ## Pre-requisites @@ -17,27 +17,21 @@ Once we have [Packages](http://s.sudre.free.fr/Software/Packages/about.html) ins The above command creates the build 'Symphony.pkg' and places it into the directory `installer/mac/build` relative to the project root. -Also note that the packages project file 'symphony-mac-packager.pkgproj' contains link to the plugin bundle and the post install script both of which are relative to 'symphony-mac-packager.pkgproj'. +Note that the packages project file 'symphony-mac-packager.pkgproj' contains link to the pre install and the post install scripts both of which are relative to 'symphony-mac-packager.pkgproj'. [More command line documentation here](http://s.sudre.free.fr/Software/documentation/Packages/en/Project_Building.html#4) -## Notes - -Currently, both the plugin source code and the plugin bundle are in the `installer/mac` directory. This helps us create builds in a quicker way than having to maintain another repo and building the plugin every time we build the pkg. - ## Implementation Details -- The plugin captures data entered by the user and copied it to a temp file -- The post installation script then reads data from the temp file and replaces the values in the 'Symphony.config' file in the installed app +- Pre installation script checks to see if the version we are installing is higher than the already installed version. If the installed version is lower, it deletes the installed version. +- Post installation script reads data from the temp files and replaces the values in the 'Symphony.config' file in the installed app ## Known Issues -- During installation, there is a section called "Destination Select" which is skipped based on the OS and it's settings. This is a [known bug](https://stackoverflow.com/questions/4647416/mac-packagemaker-destination-select-step-a-skipping-boption-permanently-disa). -- Only macOS 10.7+ versions are supported with the installer plugin +- During installation, there is a section called "Destination Select" which is skipped based on the OS and it's settings. This is a [known bug](https://stackoverflow.com/questions/4647416/mac-packagemaker-destination-select-step-a-skipping-boption-permanently-disa). ## Related links - [Packages Mac](http://s.sudre.free.fr/Software/Packages/about.html) - [Packages User Guide](http://s.sudre.free.fr/Software/documentation/Packages/en/Packages_Installation.html) - [Destination Select Bug](https://stackoverflow.com/questions/4647416/mac-packagemaker-destination-select-step-a-skipping-boption-permanently-disa) - diff --git a/installer/mac/SymphonySettingsPlugin.bundle/Contents/Info.plist b/installer/mac/SymphonySettingsPlugin.bundle/Contents/Info.plist deleted file mode 100644 index 706950bb..00000000 --- a/installer/mac/SymphonySettingsPlugin.bundle/Contents/Info.plist +++ /dev/null @@ -1,52 +0,0 @@ - - - - - BuildMachineOSBuild - 19C57 - CFBundleDevelopmentRegion - en - CFBundleExecutable - SymphonySettingsPlugin - CFBundleIdentifier - com.symphony.SymphonySettingsPlugin - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - SymphonySettingsPlugin - CFBundlePackageType - BNDL - CFBundleShortVersionString - 4.0 - CFBundleSupportedPlatforms - - MacOSX - - CFBundleVersion - 1 - DTCompiler - com.apple.compilers.llvm.clang.1_0 - DTPlatformBuild - 11C29 - DTPlatformVersion - GM - DTSDKBuild - 19B90 - DTSDKName - macosx10.15 - DTXcode - 1130 - DTXcodeBuild - 11C29 - InstallerSectionTitle - Pod Settings - LSMinimumSystemVersion - 10.10 - NSHumanReadableCopyright - Copyright © 2017 Symphony. All rights reserved. - NSMainNibFile - MyInstallerPane - NSPrincipalClass - InstallerSection - - diff --git a/installer/mac/SymphonySettingsPlugin.bundle/Contents/MacOS/SymphonySettingsPlugin b/installer/mac/SymphonySettingsPlugin.bundle/Contents/MacOS/SymphonySettingsPlugin deleted file mode 100755 index 42cda37b..00000000 Binary files a/installer/mac/SymphonySettingsPlugin.bundle/Contents/MacOS/SymphonySettingsPlugin and /dev/null differ diff --git a/installer/mac/SymphonySettingsPlugin.bundle/Contents/Resources/Base.lproj/MyInstallerPane.nib b/installer/mac/SymphonySettingsPlugin.bundle/Contents/Resources/Base.lproj/MyInstallerPane.nib deleted file mode 100644 index dae1ac20..00000000 Binary files a/installer/mac/SymphonySettingsPlugin.bundle/Contents/Resources/Base.lproj/MyInstallerPane.nib and /dev/null differ diff --git a/installer/mac/SymphonySettingsPlugin.bundle/Contents/Resources/InstallerSections.plist b/installer/mac/SymphonySettingsPlugin.bundle/Contents/Resources/InstallerSections.plist deleted file mode 100644 index e81b017d..00000000 --- a/installer/mac/SymphonySettingsPlugin.bundle/Contents/Resources/InstallerSections.plist +++ /dev/null @@ -1,16 +0,0 @@ - - - - - SectionOrder - - Introduction - ReadMe - License - SymphonySettingsPlugin.bundle - Target - PackageSelection - Install - - - diff --git a/installer/mac/SymphonySettingsPlugin.bundle/Contents/Resources/en.lproj/InfoPlist.strings b/installer/mac/SymphonySettingsPlugin.bundle/Contents/Resources/en.lproj/InfoPlist.strings deleted file mode 100644 index 9ae9c880..00000000 Binary files a/installer/mac/SymphonySettingsPlugin.bundle/Contents/Resources/en.lproj/InfoPlist.strings and /dev/null differ diff --git a/installer/mac/SymphonySettingsPlugin.bundle/Contents/Resources/en.lproj/Localizable.strings b/installer/mac/SymphonySettingsPlugin.bundle/Contents/Resources/en.lproj/Localizable.strings deleted file mode 100644 index fcc5bc06..00000000 Binary files a/installer/mac/SymphonySettingsPlugin.bundle/Contents/Resources/en.lproj/Localizable.strings and /dev/null differ diff --git a/installer/mac/SymphonySettingsPlugin.bundle/Contents/_CodeSignature/CodeResources b/installer/mac/SymphonySettingsPlugin.bundle/Contents/_CodeSignature/CodeResources deleted file mode 100644 index 930da407..00000000 --- a/installer/mac/SymphonySettingsPlugin.bundle/Contents/_CodeSignature/CodeResources +++ /dev/null @@ -1,191 +0,0 @@ - - - - - files - - Resources/Base.lproj/MyInstallerPane.nib - - YqJEUs+O0NAGFaXYG/PL5/LjGRY= - - Resources/InstallerSections.plist - - htLpJqbvPLRCEJWl7tW5JtJh57U= - - Resources/en.lproj/InfoPlist.strings - - hash - - MKMIqMmrq5wHe2WIb39Zx7uopYM= - - optional - - - Resources/en.lproj/Localizable.strings - - hash - - BNnst4BtRwVgmY7KjJHnv/Gi9bA= - - optional - - - - files2 - - Resources/Base.lproj/MyInstallerPane.nib - - hash - - YqJEUs+O0NAGFaXYG/PL5/LjGRY= - - hash2 - - vrmW//WHQVaIHJrMeFnpvRK5qq2445PL7k/PHsv18/k= - - - Resources/InstallerSections.plist - - hash - - htLpJqbvPLRCEJWl7tW5JtJh57U= - - hash2 - - s4rwjWW7Gd+XrsmL4BJfMLfOoaUnr8TRXs1Fc6Ieb24= - - - Resources/en.lproj/InfoPlist.strings - - hash - - MKMIqMmrq5wHe2WIb39Zx7uopYM= - - hash2 - - 6fmnl10zA3TcGk73XQtxuW2uRXRq0TLb3Oiprz+uW1M= - - optional - - - Resources/en.lproj/Localizable.strings - - hash - - BNnst4BtRwVgmY7KjJHnv/Gi9bA= - - hash2 - - N91Gfh6N6xvbnmDSlWU/PARxExcPoyutwL88q2opqak= - - optional - - - - rules - - ^Resources/ - - ^Resources/.*\.lproj/ - - optional - - weight - 1000 - - ^Resources/.*\.lproj/locversion.plist$ - - omit - - weight - 1100 - - ^Resources/Base\.lproj/ - - weight - 1010 - - ^version.plist$ - - - rules2 - - .*\.dSYM($|/) - - weight - 11 - - ^(.*/)?\.DS_Store$ - - omit - - weight - 2000 - - ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ - - nested - - weight - 10 - - ^.* - - ^Info\.plist$ - - omit - - weight - 20 - - ^PkgInfo$ - - omit - - weight - 20 - - ^Resources/ - - weight - 20 - - ^Resources/.*\.lproj/ - - optional - - weight - 1000 - - ^Resources/.*\.lproj/locversion.plist$ - - omit - - weight - 1100 - - ^Resources/Base\.lproj/ - - weight - 1010 - - ^[^/]+$ - - nested - - weight - 10 - - ^embedded\.provisionprofile$ - - weight - 20 - - ^version\.plist$ - - weight - 20 - - - - diff --git a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin.xcodeproj/project.pbxproj b/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin.xcodeproj/project.pbxproj deleted file mode 100644 index fda8016d..00000000 --- a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin.xcodeproj/project.pbxproj +++ /dev/null @@ -1,339 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 3A10EBD41ED4336D0083702F /* MyInstallerPane.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A10EBD31ED4336D0083702F /* MyInstallerPane.m */; }; - 3A10EBD71ED4336D0083702F /* MyInstallerPane.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3A10EBD51ED4336D0083702F /* MyInstallerPane.xib */; }; - 3A10EBDA1ED4336D0083702F /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 3A10EBD81ED4336D0083702F /* Localizable.strings */; }; - 3A10EBDC1ED4336D0083702F /* InstallerSections.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3A10EBDB1ED4336D0083702F /* InstallerSections.plist */; }; - 3A10EBE01ED4336D0083702F /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 3A10EBDE1ED4336D0083702F /* InfoPlist.strings */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 3A10EBCF1ED4336D0083702F /* SymphonySettingsPlugin.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SymphonySettingsPlugin.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; - 3A10EBD21ED4336D0083702F /* MyInstallerPane.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyInstallerPane.h; sourceTree = ""; }; - 3A10EBD31ED4336D0083702F /* MyInstallerPane.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MyInstallerPane.m; sourceTree = ""; }; - 3A10EBD61ED4336D0083702F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MyInstallerPane.xib; sourceTree = ""; }; - 3A10EBD91ED4336D0083702F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; - 3A10EBDB1ED4336D0083702F /* InstallerSections.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = InstallerSections.plist; sourceTree = ""; }; - 3A10EBDD1ED4336D0083702F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 3A10EBDF1ED4336D0083702F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 3A10EBCC1ED4336D0083702F /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 3A10EBC61ED4336D0083702F = { - isa = PBXGroup; - children = ( - 3A10EBD11ED4336D0083702F /* SymphonySettingsPlugin */, - 3A10EBD01ED4336D0083702F /* Products */, - ); - sourceTree = ""; - }; - 3A10EBD01ED4336D0083702F /* Products */ = { - isa = PBXGroup; - children = ( - 3A10EBCF1ED4336D0083702F /* SymphonySettingsPlugin.bundle */, - ); - name = Products; - sourceTree = ""; - }; - 3A10EBD11ED4336D0083702F /* SymphonySettingsPlugin */ = { - isa = PBXGroup; - children = ( - 3A10EBD21ED4336D0083702F /* MyInstallerPane.h */, - 3A10EBD31ED4336D0083702F /* MyInstallerPane.m */, - 3A10EBD51ED4336D0083702F /* MyInstallerPane.xib */, - 3A10EBD81ED4336D0083702F /* Localizable.strings */, - 3A10EBDB1ED4336D0083702F /* InstallerSections.plist */, - 3A10EBDD1ED4336D0083702F /* Info.plist */, - 3A10EBDE1ED4336D0083702F /* InfoPlist.strings */, - ); - path = SymphonySettingsPlugin; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 3A10EBCE1ED4336D0083702F /* SymphonySettingsPlugin */ = { - isa = PBXNativeTarget; - buildConfigurationList = 3A10EBE31ED4336D0083702F /* Build configuration list for PBXNativeTarget "SymphonySettingsPlugin" */; - buildPhases = ( - 3A10EBCB1ED4336D0083702F /* Sources */, - 3A10EBCC1ED4336D0083702F /* Frameworks */, - 3A10EBCD1ED4336D0083702F /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = SymphonySettingsPlugin; - productName = SymphonySettingsPlugin; - productReference = 3A10EBCF1ED4336D0083702F /* SymphonySettingsPlugin.bundle */; - productType = "com.apple.product-type.bundle"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 3A10EBC71ED4336D0083702F /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1100; - ORGANIZATIONNAME = Symphony; - TargetAttributes = { - 3A10EBCE1ED4336D0083702F = { - CreatedOnToolsVersion = 8.3.2; - DevelopmentTeam = 7S74264P3V; - ProvisioningStyle = Automatic; - }; - }; - }; - buildConfigurationList = 3A10EBCA1ED4336D0083702F /* Build configuration list for PBXProject "SymphonySettingsPlugin" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 3A10EBC61ED4336D0083702F; - productRefGroup = 3A10EBD01ED4336D0083702F /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 3A10EBCE1ED4336D0083702F /* SymphonySettingsPlugin */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 3A10EBCD1ED4336D0083702F /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 3A10EBD71ED4336D0083702F /* MyInstallerPane.xib in Resources */, - 3A10EBE01ED4336D0083702F /* InfoPlist.strings in Resources */, - 3A10EBDA1ED4336D0083702F /* Localizable.strings in Resources */, - 3A10EBDC1ED4336D0083702F /* InstallerSections.plist in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 3A10EBCB1ED4336D0083702F /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 3A10EBD41ED4336D0083702F /* MyInstallerPane.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 3A10EBD51ED4336D0083702F /* MyInstallerPane.xib */ = { - isa = PBXVariantGroup; - children = ( - 3A10EBD61ED4336D0083702F /* Base */, - ); - name = MyInstallerPane.xib; - sourceTree = ""; - }; - 3A10EBD81ED4336D0083702F /* Localizable.strings */ = { - isa = PBXVariantGroup; - children = ( - 3A10EBD91ED4336D0083702F /* en */, - ); - name = Localizable.strings; - sourceTree = ""; - }; - 3A10EBDE1ED4336D0083702F /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 3A10EBDF1ED4336D0083702F /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 3A10EBE11ED4336D0083702F /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.10; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; - }; - name = Debug; - }; - 3A10EBE21ED4336D0083702F /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.10; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = macosx; - }; - name = Release; - }; - 3A10EBE41ED4336D0083702F /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "Apple Development"; - COMBINE_HIDPI_IMAGES = YES; - DEVELOPMENT_TEAM = 7S74264P3V; - INFOPLIST_FILE = SymphonySettingsPlugin/Info.plist; - INSTALL_PATH = "$(HOME)/Library/Bundles"; - MACOSX_DEPLOYMENT_TARGET = 10.10; - PRODUCT_BUNDLE_IDENTIFIER = com.symphony.SymphonySettingsPlugin; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; - WRAPPER_EXTENSION = bundle; - }; - name = Debug; - }; - 3A10EBE51ED4336D0083702F /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "Apple Development"; - COMBINE_HIDPI_IMAGES = YES; - DEVELOPMENT_TEAM = 7S74264P3V; - INFOPLIST_FILE = SymphonySettingsPlugin/Info.plist; - INSTALL_PATH = "$(HOME)/Library/Bundles"; - MACOSX_DEPLOYMENT_TARGET = 10.10; - PRODUCT_BUNDLE_IDENTIFIER = com.symphony.SymphonySettingsPlugin; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; - WRAPPER_EXTENSION = bundle; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 3A10EBCA1ED4336D0083702F /* Build configuration list for PBXProject "SymphonySettingsPlugin" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3A10EBE11ED4336D0083702F /* Debug */, - 3A10EBE21ED4336D0083702F /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 3A10EBE31ED4336D0083702F /* Build configuration list for PBXNativeTarget "SymphonySettingsPlugin" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3A10EBE41ED4336D0083702F /* Debug */, - 3A10EBE51ED4336D0083702F /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 3A10EBC71ED4336D0083702F /* Project object */; -} diff --git a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 6a9e319c..00000000 --- a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d98100..00000000 --- a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin.xcodeproj/xcuserdata/vishwas.xcuserdatad/xcschemes/SymphonySettingsPlugin.xcscheme b/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin.xcodeproj/xcuserdata/vishwas.xcuserdatad/xcschemes/SymphonySettingsPlugin.xcscheme deleted file mode 100644 index 7436866e..00000000 --- a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin.xcodeproj/xcuserdata/vishwas.xcuserdatad/xcschemes/SymphonySettingsPlugin.xcscheme +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin.xcodeproj/xcuserdata/vishwas.xcuserdatad/xcschemes/xcschememanagement.plist b/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin.xcodeproj/xcuserdata/vishwas.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index ac91877a..00000000 --- a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin.xcodeproj/xcuserdata/vishwas.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,27 +0,0 @@ - - - - - SchemeUserState - - Run - Debug.xcscheme - - orderHint - 1 - - SymphonySettingsPlugin.xcscheme - - orderHint - 0 - - - SuppressBuildableAutocreation - - 3A10EBCE1ED4336D0083702F - - primary - - - - - diff --git a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/Base.lproj/MyInstallerPane.xib b/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/Base.lproj/MyInstallerPane.xib deleted file mode 100644 index fbe9d806..00000000 --- a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/Base.lproj/MyInstallerPane.xib +++ /dev/null @@ -1,427 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/Info.plist b/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/Info.plist deleted file mode 100644 index 17a5f36f..00000000 --- a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/Info.plist +++ /dev/null @@ -1,30 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 4.0 - CFBundleVersion - 1 - InstallerSectionTitle - Pod Settings - NSHumanReadableCopyright - Copyright © 2017 Symphony. All rights reserved. - NSMainNibFile - MyInstallerPane - NSPrincipalClass - InstallerSection - - diff --git a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/InstallerSections.plist b/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/InstallerSections.plist deleted file mode 100644 index e81b017d..00000000 --- a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/InstallerSections.plist +++ /dev/null @@ -1,16 +0,0 @@ - - - - - SectionOrder - - Introduction - ReadMe - License - SymphonySettingsPlugin.bundle - Target - PackageSelection - Install - - - diff --git a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/MyInstallerPane.h b/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/MyInstallerPane.h deleted file mode 100644 index 3891032f..00000000 --- a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/MyInstallerPane.h +++ /dev/null @@ -1,31 +0,0 @@ -// -// MyInstallerPane.h -// SymphonySettingsPlugin -// -// Copyright © 2017 Symphony. All rights reserved. -// - -#import - -@interface MyInstallerPane : InstallerPane - -@property (weak) IBOutlet NSButton *minimizeOnCloseCheckBox; -@property (weak) IBOutlet NSButton *autoLaunchCheckBox; -@property (weak) IBOutlet NSTextField *podUrlTextBox; -@property (weak) IBOutlet NSButton *alwaysOnTopCheckBox; -@property (weak) IBOutlet NSTextField *podUrlAlertTextBox; -@property (weak) IBOutlet NSButton *bringToFrontCheckBox; -@property (weak) IBOutlet NSButton *devToolsCheckBox; - -@property (weak) IBOutlet NSButton *mediaCheckBox; -@property (weak) IBOutlet NSButton *geoLocationCheckBox; -@property (weak) IBOutlet NSButton *notificationsCheckBox; - -@property (weak) IBOutlet NSButton *pointerLockCheckBox; -@property (weak) IBOutlet NSButton *fullScreenCheckBox; -@property (weak) IBOutlet NSButton *openExternalAppCheckBox; -@property (weak) IBOutlet NSButton *midiSysexCheckBox; - -@property (weak) IBOutlet NSButton *ssoCheckBox; - -@end diff --git a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/MyInstallerPane.m b/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/MyInstallerPane.m deleted file mode 100644 index 77e49f8f..00000000 --- a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/MyInstallerPane.m +++ /dev/null @@ -1,193 +0,0 @@ -// -// MyInstallerPane.m -// SymphonySettingsPlugin -// -// Copyright © 2017 Symphony. All rights reserved. -// - -#import "MyInstallerPane.h" - -@implementation MyInstallerPane - -- (NSString *)title -{ - return [[NSBundle bundleForClass:[self class]] localizedStringForKey:@"PaneTitle" value:nil table:nil]; -} - -- (void)willEnterPane:(InstallerSectionDirection)dir { - // By default, set the value of the error message textbox to an empty string - _podUrlAlertTextBox.stringValue = @""; - [_podUrlTextBox setToolTip:@"Enter pod url in the format \"https://corporate.symphony.com\""]; - - [_ssoCheckBox setToolTip:@"Only check this option if your Symphony POD has been configured for SSO, in doubt do not check - contact your Symphony Admin"]; -} - -- (BOOL)shouldExitPane:(InstallerSectionDirection)dir { - - NSString *podUrl = [_podUrlTextBox stringValue]; - - // Now, validate the url against a url regex - NSString *regex = @"^(https:\\/\\/)?(www.)?[a-zA-Z0-9]+([\\-\\.]{1}[a-zA-Z0-9]+)*\\.[a-zA-Z]{2,}(:[0-9]{1,5})?(\\/[a-zA-Z0-9-_.+!*'(),;\\/?:@=&$]*)?$"; - - NSPredicate *podUrlTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex]; - - if (![podUrlTest evaluateWithObject:podUrl]) { - _podUrlAlertTextBox.stringValue = @"Please enter a valid Pod url."; - return NO; - } - - if ([podUrl rangeOfString:@"[POD]"].location != NSNotFound) { - _podUrlAlertTextBox.stringValue = @"Please enter a valid Pod url."; - return NO; - } - - // Double confirmation for disabling media - if ([_mediaCheckBox state] == 0) { - - NSAlert *alert = [[NSAlert alloc] init]; - [alert setMessageText: @"Are you sure you wish to disable the camera, microphone, and speakers?"]; - [alert setInformativeText:@"Once disabled, users won't be able to participate in RTC calls effectively"]; - [alert addButtonWithTitle:@"No"]; - [alert addButtonWithTitle:@"Yes"]; - [alert setAlertStyle:NSWarningAlertStyle]; - - NSInteger button = [alert runModal]; - - if (button == NSAlertFirstButtonReturn) { - return NO; - } - - return YES; - - } - - return YES; - -} - -- (void)willExitPane:(InstallerSectionDirection)dir { - - [self writeSettingsToFile]; - [self writePermissionsToFile]; - -} - -- (void)writeSettingsToFile { - - NSString *podUrl = [_podUrlTextBox stringValue]; - - NSString *securePrefix = @"https://"; - if (![podUrl hasPrefix:securePrefix]) { - podUrl = [securePrefix stringByAppendingString:podUrl]; - [_podUrlTextBox setStringValue:podUrl]; - } - - // By default, set autoLaunchOnStart and minimizeOnClose to true - NSString *autoLaunchOnStart = @"true"; - NSString *minimizeOnClose = @"true"; - NSString *alwaysOnTop = @"false"; - NSString *bringToFront = @"false"; - NSString *devToolsEnabled = @"true\n"; - - // If the checkbox is changed, set the auto launch value accordingly - if ([_autoLaunchCheckBox state] == 0) { - autoLaunchOnStart = @"false"; - } - - // If the checkbox is changed, set the minimize on close value accordingly - if ([_minimizeOnCloseCheckBox state] == 0) { - minimizeOnClose = @"false"; - } - - // If the checkbox is changed, set the always on top value accordingly - if ([_alwaysOnTopCheckBox state] == 1) { - alwaysOnTop = @"true"; - } - - // If the checkbox is changed, set the bring to front value accordingly - if ([_bringToFrontCheckBox state] == 1) { - bringToFront = @"true"; - } - - // If the checkbox is changed, set the dev tools enabled value accordingly - if ([_devToolsCheckBox state] == 0) { - devToolsEnabled = @"false\n"; - } - - // Create an array with the selected options - NSArray *symSettings = [[NSArray alloc] initWithObjects:podUrl, minimizeOnClose, autoLaunchOnStart, alwaysOnTop, bringToFront, devToolsEnabled, nil]; - - // Create a string from the array with new-line as the separator - NSString *symSettingsString = [symSettings componentsJoinedByString:@"\n"]; - - // Write all the above settings to file - [symSettingsString writeToFile:@"/tmp/sym_settings.txt" atomically:YES encoding:NSUTF8StringEncoding error:nil]; - -} - -- (void)writePermissionsToFile { - - // By default, set all the values to true - NSString *media = @"true"; - NSString *geoLocation = @"true"; - NSString *notifications = @"true"; - NSString *pointerLock = @"true"; - NSString *fullScreen = @"true"; - NSString *openExternalApp = @"true"; - NSString *midiSysex = @"true"; - - if ([_mediaCheckBox state] == 0) { - media = @"false"; - } - - if ([_geoLocationCheckBox state] == 0) { - geoLocation = @"false"; - } - - if ([_notificationsCheckBox state] == 0) { - notifications = @"false"; - } - - if ([_pointerLockCheckBox state] == 0) { - pointerLock = @"false"; - } - - if ([_fullScreenCheckBox state] == 0) { - fullScreen = @"false"; - } - - if ([_openExternalAppCheckBox state] == 0) { - openExternalApp = @"false"; - } - - if ([_midiSysexCheckBox state] == 0) { - midiSysex = @"false"; - } - - // Create an array with the selected options - NSArray *symPermissions = [[NSArray alloc] initWithObjects:media, geoLocation, notifications, midiSysex, pointerLock, fullScreen, openExternalApp, nil]; - - // Create a string from the array with new-line as the separator - NSString *symPermissionsString = [symPermissions componentsJoinedByString:@"\n"]; - - // Write all the above settings to file - [symPermissionsString writeToFile:@"/tmp/sym_permissions.txt" atomically:YES encoding:NSUTF8StringEncoding error:nil]; - -} - -- (IBAction)handleSSOCheckboxStateChange:(id)sender { - - NSString *podUrl = [_podUrlTextBox stringValue]; - - NSString *ssoUrl = @"/login/sso/initsso"; - if ([_ssoCheckBox state] == 1) { - podUrl = [podUrl stringByAppendingString:ssoUrl]; - [_podUrlTextBox setStringValue:podUrl]; - } else { - podUrl = [podUrl substringToIndex:podUrl.length - ssoUrl.length]; - [_podUrlTextBox setStringValue:podUrl]; - } - -} - -@end diff --git a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/en.lproj/InfoPlist.strings b/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/en.lproj/InfoPlist.strings deleted file mode 100644 index 84ad2f5f..00000000 --- a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -InstallerSectionTitle = "Pod Settings"; - diff --git a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/en.lproj/Localizable.strings b/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/en.lproj/Localizable.strings deleted file mode 100644 index 944f5fa9..00000000 --- a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/en.lproj/Localizable.strings +++ /dev/null @@ -1,3 +0,0 @@ -/* Localized versions of Info.plist keys */ - -"PaneTitle" = "Pod Settings"; diff --git a/installer/mac/postinstall.sh b/installer/mac/postinstall.sh index 14ddc050..8814195f 100755 --- a/installer/mac/postinstall.sh +++ b/installer/mac/postinstall.sh @@ -15,22 +15,13 @@ always_on_top=$(sed -n '4p' ${settingsFilePath}); bring_to_front=$(sed -n '5p' ${settingsFilePath}); dev_tools_enabled=$(sed -n '6p' ${settingsFilePath}); -if [ "$pod_url" == "" ]; then - pod_url="https://my.symphony.com" -fi - +## If any of the above values turn out to be empty, set default values ## +if [ "$pod_url" == "" ]; then pod_url="https://my.symphony.com"; fi if [ "$minimize_on_close" == "" ] || [ "$minimize_on_close" == 'true' ]; then minimize_on_close='ENABLED'; else minimize_on_close='DISABLED'; fi - if [ "$launch_on_startup" == "" ] || [ "$launch_on_startup" == 'true' ]; then launch_on_startup='ENABLED'; else launch_on_startup='DISABLED'; fi - if [ "$always_on_top" == "" ] || [ "$always_on_top" == 'false' ]; then always_on_top='DISABLED'; else always_on_top='ENABLED'; fi - if [ "$bring_to_front" == "" ] || [ "$bring_to_front" == 'false' ]; then bring_to_front='DISABLED'; else bring_to_front='ENABLED'; fi - -if [ "$dev_tools_enabled" == "" ]; then - dev_tools_enabled=true; -fi - +if [ "$dev_tools_enabled" == "" ]; then dev_tools_enabled=true; fi pod_url_escaped=$(sed 's#[&/\]#\\&#g' <<<"$pod_url") ## Replace the default settings with the user selected settings ## @@ -41,9 +32,6 @@ sed -i "" -E "s#\"launchOnStartup\" ?: ?\"([Ee][Nn][Aa][Bb][Ll][Ee][Dd]|[Dd][Ii] sed -i "" -E "s#\"bringToFront\" ?: ?\"([Ee][Nn][Aa][Bb][Ll][Ee][Dd]|[Dd][Ii][Ss][Aa][Bb][Ll][Ee][Dd])\"#\"bringToFront\":\ \"$bring_to_front\"#g" ${newPath} sed -i "" -E "s#\"devToolsEnabled\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"devToolsEnabled\":\ $dev_tools_enabled#g" ${newPath} -## Remove the temp settings file created ## -rm -f ${settingsFilePath} - ## Get Symphony Permissions from the temp file ## media=$(sed -n '1p' ${permissionsFilePath}); geo_location=$(sed -n '2p' ${permissionsFilePath}); @@ -53,33 +41,14 @@ pointer_lock=$(sed -n '5p' ${permissionsFilePath}); full_screen=$(sed -n '6p' ${permissionsFilePath}); open_external_app=$(sed -n '7p' ${permissionsFilePath}); -if [ "$media" == "" ]; then - media=true; -fi - -if [ "$geo_location" == "" ]; then - geo_location=true; -fi - -if [ "$notifications" == "" ]; then - notifications=true; -fi - -if [ "$midi_sysex" == "" ]; then - midi_sysex=true; -fi - -if [ "$pointer_lock" == "" ]; then - pointer_lock=true; -fi - -if [ "$full_screen" == "" ]; then - full_screen=true; -fi - -if [ "$open_external_app" == "" ]; then - open_external_app=true; -fi +## If any of the above values turn out to be empty, set default values ## +if [ "$media" == "" ]; then media=true; fi +if [ "$geo_location" == "" ]; then geo_location=true; fi +if [ "$notifications" == "" ]; then notifications=true; fi +if [ "$midi_sysex" == "" ]; then midi_sysex=true; fi +if [ "$pointer_lock" == "" ]; then pointer_lock=true;fi +if [ "$full_screen" == "" ]; then full_screen=true; fi +if [ "$open_external_app" == "" ]; then open_external_app=true; fi ## Replace the default permissions with the user selected permissions ## sed -i "" -E "s#\"media\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"media\":\ $media#g" ${newPath} @@ -90,6 +59,6 @@ sed -i "" -E "s#\"pointerLock\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"po sed -i "" -E "s#\"fullscreen\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"fullscreen\":\ $full_screen#g" ${newPath} sed -i "" -E "s#\"openExternal\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"openExternal\":\ $open_external_app#g" ${newPath} - -## Remove the temp permissions file created ## +## Remove the temp settings & permissions file created ## +rm -f ${settingsFilePath} rm -f ${permissionsFilePath} diff --git a/installer/mac/symphony-mac-packager.pkgproj b/installer/mac/symphony-mac-packager.pkgproj index 6e3e8a9a..927271a1 100644 --- a/installer/mac/symphony-mac-packager.pkgproj +++ b/installer/mac/symphony-mac-packager.pkgproj @@ -494,7 +494,7 @@ FOLLOW_SYMBOLIC_LINKS IDENTIFIER - com.symphony.symphony-desktop + com.symphony.electron-desktop LOCATION 0 NAME @@ -510,7 +510,7 @@ USE_HFS+_COMPRESSION VERSION - 2.0.0 + 8.0.0 TYPE 0 @@ -661,17 +661,6 @@ LIST_TITLE_KEY InstallerSectionTitle - - ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS - ICPresentationViewInstallerPluginController - ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_INSTALLERPLUGIN_PATH - - PATH - SymphonySettingsPlugin.bundle - PATH_TYPE - 1 - - ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS ICPresentationViewDestinationSelectController @@ -715,9 +704,9 @@ VALUE PATH - intro.html + /Users/vishwas/Code/symphony/SymphonyElectron/installer/mac/intro.html PATH_TYPE - 3 + 1 @@ -766,7 +755,7 @@ IC_REQUIREMENT_OS_DISTRIBUTION_TYPE 0 IC_REQUIREMENT_OS_MINIMUM_VERSION - 100700 + 100900 IC_REQUIREMENT_CHECK_TYPE 1 @@ -781,11 +770,11 @@ BEHAVIOR - 3 + 2 DICTIONARY IC_REQUIREMENT_RAM_MINIMUM_SIZE_INDEX - 5 + 6 IC_REQUIREMENT_CHECK_TYPE 0 @@ -800,7 +789,7 @@ BEHAVIOR - 3 + 2 DICTIONARY IC_REQUIREMENT_CPU_ARCHITECTURE_FAMILY @@ -810,7 +799,7 @@ IC_REQUIREMENT_CPU_MINIMUM_CPU_CORES_COUNT 1 IC_REQUIREMENT_CPU_MINIMUM_FREQUENCY - 0 + 2000000 IC_REQUIREMENT_CPU_POWERPC_ARCHITECTURE_TYPE 0 diff --git a/package-lock.json b/package-lock.json index b3040557..742f14f7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17739,16 +17739,16 @@ } }, "screen-share-indicator-frame": { - "version": "1.4.4", - "resolved": "git+https://github.com/symphonyoss/ScreenShareIndicatorFrame.git#e389ca1e037d174de4b5facb69e435c32c74db76", + "version": "1.4.6", + "resolved": "git+https://github.com/symphonyoss/ScreenShareIndicatorFrame.git#32472243f7c840c6f1310fde56b5498598eeb0a8", "optional": true, "requires": { "run-script-os": "1.0.7" } }, "screen-snippet": { - "version": "1.0.6", - "resolved": "git+https://github.com/symphonyoss/ScreenSnippet2.git#c493f35831d7bf2a8164945f83c2669781dde3a7", + "version": "1.0.7", + "resolved": "git+https://github.com/symphonyoss/ScreenSnippet2.git#de0b90b92113b866cbc30a1c0a5f3c8fc0f6a418", "optional": true }, "semver": { diff --git a/package.json b/package.json index 887dc806..edabc34b 100644 --- a/package.json +++ b/package.json @@ -75,8 +75,7 @@ "library/indexvalidator.exec", "library/libsymphonysearch.dylib", "library/cryptoLib.dylib", - "library/dictionary", - "installer/mac/SymphonySettingsPlugin.bundle/Contents/MacOS/SymphonySettingsPlugin" + "library/dictionary" ] }, "win": { diff --git a/scripts/build-mac.sh b/scripts/build-mac.sh index dc7f65ab..fb8d882c 100755 --- a/scripts/build-mac.sh +++ b/scripts/build-mac.sh @@ -86,8 +86,8 @@ echo "Running snyk security tests" snyk test --file=package.json --org="$SNYK_ORG" # Replace url in config -echo "Setting default pod url to https://corporate.symphony.com" -sed -i -e 's/\"url\"[[:space:]]*\:[[:space:]]*\".*\"/\"url\":\"https:\/\/corporate.symphony.com\"/g' config/Symphony.config +echo "Setting default pod url to https://my.symphony.com" +sed -i -e 's/\"url\"[[:space:]]*\:[[:space:]]*\".*\"/\"url\":\"https:\/\/my.symphony.com\"/g' config/Symphony.config # Setup the build version echo "Setting build version to ${PARENT_BUILD_VERSION}" diff --git a/spec/__snapshots__/welcome.spec.ts.snap b/spec/__snapshots__/welcome.spec.ts.snap new file mode 100644 index 00000000..0299429f --- /dev/null +++ b/spec/__snapshots__/welcome.spec.ts.snap @@ -0,0 +1,63 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`welcome should render correctly 1`] = ` +
+
+ Symphony Logo +
+
+

+ Pod URL +

+
+
+ +
+
+ +
+
+
+
+`; diff --git a/spec/welcome.spec.ts b/spec/welcome.spec.ts new file mode 100644 index 00000000..eddb9dfe --- /dev/null +++ b/spec/welcome.spec.ts @@ -0,0 +1,132 @@ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import Welcome from '../src/renderer/components/welcome'; +import { ipcRenderer } from './__mocks__/electron'; + +describe('welcome', () => { + const welcomeLabel = 'welcome'; + const welcomeMock = { + url: 'https://my.symphony.com', + message: '', + urlValid: true, + sso: false, + }; + const onLabelEvent = 'on'; + const removeListenerLabelEvent = 'removeListener'; + + it('should render correctly', () => { + const wrapper = shallow(React.createElement(Welcome)); + expect(wrapper).toMatchSnapshot(); + }); + + it('should call `welcome` event when component is mounted', () => { + const spy = jest.spyOn(ipcRenderer, onLabelEvent); + shallow(React.createElement(Welcome)); + expect(spy).toBeCalledWith(welcomeLabel, expect.any(Function)); + }); + + it('should remove listener `welcome` when component is unmounted', () => { + const spyMount = jest.spyOn(ipcRenderer, onLabelEvent); + const spyUnmount = jest.spyOn(ipcRenderer, removeListenerLabelEvent); + + const wrapper = shallow(React.createElement(Welcome)); + expect(spyMount).toBeCalledWith(welcomeLabel, expect.any(Function)); + + wrapper.unmount(); + expect(spyUnmount).toBeCalledWith(welcomeLabel, expect.any(Function)); + }); + + it('should call `updateState` when component is mounted', () => { + const spy = jest.spyOn(Welcome.prototype, 'setState'); + shallow(React.createElement(Welcome)); + + ipcRenderer.send('welcome', welcomeMock); + + expect(spy).toBeCalledWith(welcomeMock); + }); + + it('should change pod url in text box', () => { + const podUrlMock = { + url: 'https://corporate.symphony.com', + message: '', + urlValid: true, + sso: false, + }; + + const spy = jest.spyOn(Welcome.prototype, 'setState'); + const updatePodUrlSpy = jest.spyOn(Welcome.prototype, 'updatePodUrl'); + + const wrapper = shallow(React.createElement(Welcome)); + ipcRenderer.send('welcome', welcomeMock); + + const welcomePodUrlBox = `input.Welcome-main-container-podurl-box`; + const input = wrapper.find(welcomePodUrlBox); + + input.simulate('focus'); + input.simulate('change', {target: {value: 'https://corporate.symphony.com'}}); + + expect(updatePodUrlSpy).toBeCalled(); + expect(spy).toBeCalledWith(podUrlMock); + }); + + it('should show message for invalid pod url', () => { + const podUrlMock = { + url: 'abcdef', + message: 'Please enter a valid url', + urlValid: false, + sso: false, + }; + + const spy = jest.spyOn(Welcome.prototype, 'setState'); + const updatePodUrlSpy = jest.spyOn(Welcome.prototype, 'updatePodUrl'); + + const wrapper = shallow(React.createElement(Welcome)); + ipcRenderer.send('welcome', welcomeMock); + + const welcomePodUrlBox = `input.Welcome-main-container-podurl-box`; + const input = wrapper.find(welcomePodUrlBox); + + input.simulate('focus'); + input.simulate('change', {target: {value: 'abcdef'}}); + + expect(updatePodUrlSpy).toBeCalled(); + expect(spy).toBeCalledWith(podUrlMock); + }); + + it('should click sso checkbox', () => { + const podUrlMock = { + url: 'https://my.symphony.com', + message: '', + urlValid: true, + sso: true, + }; + + const spy = jest.spyOn(Welcome.prototype, 'setState'); + const updatePodUrlSpy = jest.spyOn(Welcome.prototype, 'updateSsoCheckbox'); + + const wrapper = shallow(React.createElement(Welcome)); + ipcRenderer.send('welcome', welcomeMock); + + const welcomePodUrlBox = `input[type="checkbox"]`; + const input = wrapper.find(welcomePodUrlBox); + + input.simulate('focus'); + input.simulate('change', {target: {checked: true}}); + + expect(updatePodUrlSpy).toBeCalled(); + expect(spy).toBeCalledWith(podUrlMock); + }); + + it('should set pod url', () => { + const spy = jest.spyOn(Welcome.prototype, 'setState'); + const setPodUrlSpy = jest.spyOn(Welcome.prototype, 'setPodUrl'); + + const wrapper = shallow(React.createElement(Welcome)); + ipcRenderer.send('welcome', welcomeMock); + const welcomeContinueButton = `button.Welcome-continue-button`; + wrapper.find(welcomeContinueButton).simulate('click'); + + expect(setPodUrlSpy).toBeCalled(); + expect(spy).toBeCalledWith(welcomeMock); + }); +}); diff --git a/src/app/config-handler.ts b/src/app/config-handler.ts index 3de5d132..e32428f8 100644 --- a/src/app/config-handler.ts +++ b/src/app/config-handler.ts @@ -22,12 +22,8 @@ export enum ClientSwitchType { CLIENT_2_0_DAILY = 'CLIENT_2_0_DAILY', } -export interface IGlobalConfig { - url: string; - contextIsolation: boolean; -} - export interface IConfig { + url: string; minimizeOnClose: CloudConfigDataTypes; launchOnStartup: CloudConfigDataTypes; alwaysOnTop: CloudConfigDataTypes; @@ -51,6 +47,11 @@ export interface IConfig { clientSwitch: ClientSwitchType; } +export interface IGlobalConfig { + url: string; + contextIsolation: boolean; +} + export interface ICloudConfig { configVersion?: string; podLevelEntitlements: IPodLevelEntitlements; @@ -214,13 +215,13 @@ class Config { * @param data {IConfig} */ public async updateUserConfig(data: Partial): Promise { - logger.info(`config-handler: updating user config values with the data`, data); + logger.info(`config-handler: updating user config values with the data`, JSON.stringify(data)); this.userConfig = { ...this.userConfig, ...data }; try { await writeFile(this.userConfigPath, JSON.stringify(this.userConfig), { encoding: 'utf8' }); - logger.info(`config-handler: updated user config values with the data ${data}`); + logger.info(`config-handler: updated user config values with the data ${JSON.stringify(data)}`); } catch (error) { - logger.error(`config-handler: failed to update user config file with ${data}`, error); + logger.error(`config-handler: failed to update user config file with ${JSON.stringify(data)}`, error); dialog.showErrorBox(`Update failed`, `Failed to update user config due to error: ${error}`); } } @@ -323,7 +324,8 @@ class Config { await app.whenReady(); await this.readGlobalConfig(); logger.info(`config-handler: user config doesn't exist! will create new one and update config`); - await this.updateUserConfig({ configVersion: app.getVersion().toString(), buildNumber, ...this.globalConfig } as IConfig); + const { url, ...rest } = this.globalConfig as IConfig; + await this.updateUserConfig({ configVersion: app.getVersion().toString(), buildNumber, ...rest } as IConfig); } this.userConfig = this.parseConfigData(fs.readFileSync(this.userConfigPath, 'utf8')); logger.info(`config-handler: User configuration: `, this.userConfig); diff --git a/src/app/window-handler.ts b/src/app/window-handler.ts index 9a79c4f9..78422fb4 100644 --- a/src/app/window-handler.ts +++ b/src/app/window-handler.ts @@ -51,8 +51,8 @@ export interface ICustomBrowserWindow extends Electron.BrowserWindow { } // Default window width & height -const DEFAULT_WIDTH: number = 900; -const DEFAULT_HEIGHT: number = 900; +let DEFAULT_WIDTH: number = 900; +let DEFAULT_HEIGHT: number = 900; export class WindowHandler { @@ -88,10 +88,12 @@ export class WindowHandler { private readonly backgroundThrottling: boolean; private readonly windowOpts: ICustomBrowserWindowConstructorOpts; private readonly globalConfig: IGlobalConfig; + private readonly userConfig: IConfig; private readonly config: IConfig; // Window reference private readonly windows: object; + private shouldShowWelcomeScreen: boolean = false; private loadFailError: string | undefined; private mainWindow: ICustomBrowserWindow | null = null; private aboutAppWindow: Electron.BrowserWindow | null = null; @@ -105,13 +107,15 @@ export class WindowHandler { // Use these variables only on initial setup this.config = config.getConfigFields([ 'isCustomTitleBar', 'mainWinPos', 'minimizeOnClose', 'notificationSettings', 'alwaysOnTop', 'locale', 'customFlags', 'clientSwitch' ]); logger.info(`window-handler: main windows initialized with following config data`, this.config); + this.globalConfig = config.getGlobalConfigFields([ 'url', 'contextIsolation' ]); - const { disableThrottling } = config.getCloudConfigFields([ 'disableThrottling' ]) as any; - const { url, contextIsolation }: IGlobalConfig = this.globalConfig; + this.userConfig = config.getUserConfigFields([ 'url' ]); + const { customFlags } = this.config; + const { disableThrottling } = config.getCloudConfigFields([ 'disableThrottling' ]) as any; this.windows = {}; - this.contextIsolation = contextIsolation || false; + this.contextIsolation = this.globalConfig.contextIsolation || false; this.backgroundThrottling = (customFlags.disableThrottling !== CloudConfigDataTypes.ENABLED || disableThrottling !== CloudConfigDataTypes.ENABLED); this.isCustomTitleBar = isWindowsOS && this.config.isCustomTitleBar === CloudConfigDataTypes.ENABLED; this.windowOpts = { @@ -146,7 +150,7 @@ export class WindowHandler { i18n.setLocale(locale); try { - const extra = {podUrl: url, process: 'main'}; + const extra = {podUrl: this.userConfig.url ? this.userConfig.url : this.globalConfig.url, process: 'main'}; const defaultOpts = {uploadToServer: false, companyName: 'Symphony', submitURL: ''}; crashReporter.start({...defaultOpts, extra}); } catch (e) { @@ -160,12 +164,28 @@ export class WindowHandler { */ public async createApplication() { - this.updateVersionInfo(); + await this.updateVersionInfo(); this.spellchecker = new SpellChecker(); logger.info(`window-handler: initialized spellchecker module with locale ${this.spellchecker.locale}`); logger.info('window-handler: createApplication mainWinPos: ' + JSON.stringify(this.config.mainWinPos)); + let {isFullScreen, isMaximized} = this.config.mainWinPos ? this.config.mainWinPos : {isFullScreen: false, isMaximized: false}; + + this.url = WindowHandler.getValidUrl(this.userConfig.url ? this.userConfig.url : this.globalConfig.url); + logger.info(`window-handler: setting url ${this.url} from config file!`); + + if (this.globalConfig.url.startsWith('https://my.symphony.com') && !this.userConfig.url) { + this.shouldShowWelcomeScreen = true; + isMaximized = false; + isFullScreen = false; + DEFAULT_HEIGHT = 333; + DEFAULT_WIDTH = 542; + this.windowOpts.resizable = false; + this.windowOpts.maximizable = false; + this.windowOpts.fullscreenable = false; + } + // set window opts with additional config this.mainWindow = new BrowserWindow({ ...this.windowOpts, ...getBounds(this.config.mainWinPos, DEFAULT_WIDTH, DEFAULT_HEIGHT), @@ -180,31 +200,6 @@ export class WindowHandler { logger.info('window-handler: this.mainWindow.getBounds: ' + JSON.stringify(this.mainWindow.getBounds())); this.mainWindow.winName = apiName.mainWindowName; - const {isFullScreen, isMaximized} = this.config.mainWinPos ? this.config.mainWinPos : {isFullScreen: false, isMaximized: false}; - if (isMaximized) { - this.mainWindow.maximize(); - logger.info(`window-handler: window is maximized!`); - } - - if (isFullScreen) { - logger.info(`window-handler: window is in full screen!`); - this.mainWindow.setFullScreen(true); - } - - // Event needed to hide native menu bar on Windows 10 as we use custom menu bar - this.mainWindow.webContents.once('did-start-loading', () => { - logger.info(`window-handler: main window web contents started loading!`); - if ((this.config.isCustomTitleBar === CloudConfigDataTypes.ENABLED && isWindowsOS) && this.mainWindow && windowExists(this.mainWindow)) { - this.mainWindow.setMenuBarVisibility(false); - } - // monitors network connection and - // displays error banner on failure - monitorNetworkInterception(); - }); - - this.url = WindowHandler.getValidUrl(this.globalConfig.url); - logger.info(`window-handler: setting url ${this.url} from config file!`); - // Get url to load from cmd line or from global config file const urlFromCmd = getCommandLineArgs(process.argv, '--url=', false); @@ -219,22 +214,59 @@ export class WindowHandler { logger.info(`window-handler: url from command line is whitelisted in the config file.`); logger.info(`window-handler: setting ${commandLineUrl} from the command line as the main window url.`); this.url = commandLineUrl; + this.shouldShowWelcomeScreen = false; + isMaximized = true; + isFullScreen = false; + this.mainWindow.resizable = true; + this.mainWindow.maximizable = true; + this.mainWindow.fullScreenable = true; } else { logger.info(`window-handler: url ${commandLineUrl} from command line is NOT WHITELISTED in the config file.`); } } else { logger.info(`window-handler: setting ${commandLineUrl} from the command line as the main window url since pod whitelist is empty.`); this.url = commandLineUrl; + this.shouldShowWelcomeScreen = false; + isMaximized = true; + isFullScreen = false; + this.mainWindow.resizable = true; + this.mainWindow.maximizable = true; + this.mainWindow.fullScreenable = true; } } + if (isMaximized) { + this.mainWindow.maximize(); + logger.info(`window-handler: window is maximized!`); + } + + if (isFullScreen) { + logger.info(`window-handler: window is in full screen!`); + this.mainWindow.setFullScreen(true); + } + this.startUrl = this.url; + if (this.shouldShowWelcomeScreen) { + this.handleWelcomeScreen(); + } // loads the main window with url from config/cmd line this.mainWindow.loadURL(this.url); // check for build expiry in case of test builds this.checkExpiry(this.mainWindow); // need this for postMessage origin this.mainWindow.origin = this.globalConfig.url; + + // Event needed to hide native menu bar on Windows 10 as we use custom menu bar + this.mainWindow.webContents.once('did-start-loading', () => { + logger.info(`window-handler: main window web contents started loading!`); + if ((this.config.isCustomTitleBar === CloudConfigDataTypes.ENABLED && isWindowsOS) && this.mainWindow && windowExists(this.mainWindow)) { + this.mainWindow.setMenuBarVisibility(false); + } + // monitors network connection and + // displays error banner on failure + monitorNetworkInterception(); + }); + this.mainWindow.webContents.on('did-finish-load', async () => { logger.info(`window-handler: main window web contents finished loading!`); // early exit if the window has already been destroyed @@ -380,6 +412,45 @@ export class WindowHandler { return this.mainWindow; } + /** + * Handles the use case of showing + * welcome screen for first time installs + */ + public handleWelcomeScreen() { + + if (!this.url || !this.mainWindow) { + return; + } + + if (this.url.startsWith('https://my.symphony.com')) { + this.url = format({ + pathname: require.resolve('../renderer/react-window.html'), + protocol: 'file', + query: { + componentName: 'welcome', + locale: i18n.getLocale(), + }, + slashes: true, + }); + } + + this.mainWindow.webContents.on('did-finish-load', () => { + if (!this.url || !this.mainWindow) { + return; + } + if (this.url.indexOf('welcome')) { + this.mainWindow.webContents.send('page-load-welcome', { locale: i18n.getLocale(), resource: i18n.loadedResources }); + this.mainWindow.webContents.send('welcome', { url: this.startUrl, message: '', urlValid: true, sso: false }); + } + }); + + ipcMain.on('set-pod-url', async (_event, newPodUrl: string) => { + await config.updateUserConfig({url: newPodUrl, mainWinPos: { ...this.mainWindow!.getPosition(), ...{ height: 900, width: 900 } } }); + app.relaunch(); + app.exit(); + }); + } + /** * Gets the main window */ diff --git a/src/locale/en-US.json b/src/locale/en-US.json index 52a31c4f..11c6dac9 100644 --- a/src/locale/en-US.json +++ b/src/locale/en-US.json @@ -195,6 +195,15 @@ "Undo": "Undo", "Updating Title bar style requires Symphony to relaunch.": "Updating Title bar style requires Symphony to relaunch.", "View": "View", + "Welcome": { + "Continue": "Continue", + "Enable Single Sign On": "Enable Single Sign On", + "Please enter a valid url": "Please enter a valid url", + "Pod URL": "Pod URL", + "SSO": "SSO", + "Symphony Logo": "Symphony", + "WelcomeText": "Welcome" + }, "Window": "Window", "Would you like to restart and apply these new settings now?": "Would you like to restart and apply these new settings now?", "Your administrator has disabled": "Your administrator has disabled", diff --git a/src/locale/en.json b/src/locale/en.json index 52a31c4f..11c6dac9 100644 --- a/src/locale/en.json +++ b/src/locale/en.json @@ -195,6 +195,15 @@ "Undo": "Undo", "Updating Title bar style requires Symphony to relaunch.": "Updating Title bar style requires Symphony to relaunch.", "View": "View", + "Welcome": { + "Continue": "Continue", + "Enable Single Sign On": "Enable Single Sign On", + "Please enter a valid url": "Please enter a valid url", + "Pod URL": "Pod URL", + "SSO": "SSO", + "Symphony Logo": "Symphony", + "WelcomeText": "Welcome" + }, "Window": "Window", "Would you like to restart and apply these new settings now?": "Would you like to restart and apply these new settings now?", "Your administrator has disabled": "Your administrator has disabled", diff --git a/src/locale/fr-FR.json b/src/locale/fr-FR.json index 2c8aa138..985611a3 100644 --- a/src/locale/fr-FR.json +++ b/src/locale/fr-FR.json @@ -196,6 +196,15 @@ "Undo": "Annuler la dernière opération", "Updating Title bar style requires Symphony to relaunch.": "La mise à jour du style de la barre de titre nécessite le redémarrage de Symphony.", "View": "Visualiser", + "Welcome": { + "Continue": "Continuer", + "Enable Single Sign On": "Activer la SSO", + "Please enter a valid url": "Veuillez saisir une URL valide", + "Pod URL": "URL du pod", + "SSO": "SSO", + "Symphony Logo": "Symphony", + "WelcomeText": "Bienvenue" + }, "Window": "Fenêtre", "Would you like to restart and apply these new settings now?": "Voulez-vous redémarrer et appliquer ce nouveau paramètre maintenant?", "Your administrator has disabled": "Votre administrateur a désactivé", diff --git a/src/locale/fr.json b/src/locale/fr.json index fd1e99cb..f0fafd03 100644 --- a/src/locale/fr.json +++ b/src/locale/fr.json @@ -195,6 +195,15 @@ "Undo": "Annuler la dernière opération", "Updating Title bar style requires Symphony to relaunch.": "La mise à jour du style de la barre de titre nécessite le redémarrage de Symphony.", "View": "Visualiser", + "Welcome": { + "Continue": "Continuer", + "Enable Single Sign On": "Activer la SSO", + "Please enter a valid url": "Veuillez saisir une URL valide", + "Pod URL": "URL du pod", + "SSO": "SSO", + "Symphony Logo": "Symphony", + "WelcomeText": "Bienvenue" + }, "Window": "Fenêtre", "Would you like to restart and apply these new settings now?": "Voulez-vous redémarrer et appliquer ce nouveau paramètre maintenant?", "Your administrator has disabled": "Votre administrateur a désactivé", diff --git a/src/locale/ja-JP.json b/src/locale/ja-JP.json index 63e8e68f..75243a4f 100644 --- a/src/locale/ja-JP.json +++ b/src/locale/ja-JP.json @@ -195,6 +195,15 @@ "Undo": "元に戻す", "Updating Title bar style requires Symphony to relaunch.": "タイトルバーのスタイルを更新するには、Symphonyが再起動する必要があります。", "View": "ビュー", + "Welcome": { + "Continue": "持続する", + "Enable Single Sign On": "シングルサインオンを有効にする", + "Please enter a valid url": "有効なURLを入力してください", + "Pod URL": "ポッドURL", + "SSO": "SSO", + "Symphony Logo": "Symphony", + "WelcomeText": "ようこそ" + }, "Window": "ウインドウ", "Would you like to restart and apply these new settings now?": "今すぐ再起動して、新しい設定を適用しますか?", "Your administrator has disabled": "管理者によて無効にされています", diff --git a/src/locale/ja.json b/src/locale/ja.json index 63e8e68f..75243a4f 100644 --- a/src/locale/ja.json +++ b/src/locale/ja.json @@ -195,6 +195,15 @@ "Undo": "元に戻す", "Updating Title bar style requires Symphony to relaunch.": "タイトルバーのスタイルを更新するには、Symphonyが再起動する必要があります。", "View": "ビュー", + "Welcome": { + "Continue": "持続する", + "Enable Single Sign On": "シングルサインオンを有効にする", + "Please enter a valid url": "有効なURLを入力してください", + "Pod URL": "ポッドURL", + "SSO": "SSO", + "Symphony Logo": "Symphony", + "WelcomeText": "ようこそ" + }, "Window": "ウインドウ", "Would you like to restart and apply these new settings now?": "今すぐ再起動して、新しい設定を適用しますか?", "Your administrator has disabled": "管理者によて無効にされています", diff --git a/src/renderer/assets/symphony-logo-plain.png b/src/renderer/assets/symphony-logo-plain.png new file mode 100644 index 00000000..777e6ba8 Binary files /dev/null and b/src/renderer/assets/symphony-logo-plain.png differ diff --git a/src/renderer/components/welcome.tsx b/src/renderer/components/welcome.tsx new file mode 100644 index 00000000..f38d1c8d --- /dev/null +++ b/src/renderer/components/welcome.tsx @@ -0,0 +1,141 @@ +import { ipcRenderer } from 'electron'; +import * as React from 'react'; +import { i18n } from '../../common/i18n-preload'; + +interface IState { + url: string; + message: string; + urlValid: boolean; + sso: boolean; +} + +const WELCOME_NAMESPACE = 'Welcome'; + +export default class Welcome extends React.Component<{}, IState> { + + private readonly eventHandlers = { + onSetPodUrl: () => this.setPodUrl(), + }; + + constructor(props) { + super(props); + this.state = { + url: 'https://my.symphony.com', + message: '', + urlValid: true, + sso: false, + }; + this.updateState = this.updateState.bind(this); + } + + /** + * Render the component + */ + public render(): JSX.Element { + const { url, message, urlValid, sso } = this.state; + return ( +
+
+ {i18n.t('Symphony +
+
+

{i18n.t('Pod URL', WELCOME_NAMESPACE)()}

+
+
+ + +
+
+ +
+
+ + +
+
+ ); + } + + /** + * Perform actions on component being mounted + */ + public componentDidMount(): void { + ipcRenderer.on('welcome', this.updateState); + } + + /** + * Perform actions on component being unmounted + */ + public componentWillUnmount(): void { + ipcRenderer.removeListener('welcome', this.updateState); + } + + /** + * Set pod url and pass it to the main process + */ + public setPodUrl(): void { + const { url, sso } = this.state; + let ssoPath = '/login/sso/initsso'; + if (url.endsWith('/')) { + ssoPath = 'login/sso/initsso'; + } + ipcRenderer.send('set-pod-url', sso ? `${url}${ssoPath}` : url); + } + + /** + * Update pod url from the text box + * @param _event + */ + public updatePodUrl(_event): void { + const url = _event.target.value; + const match = url.match(/(https?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)/g) != null; + if (!match) { + this.updateState(_event, { + url, + message: i18n.t('Please enter a valid url', WELCOME_NAMESPACE)(), + urlValid: false, + sso: this.state.sso, + }); + return; + } + this.updateState(_event, { url, message: '', urlValid: true, sso: this.state.sso }); + } + + /** + * Update the SSO checkbox + * @param _event Event occurred upon action + * on the checkbox + */ + public updateSsoCheckbox(_event): void { + const ssoCheckBox = _event.target.checked; + this.updateState(_event, { + url: this.state.url, + message: this.state.message, + urlValid: this.state.urlValid, + sso: ssoCheckBox, + }); + } + + /** + * Update state + * @param _event + * @param data + */ + private updateState(_event, data): void { + this.setState(data as IState); + } + +} diff --git a/src/renderer/preload-component.ts b/src/renderer/preload-component.ts index 144f04a3..7bf89c56 100644 --- a/src/renderer/preload-component.ts +++ b/src/renderer/preload-component.ts @@ -10,6 +10,7 @@ import NotificationSettings from './components/notification-settings'; import ScreenPicker from './components/screen-picker'; import ScreenSharingFrame from './components/screen-sharing-frame'; import ScreenSharingIndicator from './components/screen-sharing-indicator'; +import Welcome from './components/welcome'; const enum components { aboutApp = 'about-app', @@ -19,6 +20,7 @@ const enum components { basicAuth = 'basic-auth', notification = 'notification-comp', notificationSettings = 'notification-settings', + welcome = 'welcome', } const loadStyle = (style) => { @@ -72,6 +74,11 @@ const load = () => { loadStyle(components.notificationSettings); component = NotificationSettings; break; + case components.welcome: + document.title = i18n.t('WelcomeText', 'Welcome')(); + loadStyle(components.welcome); + component = Welcome; + break; } const element = React.createElement(component); ReactDOM.render(element, document.getElementById('Root')); diff --git a/src/renderer/preload-main.ts b/src/renderer/preload-main.ts index 17480ff6..0c6ae243 100644 --- a/src/renderer/preload-main.ts +++ b/src/renderer/preload-main.ts @@ -9,6 +9,7 @@ import DownloadManager from './components/download-manager'; import MessageBanner from './components/message-banner'; import NetworkError from './components/network-error'; import SnackBar from './components/snack-bar'; +import Welcome from './components/welcome'; import WindowsTitleBar from './components/windows-title-bar'; import { SSFApi } from './ssf-api'; @@ -148,6 +149,20 @@ ipcRenderer.on('page-load', (_event, { locale, resources, enableCustomTitleBar } banner.showBanner(false, 'error'); }); +ipcRenderer.on('page-load-welcome', (_event, data) => { + const { locale, resource } = data; + i18n.setResource(locale, resource); + // Renders component as soon as the page is ready + document.title = i18n.t('WelcomeText', 'Welcome')(); + const styles = document.createElement('link'); + styles.rel = 'stylesheet'; + styles.type = 'text/css'; + styles.href = `./styles/welcome.css`; + document.getElementsByTagName('head')[0].appendChild(styles); + const element = React.createElement(Welcome); + ReactDOM.render(element, document.getElementById('Root')); +}); + // When the window fails to load ipcRenderer.on('page-load-failed', (_event, { locale, resources }) => { i18n.setResource(locale, resources); diff --git a/src/renderer/styles/welcome.less b/src/renderer/styles/welcome.less new file mode 100644 index 00000000..22216e48 --- /dev/null +++ b/src/renderer/styles/welcome.less @@ -0,0 +1,186 @@ +@import "theme"; + +@white: rgb(255, 255, 255, 1); +@version-text-color: rgb(47, 47, 47, 1); +@text-padding: 10px; + +body { + background-color: white; + margin: 0; + height: 100%; + width: 100%; +} + +.Welcome:lang(ja-JP) { + font-family: @font-family-ja; + + h4 { + margin: 3px 0; + } + + .Welcome-symphony-section { + padding-left: 10px; + } +} + +.Welcome:lang(fr-FR) { + + .Welcome-symphony-section { + padding-left: 10px; + } +} + +.Welcome { + display: flex; + flex-direction: column; + padding: 10px; + font-family: @font-family; + + &-image-container { + text-align: center; + margin: 50px 0 10px; + } + + &-image-container img { + width: 200px; + } + + &-header-content { + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-start; + } + + &-main-container { + padding: 10px 20%; + } + + &-main-container-input-div { + display: flex; + align-items: center; + width: 100%; + } + + &-main-container-input-selection { + width: 100%; + } + + &-main-container-podurl-box { + float: left; + width: 100%; + border-radius: 4px; + border: 1px solid #000; + padding: 5px; + max-width: -webkit-fill-available; + } + + &-main-container-sso-box { + float: left; + width: 30%; + font-size: 12px; + padding-left: 5px; + } + + &-name { + font-size: 1.0em; + font-weight: bold; + margin-bottom: 6px; + } + + &-message-label { + font-size: 12px; + margin-left: 2px; + color: red; + } + + &-logo { + margin: auto; + } + + &-symphony-section { + padding-left: 10px; + } + + hr { + width: 90%; + } + + ul { + list-style: none; + clear: both; + display: table; + text-align: right; + margin: 0; + } + + h4 { + text-align: start; + margin: 6px 0; + } + + li { + display: table-row; + text-align: left; + line-height: 20px; + } + + b { + display: table-cell; + padding-right: 1em; + text-align: left; + font-weight: normal; + } + + &-continue-button { + text-transform: capitalize; + } + + &-continue-button { + box-shadow: none; + border: none; + border-radius: 20px; + font-size: 0.8rem; + text-align: center; + padding: 10px 32px; + display: inline-block; + text-decoration: none; + line-height: 12px; + background-color: #3da2fd; + color: #ffffff; + cursor: pointer; + text-transform: uppercase; + float: right; + margin: 24px 30px 4px 0; + + &:focus { + box-shadow: 0 0 10px rgba(61, 162, 253, 1); + outline: none; + } + } + + &-continue-button-disabled { + box-shadow: none; + border: none; + border-radius: 20px; + font-size: 0.8rem; + text-align: center; + padding: 10px 32px; + display: inline-block; + text-decoration: none; + line-height: 12px; + color: #ffffff; + text-transform: uppercase; + float: right; + margin: 24px 30px 4px 0; + cursor: not-allowed; + background-color: #cccccc; + pointer-events: none; + + &:focus { + box-shadow: 0 0 10px rgba(61, 162, 253, 1); + outline: none; + } + } +} +