Skip to content

Commit

Permalink
Merge pull request #4926 from himeshsiriwardana/replace-feature-json-…
Browse files Browse the repository at this point in the history
…file

Added hooks for IS 7 and 7.1 to make feature variables always true
  • Loading branch information
himeshsiriwardana authored Dec 10, 2024
2 parents 62826e7 + 3ffa01a commit 94fbe3a
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 2 deletions.
2 changes: 1 addition & 1 deletion en/asgardeo/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def parse_json(file_path):
json_file.close()
return features_to_remove

files_to_remove = parse_json(os.path.join(os.getcwd(), 'features.json'))
files_to_remove = parse_json(os.path.join(os.getcwd(), '../features.json'))

def on_files(files, config):
if os.getenv("ENABLE_HOOKS") == "true":
Expand Down
File renamed without changes.
26 changes: 26 additions & 0 deletions en/identity-server/7.0.0/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import os
import json
from mkdocs.structure.nav import Section, Page, Link

def parse_json(file_path):
features_to_remove = {"feature": {}, "page": []}
with open(file_path, 'r') as json_file:
parse_data = json.load(json_file)
for feature, details in parse_data.items():
enabled = details['enabled']
page = details['page']
features_to_remove['feature'][feature] = enabled

if not enabled:
features_to_remove['page'].extend(page)
json_file.close()
return features_to_remove

files_to_remove = parse_json(os.path.join(os.getcwd(), '../../features.json'))

def on_config(config):

for feature, enabled in files_to_remove['feature'].items():
config[feature] = True

return config
3 changes: 3 additions & 0 deletions en/identity-server/7.0.0/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ extra:
base_path: /en/7.0.0
is_version: 7.0.0

hooks:
- hooks.py

plugins:
- search:
indexing: "full"
Expand Down
26 changes: 26 additions & 0 deletions en/identity-server/next/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import os
import json
from mkdocs.structure.nav import Section, Page, Link

def parse_json(file_path):
features_to_remove = {"feature": {}, "page": []}
with open(file_path, 'r') as json_file:
parse_data = json.load(json_file)
for feature, details in parse_data.items():
enabled = details['enabled']
page = details['page']
features_to_remove['feature'][feature] = enabled

if not enabled:
features_to_remove['page'].extend(page)
json_file.close()
return features_to_remove

files_to_remove = parse_json(os.path.join(os.getcwd(), '../../features.json'))

def on_config(config):

for feature, enabled in files_to_remove['feature'].items():
config[feature] = True

return config
3 changes: 3 additions & 0 deletions en/identity-server/next/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ extra:
base_path: /en/next
is_version: next

hooks:
- hooks.py

plugins:
- search:
indexing: "full"
Expand Down
2 changes: 1 addition & 1 deletion en/includes/guides/users/attributes/manage-attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ To delete an attribute:

Only custom attributes can be deleted.

{% if product_name == "WSO2 Identity Server" or (product_name == "Asgardeo" and unique_attributes) %}
{% if unique_attributes %}
## Assign multiple email addresses and mobile numbers to a user

{{ product_name }} allows users to associate multiple email addresses and mobile numbers with their profiles. For users with multiple values, they may also select a primary email address and a primary mobile number.
Expand Down

0 comments on commit 94fbe3a

Please sign in to comment.