Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • Experimental/tsup
  • Product/1107-frontendPerformance
  • Product/1215-gitlabCleanUp
  • Product/1442-projectInviteMngmnt
  • Sprint/2021-09
  • Sprint/2022-01
  • Topic/1227-frontendPerformance
  • Topic/1529-HandleExternalUserInvitation
  • dev
  • gitkeep
  • master
  • v1.0.0
  • v1.1.0
  • v1.2.0
  • v1.2.1
  • v1.2.2
  • v1.3.0
  • v1.3.1
  • v1.3.2
  • v1.4.0
  • v1.5.0
  • v1.5.1
  • v1.5.2
  • v1.6.0
  • v1.7.0
  • v1.7.1
  • v1.8.0
  • v1.8.1
  • v1.9.0
29 results

Target

Select target project
  • coscine/frontend/libraries/app-util
1 result
Select Git revision
  • Experimental/tsup
  • Product/1107-frontendPerformance
  • Product/1215-gitlabCleanUp
  • Product/1442-projectInviteMngmnt
  • Sprint/2021-09
  • Sprint/2022-01
  • Topic/1227-frontendPerformance
  • Topic/1529-HandleExternalUserInvitation
  • dev
  • gitkeep
  • master
  • v1.0.0
  • v1.1.0
  • v1.2.0
  • v1.2.1
  • v1.2.2
  • v1.3.0
  • v1.3.1
  • v1.3.2
  • v1.4.0
  • v1.5.0
  • v1.5.1
  • v1.5.2
  • v1.6.0
  • v1.7.0
  • v1.7.1
  • v1.8.0
  • v1.8.1
  • v1.9.0
29 results
Show changes
Commits on Source (3)
# Dist folder
dist
publishDocsTempFolder
.vscode
package-lock.json
# Logs
logs
*.log
......
This diff is collapsed.
{
"name": "@coscine/app-util",
"version": "1.1.0",
"version": "1.2.0",
"description": "This library provides utility methods for the CoScInE Apps with JavaScript.",
"keywords": [
"coscine",
......
export { LanguageUtil } from './util/language';
\ No newline at end of file
export { LanguageUtil } from './util/language'
export { GuidUtil } from './util/guid'
export class GuidUtil {
public static isValidGuid(guid: any) {
if (
guid !== null &&
typeof guid === 'string' &&
guid.match(/[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}/i)
) {
return true
}
return false
}
public static getResourceId() {
const urlParams = new URLSearchParams(window.location.search)
if (urlParams.has('resource_id')) {
const urlResourceId = urlParams.get('resource_id')
if (this.isValidGuid(urlResourceId)) {
return urlResourceId
}
}
return ''
}
public static getProjectId() {
const baseUrl = _spPageContextInfo.siteAbsoluteUrl
const splitUrl = baseUrl.split('/')
const projectUri = splitUrl[splitUrl.length - 1]
if (this.isValidGuid(projectUri)) {
return projectUri
}
return ''
}
}