Merge pull request #8483 from appwrite/fix-template-variable

Add value to variables template
This commit is contained in:
Christy Jacob 2024-08-07 18:05:34 +04:00 committed by GitHub
commit f20851e8f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 38 additions and 35 deletions

View file

@ -110,8 +110,7 @@ class TemplateFunction extends Model
'default' => [],
'example' => [],
'array' => true
])
;
]);
}
/**

View file

@ -33,8 +33,7 @@ class TemplateRuntime extends Model
'description' => 'Path to function in VCS (Version Control System) repository',
'default' => '',
'example' => 'node/starter',
])
;
]);
}
/**

View file

@ -10,37 +10,42 @@ class TemplateVariable extends Model
public function __construct()
{
$this
->addRule('name', [
'type' => self::TYPE_STRING,
'description' => 'Variable Name.',
'default' => '',
'example' => 'APPWRITE_DATABASE_ID',
])
->addRule('description', [
'type' => self::TYPE_STRING,
'description' => 'Variable Description.',
'default' => '',
'example' => 'The ID of the Appwrite database that contains the collection to sync.',
])
->addRule('placeholder', [
'type' => self::TYPE_STRING,
'description' => 'Variable Placeholder.',
'default' => '',
'example' => '64a55...7b912',
])
->addRule('required', [
'type' => self::TYPE_BOOLEAN,
'description' => 'Is the variable required?',
'default' => false,
'example' => false,
])
->addRule('type', [
'type' => self::TYPE_STRING,
'description' => 'Variable Type.',
'default' => '',
'example' => 'password',
])
;
->addRule('name', [
'type' => self::TYPE_STRING,
'description' => 'Variable Name.',
'default' => '',
'example' => 'APPWRITE_DATABASE_ID',
])
->addRule('description', [
'type' => self::TYPE_STRING,
'description' => 'Variable Description.',
'default' => '',
'example' => 'The ID of the Appwrite database that contains the collection to sync.',
])
->addRule('value', [
'type' => self::TYPE_STRING,
'description' => 'Variable Value.',
'default' => '',
'example' => '512',
])
->addRule('placeholder', [
'type' => self::TYPE_STRING,
'description' => 'Variable Placeholder.',
'default' => '',
'example' => '64a55...7b912',
])
->addRule('required', [
'type' => self::TYPE_BOOLEAN,
'description' => 'Is the variable required?',
'default' => false,
'example' => false,
])
->addRule('type', [
'type' => self::TYPE_STRING,
'description' => 'Variable Type.',
'default' => '',
'example' => 'password',
]);
}
/**