Add testing section in appstore and mark testing apps
This is not some final design to indicate which app is in testing but the logistics are there, mainly css from now Fixes #451
This commit is contained in:
@@ -92,7 +92,6 @@ html {
|
||||
}
|
||||
|
||||
.highlight {
|
||||
transition: background-color 500ms;
|
||||
}
|
||||
|
||||
.highlight:hover {
|
||||
@@ -147,6 +146,12 @@ html {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.appstore-item-content-testing {
|
||||
background-color: rgb(201, 201, 201);
|
||||
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
background-size: 64px 64px;
|
||||
}
|
||||
|
||||
.appstore-item-content-title {
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
|
||||
@@ -94,11 +94,13 @@
|
||||
<a href="" class="appstore-category-link" ng-click="showCategory($event);" ng-class="{'category-active': category === 'sync' }" category="sync">Media Sync</a>
|
||||
<a href="" class="appstore-category-link" ng-click="showCategory($event);" ng-class="{'category-active': category === 'git' }" category="git">Code Hosting</a>
|
||||
<a href="" class="appstore-category-link" ng-click="showCategory($event);" ng-class="{'category-active': category === 'wiki' }" category="wiki">Wiki</a>
|
||||
<br/>
|
||||
<a href="" class="appstore-category-link" ng-click="showCategory($event);" ng-class="{'category-active': category === 'testing' }" category="testing" ng-show="config.developerMode">Testing</a>
|
||||
</div>
|
||||
<div class="col-md-10" ng-show="ready && apps.length">
|
||||
<div class="row-no-margin">
|
||||
<div class="col-sm-1 appstore-item" ng-repeat="app in apps">
|
||||
<div class="appstore-item-content highlight" ng-click="showInstall(app)">
|
||||
<div class="appstore-item-content highlight" ng-click="showInstall(app)" ng-class="{ 'appstore-item-content-testing': app.publishState === 'testing' }">
|
||||
<div class="appstore-item-content-icon col-same-height">
|
||||
<img ng-src="{{app.iconUrl}}" onerror="this.onerror=null;this.src='img/appicon_fallback.png'" class="app-icon"/>
|
||||
</div>
|
||||
|
||||
@@ -20,6 +20,25 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
|
||||
mediaLinks: []
|
||||
};
|
||||
|
||||
|
||||
function getAppList(callback) {
|
||||
AppStore.getApps(function (error, apps) {
|
||||
if (error) return callback(error);
|
||||
|
||||
Client.getNonApprovedApps(function (error, result) {
|
||||
if (error) return callback(error);
|
||||
|
||||
// add testing tag to the manifest for UI and search reasons
|
||||
result.forEach(function (app) {
|
||||
app.manifest.tags.push('testing');
|
||||
});
|
||||
|
||||
callback(null, apps.concat(result));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// TODO does not support testing apps in search
|
||||
$scope.search = function () {
|
||||
if (!$scope.searchString) return $scope.showCategory(null, $scope.cachedCategory);
|
||||
|
||||
@@ -49,7 +68,7 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
|
||||
|
||||
$scope.ready = false;
|
||||
|
||||
AppStore.getApps(function (error, apps) {
|
||||
getAppList(function (error, apps) {
|
||||
if (error) return $timeout($scope.showCategory.bind(null, event), 1000);
|
||||
|
||||
if (!$scope.category) {
|
||||
@@ -156,28 +175,21 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
|
||||
function refresh() {
|
||||
$scope.ready = false;
|
||||
|
||||
AppStore.getApps(function (error, apps) {
|
||||
getAppList(function (error, apps) {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
return $timeout(refresh, 1000);
|
||||
}
|
||||
|
||||
Client.getNonApprovedApps(function (error, result) {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
return $timeout(refresh, 1000);
|
||||
}
|
||||
$scope.apps = apps;
|
||||
|
||||
$scope.apps = apps.concat(result);
|
||||
// show install app dialog immediately if an app id was passed in the query
|
||||
if ($routeParams.appId) {
|
||||
var found = apps.filter(function (app) { return (app.id === $routeParams.appId); });
|
||||
if (found.length) $scope.showInstall(found[0]);
|
||||
}
|
||||
|
||||
// show install app dialog immediately if an app id was passed in the query
|
||||
if ($routeParams.appId) {
|
||||
var found = apps.filter(function (app) { return (app.id === $routeParams.appId); });
|
||||
if (found.length) $scope.showInstall(found[0]);
|
||||
}
|
||||
|
||||
$scope.ready = true;
|
||||
});
|
||||
$scope.ready = true;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user