Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
origin-web-common
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Java-于龙
origin-web-common
Commits
5596f79f
Commit
5596f79f
authored
Oct 11, 2017
by
Sam Padgett
Committed by
GitHub
Oct 11, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #227 from jeff-phillips-18/filters
Add common filters for service instance values
parents
eaafcda3
bc4c298c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
136 additions
and
0 deletions
+136
-0
origin-web-common-ui.js
dist/origin-web-common-ui.js
+39
-0
origin-web-common.js
dist/origin-web-common.js
+39
-0
origin-web-common.min.js
dist/origin-web-common.min.js
+19
-0
resources.js
src/filters/resources.js
+39
-0
No files found.
dist/origin-web-common-ui.js
View file @
5596f79f
...
@@ -1816,6 +1816,45 @@ angular.module('openshiftCommonUI')
...
@@ -1816,6 +1816,45 @@ angular.module('openshiftCommonUI')
return
!!
annotationFilter
(
deployment
,
'deploymentConfig'
);
return
!!
annotationFilter
(
deployment
,
'deploymentConfig'
);
};
};
})
})
.
filter
(
'serviceClassDisplayName'
,
function
()
{
return
function
(
serviceClass
)
{
var
serviceClassDisplayName
=
_
.
get
(
serviceClass
,
'spec.externalMetadata.displayName'
);
if
(
serviceClassDisplayName
)
{
return
serviceClassDisplayName
;
}
var
serviceClassExternalName
=
_
.
get
(
serviceClass
,
'spec.externalName'
);
if
(
serviceClassExternalName
)
{
return
serviceClassExternalName
;
}
return
_
.
get
(
serviceClass
,
'metadata.name'
);
};
})
.
filter
(
'serviceInstanceDisplayName'
,
function
(
serviceClassDisplayNameFilter
)
{
return
function
(
instance
,
serviceClass
)
{
if
(
serviceClass
)
{
return
serviceClassDisplayNameFilter
(
serviceClass
);
}
return
_
.
get
(
instance
,
'metadata.name'
);
};
})
.
filter
(
'serviceInstanceStatus'
,
function
(
isServiceInstanceReadyFilter
)
{
return
function
(
instance
)
{
var
status
=
'Pending'
;
var
conditions
=
_
.
get
(
instance
,
'status.conditions'
);
var
instanceError
=
_
.
find
(
conditions
,
{
type
:
'Failed'
,
status
:
'True'
});
if
(
instanceError
)
{
status
=
'Failed'
;
}
else
if
(
isServiceInstanceReadyFilter
(
instance
))
{
status
=
'Ready'
;
}
return
status
;
};
})
;
;
;
'use strict'
;
;
'use strict'
;
angular
.
module
(
'openshiftCommonUI'
)
angular
.
module
(
'openshiftCommonUI'
)
...
...
dist/origin-web-common.js
View file @
5596f79f
...
@@ -2026,6 +2026,45 @@ angular.module('openshiftCommonUI')
...
@@ -2026,6 +2026,45 @@ angular.module('openshiftCommonUI')
return
!!
annotationFilter
(
deployment
,
'deploymentConfig'
);
return
!!
annotationFilter
(
deployment
,
'deploymentConfig'
);
};
};
}])
}])
.
filter
(
'serviceClassDisplayName'
,
function
()
{
return
function
(
serviceClass
)
{
var
serviceClassDisplayName
=
_
.
get
(
serviceClass
,
'spec.externalMetadata.displayName'
);
if
(
serviceClassDisplayName
)
{
return
serviceClassDisplayName
;
}
var
serviceClassExternalName
=
_
.
get
(
serviceClass
,
'spec.externalName'
);
if
(
serviceClassExternalName
)
{
return
serviceClassExternalName
;
}
return
_
.
get
(
serviceClass
,
'metadata.name'
);
};
})
.
filter
(
'serviceInstanceDisplayName'
,
[
"serviceClassDisplayNameFilter"
,
function
(
serviceClassDisplayNameFilter
)
{
return
function
(
instance
,
serviceClass
)
{
if
(
serviceClass
)
{
return
serviceClassDisplayNameFilter
(
serviceClass
);
}
return
_
.
get
(
instance
,
'metadata.name'
);
};
}])
.
filter
(
'serviceInstanceStatus'
,
[
"isServiceInstanceReadyFilter"
,
function
(
isServiceInstanceReadyFilter
)
{
return
function
(
instance
)
{
var
status
=
'Pending'
;
var
conditions
=
_
.
get
(
instance
,
'status.conditions'
);
var
instanceError
=
_
.
find
(
conditions
,
{
type
:
'Failed'
,
status
:
'True'
});
if
(
instanceError
)
{
status
=
'Failed'
;
}
else
if
(
isServiceInstanceReadyFilter
(
instance
))
{
status
=
'Ready'
;
}
return
status
;
};
}])
;
;
;
'use strict'
;
;
'use strict'
;
angular
.
module
(
'openshiftCommonUI'
)
angular
.
module
(
'openshiftCommonUI'
)
...
...
dist/origin-web-common.min.js
View file @
5596f79f
...
@@ -913,6 +913,25 @@ return !!annotationFilter(object, "deployment.kubernetes.io/revision");
...
@@ -913,6 +913,25 @@ return !!annotationFilter(object, "deployment.kubernetes.io/revision");
return
function
(
deployment
)
{
return
function
(
deployment
)
{
return
!!
annotationFilter
(
deployment
,
"deploymentConfig"
);
return
!!
annotationFilter
(
deployment
,
"deploymentConfig"
);
};
};
}
]).
filter
(
"serviceClassDisplayName"
,
function
()
{
return
function
(
serviceClass
)
{
var
serviceClassDisplayName
=
_
.
get
(
serviceClass
,
"spec.externalMetadata.displayName"
);
if
(
serviceClassDisplayName
)
return
serviceClassDisplayName
;
var
serviceClassExternalName
=
_
.
get
(
serviceClass
,
"spec.externalName"
);
return
serviceClassExternalName
?
serviceClassExternalName
:
_
.
get
(
serviceClass
,
"metadata.name"
);
};
}).
filter
(
"serviceInstanceDisplayName"
,
[
"serviceClassDisplayNameFilter"
,
function
(
serviceClassDisplayNameFilter
)
{
return
function
(
instance
,
serviceClass
)
{
return
serviceClass
?
serviceClassDisplayNameFilter
(
serviceClass
)
:
_
.
get
(
instance
,
"metadata.name"
);
};
}
]).
filter
(
"serviceInstanceStatus"
,
[
"isServiceInstanceReadyFilter"
,
function
(
isServiceInstanceReadyFilter
)
{
return
function
(
instance
)
{
var
status
=
"Pending"
,
conditions
=
_
.
get
(
instance
,
"status.conditions"
),
instanceError
=
_
.
find
(
conditions
,
{
type
:
"Failed"
,
status
:
"True"
});
return
instanceError
?
status
=
"Failed"
:
isServiceInstanceReadyFilter
(
instance
)
&&
(
status
=
"Ready"
),
status
;
};
}
]),
angular
.
module
(
"openshiftCommonUI"
).
filter
(
"camelToLower"
,
function
()
{
}
]),
angular
.
module
(
"openshiftCommonUI"
).
filter
(
"camelToLower"
,
function
()
{
return
function
(
str
)
{
return
function
(
str
)
{
return
str
?
_
.
startCase
(
str
).
toLowerCase
()
:
str
;
return
str
?
_
.
startCase
(
str
).
toLowerCase
()
:
str
;
...
...
src/filters/resources.js
View file @
5596f79f
...
@@ -174,4 +174,43 @@ angular.module('openshiftCommonUI')
...
@@ -174,4 +174,43 @@ angular.module('openshiftCommonUI')
return
!!
annotationFilter
(
deployment
,
'deploymentConfig'
);
return
!!
annotationFilter
(
deployment
,
'deploymentConfig'
);
};
};
})
})
.
filter
(
'serviceClassDisplayName'
,
function
()
{
return
function
(
serviceClass
)
{
var
serviceClassDisplayName
=
_
.
get
(
serviceClass
,
'spec.externalMetadata.displayName'
);
if
(
serviceClassDisplayName
)
{
return
serviceClassDisplayName
;
}
var
serviceClassExternalName
=
_
.
get
(
serviceClass
,
'spec.externalName'
);
if
(
serviceClassExternalName
)
{
return
serviceClassExternalName
;
}
return
_
.
get
(
serviceClass
,
'metadata.name'
);
};
})
.
filter
(
'serviceInstanceDisplayName'
,
function
(
serviceClassDisplayNameFilter
)
{
return
function
(
instance
,
serviceClass
)
{
if
(
serviceClass
)
{
return
serviceClassDisplayNameFilter
(
serviceClass
);
}
return
_
.
get
(
instance
,
'metadata.name'
);
};
})
.
filter
(
'serviceInstanceStatus'
,
function
(
isServiceInstanceReadyFilter
)
{
return
function
(
instance
)
{
var
status
=
'Pending'
;
var
conditions
=
_
.
get
(
instance
,
'status.conditions'
);
var
instanceError
=
_
.
find
(
conditions
,
{
type
:
'Failed'
,
status
:
'True'
});
if
(
instanceError
)
{
status
=
'Failed'
;
}
else
if
(
isServiceInstanceReadyFilter
(
instance
))
{
status
=
'Ready'
;
}
return
status
;
};
})
;
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment